summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPicca Frédéric-Emmanuel <picca@debian.org>2018-08-02 20:54:28 +0200
committerPicca Frédéric-Emmanuel <picca@debian.org>2018-08-02 20:54:28 +0200
commit0c737c7331790e9825a69d65b26d08075aded68a (patch)
treecad7520f2899b8bd84abca0526f32da32eb6b90b
parenta9695cd9edb7b272e0b2dcd20882c2580dd9fb61 (diff)
New upstream version 5.3.2+dfsg
-rw-r--r--PKG-INFO4
-rw-r--r--PyMca5.egg-info/PKG-INFO4
-rw-r--r--PyMca5.egg-info/SOURCES.txt11
-rw-r--r--PyMca5.egg-info/requires.txt3
-rw-r--r--PyMca5/PyMcaCore/NexusTools.py2
-rw-r--r--PyMca5/PyMcaCore/Plugin1DBase.py3
-rw-r--r--PyMca5/PyMcaCore/StackBase.py17
-rw-r--r--PyMca5/PyMcaCore/StackPluginBase.py11
-rw-r--r--PyMca5/PyMcaGraph/backends/GLSupport/GLProgram.py3
-rw-r--r--PyMca5/PyMcaGraph/backends/MatplotlibBackend.py3
-rw-r--r--PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.c22055
-rw-r--r--PyMca5/PyMcaGraph/ctools/_ctools/cython/default/_ctools.c28414
-rw-r--r--PyMca5/PyMcaGui/PyMcaPrintPreview.py31
-rw-r--r--PyMca5/PyMcaGui/PyMcaQt.py148
-rw-r--r--PyMca5/PyMcaGui/__init__.py4
-rw-r--r--PyMca5/PyMcaGui/math/fitting/SimpleFitAllGui.py1
-rw-r--r--PyMca5/PyMcaGui/math/fitting/SimpleFitGui.py1
-rw-r--r--PyMca5/PyMcaGui/physics/xrf/XRFMCPyMca.py6
-rw-r--r--PyMca5/PyMcaGui/plotting/MaskImageWidget.py36
-rw-r--r--PyMca5/PyMcaGui/plotting/PlotWidget.py30
-rw-r--r--PyMca5/PyMcaGui/plotting/PyMca_Icons.py30
-rw-r--r--PyMca5/PyMcaGui/pymca/ExternalImagesWindow.py10
-rw-r--r--PyMca5/PyMcaGui/pymca/PyMcaMain.py108
-rw-r--r--PyMca5/PyMcaGui/pymca/QHDF5StackWizard.py6
-rw-r--r--PyMca5/PyMcaGui/pymca/QStackWidget.py39
-rw-r--r--PyMca5/PyMcaGui/pymca/RGBCorrelatorWidget.py18
-rw-r--r--PyMca5/PyMcaGui/pymca/StackSelector.py8
-rw-r--r--PyMca5/PyMcaIO/EdfFile.py51
-rw-r--r--PyMca5/PyMcaIO/HDF5Stack1D.py22
-rw-r--r--PyMca5/PyMcaIO/MarCCD.py8
-rw-r--r--PyMca5/PyMcaIO/PilatusCBF.py13
-rw-r--r--PyMca5/PyMcaIO/SpecFileStack.py34
-rw-r--r--PyMca5/PyMcaIO/TiffIO.py84
-rw-r--r--PyMca5/PyMcaMath/fitting/SimpleFitModule.py88
-rw-r--r--PyMca5/PyMcaMisc/PhysicalMemory.py28
-rw-r--r--PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.c22222
-rw-r--r--PyMca5/PyMcaPhysics/xas/_xas/cython/default/_xas.c28349
-rw-r--r--PyMca5/PyMcaPlugins/AlignmentScanPlugin.py2
-rw-r--r--PyMca5/PyMcaPlugins/BackgroundScanPlugin.py9
-rw-r--r--PyMca5/PyMcaPlugins/BackgroundStackPlugin.py40
-rw-r--r--PyMca5/PyMcaPlugins/ExternalImagesStackPlugin.py43
-rw-r--r--PyMca5/PyMcaPlugins/FitAllCurvesPlugin.py5
-rw-r--r--PyMca5/PyMcaPlugins/FitStackPlugin.py42
-rw-r--r--PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py42
-rw-r--r--PyMca5/PyMcaPlugins/LoadPositionersStackPlugin.py16
-rw-r--r--PyMca5/PyMcaPlugins/MathPlugins.py4
-rw-r--r--PyMca5/PyMcaPlugins/MedianFilterScanDeglitchPlugin.py6
-rw-r--r--PyMca5/PyMcaPlugins/MedianFilterScanPlugin.py7
-rw-r--r--PyMca5/PyMcaPlugins/MedianFilterStackPlugin.py43
-rw-r--r--PyMca5/PyMcaPlugins/MotorInfoPlugin.py5
-rw-r--r--PyMca5/PyMcaPlugins/NormalizationPlugins.py13
-rw-r--r--PyMca5/PyMcaPlugins/PCAStackPlugin.py48
-rw-r--r--PyMca5/PyMcaPlugins/ROIStackPlugin.py43
-rw-r--r--PyMca5/PyMcaPlugins/ReverseStackPlugin.py40
-rw-r--r--PyMca5/PyMcaPlugins/SilxExternalImagesStackPlugin.py26
-rw-r--r--PyMca5/PyMcaPlugins/SilxRoiStackPlugin.py14
-rw-r--r--PyMca5/PyMcaPlugins/SimpleShift.py13
-rw-r--r--PyMca5/PyMcaPlugins/StackAxesPlugin.py39
-rw-r--r--PyMca5/PyMcaPlugins/StackBrowserPlugin.py39
-rw-r--r--PyMca5/PyMcaPlugins/StackMotorInfoPlugin.py5
-rw-r--r--PyMca5/PyMcaPlugins/StackNormalizationPlugin.py54
-rw-r--r--PyMca5/PyMcaPlugins/StackScanWindowPlugin.py34
-rw-r--r--PyMca5/PyMcaPlugins/StackShowSpectra.py5
-rw-r--r--PyMca5/PyMcaPlugins/XASPlugin.py3
-rw-r--r--PyMca5/__init__.py73
-rw-r--r--PyMca5/scripts/edfviewer11
-rw-r--r--PyMca5/scripts/elementsinfo11
-rw-r--r--PyMca5/scripts/mca2edf11
-rw-r--r--PyMca5/scripts/peakidentifier14
-rw-r--r--PyMca5/scripts/pymca14
-rw-r--r--PyMca5/scripts/pymcabatch11
-rw-r--r--PyMca5/scripts/pymcapostbatch11
-rw-r--r--PyMca5/scripts/pymcaroitool12
-rw-r--r--PyMca5/scripts/rgbcorrelator14
-rw-r--r--PyMca5/tests/XrfTest.py4
-rw-r--r--changelog.txt9
-rw-r--r--doc/man/pymca.112
-rw-r--r--doc/man/pymcaroitool.15
-rw-r--r--doc/source/customization/index.rst5
-rw-r--r--doc/source/customization/plugins/index.rst9
-rw-r--r--doc/source/customization/plugins/plugins1d.rst89
-rw-r--r--doc/source/customization/plugins/stackplugins.rst127
-rw-r--r--doc/source/customization/plugins1d.rst20
-rw-r--r--doc/source/customization/settings.rst4
-rw-r--r--doc/source/customization/stackplugins.rst21
-rw-r--r--doc/source/faq.rst27
-rw-r--r--doc/source/hdf5/index.rst14
-rw-r--r--doc/source/index.rst1
-rw-r--r--doc/source/install.rst245
-rw-r--r--setup.py97
90 files changed, 58278 insertions, 45138 deletions
diff --git a/PKG-INFO b/PKG-INFO
index efbd49f..d997002 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: PyMca5
-Version: 5.3.1
+Version: 5.3.2
Summary: Mapping and X-Ray Fluorescence Analysis
Home-page: http://pymca.sourceforge.net
Author: V. Armando Sole
Author-email: sole@esrf.fr
License: MIT
-Download-URL: https://github.com/vasole/pymca/archive/v5.3.1.tar.gz
+Download-URL: https://github.com/vasole/pymca/archive/v5.3.2.tar.gz
Description: Stand-alone application and Python tools for interactive and/or batch processing analysis of X-Ray Fluorescence Spectra. Graphical user interface (GUI) and batch processing capabilities provided
Platform: any
diff --git a/PyMca5.egg-info/PKG-INFO b/PyMca5.egg-info/PKG-INFO
index efbd49f..d997002 100644
--- a/PyMca5.egg-info/PKG-INFO
+++ b/PyMca5.egg-info/PKG-INFO
@@ -1,12 +1,12 @@
Metadata-Version: 1.1
Name: PyMca5
-Version: 5.3.1
+Version: 5.3.2
Summary: Mapping and X-Ray Fluorescence Analysis
Home-page: http://pymca.sourceforge.net
Author: V. Armando Sole
Author-email: sole@esrf.fr
License: MIT
-Download-URL: https://github.com/vasole/pymca/archive/v5.3.1.tar.gz
+Download-URL: https://github.com/vasole/pymca/archive/v5.3.2.tar.gz
Description: Stand-alone application and Python tools for interactive and/or batch processing analysis of X-Ray Fluorescence Spectra. Graphical user interface (GUI) and batch processing capabilities provided
Platform: any
diff --git a/PyMca5.egg-info/SOURCES.txt b/PyMca5.egg-info/SOURCES.txt
index 666eb72..40702b0 100644
--- a/PyMca5.egg-info/SOURCES.txt
+++ b/PyMca5.egg-info/SOURCES.txt
@@ -342,9 +342,9 @@ PyMca5/PyMcaGraph/ctools/_ctools/cython/InsidePolygonWithBounds.pxd
PyMca5/PyMcaGraph/ctools/_ctools/cython/InsidePolygonWithBounds.pyx
PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pxd
PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx
-PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.c
PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.py
PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx
+PyMca5/PyMcaGraph/ctools/_ctools/cython/default/_ctools.c
PyMca5/PyMcaGraph/ctools/_ctools/include/Colormap.h
PyMca5/PyMcaGraph/ctools/_ctools/include/ColormapLUT.h
PyMca5/PyMcaGraph/ctools/_ctools/include/InsidePolygonWithBounds.h
@@ -358,6 +358,7 @@ PyMca5/PyMcaGraph/ctools/_ctools/test/testColormap.py
PyMca5/PyMcaGraph/ctools/_ctools/test/testFastLog10.py
PyMca5/PyMcaGraph/ctools/_ctools/test/testMinMax.py
PyMca5/PyMcaGui/PluginsToolButton.py
+PyMca5/PyMcaGui/PyMcaPrintPreview.py
PyMca5/PyMcaGui/PyMcaQt.py
PyMca5/PyMcaGui/__init__.py
PyMca5/PyMcaGui/io/PyMcaFileDialogs.py
@@ -668,10 +669,10 @@ PyMca5/PyMcaPhysics/xas/XASSelfattenuationCorrection.py
PyMca5/PyMcaPhysics/xas/XASStackBatch.py
PyMca5/PyMcaPhysics/xas/__init__.py
PyMca5/PyMcaPhysics/xas/_xas/setup.py
-PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.c
PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx
PyMca5/PyMcaPhysics/xas/_xas/cython/bessel0.pxd
PyMca5/PyMcaPhysics/xas/_xas/cython/polspl.pxd
+PyMca5/PyMcaPhysics/xas/_xas/cython/default/_xas.c
PyMca5/PyMcaPhysics/xas/_xas/include/bessel0.h
PyMca5/PyMcaPhysics/xas/_xas/include/polspl.h
PyMca5/PyMcaPhysics/xas/_xas/src/bessel0.c
@@ -789,8 +790,10 @@ doc/source/tutorials.rst
doc/source/_templates/localtoc.html
doc/source/_templates/pagesource.html
doc/source/customization/index.rst
-doc/source/customization/plugins1d.rst
-doc/source/customization/stackplugins.rst
+doc/source/customization/settings.rst
+doc/source/customization/plugins/index.rst
+doc/source/customization/plugins/plugins1d.rst
+doc/source/customization/plugins/stackplugins.rst
doc/source/hdf5/index.rst
doc/source/img/PyMca.ico
doc/source/img/PyMca_256x256.png
diff --git a/PyMca5.egg-info/requires.txt b/PyMca5.egg-info/requires.txt
index 715802b..265c771 100644
--- a/PyMca5.egg-info/requires.txt
+++ b/PyMca5.egg-info/requires.txt
@@ -1,3 +1,4 @@
fisx>=1.1.4
-matplotlib
+h5py
+matplotlib>1.0
numpy
diff --git a/PyMca5/PyMcaCore/NexusTools.py b/PyMca5/PyMcaCore/NexusTools.py
index 17a1177..9385920 100644
--- a/PyMca5/PyMcaCore/NexusTools.py
+++ b/PyMca5/PyMcaCore/NexusTools.py
@@ -483,7 +483,7 @@ if __name__ == "__main__":
except:
print("Usage: NexusTools <file> <key>")
sys.exit()
- h5 = h5py.File(sourcename)
+ h5 = h5py.File(sourcename, 'r')
entries = getNXClassGroups(h5, "/", ["NXentry", b"NXentry"], single=False)
if not len(entries):
entries = [item for name, item in h5["/"].items() if isGroup(item)]
diff --git a/PyMca5/PyMcaCore/Plugin1DBase.py b/PyMca5/PyMcaCore/Plugin1DBase.py
index fe63ece..2cae8d6 100644
--- a/PyMca5/PyMcaCore/Plugin1DBase.py
+++ b/PyMca5/PyMcaCore/Plugin1DBase.py
@@ -36,7 +36,8 @@ perform user defined operations of the plotted 1D data.
Plugins can be automatically installed provided they are in the appropriate place:
- - In the user home directory: *${HOME}/PyMca/plugins* (POSIX systems)
+ - In the user home directory (POSIX systems): *${HOME}/.pymca/plugins*
+ or *${HOME}/PyMca5/plugins* (older PyMca installation)
- In *"My Documents\\\\PyMca\\\\plugins"* (Windows)
A plugin inherit the :class:`Plugin1DBase` class and implement the methods:
diff --git a/PyMca5/PyMcaCore/StackBase.py b/PyMca5/PyMcaCore/StackBase.py
index 4640a52..f7f9352 100644
--- a/PyMca5/PyMcaCore/StackBase.py
+++ b/PyMca5/PyMcaCore/StackBase.py
@@ -281,11 +281,12 @@ class StackBase(object):
dtype=numpy.float)
mcaData0 = numpy.zeros((shape[2],), numpy.float)
step = 1
- if hasattr(self._stack, "monitor"):
- monitor = self._stack.monitor[:]
- monitor.shape = shape[2]
- else:
- monitor = numpy.ones((shape[2],), numpy.float)
+ # this is not the meaning of monitor
+ #if hasattr(self._stack, "monitor"):
+ # monitor = self._stack.monitor[:]
+ # monitor.shape = shape[2]
+ #else:
+ # monitor = numpy.ones((shape[2],), numpy.float)
for i in range(shape[0]):
tmpData = self._stack.data[i:i+step,:,:]
numpy.add(self._stackImageData[i:i+step,:],
@@ -323,8 +324,12 @@ class StackBase(object):
"SourceName": "Stack",
"Key": "SUM"}
if "McaLiveTime" in self._stack.info:
- dataObject.info["McaLiveTime"] = \
+ if hasattr(self._stack.info["McaLiveTime"], "sum"):
+ dataObject.info["McaLiveTime"] = \
self._stack.info["McaLiveTime"].sum()
+ else:
+ print("Not an array. Skipping time information")
+ del dataObject.info["McaLiveTime"]
if not hasattr(self._stack, 'x'):
self._stack.x = None
if self._stack.x in [None, []]:
diff --git a/PyMca5/PyMcaCore/StackPluginBase.py b/PyMca5/PyMcaCore/StackPluginBase.py
index 78f9bb2..d586a1f 100644
--- a/PyMca5/PyMcaCore/StackPluginBase.py
+++ b/PyMca5/PyMcaCore/StackPluginBase.py
@@ -33,8 +33,15 @@ __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
__doc__ = """
A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack. It has to
-inherit the :class:`StackPluginBase` class and implement the following methods:
+in order to perform user defined operations on the data stack.
+
+Plugins can be automatically installed provided they are in the appropriate place:
+
+ - In the user home directory (POSIX systems): *${HOME}/.pymca/plugins*
+ or *${HOME}/PyMca5/plugins* (older PyMca installation)
+ - In *"My Documents\\\\PyMca\\\\plugins"* (Windows)
+
+It has to inherit the :class:`StackPluginBase` class and implement the following methods:
- :meth:`StackPluginBase.getMethods`
- :meth:`StackPluginBase.getMethodToolTip` (optional but convenient)
diff --git a/PyMca5/PyMcaGraph/backends/GLSupport/GLProgram.py b/PyMca5/PyMcaGraph/backends/GLSupport/GLProgram.py
index da5ced7..db887b6 100644
--- a/PyMca5/PyMcaGraph/backends/GLSupport/GLProgram.py
+++ b/PyMca5/PyMcaGraph/backends/GLSupport/GLProgram.py
@@ -110,7 +110,8 @@ class GLProgram(object):
glValidateProgram(program)
if glGetProgramiv(program, GL_VALIDATE_STATUS) != GL_TRUE:
warnings.warn(
- 'Cannot validate program: ' + glGetProgramInfoLog(program),
+ 'Cannot validate program: ' + \
+ glGetProgramInfoLog(program).decode('ascii'),
RuntimeWarning)
attributes = {}
diff --git a/PyMca5/PyMcaGraph/backends/MatplotlibBackend.py b/PyMca5/PyMcaGraph/backends/MatplotlibBackend.py
index 068ff25..6a48c79 100644
--- a/PyMca5/PyMcaGraph/backends/MatplotlibBackend.py
+++ b/PyMca5/PyMcaGraph/backends/MatplotlibBackend.py
@@ -2333,6 +2333,9 @@ class MatplotlibBackend(PlotBackend.PlotBackend):
self._rightAxisEnabled = None
try:
self.graph.draw()
+ # Next line had to be added with MacOS, matplotlib 2.2.2
+ # and Python 3.7 I'm afraid it will affect performance.
+ self.graph.flush_events()
except ValueError:
# TODO: Understand why matplotlib 2.1.0rc0 raises an
# error when toggling semilogarithmic axes and previous
diff --git a/PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.c b/PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.c
deleted file mode 100644
index fe3c3d1..0000000
--- a/PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.c
+++ /dev/null
@@ -1,22055 +0,0 @@
-/* Generated by Cython 0.19.1 on Tue Apr 07 10:46:33 2015 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#include "Python.h"
-#ifndef Py_PYTHON_H
- #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02040000
- #error Cython requires Python 2.4+.
-#else
-#include <stddef.h> /* For offsetof */
-#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
-#endif
-#if !defined(WIN32) && !defined(MS_WINDOWS)
- #ifndef __stdcall
- #define __stdcall
- #endif
- #ifndef __cdecl
- #define __cdecl
- #endif
- #ifndef __fastcall
- #define __fastcall
- #endif
-#endif
-#ifndef DL_IMPORT
- #define DL_IMPORT(t) t
-#endif
-#ifndef DL_EXPORT
- #define DL_EXPORT(t) t
-#endif
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#ifndef Py_HUGE_VAL
- #define Py_HUGE_VAL HUGE_VAL
-#endif
-#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
-#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
-#endif
-#if PY_VERSION_HEX < 0x02050000
- typedef int Py_ssize_t;
- #define PY_SSIZE_T_MAX INT_MAX
- #define PY_SSIZE_T_MIN INT_MIN
- #define PY_FORMAT_SIZE_T ""
- #define CYTHON_FORMAT_SSIZE_T ""
- #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
- #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
- #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
- (PyErr_Format(PyExc_TypeError, \
- "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
- (PyObject*)0))
- #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
- !PyComplex_Check(o))
- #define PyIndex_Check __Pyx_PyIndex_Check
- #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
- #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
- #define __PYX_BUILD_PY_SSIZE_T "n"
- #define CYTHON_FORMAT_SSIZE_T "z"
- #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
- #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
- #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
- #define PyVarObject_HEAD_INIT(type, size) \
- PyObject_HEAD_INIT(type) size,
- #define PyType_Modified(t)
- typedef struct {
- void *buf;
- PyObject *obj;
- Py_ssize_t len;
- Py_ssize_t itemsize;
- int readonly;
- int ndim;
- char *format;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- void *internal;
- } Py_buffer;
- #define PyBUF_SIMPLE 0
- #define PyBUF_WRITABLE 0x0001
- #define PyBUF_FORMAT 0x0004
- #define PyBUF_ND 0x0008
- #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
- #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
- #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
- #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
- #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
- #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
- #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
- typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
- typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
-#endif
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
- PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#else
- #define __Pyx_BUILTIN_MODULE_NAME "builtins"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
- PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
- #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define Py_TPFLAGS_CHECKTYPES 0
- #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
- #define Py_TPFLAGS_HAVE_NEWBUFFER 0
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
- #define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
- 0 : _PyUnicode_Ready((PyObject *)(op)))
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
- #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
-#else
- #define CYTHON_PEP393_ENABLED 0
- #define __Pyx_PyUnicode_READY(op) (0)
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
- #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBaseString_Type PyUnicode_Type
- #define PyStringObject PyUnicodeObject
- #define PyString_Type PyUnicode_Type
- #define PyString_Check PyUnicode_Check
- #define PyString_CheckExact PyUnicode_CheckExact
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define PyBytesObject PyStringObject
- #define PyBytes_Type PyString_Type
- #define PyBytes_Check PyString_Check
- #define PyBytes_CheckExact PyString_CheckExact
- #define PyBytes_FromString PyString_FromString
- #define PyBytes_FromStringAndSize PyString_FromStringAndSize
- #define PyBytes_FromFormat PyString_FromFormat
- #define PyBytes_DecodeEscape PyString_DecodeEscape
- #define PyBytes_AsString PyString_AsString
- #define PyBytes_AsStringAndSize PyString_AsStringAndSize
- #define PyBytes_Size PyString_Size
- #define PyBytes_AS_STRING PyString_AS_STRING
- #define PyBytes_GET_SIZE PyString_GET_SIZE
- #define PyBytes_Repr PyString_Repr
- #define PyBytes_Concat PyString_Concat
- #define PyBytes_ConcatAndDel PyString_ConcatAndDel
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
- #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
- #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
- PyString_Check(obj) || PyUnicode_Check(obj))
- #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
- #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
-#endif
-#ifndef PySet_CheckExact
- #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
-#endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
-#if PY_MAJOR_VERSION >= 3
- #define PyIntObject PyLongObject
- #define PyInt_Type PyLong_Type
- #define PyInt_Check(op) PyLong_Check(op)
- #define PyInt_CheckExact(op) PyLong_CheckExact(op)
- #define PyInt_FromString PyLong_FromString
- #define PyInt_FromUnicode PyLong_FromUnicode
- #define PyInt_FromLong PyLong_FromLong
- #define PyInt_FromSize_t PyLong_FromSize_t
- #define PyInt_FromSsize_t PyLong_FromSsize_t
- #define PyInt_AsLong PyLong_AsLong
- #define PyInt_AS_LONG PyLong_AS_LONG
- #define PyInt_AsSsize_t PyLong_AsSsize_t
- #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
- #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBoolObject PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x03020000
- typedef long Py_hash_t;
- #define __Pyx_PyInt_FromHash_t PyInt_FromLong
- #define __Pyx_PyInt_AsHash_t PyInt_AsLong
-#else
- #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
- #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
-#endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
- #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
- #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
-#else
- #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
- #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
-#endif
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
-#else
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
-#endif
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_NAMESTR(n) ((char *)(n))
- #define __Pyx_DOCSTR(n) ((char *)(n))
-#else
- #define __Pyx_NAMESTR(n) (n)
- #define __Pyx_DOCSTR(n) (n)
-#endif
-#ifndef CYTHON_INLINE
- #if defined(__GNUC__)
- #define CYTHON_INLINE __inline__
- #elif defined(_MSC_VER)
- #define CYTHON_INLINE __inline
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_INLINE inline
- #else
- #define CYTHON_INLINE
- #endif
-#endif
-#ifndef CYTHON_RESTRICT
- #if defined(__GNUC__)
- #define CYTHON_RESTRICT __restrict__
- #elif defined(_MSC_VER)
- #define CYTHON_RESTRICT __restrict
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_RESTRICT restrict
- #else
- #define CYTHON_RESTRICT
- #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
- /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
- a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
- a quiet NaN. */
- float value;
- memset(&value, 0xFF, sizeof(value));
- return value;
-}
-#endif
-
-
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
-#else
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
-#endif
-
-#ifndef __PYX_EXTERN_C
- #ifdef __cplusplus
- #define __PYX_EXTERN_C extern "C"
- #else
- #define __PYX_EXTERN_C extern
- #endif
-#endif
-
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__PyMca5__PyMcaGraph__ctools___ctools
-#define __PYX_HAVE_API__PyMca5__PyMcaGraph__ctools___ctools
-#include "InsidePolygonWithBounds.h"
-#include "string.h"
-#include "stdio.h"
-#include "stdlib.h"
-#include "numpy/arrayobject.h"
-#include "numpy/ufuncobject.h"
-#include "MinMax.h"
-#include "Colormap.h"
-#include "pythread.h"
-#include "pystate.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#ifndef CYTHON_UNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-#endif
-typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
- const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyBytes_FromString PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
- #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
- const Py_UNICODE *u_end = u;
- while (*u_end++) ;
- return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
-#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
-#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params() {
- PyObject* sys = NULL;
- PyObject* default_encoding = NULL;
- PyObject* ascii_chars_u = NULL;
- PyObject* ascii_chars_b = NULL;
- sys = PyImport_ImportModule("sys");
- if (sys == NULL) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
- if (default_encoding == NULL) goto bad;
- if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
- __Pyx_sys_getdefaultencoding_not_ascii = 0;
- } else {
- const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
- char ascii_chars[128];
- int c;
- for (c = 0; c < 128; c++) {
- ascii_chars[c] = c;
- }
- __Pyx_sys_getdefaultencoding_not_ascii = 1;
- ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
- if (ascii_chars_u == NULL) goto bad;
- ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
- if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
- PyErr_Format(
- PyExc_ValueError,
- "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.",
- default_encoding_c);
- goto bad;
- }
- }
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- Py_XDECREF(ascii_chars_u);
- Py_XDECREF(ascii_chars_b);
- return 0;
-bad:
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- Py_XDECREF(ascii_chars_u);
- Py_XDECREF(ascii_chars_b);
- return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params() {
- PyObject* sys = NULL;
- PyObject* default_encoding = NULL;
- char* default_encoding_c;
- sys = PyImport_ImportModule("sys");
- if (sys == NULL) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
- if (default_encoding == NULL) goto bad;
- default_encoding_c = PyBytes_AS_STRING(default_encoding);
- __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
- strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
- Py_DECREF(sys);
- Py_DECREF(default_encoding);
- return 0;
-bad:
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- return -1;
-}
-#endif
-#endif
-
-
-#ifdef __GNUC__
- /* Test for GCC > 2.95 */
- #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
- #else /* __GNUC__ > 2 ... */
- #define likely(x) (x)
- #define unlikely(x) (x)
- #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
- #define likely(x) (x)
- #define unlikely(x) (x)
-#endif /* __GNUC__ */
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_d;
-static PyObject *__pyx_b;
-static PyObject *__pyx_empty_tuple;
-static PyObject *__pyx_empty_bytes;
-static int __pyx_lineno;
-static int __pyx_clineno = 0;
-static const char * __pyx_cfilenm= __FILE__;
-static const char *__pyx_filename;
-
-#if !defined(CYTHON_CCOMPLEX)
- #if defined(__cplusplus)
- #define CYTHON_CCOMPLEX 1
- #elif defined(_Complex_I)
- #define CYTHON_CCOMPLEX 1
- #else
- #define CYTHON_CCOMPLEX 0
- #endif
-#endif
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- #include <complex>
- #else
- #include <complex.h>
- #endif
-#endif
-#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
- #undef _Complex_I
- #define _Complex_I 1.0fj
-#endif
-
-
-static const char *__pyx_f[] = {
- "MinMax.pyx",
- "Colormap.pyx",
- "_ctools.pyx",
- "numpy.pxd",
- "stringsource",
- "type.pxd",
-};
-#define IS_UNSIGNED(type) (((type) -1) > 0)
-struct __Pyx_StructField_;
-#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
-typedef struct {
- const char* name; /* for error messages only */
- struct __Pyx_StructField_* fields;
- size_t size; /* sizeof(type) */
- size_t arraysize[8]; /* length of array in each dimension */
- int ndim;
- char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
- char is_unsigned;
- int flags;
-} __Pyx_TypeInfo;
-typedef struct __Pyx_StructField_ {
- __Pyx_TypeInfo* type;
- const char* name;
- size_t offset;
-} __Pyx_StructField;
-typedef struct {
- __Pyx_StructField* field;
- size_t parent_offset;
-} __Pyx_BufFmt_StackElem;
-typedef struct {
- __Pyx_StructField root;
- __Pyx_BufFmt_StackElem* head;
- size_t fmt_offset;
- size_t new_count, enc_count;
- size_t struct_alignment;
- int is_complex;
- char enc_type;
- char new_packmode;
- char enc_packmode;
- char is_valid_array;
-} __Pyx_BufFmt_Context;
-
-struct __pyx_memoryview_obj;
-typedef struct {
- struct __pyx_memoryview_obj *memview;
- char *data;
- Py_ssize_t shape[8];
- Py_ssize_t strides[8];
- Py_ssize_t suboffsets[8];
-} __Pyx_memviewslice;
-
-#include <pythread.h>
-#ifndef CYTHON_ATOMICS
- #define CYTHON_ATOMICS 1
-#endif
-#define __pyx_atomic_int_type int
-#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \
- (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
- !defined(__i386__)
- #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
- #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Using GNU atomics"
- #endif
-#elif CYTHON_ATOMICS && MSC_VER
- #include <Windows.h>
- #define __pyx_atomic_int_type LONG
- #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
- #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Using MSVC atomics"
- #endif
-#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
- #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
- #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Using Intel atomics"
- #endif
-#else
- #undef CYTHON_ATOMICS
- #define CYTHON_ATOMICS 0
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Not using atomics"
- #endif
-#endif
-typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
-#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
- __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
- __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
-#else
- #define __pyx_add_acquisition_count(memview) \
- __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
- __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
-#endif
-
-
-/* "numpy.pxd":723
- * # in Cython to enable them only on the right systems.
- *
- * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
- * ctypedef npy_int16 int16_t
- * ctypedef npy_int32 int32_t
- */
-typedef npy_int8 __pyx_t_5numpy_int8_t;
-
-/* "numpy.pxd":724
- *
- * ctypedef npy_int8 int8_t
- * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
- * ctypedef npy_int32 int32_t
- * ctypedef npy_int64 int64_t
- */
-typedef npy_int16 __pyx_t_5numpy_int16_t;
-
-/* "numpy.pxd":725
- * ctypedef npy_int8 int8_t
- * ctypedef npy_int16 int16_t
- * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
- * ctypedef npy_int64 int64_t
- * #ctypedef npy_int96 int96_t
- */
-typedef npy_int32 __pyx_t_5numpy_int32_t;
-
-/* "numpy.pxd":726
- * ctypedef npy_int16 int16_t
- * ctypedef npy_int32 int32_t
- * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
- * #ctypedef npy_int96 int96_t
- * #ctypedef npy_int128 int128_t
- */
-typedef npy_int64 __pyx_t_5numpy_int64_t;
-
-/* "numpy.pxd":730
- * #ctypedef npy_int128 int128_t
- *
- * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
- * ctypedef npy_uint16 uint16_t
- * ctypedef npy_uint32 uint32_t
- */
-typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-
-/* "numpy.pxd":731
- *
- * ctypedef npy_uint8 uint8_t
- * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
- * ctypedef npy_uint32 uint32_t
- * ctypedef npy_uint64 uint64_t
- */
-typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-
-/* "numpy.pxd":732
- * ctypedef npy_uint8 uint8_t
- * ctypedef npy_uint16 uint16_t
- * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
- * ctypedef npy_uint64 uint64_t
- * #ctypedef npy_uint96 uint96_t
- */
-typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-
-/* "numpy.pxd":733
- * ctypedef npy_uint16 uint16_t
- * ctypedef npy_uint32 uint32_t
- * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
- * #ctypedef npy_uint96 uint96_t
- * #ctypedef npy_uint128 uint128_t
- */
-typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-
-/* "numpy.pxd":737
- * #ctypedef npy_uint128 uint128_t
- *
- * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
- * ctypedef npy_float64 float64_t
- * #ctypedef npy_float80 float80_t
- */
-typedef npy_float32 __pyx_t_5numpy_float32_t;
-
-/* "numpy.pxd":738
- *
- * ctypedef npy_float32 float32_t
- * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
- * #ctypedef npy_float80 float80_t
- * #ctypedef npy_float128 float128_t
- */
-typedef npy_float64 __pyx_t_5numpy_float64_t;
-
-/* "numpy.pxd":747
- * # The int types are mapped a bit surprising --
- * # numpy.int corresponds to 'l' and numpy.long to 'q'
- * ctypedef npy_long int_t # <<<<<<<<<<<<<<
- * ctypedef npy_longlong long_t
- * ctypedef npy_longlong longlong_t
- */
-typedef npy_long __pyx_t_5numpy_int_t;
-
-/* "numpy.pxd":748
- * # numpy.int corresponds to 'l' and numpy.long to 'q'
- * ctypedef npy_long int_t
- * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
- * ctypedef npy_longlong longlong_t
- *
- */
-typedef npy_longlong __pyx_t_5numpy_long_t;
-
-/* "numpy.pxd":749
- * ctypedef npy_long int_t
- * ctypedef npy_longlong long_t
- * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_ulong uint_t
- */
-typedef npy_longlong __pyx_t_5numpy_longlong_t;
-
-/* "numpy.pxd":751
- * ctypedef npy_longlong longlong_t
- *
- * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
- * ctypedef npy_ulonglong ulong_t
- * ctypedef npy_ulonglong ulonglong_t
- */
-typedef npy_ulong __pyx_t_5numpy_uint_t;
-
-/* "numpy.pxd":752
- *
- * ctypedef npy_ulong uint_t
- * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
- * ctypedef npy_ulonglong ulonglong_t
- *
- */
-typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-
-/* "numpy.pxd":753
- * ctypedef npy_ulong uint_t
- * ctypedef npy_ulonglong ulong_t
- * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_intp intp_t
- */
-typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
-
-/* "numpy.pxd":755
- * ctypedef npy_ulonglong ulonglong_t
- *
- * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
- * ctypedef npy_uintp uintp_t
- *
- */
-typedef npy_intp __pyx_t_5numpy_intp_t;
-
-/* "numpy.pxd":756
- *
- * ctypedef npy_intp intp_t
- * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_double float_t
- */
-typedef npy_uintp __pyx_t_5numpy_uintp_t;
-
-/* "numpy.pxd":758
- * ctypedef npy_uintp uintp_t
- *
- * ctypedef npy_double float_t # <<<<<<<<<<<<<<
- * ctypedef npy_double double_t
- * ctypedef npy_longdouble longdouble_t
- */
-typedef npy_double __pyx_t_5numpy_float_t;
-
-/* "numpy.pxd":759
- *
- * ctypedef npy_double float_t
- * ctypedef npy_double double_t # <<<<<<<<<<<<<<
- * ctypedef npy_longdouble longdouble_t
- *
- */
-typedef npy_double __pyx_t_5numpy_double_t;
-
-/* "numpy.pxd":760
- * ctypedef npy_double float_t
- * ctypedef npy_double double_t
- * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_cfloat cfloat_t
- */
-typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
-
-/* "Colormap.pxd":29
- * #
- * #############################################################################*[inserted by cython to avoid comment closer]/
- * ctypedef unsigned char uint8_t # TODO use libc.stdint when available # <<<<<<<<<<<<<<
- *
- * cdef extern from "Colormap.h":
- */
-typedef unsigned char __pyx_t_8Colormap_uint8_t;
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- typedef ::std::complex< float > __pyx_t_float_complex;
- #else
- typedef float _Complex __pyx_t_float_complex;
- #endif
-#else
- typedef struct { float real, imag; } __pyx_t_float_complex;
-#endif
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- typedef ::std::complex< double > __pyx_t_double_complex;
- #else
- typedef double _Complex __pyx_t_double_complex;
- #endif
-#else
- typedef struct { double real, imag; } __pyx_t_double_complex;
-#endif
-
-
-/*--- Type declarations ---*/
-struct __pyx_memoryview_obj;
-struct __pyx_array_obj;
-struct __pyx_MemviewEnum_obj;
-struct __pyx_memoryviewslice_obj;
-
-/* "numpy.pxd":762
- * ctypedef npy_longdouble longdouble_t
- *
- * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
- * ctypedef npy_cdouble cdouble_t
- * ctypedef npy_clongdouble clongdouble_t
- */
-typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-
-/* "numpy.pxd":763
- *
- * ctypedef npy_cfloat cfloat_t
- * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
- * ctypedef npy_clongdouble clongdouble_t
- *
- */
-typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-
-/* "numpy.pxd":764
- * ctypedef npy_cfloat cfloat_t
- * ctypedef npy_cdouble cdouble_t
- * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_cdouble complex_t
- */
-typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-
-/* "numpy.pxd":766
- * ctypedef npy_clongdouble clongdouble_t
- *
- * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew1(a):
- */
-typedef npy_cdouble __pyx_t_5numpy_complex_t;
-
-/* "View.MemoryView":308
- *
- * @cname('__pyx_memoryview')
- * cdef class memoryview(object): # <<<<<<<<<<<<<<
- *
- * cdef object obj
- */
-struct __pyx_memoryview_obj {
- PyObject_HEAD
- struct __pyx_vtabstruct_memoryview *__pyx_vtab;
- PyObject *obj;
- PyObject *_size;
- PyObject *_array_interface;
- PyThread_type_lock lock;
- __pyx_atomic_int acquisition_count[2];
- __pyx_atomic_int *acquisition_count_aligned_p;
- Py_buffer view;
- int flags;
- int dtype_is_object;
- __Pyx_TypeInfo *typeinfo;
-};
-
-
-/* "View.MemoryView":96
- *
- * @cname("__pyx_array")
- * cdef class array: # <<<<<<<<<<<<<<
- *
- * cdef:
- */
-struct __pyx_array_obj {
- PyObject_HEAD
- char *data;
- Py_ssize_t len;
- char *format;
- int ndim;
- Py_ssize_t *_shape;
- Py_ssize_t *_strides;
- Py_ssize_t itemsize;
- PyObject *mode;
- PyObject *_format;
- void (*callback_free_data)(void *);
- int free_data;
- int dtype_is_object;
-};
-
-
-/* "View.MemoryView":275
- *
- * @cname('__pyx_MemviewEnum')
- * cdef class Enum(object): # <<<<<<<<<<<<<<
- * cdef object name
- * def __init__(self, name):
- */
-struct __pyx_MemviewEnum_obj {
- PyObject_HEAD
- PyObject *name;
-};
-
-
-/* "View.MemoryView":927
- *
- * @cname('__pyx_memoryviewslice')
- * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
- * "Internal class for passing memoryview slices to Python"
- *
- */
-struct __pyx_memoryviewslice_obj {
- struct __pyx_memoryview_obj __pyx_base;
- __Pyx_memviewslice from_slice;
- PyObject *from_object;
- PyObject *(*to_object_func)(char *);
- int (*to_dtype_func)(char *, PyObject *);
-};
-
-
-
-/* "View.MemoryView":308
- *
- * @cname('__pyx_memoryview')
- * cdef class memoryview(object): # <<<<<<<<<<<<<<
- *
- * cdef object obj
- */
-
-struct __pyx_vtabstruct_memoryview {
- char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
- PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
- PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
- PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
-};
-static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-
-
-/* "View.MemoryView":927
- *
- * @cname('__pyx_memoryviewslice')
- * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
- * "Internal class for passing memoryview slices to Python"
- *
- */
-
-struct __pyx_vtabstruct__memoryviewslice {
- struct __pyx_vtabstruct_memoryview __pyx_base;
-};
-static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
-
-#ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
-#endif
-#if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*SetupContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
- } __Pyx_RefNannyAPIStruct;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
- #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
-#ifdef WITH_THREAD
- #define __Pyx_RefNannySetupContext(name, acquire_gil) \
- if (acquire_gil) { \
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
- PyGILState_Release(__pyx_gilstate_save); \
- } else { \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
- }
-#else
- #define __Pyx_RefNannySetupContext(name, acquire_gil) \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
-#endif
- #define __Pyx_RefNannyFinishContext() \
- __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
- #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
- #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
- #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
- #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
-#else
- #define __Pyx_RefNannyDeclarations
- #define __Pyx_RefNannySetupContext(name, acquire_gil)
- #define __Pyx_RefNannyFinishContext()
- #define __Pyx_INCREF(r) Py_INCREF(r)
- #define __Pyx_DECREF(r) Py_DECREF(r)
- #define __Pyx_GOTREF(r)
- #define __Pyx_GIVEREF(r)
- #define __Pyx_XINCREF(r) Py_XINCREF(r)
- #define __Pyx_XDECREF(r) Py_XDECREF(r)
- #define __Pyx_XGOTREF(r)
- #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
-#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
-#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
- PyTypeObject* tp = Py_TYPE(obj);
- if (likely(tp->tp_getattro))
- return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
- if (likely(tp->tp_getattr))
- return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
- return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
- const char* function_name); /*proto*/
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
- Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact); /*proto*/
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
- PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
- int has_cstart, int has_cstop, int wraparound);
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
-
-static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
- __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
-static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
-
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o,n,NULL)
-static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
- PyTypeObject* tp = Py_TYPE(obj);
- if (likely(tp->tp_setattro))
- return tp->tp_setattro(obj, attr_name, value);
-#if PY_MAJOR_VERSION < 3
- if (likely(tp->tp_setattr))
- return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
-#endif
- return PyObject_SetAttr(obj, attr_name, value);
-}
-#else
-#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
-#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
-#endif
-
-#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
-#define __Pyx_MEMVIEW_DIRECT 1
-#define __Pyx_MEMVIEW_PTR 2
-#define __Pyx_MEMVIEW_FULL 4
-#define __Pyx_MEMVIEW_CONTIG 8
-#define __Pyx_MEMVIEW_STRIDED 16
-#define __Pyx_MEMVIEW_FOLLOW 32
-#define __Pyx_IS_C_CONTIG 1
-#define __Pyx_IS_F_CONTIG 2
-static int __Pyx_init_memviewslice(
- struct __pyx_memoryview_obj *memview,
- int ndim,
- __Pyx_memviewslice *memviewslice,
- int memview_is_new_reference);
-static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
- __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
-static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
- __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
-#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
-#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
-#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
-#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
-static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
-static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-
-#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/
-
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
-
-#ifndef __PYX_FORCE_INIT_THREADS
- #define __PYX_FORCE_INIT_THREADS 0
-#endif
-
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
-
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
-static CYTHON_INLINE PyObject* __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));
-
-#include <string.h>
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck);
-
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len)) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- Py_SIZE(list) = len+1;
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- Py_SIZE(list) = len+1;
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
-
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
-static void __Pyx_WriteUnraisable(const char *name, int clineno,
- int lineno, const char *filename); /*proto*/
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-typedef struct {
- Py_ssize_t shape, strides, suboffsets;
-} __Pyx_Buf_DimInfo;
-typedef struct {
- size_t refcount;
- Py_buffer pybuffer;
-} __Pyx_Buffer;
-typedef struct {
- __Pyx_Buffer *rcbuffer;
- char *data;
- __Pyx_Buf_DimInfo diminfo[8];
-} __Pyx_LocalBuf_ND;
-
-#if PY_MAJOR_VERSION < 3
- static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
- static void __Pyx_ReleaseBuffer(Py_buffer *view);
-#else
- #define __Pyx_GetBuffer PyObject_GetBuffer
- #define __Pyx_ReleaseBuffer PyBuffer_Release
-#endif
-
-
-static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
-static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- #define __Pyx_CREAL(z) ((z).real())
- #define __Pyx_CIMAG(z) ((z).imag())
- #else
- #define __Pyx_CREAL(z) (__real__(z))
- #define __Pyx_CIMAG(z) (__imag__(z))
- #endif
-#else
- #define __Pyx_CREAL(z) ((z).real)
- #define __Pyx_CIMAG(z) ((z).imag)
-#endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
- #define __Pyx_SET_CREAL(z,x) ((z).real(x))
- #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
-#else
- #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
- #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
-#endif
-
-static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
-
-#if CYTHON_CCOMPLEX
- #define __Pyx_c_eqf(a, b) ((a)==(b))
- #define __Pyx_c_sumf(a, b) ((a)+(b))
- #define __Pyx_c_difff(a, b) ((a)-(b))
- #define __Pyx_c_prodf(a, b) ((a)*(b))
- #define __Pyx_c_quotf(a, b) ((a)/(b))
- #define __Pyx_c_negf(a) (-(a))
- #ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
- #define __Pyx_c_conjf(z) (::std::conj(z))
- #if 1
- #define __Pyx_c_absf(z) (::std::abs(z))
- #define __Pyx_c_powf(a, b) (::std::pow(a, b))
- #endif
- #else
- #define __Pyx_c_is_zerof(z) ((z)==0)
- #define __Pyx_c_conjf(z) (conjf(z))
- #if 1
- #define __Pyx_c_absf(z) (cabsf(z))
- #define __Pyx_c_powf(a, b) (cpowf(a, b))
- #endif
- #endif
-#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
- static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
- #if 1
- static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
- #endif
-#endif
-
-static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
-
-#if CYTHON_CCOMPLEX
- #define __Pyx_c_eq(a, b) ((a)==(b))
- #define __Pyx_c_sum(a, b) ((a)+(b))
- #define __Pyx_c_diff(a, b) ((a)-(b))
- #define __Pyx_c_prod(a, b) ((a)*(b))
- #define __Pyx_c_quot(a, b) ((a)/(b))
- #define __Pyx_c_neg(a) (-(a))
- #ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
- #define __Pyx_c_conj(z) (::std::conj(z))
- #if 1
- #define __Pyx_c_abs(z) (::std::abs(z))
- #define __Pyx_c_pow(a, b) (::std::pow(a, b))
- #endif
- #else
- #define __Pyx_c_is_zero(z) ((z)==0)
- #define __Pyx_c_conj(z) (conj(z))
- #if 1
- #define __Pyx_c_abs(z) (cabs(z))
- #define __Pyx_c_pow(a, b) (cpow(a, b))
- #endif
- #endif
-#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
- static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
- #if 1
- static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
- #endif
-#endif
-
-static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
- char order, int ndim);
-
-static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
- __Pyx_memviewslice *slice2,
- int ndim, size_t itemsize);
-
-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);
-
-static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
-static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
-
-static int __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);
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(PyObject *);
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *);
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *);
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *);
-
-static int __Pyx_check_binary_version(void);
-
-#if !defined(__Pyx_PyIdentifier_FromString)
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
-#else
- #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
-#endif
-#endif
-
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
-
-typedef struct {
- int code_line;
- PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
- int count;
- int max_count;
- __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-
-/* Module declarations from 'cython.view' */
-
-/* Module declarations from 'cython' */
-
-/* Module declarations from 'InsidePolygonWithBounds' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'numpy' */
-
-/* Module declarations from 'numpy' */
-static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
-static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
-static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
-static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
-static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
-static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
-
-/* Module declarations from 'MinMax' */
-
-/* Module declarations from 'Colormap' */
-
-/* Module declarations from 'PyMca5.PyMcaGraph.ctools._ctools' */
-static PyTypeObject *__pyx_memoryview_type = 0;
-static PyTypeObject *__pyx_array_type = 0;
-static PyTypeObject *__pyx_MemviewEnum_type = 0;
-static PyTypeObject *__pyx_memoryviewslice_type = 0;
-static PyObject *generic = 0;
-static PyObject *strided = 0;
-static PyObject *indirect = 0;
-static PyObject *contiguous = 0;
-static PyObject *indirect_contiguous = 0;
-static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
-static void *__pyx_align_pointer(void *, size_t); /*proto*/
-static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
-static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
-static PyObject *_unellipsify(PyObject *, int); /*proto*/
-static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
-static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
-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*/
-static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, int); /*proto*/
-static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
-static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
-static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
-static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
-static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
-static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
-static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
-static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
-static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
-static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
-static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
-static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
-static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
-static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
-static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
-static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
-static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
-static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
-static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
-static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
-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 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
-#define __Pyx_MODULE_NAME "PyMca5.PyMcaGraph.ctools._ctools"
-int __pyx_module_is_main_PyMca5__PyMcaGraph__ctools___ctools = 0;
-
-/* Implementation of 'PyMca5.PyMcaGraph.ctools._ctools' */
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin_RuntimeError;
-static PyObject *__pyx_builtin_MemoryError;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_Ellipsis;
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_xrange;
-static PyObject *__pyx_builtin_id;
-static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, int __pyx_v_minPositive); /* proto */
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyArrayObject *__pyx_v_colormap, PyObject *__pyx_v_startValue, PyObject *__pyx_v_endValue, int __pyx_v_isLog10Mapping, PyObject *__pyx_v_nanColor); /* proto */
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_4fastLog10(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value); /* proto */
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_8_pnpolyd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_10_pnpolyFloat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_12_pnpolyInt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
-static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static int __pyx_array_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 */
-static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
-static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
-static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
-static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
-static int __pyx_memoryview_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 */
-static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
-static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
-static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_2[] = "zero-size array";
-static char __pyx_k_8[] = "ndarray is not C contiguous";
-static char __pyx_k_10[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_12[] = "Non-native byte order not supported";
-static char __pyx_k_14[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_15[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_18[] = "Format string allocated too short.";
-static char __pyx_k_20[] = "Empty shape tuple for cython.array";
-static char __pyx_k_22[] = "itemsize <= 0 for cython.array";
-static char __pyx_k_25[] = "unable to allocate shape or strides.";
-static char __pyx_k_27[] = "Invalid shape in axis %d: %d.";
-static char __pyx_k_28[] = "Invalid mode, expected 'c' or 'fortran', got %s";
-static char __pyx_k_30[] = "unable to allocate array data.";
-static char __pyx_k_32[] = "Can only create a buffer that is contiguous in memory.";
-static char __pyx_k_34[] = "Unable to convert item to object";
-static char __pyx_k_36[] = "Buffer view does not expose strides";
-static char __pyx_k_38[] = "<MemoryView of %r at 0x%x>";
-static char __pyx_k_39[] = "<MemoryView of %r object>";
-static char __pyx_k_42[] = "Cannot index with type '%s'";
-static char __pyx_k_44[] = "Indirect dimensions not supported";
-static char __pyx_k_46[] = "Index out of bounds (axis %d)";
-static char __pyx_k_47[] = "Step may not be zero (axis %d)";
-static char __pyx_k_48[] = "All dimensions preceding dimension %d must be indexed and not sliced";
-static char __pyx_k_49[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_50[] = "Cannot transpose memoryview with indirect dimensions";
-static char __pyx_k_51[] = "got differing extents in dimension %d (got %d and %d)";
-static char __pyx_k_52[] = "Dimension %d is not direct";
-static char __pyx_k_55[] = "C:\\GIT\\PYMCA_REFERENCE\\pymca\\PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\MinMax.pyx";
-static char __pyx_k_56[] = "PyMca5.PyMcaGraph.ctools._ctools";
-static char __pyx_k_59[] = "C:\\GIT\\PYMCA_REFERENCE\\pymca\\PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\Colormap.pyx";
-static char __pyx_k_64[] = "C:\\GIT\\PYMCA_REFERENCE\\pymca\\PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\_ctools.pyx";
-static char __pyx_k_71[] = "getbuffer(obj, view, flags)";
-static char __pyx_k_72[] = "<strided and direct or indirect>";
-static char __pyx_k_74[] = "<strided and direct>";
-static char __pyx_k_76[] = "<strided and indirect>";
-static char __pyx_k_78[] = "<contiguous and direct>";
-static char __pyx_k_80[] = "<contiguous and indirect>";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__C[] = "C";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__c[] = "c";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__f2[] = "f2";
-static char __pyx_k__f4[] = "f4";
-static char __pyx_k__f8[] = "f8";
-static char __pyx_k__i1[] = "i1";
-static char __pyx_k__i2[] = "i2";
-static char __pyx_k__i4[] = "i4";
-static char __pyx_k__i8[] = "i8";
-static char __pyx_k__id[] = "id";
-static char __pyx_k__np[] = "np";
-static char __pyx_k__u1[] = "u1";
-static char __pyx_k__u2[] = "u2";
-static char __pyx_k__u4[] = "u4";
-static char __pyx_k__u8[] = "u8";
-static char __pyx_k__obj[] = "obj";
-static char __pyx_k__str[] = "str";
-static char __pyx_k__base[] = "base";
-static char __pyx_k__data[] = "data";
-static char __pyx_k__int8[] = "int8";
-static char __pyx_k__mask[] = "mask";
-static char __pyx_k__mode[] = "mode";
-static char __pyx_k__name[] = "name";
-static char __pyx_k__ndim[] = "ndim";
-static char __pyx_k__pack[] = "pack";
-static char __pyx_k__size[] = "size";
-static char __pyx_k__step[] = "step";
-static char __pyx_k__stop[] = "stop";
-static char __pyx_k__ASCII[] = "ASCII";
-static char __pyx_k__c_end[] = "c_end";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__empty[] = "empty";
-static char __pyx_k__error[] = "error";
-static char __pyx_k__flags[] = "flags";
-static char __pyx_k__int16[] = "int16";
-static char __pyx_k__int32[] = "int32";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__order[] = "order";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__shape[] = "shape";
-static char __pyx_k__start[] = "start";
-static char __pyx_k__uint8[] = "uint8";
-static char __pyx_k__value[] = "value";
-static char __pyx_k__zeros[] = "zeros";
-static char __pyx_k__border[] = "border";
-static char __pyx_k__c_data[] = "c_data";
-static char __pyx_k__c_type[] = "c_type";
-static char __pyx_k__decode[] = "decode";
-static char __pyx_k__encode[] = "encode";
-static char __pyx_k__extend[] = "extend";
-static char __pyx_k__format[] = "format";
-static char __pyx_k__minMax[] = "minMax";
-static char __pyx_k__pixmap[] = "pixmap";
-static char __pyx_k__pnpoly[] = "pnpoly";
-static char __pyx_k__points[] = "points";
-static char __pyx_k__struct[] = "struct";
-static char __pyx_k__uint16[] = "uint16";
-static char __pyx_k__uint32[] = "uint32";
-static char __pyx_k__unpack[] = "unpack";
-static char __pyx_k__xrange[] = "xrange";
-static char __pyx_k__asarray[] = "asarray";
-static char __pyx_k__c_start[] = "c_start";
-static char __pyx_k__float32[] = "float32";
-static char __pyx_k__float64[] = "float64";
-static char __pyx_k__fortran[] = "fortran";
-static char __pyx_k__memview[] = "memview";
-static char __pyx_k__Ellipsis[] = "Ellipsis";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____name__[] = "__name__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k___pnpolyd[] = "_pnpolyd";
-static char __pyx_k__c_pixmap[] = "c_pixmap";
-static char __pyx_k__c_points[] = "c_points";
-static char __pyx_k__colormap[] = "colormap";
-static char __pyx_k__endValue[] = "endValue";
-static char __pyx_k__itemsize[] = "itemsize";
-static char __pyx_k__n_points[] = "n_points";
-static char __pyx_k__nanColor[] = "nanColor";
-static char __pyx_k__vertices[] = "vertices";
-static char __pyx_k__TypeError[] = "TypeError";
-static char __pyx_k____class__[] = "__class__";
-static char __pyx_k__c_dataMax[] = "c_dataMax";
-static char __pyx_k__c_dataMin[] = "c_dataMin";
-static char __pyx_k__c_dataPtr[] = "c_dataPtr";
-static char __pyx_k__enumerate[] = "enumerate";
-static char __pyx_k__fastLog10[] = "fastLog10";
-static char __pyx_k__IndexError[] = "IndexError";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k____import__[] = "__import__";
-static char __pyx_k___pnpolyInt[] = "_pnpolyInt";
-static char __pyx_k__c_colormap[] = "c_colormap";
-static char __pyx_k__c_dataSize[] = "c_dataSize";
-static char __pyx_k__c_nanColor[] = "c_nanColor";
-static char __pyx_k__c_vertices[] = "c_vertices";
-static char __pyx_k__n_vertices[] = "n_vertices";
-static char __pyx_k__startValue[] = "startValue";
-static char __pyx_k__MemoryError[] = "MemoryError";
-static char __pyx_k__minPositive[] = "minPositive";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static char __pyx_k___pnpolyFloat[] = "_pnpolyFloat";
-static char __pyx_k__c_dataMinPos[] = "c_dataMinPos";
-static char __pyx_k__c_startExtra[] = "c_startExtra";
-static char __pyx_k__c_nanColorPtr[] = "c_nanColorPtr";
-static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__";
-static char __pyx_k__c_dataItemSize[] = "c_dataItemSize";
-static char __pyx_k__isLog10Mapping[] = "isLog10Mapping";
-static char __pyx_k____pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k__allocate_buffer[] = "allocate_buffer";
-static char __pyx_k__dtype_is_object[] = "dtype_is_object";
-static char __pyx_k__c_colormapLength[] = "c_colormapLength";
-static char __pyx_k__ascontiguousarray[] = "ascontiguousarray";
-static char __pyx_k__dataToRGBAColormap[] = "dataToRGBAColormap";
-static char __pyx_k___NUMPY_TO_TYPE_DESC[] = "_NUMPY_TO_TYPE_DESC";
-static char __pyx_k____pyx_releasebuffer[] = "__pyx_releasebuffer";
-static PyObject *__pyx_kp_u_10;
-static PyObject *__pyx_kp_u_12;
-static PyObject *__pyx_kp_u_14;
-static PyObject *__pyx_kp_u_15;
-static PyObject *__pyx_kp_u_18;
-static PyObject *__pyx_kp_s_2;
-static PyObject *__pyx_kp_s_20;
-static PyObject *__pyx_kp_s_22;
-static PyObject *__pyx_kp_s_25;
-static PyObject *__pyx_kp_s_27;
-static PyObject *__pyx_kp_s_28;
-static PyObject *__pyx_kp_s_30;
-static PyObject *__pyx_kp_s_32;
-static PyObject *__pyx_kp_s_34;
-static PyObject *__pyx_kp_s_36;
-static PyObject *__pyx_kp_s_38;
-static PyObject *__pyx_kp_s_39;
-static PyObject *__pyx_kp_s_42;
-static PyObject *__pyx_kp_s_44;
-static PyObject *__pyx_kp_s_49;
-static PyObject *__pyx_kp_s_51;
-static PyObject *__pyx_kp_s_55;
-static PyObject *__pyx_n_s_56;
-static PyObject *__pyx_kp_s_59;
-static PyObject *__pyx_kp_s_64;
-static PyObject *__pyx_kp_s_72;
-static PyObject *__pyx_kp_s_74;
-static PyObject *__pyx_kp_s_76;
-static PyObject *__pyx_kp_s_78;
-static PyObject *__pyx_kp_u_8;
-static PyObject *__pyx_kp_s_80;
-static PyObject *__pyx_n_s__ASCII;
-static PyObject *__pyx_n_s__C;
-static PyObject *__pyx_n_s__Ellipsis;
-static PyObject *__pyx_n_s__IndexError;
-static PyObject *__pyx_n_s__MemoryError;
-static PyObject *__pyx_n_b__O;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__TypeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s___NUMPY_TO_TYPE_DESC;
-static PyObject *__pyx_n_s____class__;
-static PyObject *__pyx_n_s____import__;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____name__;
-static PyObject *__pyx_n_s____pyx_getbuffer;
-static PyObject *__pyx_n_s____pyx_releasebuffer;
-static PyObject *__pyx_n_s____pyx_vtable__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s___pnpolyFloat;
-static PyObject *__pyx_n_s___pnpolyInt;
-static PyObject *__pyx_n_s___pnpolyd;
-static PyObject *__pyx_n_s__allocate_buffer;
-static PyObject *__pyx_n_s__asarray;
-static PyObject *__pyx_n_s__ascontiguousarray;
-static PyObject *__pyx_n_s__base;
-static PyObject *__pyx_n_s__border;
-static PyObject *__pyx_n_b__c;
-static PyObject *__pyx_n_s__c;
-static PyObject *__pyx_n_u__c;
-static PyObject *__pyx_n_s__c_colormap;
-static PyObject *__pyx_n_s__c_colormapLength;
-static PyObject *__pyx_n_s__c_data;
-static PyObject *__pyx_n_s__c_dataItemSize;
-static PyObject *__pyx_n_s__c_dataMax;
-static PyObject *__pyx_n_s__c_dataMin;
-static PyObject *__pyx_n_s__c_dataMinPos;
-static PyObject *__pyx_n_s__c_dataPtr;
-static PyObject *__pyx_n_s__c_dataSize;
-static PyObject *__pyx_n_s__c_end;
-static PyObject *__pyx_n_s__c_nanColor;
-static PyObject *__pyx_n_s__c_nanColorPtr;
-static PyObject *__pyx_n_s__c_pixmap;
-static PyObject *__pyx_n_s__c_points;
-static PyObject *__pyx_n_s__c_start;
-static PyObject *__pyx_n_s__c_startExtra;
-static PyObject *__pyx_n_s__c_type;
-static PyObject *__pyx_n_s__c_vertices;
-static PyObject *__pyx_n_s__colormap;
-static PyObject *__pyx_n_s__data;
-static PyObject *__pyx_n_s__dataToRGBAColormap;
-static PyObject *__pyx_n_s__decode;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__dtype_is_object;
-static PyObject *__pyx_n_s__empty;
-static PyObject *__pyx_n_s__encode;
-static PyObject *__pyx_n_s__endValue;
-static PyObject *__pyx_n_s__enumerate;
-static PyObject *__pyx_n_s__error;
-static PyObject *__pyx_n_s__extend;
-static PyObject *__pyx_n_s__f2;
-static PyObject *__pyx_n_s__f4;
-static PyObject *__pyx_n_s__f8;
-static PyObject *__pyx_n_s__fastLog10;
-static PyObject *__pyx_n_s__flags;
-static PyObject *__pyx_n_s__float32;
-static PyObject *__pyx_n_s__float64;
-static PyObject *__pyx_n_s__format;
-static PyObject *__pyx_n_b__fortran;
-static PyObject *__pyx_n_s__fortran;
-static PyObject *__pyx_n_s__i1;
-static PyObject *__pyx_n_s__i2;
-static PyObject *__pyx_n_s__i4;
-static PyObject *__pyx_n_s__i8;
-static PyObject *__pyx_n_s__id;
-static PyObject *__pyx_n_s__int16;
-static PyObject *__pyx_n_s__int32;
-static PyObject *__pyx_n_s__int8;
-static PyObject *__pyx_n_s__isLog10Mapping;
-static PyObject *__pyx_n_s__itemsize;
-static PyObject *__pyx_n_s__mask;
-static PyObject *__pyx_n_s__memview;
-static PyObject *__pyx_n_s__minMax;
-static PyObject *__pyx_n_s__minPositive;
-static PyObject *__pyx_n_s__mode;
-static PyObject *__pyx_n_s__n_points;
-static PyObject *__pyx_n_s__n_vertices;
-static PyObject *__pyx_n_s__name;
-static PyObject *__pyx_n_s__nanColor;
-static PyObject *__pyx_n_s__ndim;
-static PyObject *__pyx_n_s__np;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__obj;
-static PyObject *__pyx_n_s__order;
-static PyObject *__pyx_n_s__pack;
-static PyObject *__pyx_n_s__pixmap;
-static PyObject *__pyx_n_s__pnpoly;
-static PyObject *__pyx_n_s__points;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__shape;
-static PyObject *__pyx_n_s__size;
-static PyObject *__pyx_n_s__start;
-static PyObject *__pyx_n_s__startValue;
-static PyObject *__pyx_n_s__step;
-static PyObject *__pyx_n_s__stop;
-static PyObject *__pyx_n_s__str;
-static PyObject *__pyx_n_s__struct;
-static PyObject *__pyx_n_s__u1;
-static PyObject *__pyx_n_s__u2;
-static PyObject *__pyx_n_s__u4;
-static PyObject *__pyx_n_s__u8;
-static PyObject *__pyx_n_s__uint16;
-static PyObject *__pyx_n_s__uint32;
-static PyObject *__pyx_n_s__uint8;
-static PyObject *__pyx_n_s__unpack;
-static PyObject *__pyx_n_s__value;
-static PyObject *__pyx_n_s__vertices;
-static PyObject *__pyx_n_s__xrange;
-static PyObject *__pyx_n_s__zeros;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_3;
-static PyObject *__pyx_int_4;
-static PyObject *__pyx_int_5;
-static PyObject *__pyx_int_6;
-static PyObject *__pyx_int_7;
-static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_int_10;
-static PyObject *__pyx_int_11;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_k_slice_1;
-static PyObject *__pyx_k_slice_4;
-static PyObject *__pyx_k_slice_5;
-static PyObject *__pyx_k_slice_6;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_7;
-static PyObject *__pyx_k_tuple_9;
-static PyObject *__pyx_k_tuple_11;
-static PyObject *__pyx_k_tuple_13;
-static PyObject *__pyx_k_tuple_16;
-static PyObject *__pyx_k_tuple_17;
-static PyObject *__pyx_k_tuple_19;
-static PyObject *__pyx_k_tuple_21;
-static PyObject *__pyx_k_tuple_23;
-static PyObject *__pyx_k_tuple_24;
-static PyObject *__pyx_k_tuple_26;
-static PyObject *__pyx_k_tuple_29;
-static PyObject *__pyx_k_tuple_31;
-static PyObject *__pyx_k_tuple_33;
-static PyObject *__pyx_k_tuple_35;
-static PyObject *__pyx_k_tuple_37;
-static PyObject *__pyx_k_tuple_40;
-static PyObject *__pyx_k_tuple_41;
-static PyObject *__pyx_k_tuple_43;
-static PyObject *__pyx_k_tuple_45;
-static PyObject *__pyx_k_tuple_53;
-static PyObject *__pyx_k_tuple_57;
-static PyObject *__pyx_k_tuple_60;
-static PyObject *__pyx_k_tuple_62;
-static PyObject *__pyx_k_tuple_65;
-static PyObject *__pyx_k_tuple_67;
-static PyObject *__pyx_k_tuple_69;
-static PyObject *__pyx_k_tuple_73;
-static PyObject *__pyx_k_tuple_75;
-static PyObject *__pyx_k_tuple_77;
-static PyObject *__pyx_k_tuple_79;
-static PyObject *__pyx_k_tuple_81;
-static PyObject *__pyx_k_codeobj_54;
-static PyObject *__pyx_k_codeobj_58;
-static PyObject *__pyx_k_codeobj_61;
-static PyObject *__pyx_k_codeobj_63;
-static PyObject *__pyx_k_codeobj_66;
-static PyObject *__pyx_k_codeobj_68;
-static PyObject *__pyx_k_codeobj_70;
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax[] = "Get min, max and optionally min positive of data.\n\n NaNs are ignored while computing min/max.\n If all data is NaNs, returned min/max are NaNs and\n returned minPositive is None.\n\n :param np.ndarray data: Array of data\n :param bool minPositive: Wheither to compute min positive or not.\n :returns: (min, max) or (min, minPositive, max) if minPositive is True\n If all data < 0, minPositive is None.\n :rtype: tuple of float\n :raises: ValueError if data is empty\n ";
-static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax = {__Pyx_NAMESTR("minMax"), (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax)};
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyArrayObject *__pyx_v_data = 0;
- int __pyx_v_minPositive;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("minMax (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__minPositive,0};
- PyObject* values[2] = {0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__minPositive);
- if (value) { values[1] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minMax") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_data = ((PyArrayObject *)values[0]);
- if (values[1]) {
- __pyx_v_minPositive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_minPositive == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":55
- * @cython.boundscheck(False)
- * @cython.wraparound(False)
- * def minMax(np.ndarray data, bint minPositive=False): # <<<<<<<<<<<<<<
- * """Get min, max and optionally min positive of data.
- *
- */
- __pyx_v_minPositive = ((int)0);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("minMax", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.minMax", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax(__pyx_self, __pyx_v_data, __pyx_v_minPositive);
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, int __pyx_v_minPositive) {
- PyArrayObject *__pyx_v_c_data = 0;
- void *__pyx_v_c_dataPtr;
- unsigned long __pyx_v_c_dataSize;
- double __pyx_v_c_dataMin;
- double __pyx_v_c_dataMinPos;
- double __pyx_v_c_dataMax;
- unsigned int __pyx_v_c_type;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- char *__pyx_t_7;
- unsigned long __pyx_t_8;
- unsigned int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("minMax", 0);
- __Pyx_INCREF((PyObject *)__pyx_v_data);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":70
- * """
- * #Convert float16 to float32
- * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
- * data = np.asarray(data, dtype=np.float32)
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_k_slice_1, 1, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__f2), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":71
- * #Convert float16 to float32
- * if data.dtype.str[1:] == 'f2':
- * data = np.asarray(data, dtype=np.float32) # <<<<<<<<<<<<<<
- *
- * cdef np.ndarray c_data = np.ascontiguousarray(data)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_data));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_data));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 71; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_v_data));
- __pyx_v_data = ((PyArrayObject *)__pyx_t_6);
- __pyx_t_6 = 0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":73
- * data = np.asarray(data, dtype=np.float32)
- *
- * cdef np.ndarray c_data = np.ascontiguousarray(data) # <<<<<<<<<<<<<<
- * cdef void * c_dataPtr = c_data.data
- * cdef unsigned long c_dataSize = c_data.size
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(((PyObject *)__pyx_v_data));
- PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_v_data));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_data = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":74
- *
- * cdef np.ndarray c_data = np.ascontiguousarray(data)
- * cdef void * c_dataPtr = c_data.data # <<<<<<<<<<<<<<
- * cdef unsigned long c_dataSize = c_data.size
- *
- */
- __pyx_t_7 = __pyx_v_c_data->data;
- __pyx_v_c_dataPtr = __pyx_t_7;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":75
- * cdef np.ndarray c_data = np.ascontiguousarray(data)
- * cdef void * c_dataPtr = c_data.data
- * cdef unsigned long c_dataSize = c_data.size # <<<<<<<<<<<<<<
- *
- * if c_dataSize == 0:
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_data), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 75; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_c_dataSize = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":77
- * cdef unsigned long c_dataSize = c_data.size
- *
- * if c_dataSize == 0: # <<<<<<<<<<<<<<
- * raise ValueError("zero-size array")
- *
- */
- __pyx_t_3 = ((__pyx_v_c_dataSize == 0) != 0);
- if (__pyx_t_3) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":78
- *
- * if c_dataSize == 0:
- * raise ValueError("zero-size array") # <<<<<<<<<<<<<<
- *
- * cdef double c_dataMin, c_dataMinPos, c_dataMax
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":82
- * cdef double c_dataMin, c_dataMinPos, c_dataMax
- *
- * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
- *
- * if minPositive:
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s___NUMPY_TO_TYPE_DESC); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s__dtype); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__str); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_4, 1, 0, NULL, NULL, &__pyx_k_slice_4, 1, 0, 0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_GetItem(__pyx_t_2, __pyx_t_6); if (!__pyx_t_4) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_4); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_c_type = __pyx_t_9;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":84
- * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]]
- *
- * if minPositive: # <<<<<<<<<<<<<<
- * with nogil:
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- */
- __pyx_t_3 = (__pyx_v_minPositive != 0);
- if (__pyx_t_3) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":85
- *
- * if minPositive:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, &c_dataMinPos, &c_dataMax)
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":87
- * with nogil:
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, &c_dataMinPos, &c_dataMax) # <<<<<<<<<<<<<<
- * if c_dataMinPos == 0:
- * return c_dataMin, None, c_dataMax
- */
- getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_dataMin), (&__pyx_v_c_dataMinPos), (&__pyx_v_c_dataMax));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":85
- *
- * if minPositive:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, &c_dataMinPos, &c_dataMax)
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":88
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, &c_dataMinPos, &c_dataMax)
- * if c_dataMinPos == 0: # <<<<<<<<<<<<<<
- * return c_dataMin, None, c_dataMax
- * else:
- */
- __pyx_t_3 = ((__pyx_v_c_dataMinPos == 0.0) != 0);
- if (__pyx_t_3) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":89
- * &c_dataMin, &c_dataMinPos, &c_dataMax)
- * if c_dataMinPos == 0:
- * return c_dataMin, None, c_dataMax # <<<<<<<<<<<<<<
- * else:
- * return c_dataMin, c_dataMinPos, c_dataMax
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_c_dataMin); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyFloat_FromDouble(__pyx_v_c_dataMax); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_2, 1, Py_None);
- __Pyx_GIVEREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- __pyx_t_4 = 0;
- __pyx_t_6 = 0;
- __pyx_r = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L9;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":91
- * return c_dataMin, None, c_dataMax
- * else:
- * return c_dataMin, c_dataMinPos, c_dataMax # <<<<<<<<<<<<<<
- * else:
- * with nogil:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_c_dataMin); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = PyFloat_FromDouble(__pyx_v_c_dataMinPos); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_c_dataMax); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_2 = 0;
- __pyx_t_6 = 0;
- __pyx_t_4 = 0;
- __pyx_r = ((PyObject *)__pyx_t_1);
- __pyx_t_1 = 0;
- goto __pyx_L0;
- }
- __pyx_L9:;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":93
- * return c_dataMin, c_dataMinPos, c_dataMax
- * else:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, NULL, &c_dataMax)
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":95
- * with nogil:
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, NULL, &c_dataMax) # <<<<<<<<<<<<<<
- * return c_dataMin, c_dataMax
- */
- getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_dataMin), NULL, (&__pyx_v_c_dataMax));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":93
- * return c_dataMin, c_dataMinPos, c_dataMax
- * else:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, NULL, &c_dataMax)
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":96
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_dataMin, NULL, &c_dataMax)
- * return c_dataMin, c_dataMax # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c_dataMin); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = PyFloat_FromDouble(__pyx_v_c_dataMax); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_1 = 0;
- __pyx_t_4 = 0;
- __pyx_r = ((PyObject *)__pyx_t_6);
- __pyx_t_6 = 0;
- goto __pyx_L0;
- }
- __pyx_L5:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.minMax", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_c_data);
- __Pyx_XDECREF((PyObject *)__pyx_v_data);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap[] = "Compute a pixmap by applying a colormap to data.\n\n :param numpy.ndarray data: Array of data value to convert to pixmap.\n :param numpy.ndarray colormap: palette to use as colormap as an array of\n RGBA color.\n :param startValue: The value to map to the first color of the colormap.\n :param endValue: The value to map to the last color of the colormap.\n :param bool isLog10Mapping: The mapping: False for linear, True for log10.\n :param nanColor: RGBA color to use for NaNs.\n If None, the first color of the colormap.\n :type nanColor: None (the default) or a container that can be converted\n to a numpy.ndarray containing 4 elements in [0, 255].\n :returns: The corresponding pixmap of RGBA pixels as an array of 4 uint8\n with same dimensions as data and used min and max.\n :rtype: A tuple : (pixmap , (usedMin, usedMax)).\n ";
-static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap = {__Pyx_NAMESTR("dataToRGBAColormap"), (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap)};
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_data = 0;
- PyArrayObject *__pyx_v_colormap = 0;
- PyObject *__pyx_v_startValue = 0;
- PyObject *__pyx_v_endValue = 0;
- int __pyx_v_isLog10Mapping;
- PyObject *__pyx_v_nanColor = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("dataToRGBAColormap (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__data,&__pyx_n_s__colormap,&__pyx_n_s__startValue,&__pyx_n_s__endValue,&__pyx_n_s__isLog10Mapping,&__pyx_n_s__nanColor,0};
- PyObject* values[6] = {0,0,0,0,0,0};
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":63
- * def dataToRGBAColormap(data,
- * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
- * startValue=None, endValue=None, # <<<<<<<<<<<<<<
- * bint isLog10Mapping=False,
- * nanColor=None):
- */
- values[2] = ((PyObject *)Py_None);
- values[3] = ((PyObject *)Py_None);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":65
- * startValue=None, endValue=None,
- * bint isLog10Mapping=False,
- * nanColor=None): # <<<<<<<<<<<<<<
- * """Compute a pixmap by applying a colormap to data.
- *
- */
- values[5] = ((PyObject *)Py_None);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__data)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__colormap)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("dataToRGBAColormap", 0, 2, 6, 1); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__startValue);
- if (value) { values[2] = value; kw_args--; }
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__endValue);
- if (value) { values[3] = value; kw_args--; }
- }
- case 4:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__isLog10Mapping);
- if (value) { values[4] = value; kw_args--; }
- }
- case 5:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nanColor);
- if (value) { values[5] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dataToRGBAColormap") < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_data = values[0];
- __pyx_v_colormap = ((PyArrayObject *)values[1]);
- __pyx_v_startValue = values[2];
- __pyx_v_endValue = values[3];
- if (values[4]) {
- __pyx_v_isLog10Mapping = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_isLog10Mapping == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":64
- * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
- * startValue=None, endValue=None,
- * bint isLog10Mapping=False, # <<<<<<<<<<<<<<
- * nanColor=None):
- * """Compute a pixmap by applying a colormap to data.
- */
- __pyx_v_isLog10Mapping = ((int)0);
- }
- __pyx_v_nanColor = values[5];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("dataToRGBAColormap", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.dataToRGBAColormap", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colormap), __pyx_ptype_5numpy_ndarray, 1, "colormap", 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap(__pyx_self, __pyx_v_data, __pyx_v_colormap, __pyx_v_startValue, __pyx_v_endValue, __pyx_v_isLog10Mapping, __pyx_v_nanColor);
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":61
- * @cython.boundscheck(False)
- * @cython.wraparound(False)
- * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
- * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
- * startValue=None, endValue=None,
- */
-
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyArrayObject *__pyx_v_colormap, PyObject *__pyx_v_startValue, PyObject *__pyx_v_endValue, int __pyx_v_isLog10Mapping, PyObject *__pyx_v_nanColor) {
- PyArrayObject *__pyx_v_c_data = 0;
- void *__pyx_v_c_dataPtr;
- unsigned long __pyx_v_c_dataSize;
- CYTHON_UNUSED unsigned int __pyx_v_c_dataItemSize;
- __Pyx_memviewslice __pyx_v_c_colormap = { 0, 0, { 0 }, { 0 }, { 0 } };
- unsigned int __pyx_v_c_colormapLength;
- unsigned char *__pyx_v_c_nanColorPtr;
- PyArrayObject *__pyx_v_c_nanColor = 0;
- PyObject *__pyx_v_pixmap = NULL;
- __Pyx_memviewslice __pyx_v_c_pixmap = { 0, 0, { 0 }, { 0 }, { 0 } };
- unsigned int __pyx_v_c_type;
- double __pyx_v_c_start;
- double __pyx_v_c_startExtra;
- double __pyx_v_c_end;
- __Pyx_LocalBuf_ND __pyx_pybuffernd_colormap;
- __Pyx_Buffer __pyx_pybuffer_colormap;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- char *__pyx_t_7;
- unsigned long __pyx_t_8;
- unsigned int __pyx_t_9;
- __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
- Py_ssize_t __pyx_t_11;
- int __pyx_t_12;
- __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_14;
- double __pyx_t_15;
- Py_ssize_t __pyx_t_16;
- Py_ssize_t __pyx_t_17;
- Py_ssize_t __pyx_t_18;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("dataToRGBAColormap", 0);
- __Pyx_INCREF(__pyx_v_data);
- __pyx_pybuffer_colormap.pybuffer.buf = NULL;
- __pyx_pybuffer_colormap.refcount = 0;
- __pyx_pybuffernd_colormap.data = NULL;
- __pyx_pybuffernd_colormap.rcbuffer = &__pyx_pybuffer_colormap;
- {
- __Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colormap.rcbuffer->pybuffer, (PyObject*)__pyx_v_colormap, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_pybuffernd_colormap.diminfo[0].strides = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colormap.diminfo[0].shape = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_colormap.diminfo[1].strides = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_colormap.diminfo[1].shape = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.shape[1];
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":83
- * """
- * #Convert float16 to float32
- * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
- * data = np.asarray(data, dtype=np.float32)
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s__dtype); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__str); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_k_slice_5, 1, 0, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, ((PyObject *)__pyx_n_s__f2), Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_3) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":84
- * #Convert float16 to float32
- * if data.dtype.str[1:] == 'f2':
- * data = np.asarray(data, dtype=np.float32) # <<<<<<<<<<<<<<
- *
- * cdef np.ndarray c_data = np.ascontiguousarray(data)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__float32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 84; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_v_data);
- __pyx_v_data = __pyx_t_6;
- __pyx_t_6 = 0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":86
- * data = np.asarray(data, dtype=np.float32)
- *
- * cdef np.ndarray c_data = np.ascontiguousarray(data) # <<<<<<<<<<<<<<
- * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim
- * cdef unsigned long c_dataSize = c_data.size
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_data);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_data);
- __Pyx_GIVEREF(__pyx_v_data);
- __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_data = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":87
- *
- * cdef np.ndarray c_data = np.ascontiguousarray(data)
- * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim # <<<<<<<<<<<<<<
- * cdef unsigned long c_dataSize = c_data.size
- * cdef unsigned int c_dataItemSize = c_data.itemsize
- */
- __pyx_t_7 = __pyx_v_c_data->data;
- __pyx_v_c_dataPtr = __pyx_t_7;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":88
- * cdef np.ndarray c_data = np.ascontiguousarray(data)
- * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim
- * cdef unsigned long c_dataSize = c_data.size # <<<<<<<<<<<<<<
- * cdef unsigned int c_dataItemSize = c_data.itemsize
- *
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_data), __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyInt_AsUnsignedLong(__pyx_t_2); if (unlikely((__pyx_t_8 == (unsigned long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_c_dataSize = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":89
- * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim
- * cdef unsigned long c_dataSize = c_data.size
- * cdef unsigned int c_dataItemSize = c_data.itemsize # <<<<<<<<<<<<<<
- *
- * cdef unsigned char[:, :] c_colormap = colormap
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_data), __pyx_n_s__itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_2); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_c_dataItemSize = __pyx_t_9;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":91
- * cdef unsigned int c_dataItemSize = c_data.itemsize
- *
- * cdef unsigned char[:, :] c_colormap = colormap # <<<<<<<<<<<<<<
- * cdef unsigned int c_colormapLength = len(colormap)
- *
- */
- __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(((PyObject *)__pyx_v_colormap));
- if (unlikely(!__pyx_t_10.memview)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_colormap = __pyx_t_10;
- __pyx_t_10.memview = NULL;
- __pyx_t_10.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":92
- *
- * cdef unsigned char[:, :] c_colormap = colormap
- * cdef unsigned int c_colormapLength = len(colormap) # <<<<<<<<<<<<<<
- *
- * cdef unsigned char * c_nanColorPtr
- */
- __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_colormap)); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_colormapLength = __pyx_t_11;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":96
- * cdef unsigned char * c_nanColorPtr
- * cdef np.ndarray c_nanColor
- * if nanColor is None: # <<<<<<<<<<<<<<
- * c_nanColorPtr = NULL
- * else:
- */
- __pyx_t_3 = (__pyx_v_nanColor == Py_None);
- __pyx_t_12 = (__pyx_t_3 != 0);
- if (__pyx_t_12) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":97
- * cdef np.ndarray c_nanColor
- * if nanColor is None:
- * c_nanColorPtr = NULL # <<<<<<<<<<<<<<
- * else:
- * c_nanColor = np.asarray(nanColor, dtype=np.uint8, order='C')
- */
- __pyx_v_c_nanColorPtr = NULL;
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":99
- * c_nanColorPtr = NULL
- * else:
- * c_nanColor = np.asarray(nanColor, dtype=np.uint8, order='C') # <<<<<<<<<<<<<<
- * c_nanColorPtr = <unsigned char *> c_nanColor.data
- *
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__asarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_nanColor);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_nanColor);
- __Pyx_GIVEREF(__pyx_v_nanColor);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__uint8); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__order), ((PyObject *)__pyx_n_s__C)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_nanColor = ((PyArrayObject *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":100
- * else:
- * c_nanColor = np.asarray(nanColor, dtype=np.uint8, order='C')
- * c_nanColorPtr = <unsigned char *> c_nanColor.data # <<<<<<<<<<<<<<
- *
- * pixmap = np.empty((data.size, 4), dtype=np.uint8)
- */
- __pyx_v_c_nanColorPtr = ((unsigned char *)__pyx_v_c_nanColor->data);
- }
- __pyx_L4:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":102
- * c_nanColorPtr = <unsigned char *> c_nanColor.data
- *
- * pixmap = np.empty((data.size, 4), dtype=np.uint8) # <<<<<<<<<<<<<<
- * cdef unsigned char[:, :] c_pixmap = pixmap
- *
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__empty); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s__size); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_int_4);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_4);
- __Pyx_GIVEREF(__pyx_int_4);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
- __pyx_t_2 = 0;
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__np); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__uint8); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_v_pixmap = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":103
- *
- * pixmap = np.empty((data.size, 4), dtype=np.uint8)
- * cdef unsigned char[:, :] c_pixmap = pixmap # <<<<<<<<<<<<<<
- *
- * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]]
- */
- __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(__pyx_v_pixmap);
- if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_pixmap = __pyx_t_13;
- __pyx_t_13.memview = NULL;
- __pyx_t_13.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":105
- * cdef unsigned char[:, :] c_pixmap = pixmap
- *
- * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
- *
- * cdef double c_start, c_startExtra, c_end
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s___NUMPY_TO_TYPE_DESC); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s__dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__str); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_k_slice_6, 1, 0, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_GetItem(__pyx_t_1, __pyx_t_2); if (!__pyx_t_5) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_9 = __Pyx_PyInt_AsUnsignedInt(__pyx_t_5); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_c_type = __pyx_t_9;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":108
- *
- * cdef double c_start, c_startExtra, c_end
- * if startValue is None or endValue is None: # <<<<<<<<<<<<<<
- * if isLog10Mapping:
- * with nogil:
- */
- __pyx_t_12 = (__pyx_v_startValue == Py_None);
- if (!(__pyx_t_12 != 0)) {
- __pyx_t_3 = (__pyx_v_endValue == Py_None);
- __pyx_t_14 = (__pyx_t_3 != 0);
- } else {
- __pyx_t_14 = (__pyx_t_12 != 0);
- }
- if (__pyx_t_14) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":109
- * cdef double c_start, c_startExtra, c_end
- * if startValue is None or endValue is None:
- * if isLog10Mapping: # <<<<<<<<<<<<<<
- * with nogil:
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- */
- __pyx_t_14 = (__pyx_v_isLog10Mapping != 0);
- if (__pyx_t_14) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":110
- * if startValue is None or endValue is None:
- * if isLog10Mapping:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_startExtra, &c_start, &c_end)
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":112
- * with nogil:
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_startExtra, &c_start, &c_end) # <<<<<<<<<<<<<<
- * else:
- * with nogil:
- */
- getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_startExtra), (&__pyx_v_c_start), (&__pyx_v_c_end));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":110
- * if startValue is None or endValue is None:
- * if isLog10Mapping:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_startExtra, &c_start, &c_end)
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":114
- * &c_startExtra, &c_start, &c_end)
- * else:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_start, NULL, &c_end)
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":116
- * with nogil:
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_start, NULL, &c_end) # <<<<<<<<<<<<<<
- *
- * if startValue is not None:
- */
- getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_start), NULL, (&__pyx_v_c_end));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":114
- * &c_startExtra, &c_start, &c_end)
- * else:
- * with nogil: # <<<<<<<<<<<<<<
- * getMinMax(c_dataPtr, c_type, c_dataSize,
- * &c_start, NULL, &c_end)
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
- }
- __pyx_L6:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":118
- * &c_start, NULL, &c_end)
- *
- * if startValue is not None: # <<<<<<<<<<<<<<
- * c_start = startValue
- * if endValue is not None:
- */
- __pyx_t_14 = (__pyx_v_startValue != Py_None);
- __pyx_t_12 = (__pyx_t_14 != 0);
- if (__pyx_t_12) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":119
- *
- * if startValue is not None:
- * c_start = startValue # <<<<<<<<<<<<<<
- * if endValue is not None:
- * c_end = endValue
- */
- __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_startValue); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_start = __pyx_t_15;
- goto __pyx_L13;
- }
- __pyx_L13:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":120
- * if startValue is not None:
- * c_start = startValue
- * if endValue is not None: # <<<<<<<<<<<<<<
- * c_end = endValue
- * else:
- */
- __pyx_t_12 = (__pyx_v_endValue != Py_None);
- __pyx_t_14 = (__pyx_t_12 != 0);
- if (__pyx_t_14) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":121
- * c_start = startValue
- * if endValue is not None:
- * c_end = endValue # <<<<<<<<<<<<<<
- * else:
- * c_start = startValue
- */
- __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_endValue); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_end = __pyx_t_15;
- goto __pyx_L14;
- }
- __pyx_L14:;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":123
- * c_end = endValue
- * else:
- * c_start = startValue # <<<<<<<<<<<<<<
- * c_end = endValue
- *
- */
- __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_startValue); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_start = __pyx_t_15;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":124
- * else:
- * c_start = startValue
- * c_end = endValue # <<<<<<<<<<<<<<
- *
- * with nogil:
- */
- __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_endValue); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_end = __pyx_t_15;
- }
- __pyx_L5:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":126
- * c_end = endValue
- *
- * with nogil: # <<<<<<<<<<<<<<
- * colormapFillPixmap(c_dataPtr,
- * c_type,
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":133
- * c_end,
- * isLog10Mapping,
- * &c_colormap[0, 0], # <<<<<<<<<<<<<<
- * c_colormapLength,
- * c_nanColorPtr,
- */
- __pyx_t_11 = 0;
- __pyx_t_16 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":136
- * c_colormapLength,
- * c_nanColorPtr,
- * &c_pixmap[0, 0]) # <<<<<<<<<<<<<<
- *
- * pixmap.shape = data.shape + (4,)
- */
- __pyx_t_17 = 0;
- __pyx_t_18 = 0;
- colormapFillPixmap(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, __pyx_v_c_start, __pyx_v_c_end, __pyx_v_isLog10Mapping, (&(*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_colormap.data + __pyx_t_11 * __pyx_v_c_colormap.strides[0]) ) + __pyx_t_16 * __pyx_v_c_colormap.strides[1]) )))), __pyx_v_c_colormapLength, __pyx_v_c_nanColorPtr, (&(*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_pixmap.data + __pyx_t_17 * __pyx_v_c_pixmap.strides[0]) ) + __pyx_t_18 * __pyx_v_c_pixmap.strides[1]) )))));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":126
- * c_end = endValue
- *
- * with nogil: # <<<<<<<<<<<<<<
- * colormapFillPixmap(c_dataPtr,
- * c_type,
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":138
- * &c_pixmap[0, 0])
- *
- * pixmap.shape = data.shape + (4,) # <<<<<<<<<<<<<<
- * return pixmap, (c_start, c_end)
- *
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s__shape); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_2 = PyNumber_Add(__pyx_t_5, ((PyObject *)__pyx_k_tuple_7)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__Pyx_PyObject_SetAttrStr(__pyx_v_pixmap, __pyx_n_s__shape, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":139
- *
- * pixmap.shape = data.shape + (4,)
- * return pixmap, (c_start, c_end) # <<<<<<<<<<<<<<
- *
- * def fastLog10(double value):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyFloat_FromDouble(__pyx_v_c_start); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_5 = PyFloat_FromDouble(__pyx_v_c_end); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_2 = 0;
- __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_pixmap);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pixmap);
- __Pyx_GIVEREF(__pyx_v_pixmap);
- PyTuple_SET_ITEM(__pyx_t_5, 1, ((PyObject *)__pyx_t_1));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
- __pyx_t_1 = 0;
- __pyx_r = ((PyObject *)__pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
- { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colormap.rcbuffer->pybuffer);
- __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.dataToRGBAColormap", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- goto __pyx_L2;
- __pyx_L0:;
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colormap.rcbuffer->pybuffer);
- __pyx_L2:;
- __Pyx_XDECREF((PyObject *)__pyx_v_c_data);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_colormap, 1);
- __Pyx_XDECREF((PyObject *)__pyx_v_c_nanColor);
- __Pyx_XDECREF(__pyx_v_pixmap);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_pixmap, 1);
- __Pyx_XDECREF(__pyx_v_data);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10(PyObject *__pyx_self, PyObject *__pyx_arg_value); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10 = {__Pyx_NAMESTR("fastLog10"), (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10(PyObject *__pyx_self, PyObject *__pyx_arg_value) {
- double __pyx_v_value;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("fastLog10 (wrapper)", 0);
- assert(__pyx_arg_value); {
- __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.fastLog10", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_4fastLog10(__pyx_self, ((double)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":141
- * return pixmap, (c_start, c_end)
- *
- * def fastLog10(double value): # <<<<<<<<<<<<<<
- * return _fastLog10(value)
- */
-
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_4fastLog10(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("fastLog10", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":142
- *
- * def fastLog10(double value):
- * return _fastLog10(value) # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(fastLog10(__pyx_v_value)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.fastLog10", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static char __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly[] = "\n :param vertices: Array Nx2 with the coordenates of the polygon vertices\n :type vertices: ndarray\n :param points: Points to be checked out.\n :type points: ndarray Nx2 or list of [x, y] pairs\n :param border: Flag to indicate if a pointon a vertex is to be in or out\n :type border: boolean (default True)\n ";
-static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly = {__Pyx_NAMESTR("pnpoly"), (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly)};
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_vertices = 0;
- PyObject *__pyx_v_points = 0;
- int __pyx_v_border;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("pnpoly (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vertices,&__pyx_n_s__points,&__pyx_n_s__border,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertices)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("pnpoly", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__border);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pnpoly") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_vertices = values[0];
- __pyx_v_points = values[1];
- if (values[2]) {
- __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":54
- *
- * @cython.boundscheck(False)
- * def pnpoly(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * """
- * :param vertices: Array Nx2 with the coordenates of the polygon vertices
- */
- __pyx_v_border = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("pnpoly", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.pnpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("pnpoly", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":63
- * :type border: boolean (default True)
- * """
- * if isinstance(points, numpy.ndarray): # <<<<<<<<<<<<<<
- * if points.dtype == numpy.float32:
- * return _pnpolyFloat(vertices, points, border)
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_points, ((PyObject*)__pyx_ptype_5numpy_ndarray));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":64
- * """
- * if isinstance(points, numpy.ndarray):
- * if points.dtype == numpy.float32: # <<<<<<<<<<<<<<
- * return _pnpolyFloat(vertices, points, border)
- * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s__dtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float32); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (__pyx_t_2) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":65
- * if isinstance(points, numpy.ndarray):
- * if points.dtype == numpy.float32:
- * return _pnpolyFloat(vertices, points, border) # <<<<<<<<<<<<<<
- * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
- * numpy.uint32, numpy.uint8, numpy.uint16]:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s___pnpolyFloat); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_border); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_vertices);
- __Pyx_GIVEREF(__pyx_v_vertices);
- __Pyx_INCREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_points);
- __Pyx_GIVEREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_5);
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
- goto __pyx_L4;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":66
- * if points.dtype == numpy.float32:
- * return _pnpolyFloat(vertices, points, border)
- * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16, # <<<<<<<<<<<<<<
- * numpy.uint32, numpy.uint8, numpy.uint16]:
- * return _pnpolyInt(vertices, points, border)
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!((int)__pyx_t_2)) {
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = ((int)__pyx_t_1);
- } else {
- __pyx_t_6 = ((int)__pyx_t_2);
- }
- if (!__pyx_t_6) {
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = ((int)__pyx_t_2);
- } else {
- __pyx_t_1 = __pyx_t_6;
- }
- if (!__pyx_t_1) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":67
- * return _pnpolyFloat(vertices, points, border)
- * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
- * numpy.uint32, numpy.uint8, numpy.uint16]: # <<<<<<<<<<<<<<
- * return _pnpolyInt(vertices, points, border)
- * return _pnpolyd(vertices, points, border)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__uint32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_2 = ((int)__pyx_t_6);
- } else {
- __pyx_t_2 = __pyx_t_1;
- }
- if (!__pyx_t_2) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":66
- * if points.dtype == numpy.float32:
- * return _pnpolyFloat(vertices, points, border)
- * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16, # <<<<<<<<<<<<<<
- * numpy.uint32, numpy.uint8, numpy.uint16]:
- * return _pnpolyInt(vertices, points, border)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = ((int)__pyx_t_1);
- } else {
- __pyx_t_6 = __pyx_t_2;
- }
- if (!__pyx_t_6) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":67
- * return _pnpolyFloat(vertices, points, border)
- * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
- * numpy.uint32, numpy.uint8, numpy.uint16]: # <<<<<<<<<<<<<<
- * return _pnpolyInt(vertices, points, border)
- * return _pnpolyd(vertices, points, border)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__uint16); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_1 = ((int)__pyx_t_2);
- } else {
- __pyx_t_1 = __pyx_t_6;
- }
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = (__pyx_t_1 != 0);
- if (__pyx_t_6) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":68
- * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
- * numpy.uint32, numpy.uint8, numpy.uint16]:
- * return _pnpolyInt(vertices, points, border) # <<<<<<<<<<<<<<
- * return _pnpolyd(vertices, points, border)
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s___pnpolyInt); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_border); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_vertices);
- __Pyx_GIVEREF(__pyx_v_vertices);
- __Pyx_INCREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_points);
- __Pyx_GIVEREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- goto __pyx_L4;
- }
- __pyx_L4:;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":69
- * numpy.uint32, numpy.uint8, numpy.uint16]:
- * return _pnpolyInt(vertices, points, border)
- * return _pnpolyd(vertices, points, border) # <<<<<<<<<<<<<<
- *
- * @cython.boundscheck(False)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___pnpolyd); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_border); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_vertices);
- __Pyx_GIVEREF(__pyx_v_vertices);
- __Pyx_INCREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_v_points);
- __Pyx_GIVEREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_r = __pyx_t_4;
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.pnpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd = {__Pyx_NAMESTR("_pnpolyd"), (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_vertices = 0;
- PyObject *__pyx_v_points = 0;
- int __pyx_v_border;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_pnpolyd (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vertices,&__pyx_n_s__points,&__pyx_n_s__border,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertices)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_pnpolyd", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__border);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_pnpolyd") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_vertices = values[0];
- __pyx_v_points = values[1];
- if (values[2]) {
- __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":72
- *
- * @cython.boundscheck(False)
- * def _pnpolyd(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_v_border = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_pnpolyd", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyd", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_8_pnpolyd(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_8_pnpolyd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
- __Pyx_memviewslice __pyx_v_c_vertices = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_n_vertices;
- __Pyx_memviewslice __pyx_v_c_points = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_n_points;
- PyArrayObject *__pyx_v_mask = 0;
- __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
- __Pyx_Buffer __pyx_pybuffer_mask;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
- PyArrayObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
- Py_ssize_t __pyx_t_10;
- Py_ssize_t __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- long __pyx_t_13;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_pnpolyd", 0);
- __pyx_pybuffer_mask.pybuffer.buf = NULL;
- __pyx_pybuffer_mask.refcount = 0;
- __pyx_pybuffernd_mask.data = NULL;
- __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":73
- * @cython.boundscheck(False)
- * def _pnpolyd(vertices, points, bint border=True):
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0]
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
- __Pyx_GIVEREF(__pyx_v_vertices);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":74
- * def _pnpolyd(vertices, points, bint border=True):
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 74; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_5);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_c_vertices = __pyx_t_6;
- __pyx_t_6.memview = NULL;
- __pyx_t_6.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":75
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0] # <<<<<<<<<<<<<<
- * assert c_vertices.shape[1] == 2
- * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
- */
- __pyx_v_n_vertices = (__pyx_v_c_vertices.shape[0]);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":76
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2 # <<<<<<<<<<<<<<
- * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.float64)
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!(((__pyx_v_c_vertices.shape[1]) == 2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 76; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":77
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2
- * cdef double[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef int n_points = c_points.shape[0]
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_points);
- __Pyx_GIVEREF(__pyx_v_points);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":78
- * assert c_vertices.shape[1] == 2
- * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef int n_points = c_points.shape[0]
- * assert c_points.shape[1] == 2
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_4);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 77; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_c_points = __pyx_t_7;
- __pyx_t_7.memview = NULL;
- __pyx_t_7.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":79
- * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.float64)
- * cdef int n_points = c_points.shape[0] # <<<<<<<<<<<<<<
- * assert c_points.shape[1] == 2
- *
- */
- __pyx_v_n_points = (__pyx_v_c_points.shape[0]);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":80
- * dtype=numpy.float64)
- * cdef int n_points = c_points.shape[0]
- * assert c_points.shape[1] == 2 # <<<<<<<<<<<<<<
- *
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!(((__pyx_v_c_points.shape[1]) == 2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":83
- *
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8) # <<<<<<<<<<<<<<
- * with nogil:
- * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromLong(__pyx_v_n_points); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- __pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
- {
- __Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
- __pyx_v_mask = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf = NULL;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else {__pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
- }
- }
- __pyx_t_8 = 0;
- __pyx_v_mask = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":84
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil: # <<<<<<<<<<<<<<
- * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":85
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil:
- * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
- * border, &mask[0])
- * return mask
- */
- __pyx_t_9 = 0;
- __pyx_t_10 = 0;
- if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_c_vertices.shape[0];
- if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_c_vertices.shape[1];
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_c_points.shape[0];
- if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_c_points.shape[1];
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":86
- * with nogil:
- * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0]) # <<<<<<<<<<<<<<
- * return mask
- *
- */
- __pyx_t_13 = 0;
- if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_mask.diminfo[0].shape;
- PointsInsidePolygon((&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_vertices.data + __pyx_t_9 * __pyx_v_c_vertices.strides[0]) ) + __pyx_t_10 * __pyx_v_c_vertices.strides[1]) )))), __pyx_v_n_vertices, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_points.data + __pyx_t_11 * __pyx_v_c_points.strides[0]) ) + __pyx_t_12 * __pyx_v_c_points.strides[1]) )))), __pyx_v_n_points, __pyx_v_border, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides))));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":84
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil: # <<<<<<<<<<<<<<
- * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":87
- * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- * return mask # <<<<<<<<<<<<<<
- *
- * @cython.boundscheck(False)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_mask));
- __pyx_r = ((PyObject *)__pyx_v_mask);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
- { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
- __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyd", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- goto __pyx_L2;
- __pyx_L0:;
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
- __pyx_L2:;
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_vertices, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_points, 1);
- __Pyx_XDECREF((PyObject *)__pyx_v_mask);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat = {__Pyx_NAMESTR("_pnpolyFloat"), (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_vertices = 0;
- PyObject *__pyx_v_points = 0;
- int __pyx_v_border;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_pnpolyFloat (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vertices,&__pyx_n_s__points,&__pyx_n_s__border,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertices)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_pnpolyFloat", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__border);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_pnpolyFloat") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_vertices = values[0];
- __pyx_v_points = values[1];
- if (values[2]) {
- __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":90
- *
- * @cython.boundscheck(False)
- * def _pnpolyFloat(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_v_border = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_pnpolyFloat", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyFloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_10_pnpolyFloat(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_10_pnpolyFloat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
- __Pyx_memviewslice __pyx_v_c_vertices = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_n_vertices;
- __Pyx_memviewslice __pyx_v_c_points = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_n_points;
- PyArrayObject *__pyx_v_mask = 0;
- __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
- __Pyx_Buffer __pyx_pybuffer_mask;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
- PyArrayObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
- Py_ssize_t __pyx_t_10;
- Py_ssize_t __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- long __pyx_t_13;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_pnpolyFloat", 0);
- __pyx_pybuffer_mask.pybuffer.buf = NULL;
- __pyx_pybuffer_mask.refcount = 0;
- __pyx_pybuffernd_mask.data = NULL;
- __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":91
- * @cython.boundscheck(False)
- * def _pnpolyFloat(vertices, points, bint border=True):
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0]
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
- __Pyx_GIVEREF(__pyx_v_vertices);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":92
- * def _pnpolyFloat(vertices, points, bint border=True):
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 92; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_5);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 91; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_c_vertices = __pyx_t_6;
- __pyx_t_6.memview = NULL;
- __pyx_t_6.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":93
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0] # <<<<<<<<<<<<<<
- * assert c_vertices.shape[1] == 2
- * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
- */
- __pyx_v_n_vertices = (__pyx_v_c_vertices.shape[0]);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":94
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2 # <<<<<<<<<<<<<<
- * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.float32)
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!(((__pyx_v_c_vertices.shape[1]) == 2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 94; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":95
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2
- * cdef float[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
- * dtype=numpy.float32)
- * cdef int n_points = c_points.shape[0]
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_points);
- __Pyx_GIVEREF(__pyx_v_points);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":96
- * assert c_vertices.shape[1] == 2
- * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.float32) # <<<<<<<<<<<<<<
- * cdef int n_points = c_points.shape[0]
- * assert c_points.shape[1] == 2
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_t_4);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 95; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_c_points = __pyx_t_7;
- __pyx_t_7.memview = NULL;
- __pyx_t_7.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":97
- * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.float32)
- * cdef int n_points = c_points.shape[0] # <<<<<<<<<<<<<<
- * assert c_points.shape[1] == 2
- *
- */
- __pyx_v_n_points = (__pyx_v_c_points.shape[0]);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":98
- * dtype=numpy.float32)
- * cdef int n_points = c_points.shape[0]
- * assert c_points.shape[1] == 2 # <<<<<<<<<<<<<<
- *
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!(((__pyx_v_c_points.shape[1]) == 2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 98; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":101
- *
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8) # <<<<<<<<<<<<<<
- * with nogil:
- * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromLong(__pyx_v_n_points); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- __pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
- {
- __Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
- __pyx_v_mask = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf = NULL;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else {__pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
- }
- }
- __pyx_t_8 = 0;
- __pyx_v_mask = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":102
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil: # <<<<<<<<<<<<<<
- * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":103
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil:
- * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
- * border, &mask[0])
- * return mask
- */
- __pyx_t_9 = 0;
- __pyx_t_10 = 0;
- if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_c_vertices.shape[0];
- if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_c_vertices.shape[1];
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_c_points.shape[0];
- if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_c_points.shape[1];
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":104
- * with nogil:
- * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0]) # <<<<<<<<<<<<<<
- * return mask
- *
- */
- __pyx_t_13 = 0;
- if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_mask.diminfo[0].shape;
- PointsInsidePolygonF((&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_vertices.data + __pyx_t_9 * __pyx_v_c_vertices.strides[0]) ) + __pyx_t_10 * __pyx_v_c_vertices.strides[1]) )))), __pyx_v_n_vertices, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_points.data + __pyx_t_11 * __pyx_v_c_points.strides[0]) ) + __pyx_t_12 * __pyx_v_c_points.strides[1]) )))), __pyx_v_n_points, __pyx_v_border, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides))));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":102
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil: # <<<<<<<<<<<<<<
- * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":105
- * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- * return mask # <<<<<<<<<<<<<<
- *
- * @cython.boundscheck(False)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_mask));
- __pyx_r = ((PyObject *)__pyx_v_mask);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
- { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
- __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyFloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- goto __pyx_L2;
- __pyx_L0:;
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
- __pyx_L2:;
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_vertices, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_points, 1);
- __Pyx_XDECREF((PyObject *)__pyx_v_mask);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt = {__Pyx_NAMESTR("_pnpolyInt"), (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_vertices = 0;
- PyObject *__pyx_v_points = 0;
- int __pyx_v_border;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_pnpolyInt (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__vertices,&__pyx_n_s__points,&__pyx_n_s__border,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__vertices)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__points)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("_pnpolyInt", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__border);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_pnpolyInt") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_vertices = values[0];
- __pyx_v_points = values[1];
- if (values[2]) {
- __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":108
- *
- * @cython.boundscheck(False)
- * def _pnpolyInt(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_v_border = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("_pnpolyInt", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_12_pnpolyInt(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_12_pnpolyInt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
- __Pyx_memviewslice __pyx_v_c_vertices = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_n_vertices;
- __Pyx_memviewslice __pyx_v_c_points = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_n_points;
- PyArrayObject *__pyx_v_mask = 0;
- __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
- __Pyx_Buffer __pyx_pybuffer_mask;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
- PyArrayObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
- Py_ssize_t __pyx_t_10;
- Py_ssize_t __pyx_t_11;
- Py_ssize_t __pyx_t_12;
- long __pyx_t_13;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_pnpolyInt", 0);
- __pyx_pybuffer_mask.pybuffer.buf = NULL;
- __pyx_pybuffer_mask.refcount = 0;
- __pyx_pybuffernd_mask.data = NULL;
- __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":109
- * @cython.boundscheck(False)
- * def _pnpolyInt(vertices, points, bint border=True):
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0]
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_vertices);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
- __Pyx_GIVEREF(__pyx_v_vertices);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":110
- * def _pnpolyInt(vertices, points, bint border=True):
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_5);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_v_c_vertices = __pyx_t_6;
- __pyx_t_6.memview = NULL;
- __pyx_t_6.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":111
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0] # <<<<<<<<<<<<<<
- * assert c_vertices.shape[1] == 2
- * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
- */
- __pyx_v_n_vertices = (__pyx_v_c_vertices.shape[0]);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":112
- * dtype=numpy.float64)
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2 # <<<<<<<<<<<<<<
- * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.int32)
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!(((__pyx_v_c_vertices.shape[1]) == 2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":113
- * cdef int n_vertices = c_vertices.shape[0]
- * assert c_vertices.shape[1] == 2
- * cdef int[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
- * dtype=numpy.int32)
- * cdef int n_points = c_points.shape[0]
- */
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(__pyx_v_points);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_points);
- __Pyx_GIVEREF(__pyx_v_points);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":114
- * assert c_vertices.shape[1] == 2
- * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.int32) # <<<<<<<<<<<<<<
- * cdef int n_points = c_points.shape[0]
- * assert c_points.shape[1] == 2
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__int32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_4);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_c_points = __pyx_t_7;
- __pyx_t_7.memview = NULL;
- __pyx_t_7.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":115
- * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
- * dtype=numpy.int32)
- * cdef int n_points = c_points.shape[0] # <<<<<<<<<<<<<<
- * assert c_points.shape[1] == 2
- *
- */
- __pyx_v_n_points = (__pyx_v_c_points.shape[0]);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":116
- * dtype=numpy.int32)
- * cdef int n_points = c_points.shape[0]
- * assert c_points.shape[1] == 2 # <<<<<<<<<<<<<<
- *
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!(((__pyx_v_c_points.shape[1]) == 2) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":119
- *
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8) # <<<<<<<<<<<<<<
- * with nogil:
- * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__zeros); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyInt_FromLong(__pyx_v_n_points); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- __pyx_t_5 = 0;
- __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__uint8); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_5, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
- {
- __Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
- __pyx_v_mask = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf = NULL;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else {__pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
- }
- }
- __pyx_t_8 = 0;
- __pyx_v_mask = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":120
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil: # <<<<<<<<<<<<<<
- * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- */
- {
- #ifdef WITH_THREAD
- PyThreadState *_save;
- Py_UNBLOCK_THREADS
- #endif
- /*try:*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":121
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil:
- * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
- * border, &mask[0])
- * return mask
- */
- __pyx_t_9 = 0;
- __pyx_t_10 = 0;
- if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_c_vertices.shape[0];
- if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_c_vertices.shape[1];
- __pyx_t_11 = 0;
- __pyx_t_12 = 0;
- if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_c_points.shape[0];
- if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_c_points.shape[1];
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":122
- * with nogil:
- * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0]) # <<<<<<<<<<<<<<
- * return mask
- */
- __pyx_t_13 = 0;
- if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_mask.diminfo[0].shape;
- PointsInsidePolygonInt((&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_vertices.data + __pyx_t_9 * __pyx_v_c_vertices.strides[0]) ) + __pyx_t_10 * __pyx_v_c_vertices.strides[1]) )))), __pyx_v_n_vertices, (&(*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_points.data + __pyx_t_11 * __pyx_v_c_points.strides[0]) ) + __pyx_t_12 * __pyx_v_c_points.strides[1]) )))), __pyx_v_n_points, __pyx_v_border, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides))));
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":120
- * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
- * numpy.zeros((n_points, ), dtype=numpy.uint8)
- * with nogil: # <<<<<<<<<<<<<<
- * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- */
- /*finally:*/ {
- #ifdef WITH_THREAD
- Py_BLOCK_THREADS
- #endif
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":123
- * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
- * border, &mask[0])
- * return mask # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_mask));
- __pyx_r = ((PyObject *)__pyx_v_mask);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
- { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
- __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
- __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- goto __pyx_L2;
- __pyx_L0:;
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
- __pyx_L2:;
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_vertices, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_points, 1);
- __Pyx_XDECREF((PyObject *)__pyx_v_mask);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":194
- * # experimental exception made for __getbuffer__ and __releasebuffer__
- * # -- the details of this may change.
- * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
- * # This implementation of getbuffer is geared towards Cython
- * # requirements, and does not yet fullfill the PEP.
- */
-
-static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_v_copy_shape;
- int __pyx_v_i;
- int __pyx_v_ndim;
- int __pyx_v_endian_detector;
- int __pyx_v_little_endian;
- int __pyx_v_t;
- char *__pyx_v_f;
- PyArray_Descr *__pyx_v_descr = 0;
- int __pyx_v_offset;
- int __pyx_v_hasfields;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- char *__pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- if (__pyx_v_info != NULL) {
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
- }
-
- /* "numpy.pxd":200
- * # of flags
- *
- * if info == NULL: return # <<<<<<<<<<<<<<
- *
- * cdef int copy_shape, i, ndim
- */
- __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
- if (__pyx_t_1) {
- __pyx_r = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "numpy.pxd":203
- *
- * cdef int copy_shape, i, ndim
- * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
- *
- */
- __pyx_v_endian_detector = 1;
-
- /* "numpy.pxd":204
- * cdef int copy_shape, i, ndim
- * cdef int endian_detector = 1
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
- *
- * ndim = PyArray_NDIM(self)
- */
- __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
-
- /* "numpy.pxd":206
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
- *
- * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
- *
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- */
- __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
-
- /* "numpy.pxd":208
- * ndim = PyArray_NDIM(self)
- *
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
- * copy_shape = 1
- * else:
- */
- __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":209
- *
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- * copy_shape = 1 # <<<<<<<<<<<<<<
- * else:
- * copy_shape = 0
- */
- __pyx_v_copy_shape = 1;
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "numpy.pxd":211
- * copy_shape = 1
- * else:
- * copy_shape = 0 # <<<<<<<<<<<<<<
- *
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- */
- __pyx_v_copy_shape = 0;
- }
- __pyx_L4:;
-
- /* "numpy.pxd":213
- * copy_shape = 0
- *
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not C contiguous")
- */
- __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":214
- *
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
- * raise ValueError(u"ndarray is not C contiguous")
- *
- */
- __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
- __pyx_t_3 = __pyx_t_2;
- } else {
- __pyx_t_3 = __pyx_t_1;
- }
- if (__pyx_t_3) {
-
- /* "numpy.pxd":215
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "numpy.pxd":217
- * raise ValueError(u"ndarray is not C contiguous")
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not Fortran contiguous")
- */
- __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
- if (__pyx_t_3) {
-
- /* "numpy.pxd":218
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
- * raise ValueError(u"ndarray is not Fortran contiguous")
- *
- */
- __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
- __pyx_t_2 = __pyx_t_1;
- } else {
- __pyx_t_2 = __pyx_t_3;
- }
- if (__pyx_t_2) {
-
- /* "numpy.pxd":219
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
- *
- * info.buf = PyArray_DATA(self)
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_11), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "numpy.pxd":221
- * raise ValueError(u"ndarray is not Fortran contiguous")
- *
- * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
- * info.ndim = ndim
- * if copy_shape:
- */
- __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
-
- /* "numpy.pxd":222
- *
- * info.buf = PyArray_DATA(self)
- * info.ndim = ndim # <<<<<<<<<<<<<<
- * if copy_shape:
- * # Allocate new buffer for strides and shape info.
- */
- __pyx_v_info->ndim = __pyx_v_ndim;
-
- /* "numpy.pxd":223
- * info.buf = PyArray_DATA(self)
- * info.ndim = ndim
- * if copy_shape: # <<<<<<<<<<<<<<
- * # Allocate new buffer for strides and shape info.
- * # This is allocated as one block, strides first.
- */
- __pyx_t_2 = (__pyx_v_copy_shape != 0);
- if (__pyx_t_2) {
-
- /* "numpy.pxd":226
- * # Allocate new buffer for strides and shape info.
- * # This is allocated as one block, strides first.
- * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
- * info.shape = info.strides + ndim
- * for i in range(ndim):
- */
- __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
-
- /* "numpy.pxd":227
- * # This is allocated as one block, strides first.
- * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
- * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * info.strides[i] = PyArray_STRIDES(self)[i]
- */
- __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
-
- /* "numpy.pxd":228
- * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
- * info.shape = info.strides + ndim
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * info.strides[i] = PyArray_STRIDES(self)[i]
- * info.shape[i] = PyArray_DIMS(self)[i]
- */
- __pyx_t_5 = __pyx_v_ndim;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_i = __pyx_t_6;
-
- /* "numpy.pxd":229
- * info.shape = info.strides + ndim
- * for i in range(ndim):
- * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
- * info.shape[i] = PyArray_DIMS(self)[i]
- * else:
- */
- (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
-
- /* "numpy.pxd":230
- * for i in range(ndim):
- * info.strides[i] = PyArray_STRIDES(self)[i]
- * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
- * else:
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- */
- (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
- }
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "numpy.pxd":232
- * info.shape[i] = PyArray_DIMS(self)[i]
- * else:
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
- * info.suboffsets = NULL
- */
- __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
-
- /* "numpy.pxd":233
- * else:
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
- * info.suboffsets = NULL
- * info.itemsize = PyArray_ITEMSIZE(self)
- */
- __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
- }
- __pyx_L7:;
-
- /* "numpy.pxd":234
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- * info.itemsize = PyArray_ITEMSIZE(self)
- * info.readonly = not PyArray_ISWRITEABLE(self)
- */
- __pyx_v_info->suboffsets = NULL;
-
- /* "numpy.pxd":235
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
- * info.suboffsets = NULL
- * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
- * info.readonly = not PyArray_ISWRITEABLE(self)
- *
- */
- __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
-
- /* "numpy.pxd":236
- * info.suboffsets = NULL
- * info.itemsize = PyArray_ITEMSIZE(self)
- * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
- *
- * cdef int t
- */
- __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
-
- /* "numpy.pxd":239
- *
- * cdef int t
- * cdef char* f = NULL # <<<<<<<<<<<<<<
- * cdef dtype descr = self.descr
- * cdef list stack
- */
- __pyx_v_f = NULL;
-
- /* "numpy.pxd":240
- * cdef int t
- * cdef char* f = NULL
- * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
- * cdef list stack
- * cdef int offset
- */
- __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
- __Pyx_INCREF(__pyx_t_4);
- __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "numpy.pxd":244
- * cdef int offset
- *
- * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
- *
- * if not hasfields and not copy_shape:
- */
- __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
-
- /* "numpy.pxd":246
- * cdef bint hasfields = PyDataType_HASFIELDS(descr)
- *
- * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
- * # do not call releasebuffer
- * info.obj = None
- */
- __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
- if (__pyx_t_2) {
- __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
- __pyx_t_1 = __pyx_t_3;
- } else {
- __pyx_t_1 = __pyx_t_2;
- }
- if (__pyx_t_1) {
-
- /* "numpy.pxd":248
- * if not hasfields and not copy_shape:
- * # do not call releasebuffer
- * info.obj = None # <<<<<<<<<<<<<<
- * else:
- * # need to call releasebuffer
- */
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = Py_None;
- goto __pyx_L10;
- }
- /*else*/ {
-
- /* "numpy.pxd":251
- * else:
- * # need to call releasebuffer
- * info.obj = self # <<<<<<<<<<<<<<
- *
- * if not hasfields:
- */
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- }
- __pyx_L10:;
-
- /* "numpy.pxd":253
- * info.obj = self
- *
- * if not hasfields: # <<<<<<<<<<<<<<
- * t = descr.type_num
- * if ((descr.byteorder == c'>' and little_endian) or
- */
- __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":254
- *
- * if not hasfields:
- * t = descr.type_num # <<<<<<<<<<<<<<
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)):
- */
- __pyx_t_5 = __pyx_v_descr->type_num;
- __pyx_v_t = __pyx_t_5;
-
- /* "numpy.pxd":255
- * if not hasfields:
- * t = descr.type_num
- * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported")
- */
- __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
- if (__pyx_t_1) {
- __pyx_t_2 = (__pyx_v_little_endian != 0);
- } else {
- __pyx_t_2 = __pyx_t_1;
- }
- if (!__pyx_t_2) {
-
- /* "numpy.pxd":256
- * t = descr.type_num
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
- * raise ValueError(u"Non-native byte order not supported")
- * if t == NPY_BYTE: f = "b"
- */
- __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
- if (__pyx_t_1) {
- __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
- __pyx_t_7 = __pyx_t_3;
- } else {
- __pyx_t_7 = __pyx_t_1;
- }
- __pyx_t_1 = __pyx_t_7;
- } else {
- __pyx_t_1 = __pyx_t_2;
- }
- if (__pyx_t_1) {
-
- /* "numpy.pxd":257
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_13), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "numpy.pxd":274
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- */
- switch (__pyx_v_t) {
-
- /* "numpy.pxd":258
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported")
- * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h"
- */
- case NPY_BYTE:
- __pyx_v_f = __pyx_k__b;
- break;
-
- /* "numpy.pxd":259
- * raise ValueError(u"Non-native byte order not supported")
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H"
- */
- case NPY_UBYTE:
- __pyx_v_f = __pyx_k__B;
- break;
-
- /* "numpy.pxd":260
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i"
- */
- case NPY_SHORT:
- __pyx_v_f = __pyx_k__h;
- break;
-
- /* "numpy.pxd":261
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I"
- */
- case NPY_USHORT:
- __pyx_v_f = __pyx_k__H;
- break;
-
- /* "numpy.pxd":262
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l"
- */
- case NPY_INT:
- __pyx_v_f = __pyx_k__i;
- break;
-
- /* "numpy.pxd":263
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L"
- */
- case NPY_UINT:
- __pyx_v_f = __pyx_k__I;
- break;
-
- /* "numpy.pxd":264
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q"
- */
- case NPY_LONG:
- __pyx_v_f = __pyx_k__l;
- break;
-
- /* "numpy.pxd":265
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q"
- */
- case NPY_ULONG:
- __pyx_v_f = __pyx_k__L;
- break;
-
- /* "numpy.pxd":266
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f"
- */
- case NPY_LONGLONG:
- __pyx_v_f = __pyx_k__q;
- break;
-
- /* "numpy.pxd":267
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d"
- */
- case NPY_ULONGLONG:
- __pyx_v_f = __pyx_k__Q;
- break;
-
- /* "numpy.pxd":268
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g"
- */
- case NPY_FLOAT:
- __pyx_v_f = __pyx_k__f;
- break;
-
- /* "numpy.pxd":269
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_CFLOAT: f = "Zf"
- */
- case NPY_DOUBLE:
- __pyx_v_f = __pyx_k__d;
- break;
-
- /* "numpy.pxd":270
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
- * elif t == NPY_CFLOAT: f = "Zf"
- * elif t == NPY_CDOUBLE: f = "Zd"
- */
- case NPY_LONGDOUBLE:
- __pyx_v_f = __pyx_k__g;
- break;
-
- /* "numpy.pxd":271
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- */
- case NPY_CFLOAT:
- __pyx_v_f = __pyx_k__Zf;
- break;
-
- /* "numpy.pxd":272
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_CFLOAT: f = "Zf"
- * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- * elif t == NPY_OBJECT: f = "O"
- */
- case NPY_CDOUBLE:
- __pyx_v_f = __pyx_k__Zd;
- break;
-
- /* "numpy.pxd":273
- * elif t == NPY_CFLOAT: f = "Zf"
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
- * elif t == NPY_OBJECT: f = "O"
- * else:
- */
- case NPY_CLONGDOUBLE:
- __pyx_v_f = __pyx_k__Zg;
- break;
-
- /* "numpy.pxd":274
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- */
- case NPY_OBJECT:
- __pyx_v_f = __pyx_k__O;
- break;
- default:
-
- /* "numpy.pxd":276
- * elif t == NPY_OBJECT: f = "O"
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
- * info.format = f
- * return
- */
- __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_14), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- break;
- }
-
- /* "numpy.pxd":277
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- * info.format = f # <<<<<<<<<<<<<<
- * return
- * else:
- */
- __pyx_v_info->format = __pyx_v_f;
-
- /* "numpy.pxd":278
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- * info.format = f
- * return # <<<<<<<<<<<<<<
- * else:
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- */
- __pyx_r = 0;
- goto __pyx_L0;
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "numpy.pxd":280
- * return
- * else:
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
- * info.format[0] = c'^' # Native data types, manual alignment
- * offset = 0
- */
- __pyx_v_info->format = ((char *)malloc(255));
-
- /* "numpy.pxd":281
- * else:
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
- * offset = 0
- * f = _util_dtypestring(descr, info.format + 1,
- */
- (__pyx_v_info->format[0]) = '^';
-
- /* "numpy.pxd":282
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- * info.format[0] = c'^' # Native data types, manual alignment
- * offset = 0 # <<<<<<<<<<<<<<
- * f = _util_dtypestring(descr, info.format + 1,
- * info.format + _buffer_format_string_len,
- */
- __pyx_v_offset = 0;
-
- /* "numpy.pxd":285
- * f = _util_dtypestring(descr, info.format + 1,
- * info.format + _buffer_format_string_len,
- * &offset) # <<<<<<<<<<<<<<
- * f[0] = c'\0' # Terminate format string
- *
- */
- __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_f = __pyx_t_9;
-
- /* "numpy.pxd":286
- * info.format + _buffer_format_string_len,
- * &offset)
- * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
- *
- * def __releasebuffer__(ndarray self, Py_buffer* info):
- */
- (__pyx_v_f[0]) = '\x00';
- }
- __pyx_L11:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
- }
- goto __pyx_L2;
- __pyx_L0:;
- if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(Py_None);
- __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
- }
- __pyx_L2:;
- __Pyx_XDECREF((PyObject *)__pyx_v_descr);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
-static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
- __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "numpy.pxd":288
- * f[0] = c'\0' # Terminate format string
- *
- * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
- * if PyArray_HASFIELDS(self):
- * stdlib.free(info.format)
- */
-
-static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__releasebuffer__", 0);
-
- /* "numpy.pxd":289
- *
- * def __releasebuffer__(ndarray self, Py_buffer* info):
- * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
- * stdlib.free(info.format)
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- */
- __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":290
- * def __releasebuffer__(ndarray self, Py_buffer* info):
- * if PyArray_HASFIELDS(self):
- * stdlib.free(info.format) # <<<<<<<<<<<<<<
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- * stdlib.free(info.strides)
- */
- free(__pyx_v_info->format);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "numpy.pxd":291
- * if PyArray_HASFIELDS(self):
- * stdlib.free(info.format)
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
- * stdlib.free(info.strides)
- * # info.shape was stored after info.strides in the same block
- */
- __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":292
- * stdlib.free(info.format)
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- * stdlib.free(info.strides) # <<<<<<<<<<<<<<
- * # info.shape was stored after info.strides in the same block
- *
- */
- free(__pyx_v_info->strides);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "numpy.pxd":768
- * ctypedef npy_cdouble complex_t
- *
- * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(1, <void*>a)
- *
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
-
- /* "numpy.pxd":769
- *
- * cdef inline object PyArray_MultiIterNew1(a):
- * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew2(a, b):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":771
- * return PyArray_MultiIterNew(1, <void*>a)
- *
- * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
- *
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
-
- /* "numpy.pxd":772
- *
- * cdef inline object PyArray_MultiIterNew2(a, b):
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew3(a, b, c):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":774
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
- *
- * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
- *
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
-
- /* "numpy.pxd":775
- *
- * cdef inline object PyArray_MultiIterNew3(a, b, c):
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":777
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
- *
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
- *
- */
-
-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) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
-
- /* "numpy.pxd":778
- *
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
- */
- __Pyx_XDECREF(__pyx_r);
- __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_filename = __pyx_f[3]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":780
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
- *
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
- *
- */
-
-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) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
-
- /* "numpy.pxd":781
- *
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
- *
- * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
- */
- __Pyx_XDECREF(__pyx_r);
- __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_filename = __pyx_f[3]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":783
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
- *
- * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
- * # Recursive utility function used in __getbuffer__ to get format
- * # string. The new location in the format string is returned.
- */
-
-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) {
- PyArray_Descr *__pyx_v_child = 0;
- int __pyx_v_endian_detector;
- int __pyx_v_little_endian;
- PyObject *__pyx_v_fields = 0;
- PyObject *__pyx_v_childname = NULL;
- PyObject *__pyx_v_new_offset = NULL;
- PyObject *__pyx_v_t = NULL;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *(*__pyx_t_6)(PyObject *);
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- char *__pyx_t_12;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_util_dtypestring", 0);
-
- /* "numpy.pxd":790
- * cdef int delta_offset
- * cdef tuple i
- * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
- * cdef tuple fields
- */
- __pyx_v_endian_detector = 1;
-
- /* "numpy.pxd":791
- * cdef tuple i
- * cdef int endian_detector = 1
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
- * cdef tuple fields
- *
- */
- __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
-
- /* "numpy.pxd":794
- * cdef tuple fields
- *
- * for childname in descr.names: # <<<<<<<<<<<<<<
- * fields = descr.fields[childname]
- * child, new_offset = fields
- */
- if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
- for (;;) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[3]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- __Pyx_XDECREF(__pyx_v_childname);
- __pyx_v_childname = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "numpy.pxd":795
- *
- * for childname in descr.names:
- * fields = descr.fields[childname] # <<<<<<<<<<<<<<
- * child, new_offset = fields
- *
- */
- __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
- __pyx_v_fields = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "numpy.pxd":796
- * for childname in descr.names:
- * fields = descr.fields[childname]
- * child, new_offset = fields # <<<<<<<<<<<<<<
- *
- * if (end - f) - (new_offset - offset[0]) < 15:
- */
- if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
- PyObject* sequence = ((PyObject *)__pyx_v_fields);
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_4);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else if (1) {
- __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L6_unpacking_done;
- __pyx_L5_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L6_unpacking_done:;
- }
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_XDECREF(((PyObject *)__pyx_v_child));
- __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_v_new_offset);
- __pyx_v_new_offset = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "numpy.pxd":798
- * child, new_offset = fields
- *
- * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
- *
- */
- __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
-
- /* "numpy.pxd":799
- *
- * if (end - f) - (new_offset - offset[0]) < 15:
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
- *
- * if ((child.byteorder == c'>' and little_endian) or
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_16), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "numpy.pxd":801
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
- *
- * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
- * (child.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported")
- */
- __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
- if (__pyx_t_7) {
- __pyx_t_8 = (__pyx_v_little_endian != 0);
- } else {
- __pyx_t_8 = __pyx_t_7;
- }
- if (!__pyx_t_8) {
-
- /* "numpy.pxd":802
- *
- * if ((child.byteorder == c'>' and little_endian) or
- * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
- * raise ValueError(u"Non-native byte order not supported")
- * # One could encode it in the format string and have Cython
- */
- __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
- if (__pyx_t_7) {
- __pyx_t_9 = ((!(__pyx_v_little_endian != 0)) != 0);
- __pyx_t_10 = __pyx_t_9;
- } else {
- __pyx_t_10 = __pyx_t_7;
- }
- __pyx_t_7 = __pyx_t_10;
- } else {
- __pyx_t_7 = __pyx_t_8;
- }
- if (__pyx_t_7) {
-
- /* "numpy.pxd":803
- * if ((child.byteorder == c'>' and little_endian) or
- * (child.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * # One could encode it in the format string and have Cython
- * # complain instead, BUT: < and > in format strings also imply
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "numpy.pxd":813
- *
- * # Output padding bytes
- * while offset[0] < new_offset: # <<<<<<<<<<<<<<
- * f[0] = 120 # "x"; pad byte
- * f += 1
- */
- while (1) {
- __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!__pyx_t_7) break;
-
- /* "numpy.pxd":814
- * # Output padding bytes
- * while offset[0] < new_offset:
- * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
- * f += 1
- * offset[0] += 1
- */
- (__pyx_v_f[0]) = 120;
-
- /* "numpy.pxd":815
- * while offset[0] < new_offset:
- * f[0] = 120 # "x"; pad byte
- * f += 1 # <<<<<<<<<<<<<<
- * offset[0] += 1
- *
- */
- __pyx_v_f = (__pyx_v_f + 1);
-
- /* "numpy.pxd":816
- * f[0] = 120 # "x"; pad byte
- * f += 1
- * offset[0] += 1 # <<<<<<<<<<<<<<
- *
- * offset[0] += child.itemsize
- */
- __pyx_t_11 = 0;
- (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
- }
-
- /* "numpy.pxd":818
- * offset[0] += 1
- *
- * offset[0] += child.itemsize # <<<<<<<<<<<<<<
- *
- * if not PyDataType_HASFIELDS(child):
- */
- __pyx_t_11 = 0;
- (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
-
- /* "numpy.pxd":820
- * offset[0] += child.itemsize
- *
- * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
- * t = child.type_num
- * if end - f < 5:
- */
- __pyx_t_7 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
- if (__pyx_t_7) {
-
- /* "numpy.pxd":821
- *
- * if not PyDataType_HASFIELDS(child):
- * t = child.type_num # <<<<<<<<<<<<<<
- * if end - f < 5:
- * raise RuntimeError(u"Format string allocated too short.")
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "numpy.pxd":822
- * if not PyDataType_HASFIELDS(child):
- * t = child.type_num
- * if end - f < 5: # <<<<<<<<<<<<<<
- * raise RuntimeError(u"Format string allocated too short.")
- *
- */
- __pyx_t_7 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
- if (__pyx_t_7) {
-
- /* "numpy.pxd":823
- * t = child.type_num
- * if end - f < 5:
- * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
- *
- * # Until ticket #99 is fixed, use integers to avoid warnings
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_19), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "numpy.pxd":826
- *
- * # Until ticket #99 is fixed, use integers to avoid warnings
- * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 98;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":827
- * # Until ticket #99 is fixed, use integers to avoid warnings
- * if t == NPY_BYTE: f[0] = 98 #"b"
- * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 66;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":828
- * if t == NPY_BYTE: f[0] = 98 #"b"
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
- * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- * elif t == NPY_INT: f[0] = 105 #"i"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 104;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":829
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
- * elif t == NPY_INT: f[0] = 105 #"i"
- * elif t == NPY_UINT: f[0] = 73 #"I"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 72;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":830
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
- * elif t == NPY_UINT: f[0] = 73 #"I"
- * elif t == NPY_LONG: f[0] = 108 #"l"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 105;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":831
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- * elif t == NPY_INT: f[0] = 105 #"i"
- * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
- * elif t == NPY_LONG: f[0] = 108 #"l"
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 73;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":832
- * elif t == NPY_INT: f[0] = 105 #"i"
- * elif t == NPY_UINT: f[0] = 73 #"I"
- * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 108;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":833
- * elif t == NPY_UINT: f[0] = 73 #"I"
- * elif t == NPY_LONG: f[0] = 108 #"l"
- * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 76;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":834
- * elif t == NPY_LONG: f[0] = 108 #"l"
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 113;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":835
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 81;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":836
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 102;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":837
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- */
- __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 100;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":838
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- */
- __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 103;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":839
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
- */
- __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 90;
- (__pyx_v_f[1]) = 102;
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":840
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 90;
- (__pyx_v_f[1]) = 100;
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":841
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
- * else:
- */
- __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 90;
- (__pyx_v_f[1]) = 103;
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":842
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
- * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- */
- __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 79;
- goto __pyx_L13;
- }
- /*else*/ {
-
- /* "numpy.pxd":844
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
- * f += 1
- * else:
- */
- __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_14), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[3]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L13:;
-
- /* "numpy.pxd":845
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- * f += 1 # <<<<<<<<<<<<<<
- * else:
- * # Cython ignores struct boundary information ("T{...}"),
- */
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "numpy.pxd":849
- * # Cython ignores struct boundary information ("T{...}"),
- * # so don't output it
- * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
- * return f
- *
- */
- __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_f = __pyx_t_12;
- }
- __pyx_L11:;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "numpy.pxd":850
- * # so don't output it
- * f = _util_dtypestring(child, f, end, offset)
- * return f # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_f;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_child);
- __Pyx_XDECREF(__pyx_v_fields);
- __Pyx_XDECREF(__pyx_v_childname);
- __Pyx_XDECREF(__pyx_v_new_offset);
- __Pyx_XDECREF(__pyx_v_t);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":965
- *
- *
- * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
- * cdef PyObject* baseptr
- * if base is None:
- */
-
-static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
- PyObject *__pyx_v_baseptr;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("set_array_base", 0);
-
- /* "numpy.pxd":967
- * cdef inline void set_array_base(ndarray arr, object base):
- * cdef PyObject* baseptr
- * if base is None: # <<<<<<<<<<<<<<
- * baseptr = NULL
- * else:
- */
- __pyx_t_1 = (__pyx_v_base == Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "numpy.pxd":968
- * cdef PyObject* baseptr
- * if base is None:
- * baseptr = NULL # <<<<<<<<<<<<<<
- * else:
- * Py_INCREF(base) # important to do this before decref below!
- */
- __pyx_v_baseptr = NULL;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "numpy.pxd":970
- * baseptr = NULL
- * else:
- * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
- * baseptr = <PyObject*>base
- * Py_XDECREF(arr.base)
- */
- Py_INCREF(__pyx_v_base);
-
- /* "numpy.pxd":971
- * else:
- * Py_INCREF(base) # important to do this before decref below!
- * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
- * Py_XDECREF(arr.base)
- * arr.base = baseptr
- */
- __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
- }
- __pyx_L3:;
-
- /* "numpy.pxd":972
- * Py_INCREF(base) # important to do this before decref below!
- * baseptr = <PyObject*>base
- * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
- * arr.base = baseptr
- *
- */
- Py_XDECREF(__pyx_v_arr->base);
-
- /* "numpy.pxd":973
- * baseptr = <PyObject*>base
- * Py_XDECREF(arr.base)
- * arr.base = baseptr # <<<<<<<<<<<<<<
- *
- * cdef inline object get_array_base(ndarray arr):
- */
- __pyx_v_arr->base = __pyx_v_baseptr;
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "numpy.pxd":975
- * arr.base = baseptr
- *
- * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
- * if arr.base is NULL:
- * return None
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("get_array_base", 0);
-
- /* "numpy.pxd":976
- *
- * cdef inline object get_array_base(ndarray arr):
- * if arr.base is NULL: # <<<<<<<<<<<<<<
- * return None
- * else:
- */
- __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":977
- * cdef inline object get_array_base(ndarray arr):
- * if arr.base is NULL:
- * return None # <<<<<<<<<<<<<<
- * else:
- * return <object>arr.base
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_None);
- __pyx_r = Py_None;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "numpy.pxd":979
- * return None
- * else:
- * return <object>arr.base # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
- __pyx_r = ((PyObject *)__pyx_v_arr->base);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_shape = 0;
- Py_ssize_t __pyx_v_itemsize;
- PyObject *__pyx_v_format = 0;
- PyObject *__pyx_v_mode = 0;
- int __pyx_v_allocate_buffer;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
- {
- 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};
- PyObject* values[5] = {0,0,0,0,0};
- values[3] = ((PyObject *)__pyx_n_u__c);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shape)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__itemsize)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
- if (value) { values[3] = value; kw_args--; }
- }
- case 4:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__allocate_buffer);
- if (value) { values[4] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_shape = ((PyObject*)values[0]);
- __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_format = values[2];
- __pyx_v_mode = values[3];
- if (values[4]) {
- __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "View.MemoryView":114
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
- * mode=u"c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
- *
- * cdef int idx
- */
- __pyx_v_allocate_buffer = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument 'format' must not be None"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_r = __pyx_array_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);
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":113
- * cdef bint dtype_is_object
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
- * mode=u"c", bint allocate_buffer=True):
- *
- */
-
-static int __pyx_array_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) {
- int __pyx_v_idx;
- Py_ssize_t __pyx_v_i;
- PyObject **__pyx_v_p;
- PyObject *__pyx_v_encode = NULL;
- PyObject *__pyx_v_dim = NULL;
- char __pyx_v_order;
- PyObject *__pyx_v_decode = NULL;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- char *__pyx_t_4;
- int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- Py_ssize_t __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__cinit__", 0);
- __Pyx_INCREF(__pyx_v_format);
- __Pyx_INCREF(__pyx_v_mode);
-
- /* "View.MemoryView":120
- * cdef PyObject **p
- *
- * self.ndim = len(shape) # <<<<<<<<<<<<<<
- * self.itemsize = itemsize
- *
- */
- if (unlikely(((PyObject *)__pyx_v_shape) == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_shape)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->ndim = __pyx_t_1;
-
- /* "View.MemoryView":121
- *
- * self.ndim = len(shape)
- * self.itemsize = itemsize # <<<<<<<<<<<<<<
- *
- * if not self.ndim:
- */
- __pyx_v_self->itemsize = __pyx_v_itemsize;
-
- /* "View.MemoryView":123
- * self.itemsize = itemsize
- *
- * if not self.ndim: # <<<<<<<<<<<<<<
- * raise ValueError("Empty shape tuple for cython.array")
- *
- */
- __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":124
- *
- * if not self.ndim:
- * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
- *
- * if self.itemsize <= 0:
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_21), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":126
- * raise ValueError("Empty shape tuple for cython.array")
- *
- * if self.itemsize <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("itemsize <= 0 for cython.array")
- *
- */
- __pyx_t_2 = ((__pyx_v_self->itemsize <= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":127
- *
- * if self.itemsize <= 0:
- * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
- *
- * encode = getattr(format, 'encode', None)
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_23), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":129
- * raise ValueError("itemsize <= 0 for cython.array")
- *
- * encode = getattr(format, 'encode', None) # <<<<<<<<<<<<<<
- * if encode:
- * format = encode('ASCII')
- */
- __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_format, ((PyObject *)__pyx_n_s__encode), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_encode = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":130
- *
- * encode = getattr(format, 'encode', None)
- * if encode: # <<<<<<<<<<<<<<
- * format = encode('ASCII')
- * self._format = format
- */
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_encode); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_2) {
-
- /* "View.MemoryView":131
- * encode = getattr(format, 'encode', None)
- * if encode:
- * format = encode('ASCII') # <<<<<<<<<<<<<<
- * self._format = format
- * self.format = self._format
- */
- __pyx_t_3 = PyObject_Call(__pyx_v_encode, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_v_format);
- __pyx_v_format = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":132
- * if encode:
- * format = encode('ASCII')
- * self._format = format # <<<<<<<<<<<<<<
- * self.format = self._format
- *
- */
- if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(__pyx_v_format);
- __Pyx_GIVEREF(__pyx_v_format);
- __Pyx_GOTREF(__pyx_v_self->_format);
- __Pyx_DECREF(((PyObject *)__pyx_v_self->_format));
- __pyx_v_self->_format = ((PyObject*)__pyx_v_format);
-
- /* "View.MemoryView":133
- * format = encode('ASCII')
- * self._format = format
- * self.format = self._format # <<<<<<<<<<<<<<
- *
- * self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- */
- __pyx_t_4 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_self->_format)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_4;
-
- /* "View.MemoryView":135
- * self.format = self._format
- *
- * self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim) # <<<<<<<<<<<<<<
- * self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- *
- */
- __pyx_v_self->_shape = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim)));
-
- /* "View.MemoryView":136
- *
- * self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- * self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim) # <<<<<<<<<<<<<<
- *
- * if not self._shape or not self._strides:
- */
- __pyx_v_self->_strides = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim)));
-
- /* "View.MemoryView":138
- * self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- *
- * if not self._shape or not self._strides: # <<<<<<<<<<<<<<
- * free(self._shape)
- * free(self._strides)
- */
- __pyx_t_2 = ((!(__pyx_v_self->_shape != 0)) != 0);
- if (!__pyx_t_2) {
- __pyx_t_5 = ((!(__pyx_v_self->_strides != 0)) != 0);
- __pyx_t_6 = __pyx_t_5;
- } else {
- __pyx_t_6 = __pyx_t_2;
- }
- if (__pyx_t_6) {
-
- /* "View.MemoryView":139
- *
- * if not self._shape or not self._strides:
- * free(self._shape) # <<<<<<<<<<<<<<
- * free(self._strides)
- * raise MemoryError("unable to allocate shape or strides.")
- */
- free(__pyx_v_self->_shape);
-
- /* "View.MemoryView":140
- * if not self._shape or not self._strides:
- * free(self._shape)
- * free(self._strides) # <<<<<<<<<<<<<<
- * raise MemoryError("unable to allocate shape or strides.")
- *
- */
- free(__pyx_v_self->_strides);
-
- /* "View.MemoryView":141
- * free(self._shape)
- * free(self._strides)
- * raise MemoryError("unable to allocate shape or strides.") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_26), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":144
- *
- *
- * idx = 0 # <<<<<<<<<<<<<<
- * for idx, dim in enumerate(shape):
- * if dim <= 0:
- */
- __pyx_v_idx = 0;
-
- /* "View.MemoryView":145
- *
- * idx = 0
- * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
- * if dim <= 0:
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
- */
- __pyx_t_7 = 0;
- __pyx_t_3 = ((PyObject *)__pyx_v_shape); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
- for (;;) {
- if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- __Pyx_XDECREF(__pyx_v_dim);
- __pyx_v_dim = __pyx_t_8;
- __pyx_t_8 = 0;
- __pyx_v_idx = __pyx_t_7;
- __pyx_t_7 = (__pyx_t_7 + 1);
-
- /* "View.MemoryView":146
- * idx = 0
- * for idx, dim in enumerate(shape):
- * if dim <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
- *
- */
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_dim, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_6) {
-
- /* "View.MemoryView":147
- * for idx, dim in enumerate(shape):
- * if dim <= 0:
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
- *
- * self._shape[idx] = dim
- */
- __pyx_t_8 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_v_dim);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dim);
- __Pyx_GIVEREF(__pyx_v_dim);
- __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_27), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "View.MemoryView":149
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
- *
- * self._shape[idx] = dim # <<<<<<<<<<<<<<
- * idx += 1
- *
- */
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_t_10;
-
- /* "View.MemoryView":150
- *
- * self._shape[idx] = dim
- * idx += 1 # <<<<<<<<<<<<<<
- *
- * if mode not in ("fortran", "c"):
- */
- __pyx_v_idx = (__pyx_v_idx + 1);
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "View.MemoryView":152
- * idx += 1
- *
- * if mode not in ("fortran", "c"): # <<<<<<<<<<<<<<
- * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
- *
- */
- __Pyx_INCREF(__pyx_v_mode);
- __pyx_t_3 = __pyx_v_mode;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__fortran), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (((int)__pyx_t_6)) {
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__c), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_5 = ((int)__pyx_t_2);
- } else {
- __pyx_t_5 = ((int)__pyx_t_6);
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = (__pyx_t_5 != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":153
- *
- * if mode not in ("fortran", "c"):
- * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
- *
- * cdef char order
- */
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L10;
- }
- __pyx_L10:;
-
- /* "View.MemoryView":156
- *
- * cdef char order
- * if mode == 'fortran': # <<<<<<<<<<<<<<
- * order = 'F'
- * else:
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_mode, ((PyObject *)__pyx_n_s__fortran), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_6) {
-
- /* "View.MemoryView":157
- * cdef char order
- * if mode == 'fortran':
- * order = 'F' # <<<<<<<<<<<<<<
- * else:
- * order = 'C'
- */
- __pyx_v_order = 'F';
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "View.MemoryView":159
- * order = 'F'
- * else:
- * order = 'C' # <<<<<<<<<<<<<<
- *
- * self.len = fill_contig_strides_array(self._shape, self._strides,
- */
- __pyx_v_order = 'C';
- }
- __pyx_L11:;
-
- /* "View.MemoryView":161
- * order = 'C'
- *
- * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
- * itemsize, self.ndim, order)
- *
- */
- __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);
-
- /* "View.MemoryView":164
- * itemsize, self.ndim, order)
- *
- * decode = getattr(mode, 'decode', None) # <<<<<<<<<<<<<<
- * if decode:
- * mode = decode('ASCII')
- */
- __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_mode, ((PyObject *)__pyx_n_s__decode), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_decode = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":165
- *
- * decode = getattr(mode, 'decode', None)
- * if decode: # <<<<<<<<<<<<<<
- * mode = decode('ASCII')
- * self.mode = mode
- */
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_decode); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_6) {
-
- /* "View.MemoryView":166
- * decode = getattr(mode, 'decode', None)
- * if decode:
- * mode = decode('ASCII') # <<<<<<<<<<<<<<
- * self.mode = mode
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_v_decode, ((PyObject *)__pyx_k_tuple_29), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_v_mode);
- __pyx_v_mode = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "View.MemoryView":167
- * if decode:
- * mode = decode('ASCII')
- * self.mode = mode # <<<<<<<<<<<<<<
- *
- * self.free_data = allocate_buffer
- */
- if (!(likely(PyUnicode_CheckExact(__pyx_v_mode))||((__pyx_v_mode) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_v_mode)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(__pyx_v_mode);
- __Pyx_GIVEREF(__pyx_v_mode);
- __Pyx_GOTREF(__pyx_v_self->mode);
- __Pyx_DECREF(((PyObject *)__pyx_v_self->mode));
- __pyx_v_self->mode = ((PyObject*)__pyx_v_mode);
-
- /* "View.MemoryView":169
- * self.mode = mode
- *
- * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
- * self.dtype_is_object = format == b'O'
- * if allocate_buffer:
- */
- __pyx_v_self->free_data = __pyx_v_allocate_buffer;
-
- /* "View.MemoryView":170
- *
- * self.free_data = allocate_buffer
- * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
- * if allocate_buffer:
- * self.data = <char *>malloc(self.len)
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, ((PyObject *)__pyx_n_b__O), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_self->dtype_is_object = __pyx_t_6;
-
- /* "View.MemoryView":171
- * self.free_data = allocate_buffer
- * self.dtype_is_object = format == b'O'
- * if allocate_buffer: # <<<<<<<<<<<<<<
- * self.data = <char *>malloc(self.len)
- * if not self.data:
- */
- __pyx_t_6 = (__pyx_v_allocate_buffer != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":172
- * self.dtype_is_object = format == b'O'
- * if allocate_buffer:
- * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
- * if not self.data:
- * raise MemoryError("unable to allocate array data.")
- */
- __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
-
- /* "View.MemoryView":173
- * if allocate_buffer:
- * self.data = <char *>malloc(self.len)
- * if not self.data: # <<<<<<<<<<<<<<
- * raise MemoryError("unable to allocate array data.")
- *
- */
- __pyx_t_6 = ((!(__pyx_v_self->data != 0)) != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":174
- * self.data = <char *>malloc(self.len)
- * if not self.data:
- * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
- *
- * if self.dtype_is_object:
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_31), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
- }
- __pyx_L14:;
-
- /* "View.MemoryView":176
- * raise MemoryError("unable to allocate array data.")
- *
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * p = <PyObject **> self.data
- * for i in range(self.len / itemsize):
- */
- __pyx_t_6 = (__pyx_v_self->dtype_is_object != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":177
- *
- * if self.dtype_is_object:
- * p = <PyObject **> self.data # <<<<<<<<<<<<<<
- * for i in range(self.len / itemsize):
- * p[i] = Py_None
- */
- __pyx_v_p = ((PyObject **)__pyx_v_self->data);
-
- /* "View.MemoryView":178
- * if self.dtype_is_object:
- * p = <PyObject **> self.data
- * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
- * p[i] = Py_None
- * Py_INCREF(Py_None)
- */
- if (unlikely(__pyx_v_itemsize == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
- for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) {
- __pyx_v_i = __pyx_t_10;
-
- /* "View.MemoryView":179
- * p = <PyObject **> self.data
- * for i in range(self.len / itemsize):
- * p[i] = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- (__pyx_v_p[__pyx_v_i]) = Py_None;
-
- /* "View.MemoryView":180
- * for i in range(self.len / itemsize):
- * p[i] = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- Py_INCREF(Py_None);
- }
- goto __pyx_L15;
- }
- __pyx_L15:;
- goto __pyx_L13;
- }
- __pyx_L13:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_encode);
- __Pyx_XDECREF(__pyx_v_dim);
- __Pyx_XDECREF(__pyx_v_decode);
- __Pyx_XDECREF(__pyx_v_format);
- __Pyx_XDECREF(__pyx_v_mode);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":183
- *
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
- * cdef int bufmode = -1
- * if self.mode == b"c":
- */
-
-static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_v_bufmode;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- char *__pyx_t_4;
- Py_ssize_t __pyx_t_5;
- int __pyx_t_6;
- Py_ssize_t *__pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- if (__pyx_v_info != NULL) {
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
- }
-
- /* "View.MemoryView":184
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1 # <<<<<<<<<<<<<<
- * if self.mode == b"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- */
- __pyx_v_bufmode = -1;
-
- /* "View.MemoryView":185
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1
- * if self.mode == b"c": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == b"fortran":
- */
- __pyx_t_1 = (__Pyx_PyUnicode_Equals(((PyObject *)__pyx_v_self->mode), ((PyObject *)__pyx_n_b__c), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":186
- * cdef int bufmode = -1
- * if self.mode == b"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
- * elif self.mode == b"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- */
- __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":187
- * if self.mode == b"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == b"fortran": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- */
- __pyx_t_2 = (__Pyx_PyUnicode_Equals(((PyObject *)__pyx_v_self->mode), ((PyObject *)__pyx_n_b__fortran), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":188
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == b"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- */
- __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":189
- * elif self.mode == b"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode): # <<<<<<<<<<<<<<
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- * info.buf = self.data
- */
- __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":190
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
- * info.buf = self.data
- * info.len = self.len
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_33), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":191
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- * info.buf = self.data # <<<<<<<<<<<<<<
- * info.len = self.len
- * info.ndim = self.ndim
- */
- __pyx_t_4 = __pyx_v_self->data;
- __pyx_v_info->buf = __pyx_t_4;
-
- /* "View.MemoryView":192
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- * info.buf = self.data
- * info.len = self.len # <<<<<<<<<<<<<<
- * info.ndim = self.ndim
- * info.shape = self._shape
- */
- __pyx_t_5 = __pyx_v_self->len;
- __pyx_v_info->len = __pyx_t_5;
-
- /* "View.MemoryView":193
- * info.buf = self.data
- * info.len = self.len
- * info.ndim = self.ndim # <<<<<<<<<<<<<<
- * info.shape = self._shape
- * info.strides = self._strides
- */
- __pyx_t_6 = __pyx_v_self->ndim;
- __pyx_v_info->ndim = __pyx_t_6;
-
- /* "View.MemoryView":194
- * info.len = self.len
- * info.ndim = self.ndim
- * info.shape = self._shape # <<<<<<<<<<<<<<
- * info.strides = self._strides
- * info.suboffsets = NULL
- */
- __pyx_t_7 = __pyx_v_self->_shape;
- __pyx_v_info->shape = __pyx_t_7;
-
- /* "View.MemoryView":195
- * info.ndim = self.ndim
- * info.shape = self._shape
- * info.strides = self._strides # <<<<<<<<<<<<<<
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize
- */
- __pyx_t_7 = __pyx_v_self->_strides;
- __pyx_v_info->strides = __pyx_t_7;
-
- /* "View.MemoryView":196
- * info.shape = self._shape
- * info.strides = self._strides
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- * info.itemsize = self.itemsize
- * info.readonly = 0
- */
- __pyx_v_info->suboffsets = NULL;
-
- /* "View.MemoryView":197
- * info.strides = self._strides
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
- * info.readonly = 0
- *
- */
- __pyx_t_5 = __pyx_v_self->itemsize;
- __pyx_v_info->itemsize = __pyx_t_5;
-
- /* "View.MemoryView":198
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize
- * info.readonly = 0 # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- __pyx_v_info->readonly = 0;
-
- /* "View.MemoryView":200
- * info.readonly = 0
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * info.format = self.format
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":201
- *
- * if flags & PyBUF_FORMAT:
- * info.format = self.format # <<<<<<<<<<<<<<
- * else:
- * info.format = NULL
- */
- __pyx_t_4 = __pyx_v_self->format;
- __pyx_v_info->format = __pyx_t_4;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":203
- * info.format = self.format
- * else:
- * info.format = NULL # <<<<<<<<<<<<<<
- *
- * info.obj = self
- */
- __pyx_v_info->format = NULL;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":205
- * info.format = NULL
- *
- * info.obj = self # <<<<<<<<<<<<<<
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
- */
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
- }
- goto __pyx_L2;
- __pyx_L0:;
- if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(Py_None);
- __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
- }
- __pyx_L2:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":209
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
- *
- * def __dealloc__(array self): # <<<<<<<<<<<<<<
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- */
-
-static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":210
- *
- * def __dealloc__(array self):
- * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
- * self.callback_free_data(self.data)
- * elif self.free_data:
- */
- __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":211
- * def __dealloc__(array self):
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
- * elif self.free_data:
- * if self.dtype_is_object:
- */
- __pyx_v_self->callback_free_data(__pyx_v_self->data);
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":212
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- * elif self.free_data: # <<<<<<<<<<<<<<
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape,
- */
- __pyx_t_1 = (__pyx_v_self->free_data != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":213
- * self.callback_free_data(self.data)
- * elif self.free_data:
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * refcount_objects_in_slice(self.data, self._shape,
- * self._strides, self.ndim, False)
- */
- __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":215
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape,
- * self._strides, self.ndim, False) # <<<<<<<<<<<<<<
- * free(self.data)
- *
- */
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":216
- * refcount_objects_in_slice(self.data, self._shape,
- * self._strides, self.ndim, False)
- * free(self.data) # <<<<<<<<<<<<<<
- *
- * free(self._strides)
- */
- free(__pyx_v_self->data);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":218
- * free(self.data)
- *
- * free(self._strides) # <<<<<<<<<<<<<<
- * free(self._shape)
- *
- */
- free(__pyx_v_self->_strides);
-
- /* "View.MemoryView":219
- *
- * free(self._strides)
- * free(self._shape) # <<<<<<<<<<<<<<
- *
- * property memview:
- */
- free(__pyx_v_self->_shape);
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* Python wrapper */
-static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
-static PyObject *get_memview(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":223
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
- */
-
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":225
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
- *
- */
- __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
-
- /* "View.MemoryView":226
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
- * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
- __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":229
- *
- *
- * def __getattr__(self, attr): # <<<<<<<<<<<<<<
- * return getattr(self.memview, attr)
- *
- */
-
-static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getattr__", 0);
-
- /* "View.MemoryView":230
- *
- * def __getattr__(self, attr):
- * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
- *
- * def __getitem__(self, item):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":232
- * return getattr(self.memview, attr)
- *
- * def __getitem__(self, item): # <<<<<<<<<<<<<<
- * return self.memview[item]
- *
- */
-
-static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "View.MemoryView":233
- *
- * def __getitem__(self, item):
- * return self.memview[item] # <<<<<<<<<<<<<<
- *
- * def __setitem__(self, item, value):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (!__pyx_t_2) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
- __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":235
- * return self.memview[item]
- *
- * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
- * self.memview[item] = value
- *
- */
-
-static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setitem__", 0);
-
- /* "View.MemoryView":236
- *
- * def __setitem__(self, item, value):
- * self.memview[item] = value # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":240
- *
- * @cname("__pyx_array_new")
- * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
- * char *mode, char *buf):
- * cdef array result
- */
-
-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) {
- struct __pyx_array_obj *__pyx_v_result = 0;
- struct __pyx_array_obj *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("array_cwrapper", 0);
-
- /* "View.MemoryView":244
- * cdef array result
- *
- * if buf == NULL: # <<<<<<<<<<<<<<
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
- * else:
- */
- __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":245
- *
- * if buf == NULL:
- * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
- * else:
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
- */
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_shape));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":247
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
- * else:
- * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
- * allocate_buffer=False)
- * result.data = buf
- */
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_3 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_shape));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-
- /* "View.MemoryView":248
- * else:
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
- * allocate_buffer=False) # <<<<<<<<<<<<<<
- * result.data = buf
- *
- */
- __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__allocate_buffer), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "View.MemoryView":249
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
- * allocate_buffer=False)
- * result.data = buf # <<<<<<<<<<<<<<
- *
- * return result
- */
- __pyx_v_result->data = __pyx_v_buf;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":251
- * result.data = buf
- *
- * return result # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
-
- __pyx_r = ((struct __pyx_array_obj *)Py_None); __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_name = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,0};
- PyObject* values[1] = {0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- }
- __pyx_v_name = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":277
- * cdef class Enum(object):
- * cdef object name
- * def __init__(self, name): # <<<<<<<<<<<<<<
- * self.name = name
- * def __repr__(self):
- */
-
-static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "View.MemoryView":278
- * cdef object name
- * def __init__(self, name):
- * self.name = name # <<<<<<<<<<<<<<
- * def __repr__(self):
- * return self.name
- */
- __Pyx_INCREF(__pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- __Pyx_GOTREF(__pyx_v_self->name);
- __Pyx_DECREF(__pyx_v_self->name);
- __pyx_v_self->name = __pyx_v_name;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":279
- * def __init__(self, name):
- * self.name = name
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return self.name
- *
- */
-
-static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "View.MemoryView":280
- * self.name = name
- * def __repr__(self):
- * return self.name # <<<<<<<<<<<<<<
- *
- * cdef generic = Enum("<strided and direct or indirect>")
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->name);
- __pyx_r = __pyx_v_self->name;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":294
- *
- * @cname('__pyx_align_pointer')
- * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
- * "Align pointer memory on a given boundary"
- * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
- */
-
-static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
- Py_intptr_t __pyx_v_aligned_p;
- size_t __pyx_v_offset;
- void *__pyx_r;
- int __pyx_t_1;
-
- /* "View.MemoryView":296
- * cdef void *align_pointer(void *memory, size_t alignment) nogil:
- * "Align pointer memory on a given boundary"
- * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
- * cdef size_t offset
- *
- */
- __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
-
- /* "View.MemoryView":300
- *
- * with cython.cdivision(True):
- * offset = aligned_p % alignment # <<<<<<<<<<<<<<
- *
- * if offset > 0:
- */
- __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
-
- /* "View.MemoryView":302
- * offset = aligned_p % alignment
- *
- * if offset > 0: # <<<<<<<<<<<<<<
- * aligned_p += alignment - offset
- *
- */
- __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":303
- *
- * if offset > 0:
- * aligned_p += alignment - offset # <<<<<<<<<<<<<<
- *
- * return <void *> aligned_p
- */
- __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":305
- * aligned_p += alignment - offset
- *
- * return <void *> aligned_p # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview')
- */
- __pyx_r = ((void *)__pyx_v_aligned_p);
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_obj = 0;
- int __pyx_v_flags;
- int __pyx_v_dtype_is_object;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__flags,&__pyx_n_s__dtype_is_object,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dtype_is_object);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_obj = values[0];
- __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- if (values[2]) {
- __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "View.MemoryView":323
- * cdef __Pyx_TypeInfo *typeinfo
- *
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
- * self.obj = obj
- * self.flags = flags
- */
- __pyx_v_dtype_is_object = ((int)0);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__cinit__", 0);
-
- /* "View.MemoryView":324
- *
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
- * self.obj = obj # <<<<<<<<<<<<<<
- * self.flags = flags
- * if type(self) is memoryview or obj is not None:
- */
- __Pyx_INCREF(__pyx_v_obj);
- __Pyx_GIVEREF(__pyx_v_obj);
- __Pyx_GOTREF(__pyx_v_self->obj);
- __Pyx_DECREF(__pyx_v_self->obj);
- __pyx_v_self->obj = __pyx_v_obj;
-
- /* "View.MemoryView":325
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
- * self.obj = obj
- * self.flags = flags # <<<<<<<<<<<<<<
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags)
- */
- __pyx_v_self->flags = __pyx_v_flags;
-
- /* "View.MemoryView":326
- * self.obj = obj
- * self.flags = flags
- * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if <PyObject *> self.view.obj == NULL:
- */
- __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
- if (!(__pyx_t_1 != 0)) {
- __pyx_t_2 = (__pyx_v_obj != Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- } else {
- __pyx_t_3 = (__pyx_t_1 != 0);
- }
- if (__pyx_t_3) {
-
- /* "View.MemoryView":327
- * self.flags = flags
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
- * if <PyObject *> self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None
- */
- __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":328
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
- * (<__pyx_buffer *> &self.view).obj = Py_None
- * Py_INCREF(Py_None)
- */
- __pyx_t_3 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":329
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if <PyObject *> self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
-
- /* "View.MemoryView":330
- * if <PyObject *> self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * self.lock = PyThread_allocate_lock()
- */
- Py_INCREF(Py_None);
- goto __pyx_L4;
- }
- __pyx_L4:;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":332
- * Py_INCREF(Py_None)
- *
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
- */
- __pyx_v_self->lock = PyThread_allocate_lock();
-
- /* "View.MemoryView":333
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- *
- */
- __pyx_t_3 = ((__pyx_v_self->lock == NULL) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":334
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL:
- * raise MemoryError # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":336
- * raise MemoryError
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
- * else:
- */
- __pyx_t_3 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":337
- *
- * if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
- * else:
- * self.dtype_is_object = dtype_is_object
- */
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_n_b__O), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_self->dtype_is_object = __pyx_t_3;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":339
- * self.dtype_is_object = self.view.format == b'O'
- * else:
- * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
- *
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
- */
- __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":341
- * self.dtype_is_object = dtype_is_object
- *
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
- * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
- * self.typeinfo = NULL
- */
- __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
-
- /* "View.MemoryView":343
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
- * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
- * self.typeinfo = NULL # <<<<<<<<<<<<<<
- *
- * def __dealloc__(memoryview self):
- */
- __pyx_v_self->typeinfo = NULL;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":345
- * self.typeinfo = NULL
- *
- * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view)
- */
-
-static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":346
- *
- * def __dealloc__(memoryview self):
- * if self.obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_ReleaseBuffer(&self.view)
- *
- */
- __pyx_t_1 = (__pyx_v_self->obj != Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":347
- * def __dealloc__(memoryview self):
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
- *
- * if self.lock != NULL:
- */
- __Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":349
- * __Pyx_ReleaseBuffer(&self.view)
- *
- * if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
- */
- __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":350
- *
- * if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
- *
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
- */
- PyThread_free_lock(__pyx_v_self->lock);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":352
- * PyThread_free_lock(self.lock)
- *
- * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dim
- * cdef char *itemp = <char *> self.view.buf
- */
-
-static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
- Py_ssize_t __pyx_v_dim;
- char *__pyx_v_itemp;
- PyObject *__pyx_v_idx = NULL;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- Py_ssize_t __pyx_t_6;
- char *__pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_item_pointer", 0);
-
- /* "View.MemoryView":354
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
- * cdef Py_ssize_t dim
- * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
- *
- * for dim, idx in enumerate(index):
- */
- __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
-
- /* "View.MemoryView":356
- * cdef char *itemp = <char *> self.view.buf
- *
- * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
- *
- */
- __pyx_t_1 = 0;
- if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) {
- __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_5 = __pyx_t_4(__pyx_t_2);
- if (unlikely(!__pyx_t_5)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- __Pyx_XDECREF(__pyx_v_idx);
- __pyx_v_idx = __pyx_t_5;
- __pyx_t_5 = 0;
- __pyx_v_dim = __pyx_t_1;
- __pyx_t_1 = (__pyx_t_1 + 1);
-
- /* "View.MemoryView":357
- *
- * for dim, idx in enumerate(index):
- * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
- *
- * return itemp
- */
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_itemp = __pyx_t_7;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":359
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
- *
- * return itemp # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_itemp;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_idx);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":362
- *
- *
- * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
- * if index is Ellipsis:
- * return self
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
- PyObject *__pyx_v_have_slices = NULL;
- PyObject *__pyx_v_indices = NULL;
- char *__pyx_v_itemp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *(*__pyx_t_7)(PyObject *);
- char *__pyx_t_8;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "View.MemoryView":363
- *
- * def __getitem__(memoryview self, object index):
- * if index is Ellipsis: # <<<<<<<<<<<<<<
- * return self
- *
- */
- __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":364
- * def __getitem__(memoryview self, object index):
- * if index is Ellipsis:
- * return self # <<<<<<<<<<<<<<
- *
- * have_slices, indices = _unellipsify(index, self.view.ndim)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __pyx_r = ((PyObject *)__pyx_v_self);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":366
- * return self
- *
- * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
- *
- * cdef char *itemp
- */
- __pyx_t_3 = ((PyObject *)_unellipsify(__pyx_v_index, __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (likely(PyTuple_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else if (1) {
- __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = NULL;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L5_unpacking_done;
- __pyx_L4_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L5_unpacking_done:;
- }
- __pyx_v_have_slices = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_indices = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "View.MemoryView":369
- *
- * cdef char *itemp
- * if have_slices: # <<<<<<<<<<<<<<
- * return memview_slice(self, indices)
- * else:
- */
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_2) {
-
- /* "View.MemoryView":370
- * cdef char *itemp
- * if have_slices:
- * return memview_slice(self, indices) # <<<<<<<<<<<<<<
- * else:
- * itemp = self.get_item_pointer(indices)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":372
- * return memview_slice(self, indices)
- * else:
- * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
- * return self.convert_item_to_object(itemp)
- *
- */
- __pyx_t_8 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_itemp = __pyx_t_8;
-
- /* "View.MemoryView":373
- * else:
- * itemp = self.get_item_pointer(indices)
- * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
- *
- * def __setitem__(memoryview self, object index, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __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_filename = __pyx_f[4]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- }
- __pyx_L6:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_indices);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":375
- * return self.convert_item_to_object(itemp)
- *
- * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
- * have_slices, index = _unellipsify(index, self.view.ndim)
- *
- */
-
-static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- PyObject *__pyx_v_have_slices = NULL;
- PyObject *__pyx_v_obj = NULL;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *(*__pyx_t_5)(PyObject *);
- int __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setitem__", 0);
- __Pyx_INCREF(__pyx_v_index);
-
- /* "View.MemoryView":376
- *
- * def __setitem__(memoryview self, object index, object value):
- * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
- *
- * if have_slices:
- */
- __pyx_t_1 = ((PyObject *)_unellipsify(__pyx_v_index, __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (likely(PyTuple_CheckExact(__pyx_t_1))) {
- PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else if (1) {
- __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
- index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_2);
- index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = NULL;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L4_unpacking_done;
- __pyx_L3_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L4_unpacking_done:;
- }
- __pyx_v_have_slices = __pyx_t_2;
- __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_v_index);
- __pyx_v_index = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":378
- * have_slices, index = _unellipsify(index, self.view.ndim)
- *
- * if have_slices: # <<<<<<<<<<<<<<
- * obj = self.is_slice(value)
- * if obj:
- */
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_6) {
-
- /* "View.MemoryView":379
- *
- * if have_slices:
- * obj = self.is_slice(value) # <<<<<<<<<<<<<<
- * if obj:
- * self.setitem_slice_assignment(self[index], obj)
- */
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_obj = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":380
- * if have_slices:
- * obj = self.is_slice(value)
- * if obj: # <<<<<<<<<<<<<<
- * self.setitem_slice_assignment(self[index], obj)
- * else:
- */
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_6) {
-
- /* "View.MemoryView":381
- * obj = self.is_slice(value)
- * if obj:
- * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
- * else:
- * self.setitem_slice_assign_scalar(self[index], value)
- */
- __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (!__pyx_t_1) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":383
- * self.setitem_slice_assignment(self[index], obj)
- * else:
- * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
- * else:
- * self.setitem_indexed(index, value)
- */
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (!__pyx_t_3) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L6:;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":385
- * self.setitem_slice_assign_scalar(self[index], value)
- * else:
- * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
- *
- * cdef is_slice(self, obj):
- */
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L5:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_obj);
- __Pyx_XDECREF(__pyx_v_index);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":387
- * self.setitem_indexed(index, value)
- *
- * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
- * if not isinstance(obj, memoryview):
- * try:
- */
-
-static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_slice", 0);
- __Pyx_INCREF(__pyx_v_obj);
-
- /* "View.MemoryView":388
- *
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
- * try:
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type));
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":389
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview):
- * try: # <<<<<<<<<<<<<<
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_5);
- /*try:*/ {
-
- /* "View.MemoryView":390
- * if not isinstance(obj, memoryview):
- * try:
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
- * self.dtype_is_object)
- * except TypeError:
- */
- __pyx_t_6 = PyInt_FromLong((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "View.MemoryView":391
- * try:
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object) # <<<<<<<<<<<<<<
- * except TypeError:
- * return None
- */
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_v_obj);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
- __Pyx_GIVEREF(__pyx_v_obj);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_v_obj);
- __pyx_v_obj = __pyx_t_7;
- __pyx_t_7 = 0;
- }
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L11_try_end;
- __pyx_L4_error:;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "View.MemoryView":392
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- * except TypeError: # <<<<<<<<<<<<<<
- * return None
- *
- */
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_9) {
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "View.MemoryView":393
- * self.dtype_is_object)
- * except TypeError:
- * return None # <<<<<<<<<<<<<<
- *
- * return obj
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_None);
- __pyx_r = Py_None;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L7_except_return;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L5_exception_handled;
- }
- __pyx_L6_except_error:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L1_error;
- __pyx_L7_except_return:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L0;
- __pyx_L5_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- __pyx_L11_try_end:;
- }
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":395
- * return None
- *
- * return obj # <<<<<<<<<<<<<<
- *
- * cdef setitem_slice_assignment(self, dst, src):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_obj);
- __pyx_r = __pyx_v_obj;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_obj);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":397
- * return obj
- *
- * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice dst_slice
- * cdef __Pyx_memviewslice src_slice
- */
-
-static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
- __Pyx_memviewslice __pyx_v_dst_slice;
- __Pyx_memviewslice __pyx_v_src_slice;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
-
- /* "View.MemoryView":401
- * cdef __Pyx_memviewslice src_slice
- *
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
- * get_slice_from_memview(dst, &dst_slice)[0],
- * src.ndim, dst.ndim, self.dtype_is_object)
- */
- if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":402
- *
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
- * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
- * src.ndim, dst.ndim, self.dtype_is_object)
- *
- */
- if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":403
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
- * get_slice_from_memview(dst, &dst_slice)[0],
- * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":405
- * src.ndim, dst.ndim, self.dtype_is_object)
- *
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
- * cdef int array[128]
- * cdef void *tmp = NULL
- */
-
-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) {
- int __pyx_v_array[128];
- void *__pyx_v_tmp;
- void *__pyx_v_item;
- __Pyx_memviewslice __pyx_v_tmp_slice;
- __Pyx_memviewslice *__pyx_v_dst_slice;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
-
- /* "View.MemoryView":407
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
- * cdef int array[128]
- * cdef void *tmp = NULL # <<<<<<<<<<<<<<
- * cdef void *item
- *
- */
- __pyx_v_tmp = NULL;
-
- /* "View.MemoryView":411
- *
- * cdef __Pyx_memviewslice tmp_slice, *dst_slice
- * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
- *
- * if <size_t>self.view.itemsize > sizeof(array):
- */
- __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
-
- /* "View.MemoryView":413
- * dst_slice = get_slice_from_memview(dst, &tmp_slice)
- *
- * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
- * tmp = malloc(self.view.itemsize)
- * if tmp == NULL:
- */
- __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":414
- *
- * if <size_t>self.view.itemsize > sizeof(array):
- * tmp = malloc(self.view.itemsize) # <<<<<<<<<<<<<<
- * if tmp == NULL:
- * raise MemoryError
- */
- __pyx_v_tmp = malloc(__pyx_v_self->view.itemsize);
-
- /* "View.MemoryView":415
- * if <size_t>self.view.itemsize > sizeof(array):
- * tmp = malloc(self.view.itemsize)
- * if tmp == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- * item = tmp
- */
- __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":416
- * tmp = malloc(self.view.itemsize)
- * if tmp == NULL:
- * raise MemoryError # <<<<<<<<<<<<<<
- * item = tmp
- * else:
- */
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":417
- * if tmp == NULL:
- * raise MemoryError
- * item = tmp # <<<<<<<<<<<<<<
- * else:
- * item = <void *> array
- */
- __pyx_v_item = __pyx_v_tmp;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":419
- * item = tmp
- * else:
- * item = <void *> array # <<<<<<<<<<<<<<
- *
- * if self.dtype_is_object:
- */
- __pyx_v_item = ((void *)__pyx_v_array);
- }
- __pyx_L3:;
-
- /* "View.MemoryView":421
- * item = <void *> array
- *
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * (<PyObject **> item)[0] = <PyObject *> value
- * else:
- */
- __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":422
- *
- * if self.dtype_is_object:
- * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
- * else:
- * try:
- */
- (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":424
- * (<PyObject **> item)[0] = <PyObject *> value
- * else:
- * try: # <<<<<<<<<<<<<<
- * self.assign_item_from_object(<char *> item, value)
- * except:
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_2);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- /*try:*/ {
-
- /* "View.MemoryView":425
- * else:
- * try:
- * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
- * except:
- * free(tmp)
- */
- __pyx_t_5 = ((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_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L13_try_end;
- __pyx_L6_error:;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "View.MemoryView":426
- * try:
- * self.assign_item_from_object(<char *> item, value)
- * except: # <<<<<<<<<<<<<<
- * free(tmp)
- * raise
- */
- /*except:*/ {
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "View.MemoryView":427
- * self.assign_item_from_object(<char *> item, value)
- * except:
- * free(tmp) # <<<<<<<<<<<<<<
- * raise
- *
- */
- free(__pyx_v_tmp);
-
- /* "View.MemoryView":428
- * except:
- * free(tmp)
- * raise # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_GIVEREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
- __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L7_exception_handled;
- }
- __pyx_L8_except_error:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L1_error;
- __pyx_L7_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- __pyx_L13_try_end:;
- }
- }
- __pyx_L5:;
-
- /* "View.MemoryView":432
- *
- *
- * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- */
- __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":433
- *
- * if self.view.suboffsets != NULL:
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- * item, self.dtype_is_object)
- */
- __pyx_t_7 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L16;
- }
- __pyx_L16:;
-
- /* "View.MemoryView":435
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- * item, self.dtype_is_object) # <<<<<<<<<<<<<<
- * free(tmp)
- *
- */
- __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);
-
- /* "View.MemoryView":436
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- * item, self.dtype_is_object)
- * free(tmp) # <<<<<<<<<<<<<<
- *
- * cdef setitem_indexed(self, index, value):
- */
- free(__pyx_v_tmp);
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":438
- * free(tmp)
- *
- * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
- * cdef char *itemp = self.get_item_pointer(index)
- * self.assign_item_from_object(itemp, value)
- */
-
-static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- char *__pyx_v_itemp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- char *__pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_indexed", 0);
-
- /* "View.MemoryView":439
- *
- * cdef setitem_indexed(self, index, value):
- * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
- * self.assign_item_from_object(itemp, value)
- *
- */
- __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 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_itemp = __pyx_t_1;
-
- /* "View.MemoryView":440
- * cdef setitem_indexed(self, index, value):
- * cdef char *itemp = self.get_item_pointer(index)
- * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
- *
- * cdef convert_item_to_object(self, char *itemp):
- */
- __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_filename = __pyx_f[4]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":442
- * self.assign_item_from_object(itemp, value)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
-static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
- PyObject *__pyx_v_struct = NULL;
- PyObject *__pyx_v_bytesitem = 0;
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- size_t __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
-
- /* "View.MemoryView":445
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- * import struct # <<<<<<<<<<<<<<
- * cdef bytes bytesitem
- *
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_struct = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":448
- * cdef bytes bytesitem
- *
- * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
- * try:
- * result = struct.unpack(self.view.format, bytesitem)
- */
- __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":449
- *
- * bytesitem = itemp[:self.view.itemsize]
- * try: # <<<<<<<<<<<<<<
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_2);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- /*try:*/ {
-
- /* "View.MemoryView":450
- * bytesitem = itemp[:self.view.itemsize]
- * try:
- * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
- * except struct.error:
- * raise ValueError("Unable to convert item to object")
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- __Pyx_INCREF(((PyObject *)__pyx_v_bytesitem));
- PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_bytesitem));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_bytesitem));
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __pyx_v_result = __pyx_t_5;
- __pyx_t_5 = 0;
- }
- /*else:*/ {
-
- /* "View.MemoryView":454
- * raise ValueError("Unable to convert item to object")
- * else:
- * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
- * return result[0]
- * return result
- */
- __pyx_t_7 = strlen(__pyx_v_self->view.format);
- __pyx_t_8 = ((__pyx_t_7 == 1) != 0);
- if (__pyx_t_8) {
-
- /* "View.MemoryView":455
- * else:
- * if len(self.view.format) == 1:
- * return result[0] # <<<<<<<<<<<<<<
- * return result
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L6_except_return;
- goto __pyx_L11;
- }
- __pyx_L11:;
-
- /* "View.MemoryView":456
- * if len(self.view.format) == 1:
- * return result[0]
- * return result # <<<<<<<<<<<<<<
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_result);
- __pyx_r = __pyx_v_result;
- goto __pyx_L6_except_return;
- }
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L10_try_end;
- __pyx_L3_error:;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "View.MemoryView":451
- * try:
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error: # <<<<<<<<<<<<<<
- * raise ValueError("Unable to convert item to object")
- * else:
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_9) {
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "View.MemoryView":452
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
- * else:
- * if len(self.view.format) == 1:
- */
- __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_35), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L4_exception_handled;
- }
- __pyx_L5_except_error:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L1_error;
- __pyx_L6_except_return:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L0;
- __pyx_L4_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- __pyx_L10_try_end:;
- }
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_struct);
- __Pyx_XDECREF(__pyx_v_bytesitem);
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":458
- * return result
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
-static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
- PyObject *__pyx_v_struct = NULL;
- char __pyx_v_c;
- PyObject *__pyx_v_bytesvalue = 0;
- Py_ssize_t __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- char *__pyx_t_9;
- char *__pyx_t_10;
- char *__pyx_t_11;
- char *__pyx_t_12;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
-
- /* "View.MemoryView":461
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- * import struct # <<<<<<<<<<<<<<
- * cdef char c
- * cdef bytes bytesvalue
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_struct = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":466
- * cdef Py_ssize_t i
- *
- * if isinstance(value, tuple): # <<<<<<<<<<<<<<
- * bytesvalue = struct.pack(self.view.format, *value)
- * else:
- */
- __pyx_t_2 = PyTuple_Check(__pyx_v_value);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":467
- *
- * if isinstance(value, tuple):
- * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
- * else:
- * bytesvalue = struct.pack(self.view.format, value)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_6));
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":469
- * bytesvalue = struct.pack(self.view.format, *value)
- * else:
- * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
- *
- * for i, c in enumerate(bytesvalue):
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_6));
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_6));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
- __Pyx_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_6);
- __pyx_t_6 = 0;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":471
- * bytesvalue = struct.pack(self.view.format, value)
- *
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
- * itemp[i] = c
- *
- */
- __pyx_t_7 = 0;
- if (unlikely(((PyObject *)__pyx_v_bytesvalue) == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __Pyx_INCREF(((PyObject *)__pyx_v_bytesvalue));
- __pyx_t_8 = __pyx_v_bytesvalue;
- __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
- __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
- for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
- __pyx_t_9 = __pyx_t_12;
- __pyx_v_c = (__pyx_t_9[0]);
-
- /* "View.MemoryView":472
- *
- * for i, c in enumerate(bytesvalue):
- * itemp[i] = c # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- __pyx_v_i = __pyx_t_7;
-
- /* "View.MemoryView":471
- * bytesvalue = struct.pack(self.view.format, value)
- *
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
- * itemp[i] = c
- *
- */
- __pyx_t_7 = (__pyx_t_7 + 1);
-
- /* "View.MemoryView":472
- *
- * for i, c in enumerate(bytesvalue):
- * itemp[i] = c # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
- }
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(((PyObject *)__pyx_t_8));
- __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_struct);
- __Pyx_XDECREF(__pyx_v_bytesvalue);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":475
- *
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
- * if flags & PyBUF_STRIDES:
- * info.shape = self.view.shape
- */
-
-static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- Py_ssize_t *__pyx_t_2;
- char *__pyx_t_3;
- void *__pyx_t_4;
- int __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- if (__pyx_v_info != NULL) {
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
- }
-
- /* "View.MemoryView":476
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.shape = self.view.shape
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":477
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_STRIDES:
- * info.shape = self.view.shape # <<<<<<<<<<<<<<
- * else:
- * info.shape = NULL
- */
- __pyx_t_2 = __pyx_v_self->view.shape;
- __pyx_v_info->shape = __pyx_t_2;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":479
- * info.shape = self.view.shape
- * else:
- * info.shape = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_STRIDES:
- */
- __pyx_v_info->shape = NULL;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":481
- * info.shape = NULL
- *
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.strides = self.view.strides
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":482
- *
- * if flags & PyBUF_STRIDES:
- * info.strides = self.view.strides # <<<<<<<<<<<<<<
- * else:
- * info.strides = NULL
- */
- __pyx_t_2 = __pyx_v_self->view.strides;
- __pyx_v_info->strides = __pyx_t_2;
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "View.MemoryView":484
- * info.strides = self.view.strides
- * else:
- * info.strides = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_INDIRECT:
- */
- __pyx_v_info->strides = NULL;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":486
- * info.strides = NULL
- *
- * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
- * info.suboffsets = self.view.suboffsets
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":487
- *
- * if flags & PyBUF_INDIRECT:
- * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
- * else:
- * info.suboffsets = NULL
- */
- __pyx_t_2 = __pyx_v_self->view.suboffsets;
- __pyx_v_info->suboffsets = __pyx_t_2;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":489
- * info.suboffsets = self.view.suboffsets
- * else:
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- __pyx_v_info->suboffsets = NULL;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":491
- * info.suboffsets = NULL
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * info.format = self.view.format
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":492
- *
- * if flags & PyBUF_FORMAT:
- * info.format = self.view.format # <<<<<<<<<<<<<<
- * else:
- * info.format = NULL
- */
- __pyx_t_3 = __pyx_v_self->view.format;
- __pyx_v_info->format = __pyx_t_3;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":494
- * info.format = self.view.format
- * else:
- * info.format = NULL # <<<<<<<<<<<<<<
- *
- * info.buf = self.view.buf
- */
- __pyx_v_info->format = NULL;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":496
- * info.format = NULL
- *
- * info.buf = self.view.buf # <<<<<<<<<<<<<<
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize
- */
- __pyx_t_4 = __pyx_v_self->view.buf;
- __pyx_v_info->buf = __pyx_t_4;
-
- /* "View.MemoryView":497
- *
- * info.buf = self.view.buf
- * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len
- */
- __pyx_t_5 = __pyx_v_self->view.ndim;
- __pyx_v_info->ndim = __pyx_t_5;
-
- /* "View.MemoryView":498
- * info.buf = self.view.buf
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
- * info.len = self.view.len
- * info.readonly = 0
- */
- __pyx_t_6 = __pyx_v_self->view.itemsize;
- __pyx_v_info->itemsize = __pyx_t_6;
-
- /* "View.MemoryView":499
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len # <<<<<<<<<<<<<<
- * info.readonly = 0
- * info.obj = self
- */
- __pyx_t_6 = __pyx_v_self->view.len;
- __pyx_v_info->len = __pyx_t_6;
-
- /* "View.MemoryView":500
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len
- * info.readonly = 0 # <<<<<<<<<<<<<<
- * info.obj = self
- *
- */
- __pyx_v_info->readonly = 0;
-
- /* "View.MemoryView":501
- * info.len = self.view.len
- * info.readonly = 0
- * info.obj = self # <<<<<<<<<<<<<<
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
- */
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
-
- __pyx_r = 0;
- if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(Py_None);
- __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
- }
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":508
- * property T:
- * @cname('__pyx_memoryview_transpose')
- * def __get__(self): # <<<<<<<<<<<<<<
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- */
-
-static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":509
- * @cname('__pyx_memoryview_transpose')
- * def __get__(self):
- * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
- * transpose_memslice(&result.from_slice)
- * return result
- */
- __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":510
- * def __get__(self):
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":511
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
- *
- * property base:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":515
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
- *
- */
-
-static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":516
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self):
- * return self.obj # <<<<<<<<<<<<<<
- *
- * property shape:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->obj);
- __pyx_r = __pyx_v_self->obj;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":520
- * property shape:
- * @cname('__pyx_memoryview_get_shape')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
- *
- */
-
-static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":521
- * @cname('__pyx_memoryview_get_shape')
- * def __get__(self):
- * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
- *
- * property strides:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_v_self->view.ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
- __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __pyx_t_4 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_r = ((PyObject *)__pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":525
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
- *
- */
-
-static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":526
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
- *
- * raise ValueError("Buffer view does not expose strides")
- */
- __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":528
- * if self.view.strides == NULL:
- *
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
- *
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_37), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":530
- * raise ValueError("Buffer view does not expose strides")
- *
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
- *
- * property suboffsets:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_v_self->view.ndim;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
- __pyx_v_i = __pyx_t_4;
- __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __pyx_t_5 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_2))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":534
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
- */
-
-static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":535
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self):
- * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
- * return [-1] * self.view.ndim
- *
- */
- __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":536
- * def __get__(self):
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim # <<<<<<<<<<<<<<
- *
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- { Py_ssize_t __pyx_temp;
- for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) {
- __Pyx_INCREF(__pyx_int_neg_1);
- PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- }
- }
- __pyx_r = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":538
- * return [-1] * self.view.ndim
- *
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
- *
- * property ndim:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_v_self->view.ndim;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
- __pyx_v_i = __pyx_t_4;
- __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __pyx_t_5 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_2))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":542
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
- *
- */
-
-static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":543
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self):
- * return self.view.ndim # <<<<<<<<<<<<<<
- *
- * property itemsize:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":547
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
- *
- */
-
-static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":548
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self):
- * return self.view.itemsize # <<<<<<<<<<<<<<
- *
- * property nbytes:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":552
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
- *
- */
-
-static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":553
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self):
- * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
- *
- * property size:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":557
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
- */
-
-static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_v_length = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
- PyObject *(*__pyx_t_6)(PyObject *);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":558
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
- *
- */
- __pyx_t_1 = (__pyx_v_self->_size == Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":559
- * def __get__(self):
- * if self._size is None:
- * result = 1 # <<<<<<<<<<<<<<
- *
- * for length in self.shape:
- */
- __Pyx_INCREF(__pyx_int_1);
- __pyx_v_result = __pyx_int_1;
-
- /* "View.MemoryView":561
- * result = 1
- *
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_3 = __pyx_t_6(__pyx_t_4);
- if (unlikely(!__pyx_t_3)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF(__pyx_v_length);
- __pyx_v_length = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":562
- *
- * for length in self.shape:
- * result *= length # <<<<<<<<<<<<<<
- *
- * self._size = result
- */
- __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_v_result);
- __pyx_v_result = __pyx_t_3;
- __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "View.MemoryView":564
- * result *= length
- *
- * self._size = result # <<<<<<<<<<<<<<
- *
- * return self._size
- */
- __Pyx_INCREF(__pyx_v_result);
- __Pyx_GIVEREF(__pyx_v_result);
- __Pyx_GOTREF(__pyx_v_self->_size);
- __Pyx_DECREF(__pyx_v_self->_size);
- __pyx_v_self->_size = __pyx_v_result;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":566
- * self._size = result
- *
- * return self._size # <<<<<<<<<<<<<<
- *
- * def __len__(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->_size);
- __pyx_r = __pyx_v_self->_size;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_length);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":568
- * return self._size
- *
- * def __len__(self): # <<<<<<<<<<<<<<
- * if self.view.ndim >= 1:
- * return self.view.shape[0]
- */
-
-static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "View.MemoryView":569
- *
- * def __len__(self):
- * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
- * return self.view.shape[0]
- *
- */
- __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":570
- * def __len__(self):
- * if self.view.ndim >= 1:
- * return self.view.shape[0] # <<<<<<<<<<<<<<
- *
- * return 0
- */
- __pyx_r = (__pyx_v_self->view.shape[0]);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":572
- * return self.view.shape[0]
- *
- * return 0 # <<<<<<<<<<<<<<
- *
- * def __repr__(self):
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":574
- * return 0
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
- * id(self))
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "View.MemoryView":575
- *
- * def __repr__(self):
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
- * id(self))
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":576
- * def __repr__(self):
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
- * id(self)) # <<<<<<<<<<<<<<
- *
- * def __str__(self):
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_1 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_38), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":578
- * id(self))
- *
- * def __str__(self): # <<<<<<<<<<<<<<
- * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
- *
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__str__", 0);
-
- /* "View.MemoryView":579
- *
- * def __str__(self):
- * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_1);
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":582
- *
- *
- * def is_c_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice *__pyx_v_mslice;
- __Pyx_memviewslice __pyx_v_tmp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_c_contig", 0);
-
- /* "View.MemoryView":584
- * def is_c_contig(self):
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
- *
- */
- __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
-
- /* "View.MemoryView":585
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
- *
- * def is_f_contig(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'C', self.view.ndim)
- *
- * def is_f_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice *__pyx_v_mslice;
- __Pyx_memviewslice __pyx_v_tmp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_f_contig", 0);
-
- /* "View.MemoryView":589
- * def is_f_contig(self):
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
- *
- */
- __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
-
- /* "View.MemoryView":590
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
- *
- * def copy(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("copy (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":592
- * return slice_is_contig(mslice, 'F', self.view.ndim)
- *
- * def copy(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice mslice
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice __pyx_v_mslice;
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("copy", 0);
-
- /* "View.MemoryView":594
- * def copy(self):
- * cdef __Pyx_memviewslice mslice
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
- *
- * slice_copy(self, &mslice)
- */
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
-
- /* "View.MemoryView":596
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
- *
- * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
- * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
- * self.view.itemsize,
- */
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
-
- /* "View.MemoryView":600
- * self.view.itemsize,
- * flags|PyBUF_C_CONTIGUOUS,
- * self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * return memoryview_copy_from_slice(self, &mslice)
- */
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k__c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_mslice = __pyx_t_1;
-
- /* "View.MemoryView":602
- * self.dtype_is_object)
- *
- * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
- *
- * def copy_fortran(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":604
- * return memoryview_copy_from_slice(self, &mslice)
- *
- * def copy_fortran(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice src, dst
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice __pyx_v_src;
- __Pyx_memviewslice __pyx_v_dst;
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("copy_fortran", 0);
-
- /* "View.MemoryView":606
- * def copy_fortran(self):
- * cdef __Pyx_memviewslice src, dst
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
- *
- * slice_copy(self, &src)
- */
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
-
- /* "View.MemoryView":608
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
- *
- * slice_copy(self, &src) # <<<<<<<<<<<<<<
- * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
- * self.view.itemsize,
- */
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
-
- /* "View.MemoryView":612
- * self.view.itemsize,
- * flags|PyBUF_F_CONTIGUOUS,
- * self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * return memoryview_copy_from_slice(self, &dst)
- */
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k__fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_dst = __pyx_t_1;
-
- /* "View.MemoryView":614
- * self.dtype_is_object)
- *
- * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":618
- *
- * @cname('__pyx_memoryview_new')
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo
- */
-
-static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
- struct __pyx_memoryview_obj *__pyx_v_result = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
-
- /* "View.MemoryView":619
- * @cname('__pyx_memoryview_new')
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
- * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
- * result.typeinfo = typeinfo
- * return result
- */
- __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_o);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
- __Pyx_GIVEREF(__pyx_v_o);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":620
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_v_result->typeinfo = __pyx_v_typeinfo;
-
- /* "View.MemoryView":621
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo
- * return result # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_check')
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":624
- *
- * @cname('__pyx_memoryview_check')
- * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
- * return isinstance(o, memoryview)
- *
- */
-
-static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("memoryview_check", 0);
-
- /* "View.MemoryView":625
- * @cname('__pyx_memoryview_check')
- * cdef inline bint memoryview_check(object o):
- * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
- *
- * cdef tuple _unellipsify(object index, int ndim):
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type));
- __pyx_r = __pyx_t_1;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":627
- * return isinstance(o, memoryview)
- *
- * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
- * """
- * Replace all ellipses with full slices and fill incomplete indices with
- */
-
-static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
- PyObject *__pyx_v_tup = NULL;
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_v_have_slices = NULL;
- int __pyx_v_seen_ellipsis;
- CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
- PyObject *__pyx_v_item = NULL;
- PyObject *__pyx_v_nslices = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
- PyObject *(*__pyx_t_6)(PyObject *);
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_t_11;
- int __pyx_t_12;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_unellipsify", 0);
-
- /* "View.MemoryView":632
- * full slices.
- * """
- * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
- * tup = (index,)
- * else:
- */
- __pyx_t_1 = PyTuple_Check(__pyx_v_index);
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":633
- * """
- * if not isinstance(index, tuple):
- * tup = (index,) # <<<<<<<<<<<<<<
- * else:
- * tup = index
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_index);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
- __Pyx_GIVEREF(__pyx_v_index);
- __pyx_v_tup = ((PyObject *)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":635
- * tup = (index,)
- * else:
- * tup = index # <<<<<<<<<<<<<<
- *
- * result = []
- */
- __Pyx_INCREF(__pyx_v_index);
- __pyx_v_tup = __pyx_v_index;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":637
- * tup = index
- *
- * result = [] # <<<<<<<<<<<<<<
- * have_slices = False
- * seen_ellipsis = False
- */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_result = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":638
- *
- * result = []
- * have_slices = False # <<<<<<<<<<<<<<
- * seen_ellipsis = False
- * for idx, item in enumerate(tup):
- */
- __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_have_slices = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":639
- * result = []
- * have_slices = False
- * seen_ellipsis = False # <<<<<<<<<<<<<<
- * for idx, item in enumerate(tup):
- * if item is Ellipsis:
- */
- __pyx_v_seen_ellipsis = 0;
-
- /* "View.MemoryView":640
- * have_slices = False
- * seen_ellipsis = False
- * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
- * if item is Ellipsis:
- * if not seen_ellipsis:
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_3 = __pyx_int_0;
- if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) {
- __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_7 = __pyx_t_6(__pyx_t_4);
- if (unlikely(!__pyx_t_7)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_7);
- }
- __Pyx_XDECREF(__pyx_v_item);
- __pyx_v_item = __pyx_t_7;
- __pyx_t_7 = 0;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_v_idx);
- __pyx_v_idx = __pyx_t_3;
- __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3);
- __pyx_t_3 = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "View.MemoryView":641
- * seen_ellipsis = False
- * for idx, item in enumerate(tup):
- * if item is Ellipsis: # <<<<<<<<<<<<<<
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
- */
- __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":642
- * for idx, item in enumerate(tup):
- * if item is Ellipsis:
- * if not seen_ellipsis: # <<<<<<<<<<<<<<
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
- * seen_ellipsis = True
- */
- __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":643
- * if item is Ellipsis:
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
- * seen_ellipsis = True
- * else:
- */
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_40), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_9) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_9) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- { Py_ssize_t __pyx_temp;
- for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_9) + 1); __pyx_temp++) {
- __Pyx_INCREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_10, __pyx_temp, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_10));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
- /* "View.MemoryView":644
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
- * seen_ellipsis = True # <<<<<<<<<<<<<<
- * else:
- * result.append(slice(None))
- */
- __pyx_v_seen_ellipsis = 1;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":646
- * seen_ellipsis = True
- * else:
- * result.append(slice(None)) # <<<<<<<<<<<<<<
- * have_slices = True
- * else:
- */
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __pyx_L7:;
-
- /* "View.MemoryView":647
- * else:
- * result.append(slice(None))
- * have_slices = True # <<<<<<<<<<<<<<
- * else:
- * if not isinstance(item, slice) and not PyIndex_Check(item):
- */
- __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_v_have_slices);
- __pyx_v_have_slices = __pyx_t_10;
- __pyx_t_10 = 0;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":649
- * have_slices = True
- * else:
- * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
- * raise TypeError("Cannot index with type '%s'" % type(item))
- *
- */
- __pyx_t_1 = PySlice_Check(__pyx_v_item);
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
- __pyx_t_1 = ((!(__Pyx_PyIndex_Check(__pyx_v_item) != 0)) != 0);
- __pyx_t_12 = __pyx_t_1;
- } else {
- __pyx_t_12 = __pyx_t_2;
- }
- if (__pyx_t_12) {
-
- /* "View.MemoryView":650
- * else:
- * if not isinstance(item, slice) and not PyIndex_Check(item):
- * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
- *
- * have_slices = have_slices or isinstance(item, slice)
- */
- __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_42), ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_10));
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_10));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "View.MemoryView":652
- * raise TypeError("Cannot index with type '%s'" % type(item))
- *
- * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
- * result.append(item)
- *
- */
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_12) {
- __pyx_t_12 = PySlice_Check(__pyx_v_item);
- __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_8 = __pyx_t_10;
- __pyx_t_10 = 0;
- } else {
- __Pyx_INCREF(__pyx_v_have_slices);
- __pyx_t_8 = __pyx_v_have_slices;
- }
- __Pyx_DECREF(__pyx_v_have_slices);
- __pyx_v_have_slices = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "View.MemoryView":653
- *
- * have_slices = have_slices or isinstance(item, slice)
- * result.append(item) # <<<<<<<<<<<<<<
- *
- * nslices = ndim - len(result)
- */
- __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L6:;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "View.MemoryView":655
- * result.append(item)
- *
- * nslices = ndim - len(result) # <<<<<<<<<<<<<<
- * if nslices:
- * result.extend([slice(None)] * nslices)
- */
- __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_result)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_ndim - __pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_nslices = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":656
- *
- * nslices = ndim - len(result)
- * if nslices: # <<<<<<<<<<<<<<
- * result.extend([slice(None)] * nslices)
- *
- */
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_nslices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_12) {
-
- /* "View.MemoryView":657
- * nslices = ndim - len(result)
- * if nslices:
- * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
- *
- * return have_slices or nslices, tuple(result)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_43), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_8, __pyx_v_nslices); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_temp);
- __Pyx_DECREF(__pyx_t_8);
- __pyx_t_8 = __pyx_temp;
- }
- __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "View.MemoryView":659
- * result.extend([slice(None)] * nslices)
- *
- * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
- *
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_12) {
- __Pyx_INCREF(__pyx_v_nslices);
- __pyx_t_8 = __pyx_v_nslices;
- } else {
- __Pyx_INCREF(__pyx_v_have_slices);
- __pyx_t_8 = __pyx_v_have_slices;
- }
- __pyx_t_4 = ((PyObject *)PyList_AsTuple(__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_8 = 0;
- __pyx_t_4 = 0;
- __pyx_r = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_tup);
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_idx);
- __Pyx_XDECREF(__pyx_v_item);
- __Pyx_XDECREF(__pyx_v_nslices);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":661
- * return have_slices or nslices, tuple(result)
- *
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
- * cdef int i
- * for i in range(ndim):
- */
-
-static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
-
- /* "View.MemoryView":663
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
- * raise ValueError("Indirect dimensions not supported")
- */
- __pyx_t_1 = __pyx_v_ndim;
- for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
- __pyx_v_i = __pyx_t_2;
-
- /* "View.MemoryView":664
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
- * raise ValueError("Indirect dimensions not supported")
- *
- */
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":665
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
- * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_45), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
- }
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":672
- *
- * @cname('__pyx_memview_slice')
- * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
- * cdef int new_ndim = 0, suboffset_dim = -1, dim
- * cdef bint negative_step
- */
-
-static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
- int __pyx_v_new_ndim;
- int __pyx_v_suboffset_dim;
- int __pyx_v_dim;
- __Pyx_memviewslice __pyx_v_src;
- __Pyx_memviewslice __pyx_v_dst;
- __Pyx_memviewslice *__pyx_v_p_src;
- struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
- __Pyx_memviewslice *__pyx_v_p_dst;
- int *__pyx_v_p_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;
- PyObject *__pyx_v_index = NULL;
- struct __pyx_memoryview_obj *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- struct __pyx_memoryview_obj *__pyx_t_3;
- char *__pyx_t_4;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
- PyObject *(*__pyx_t_8)(PyObject *);
- PyObject *__pyx_t_9 = NULL;
- Py_ssize_t __pyx_t_10;
- int __pyx_t_11;
- PyObject *__pyx_t_12 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memview_slice", 0);
-
- /* "View.MemoryView":673
- * @cname('__pyx_memview_slice')
- * cdef memoryview memview_slice(memoryview memview, object indices):
- * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
- * cdef bint negative_step
- * cdef __Pyx_memviewslice src, dst
- */
- __pyx_v_new_ndim = 0;
- __pyx_v_suboffset_dim = -1;
-
- /* "View.MemoryView":680
- *
- *
- * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
- *
- * cdef _memoryviewslice memviewsliceobj
- */
- memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
-
- /* "View.MemoryView":684
- * cdef _memoryviewslice memviewsliceobj
- *
- * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
- *
- * if isinstance(memview, _memoryviewslice):
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "View.MemoryView":686
- * assert memview.view.ndim > 0
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * memviewsliceobj = memview
- * p_src = &memviewsliceobj.from_slice
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":687
- *
- * if isinstance(memview, _memoryviewslice):
- * memviewsliceobj = memview # <<<<<<<<<<<<<<
- * p_src = &memviewsliceobj.from_slice
- * else:
- */
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(((PyObject *)__pyx_v_memview));
- __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview);
-
- /* "View.MemoryView":688
- * if isinstance(memview, _memoryviewslice):
- * memviewsliceobj = memview
- * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
- * else:
- * slice_copy(memview, &src)
- */
- __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":690
- * p_src = &memviewsliceobj.from_slice
- * else:
- * slice_copy(memview, &src) # <<<<<<<<<<<<<<
- * p_src = &src
- *
- */
- __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
-
- /* "View.MemoryView":691
- * else:
- * slice_copy(memview, &src)
- * p_src = &src # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_p_src = (&__pyx_v_src);
- }
- __pyx_L3:;
-
- /* "View.MemoryView":697
- *
- *
- * dst.memview = p_src.memview # <<<<<<<<<<<<<<
- * dst.data = p_src.data
- *
- */
- __pyx_t_3 = __pyx_v_p_src->memview;
- __pyx_v_dst.memview = __pyx_t_3;
-
- /* "View.MemoryView":698
- *
- * dst.memview = p_src.memview
- * dst.data = p_src.data # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_4 = __pyx_v_p_src->data;
- __pyx_v_dst.data = __pyx_t_4;
-
- /* "View.MemoryView":703
- *
- *
- * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
- * cdef int *p_suboffset_dim = &suboffset_dim
- * cdef Py_ssize_t start, stop, step
- */
- __pyx_v_p_dst = (&__pyx_v_dst);
-
- /* "View.MemoryView":704
- *
- * cdef __Pyx_memviewslice *p_dst = &dst
- * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
- * cdef Py_ssize_t start, stop, step
- * cdef bint have_start, have_stop, have_step
- */
- __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
-
- /* "View.MemoryView":708
- * cdef bint have_start, have_stop, have_step
- *
- * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
- * if PyIndex_Check(index):
- * slice_memviewslice(
- */
- __pyx_t_5 = 0;
- if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) {
- __pyx_t_6 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- } else {
- __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) {
- if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) {
- if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_9 = __pyx_t_8(__pyx_t_6);
- if (unlikely(!__pyx_t_9)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[4]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF(__pyx_v_index);
- __pyx_v_index = __pyx_t_9;
- __pyx_t_9 = 0;
- __pyx_v_dim = __pyx_t_5;
- __pyx_t_5 = (__pyx_t_5 + 1);
-
- /* "View.MemoryView":709
- *
- * for dim, index in enumerate(indices):
- * if PyIndex_Check(index): # <<<<<<<<<<<<<<
- * slice_memviewslice(
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
- */
- __pyx_t_2 = (__Pyx_PyIndex_Check(__pyx_v_index) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":713
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
- * dim, new_ndim, p_suboffset_dim,
- * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
- * 0, 0, 0, # have_{start,stop,step}
- * False)
- */
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":715
- * index, 0, 0, # start, stop, step
- * 0, 0, 0, # have_{start,stop,step}
- * False) # <<<<<<<<<<<<<<
- * elif index is None:
- * p_dst.shape[new_ndim] = 1
- */
- __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 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
-
- /* "View.MemoryView":716
- * 0, 0, 0, # have_{start,stop,step}
- * False)
- * elif index is None: # <<<<<<<<<<<<<<
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0
- */
- __pyx_t_2 = (__pyx_v_index == Py_None);
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":717
- * False)
- * elif index is None:
- * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1
- */
- (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
-
- /* "View.MemoryView":718
- * elif index is None:
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
- * p_dst.suboffsets[new_ndim] = -1
- * new_ndim += 1
- */
- (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
-
- /* "View.MemoryView":719
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
- * new_ndim += 1
- * else:
- */
- (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1;
-
- /* "View.MemoryView":720
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1
- * new_ndim += 1 # <<<<<<<<<<<<<<
- * else:
- * start = index.start or 0
- */
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":722
- * new_ndim += 1
- * else:
- * start = index.start or 0 # <<<<<<<<<<<<<<
- * stop = index.stop or 0
- * step = index.step or 0
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_12 = __pyx_int_0;
- } else {
- __pyx_t_12 = __pyx_t_9;
- __pyx_t_9 = 0;
- }
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_start = __pyx_t_10;
-
- /* "View.MemoryView":723
- * else:
- * start = index.start or 0
- * stop = index.stop or 0 # <<<<<<<<<<<<<<
- * step = index.step or 0
- *
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_9 = __pyx_int_0;
- } else {
- __pyx_t_9 = __pyx_t_12;
- __pyx_t_12 = 0;
- }
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_stop = __pyx_t_10;
-
- /* "View.MemoryView":724
- * start = index.start or 0
- * stop = index.stop or 0
- * step = index.step or 0 # <<<<<<<<<<<<<<
- *
- * have_start = index.start is not None
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_12 = __pyx_int_0;
- } else {
- __pyx_t_12 = __pyx_t_9;
- __pyx_t_9 = 0;
- }
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_step = __pyx_t_10;
-
- /* "View.MemoryView":726
- * step = index.step or 0
- *
- * have_start = index.start is not None # <<<<<<<<<<<<<<
- * have_stop = index.stop is not None
- * have_step = index.step is not None
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = (__pyx_t_12 != Py_None);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_have_start = __pyx_t_1;
-
- /* "View.MemoryView":727
- *
- * have_start = index.start is not None
- * have_stop = index.stop is not None # <<<<<<<<<<<<<<
- * have_step = index.step is not None
- *
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = (__pyx_t_12 != Py_None);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_have_stop = __pyx_t_1;
-
- /* "View.MemoryView":728
- * have_start = index.start is not None
- * have_stop = index.stop is not None
- * have_step = index.step is not None # <<<<<<<<<<<<<<
- *
- * slice_memviewslice(
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__step); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = (__pyx_t_12 != Py_None);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_have_step = __pyx_t_1;
-
- /* "View.MemoryView":735
- * start, stop, step,
- * have_start, have_stop, have_step,
- * True) # <<<<<<<<<<<<<<
- * new_ndim += 1
- *
- */
- __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 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":736
- * have_start, have_stop, have_step,
- * True)
- * new_ndim += 1 # <<<<<<<<<<<<<<
- *
- * if isinstance(memview, _memoryviewslice):
- */
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
- }
- __pyx_L6:;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "View.MemoryView":738
- * new_ndim += 1
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func,
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":739
- *
- * if isinstance(memview, _memoryviewslice):
- * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
- * memviewsliceobj.to_object_func,
- * memviewsliceobj.to_dtype_func,
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
-
- /* "View.MemoryView":740
- * if isinstance(memview, _memoryviewslice):
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
- * memviewsliceobj.to_dtype_func,
- * memview.dtype_is_object)
- */
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[4]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-
- /* "View.MemoryView":742
- * memviewsliceobj.to_object_func,
- * memviewsliceobj.to_dtype_func,
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
- */
- __pyx_t_6 = __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_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_6);
- __pyx_t_6 = 0;
- goto __pyx_L0;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":744
- * memview.dtype_is_object)
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
- * memview.dtype_is_object)
- *
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
-
- /* "View.MemoryView":745
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_6);
- __pyx_t_6 = 0;
- goto __pyx_L0;
- }
- __pyx_L7:;
-
- __pyx_r = ((struct __pyx_memoryview_obj *)Py_None); __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
- __Pyx_XDECREF(__pyx_v_index);
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":769
- *
- * @cname('__pyx_memoryview_slice_memviewslice')
- * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *dst,
- * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
- */
-
-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) {
- Py_ssize_t __pyx_v_new_shape;
- int __pyx_v_negative_step;
- int __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":789
- * cdef bint negative_step
- *
- * if not is_slice: # <<<<<<<<<<<<<<
- *
- * if start < 0:
- */
- __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":791
- * if not is_slice:
- *
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if not 0 <= start < shape:
- */
- __pyx_t_1 = ((__pyx_v_start < 0) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":792
- *
- * if start < 0:
- * start += shape # <<<<<<<<<<<<<<
- * if not 0 <= start < shape:
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
- */
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":793
- * if start < 0:
- * start += shape
- * if not 0 <= start < shape: # <<<<<<<<<<<<<<
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
- * else:
- */
- __pyx_t_1 = (0 <= __pyx_v_start);
- if (__pyx_t_1) {
- __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
- }
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":794
- * start += shape
- * if not 0 <= start < shape:
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
- * else:
- *
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_46, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":797
- * else:
- *
- * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
- *
- * if have_step and step == 0:
- */
- __pyx_t_2 = (__pyx_v_have_step != 0);
- if (__pyx_t_2) {
- __pyx_t_1 = (__pyx_v_step < 0);
- __pyx_t_4 = __pyx_t_1;
- } else {
- __pyx_t_4 = __pyx_t_2;
- }
- __pyx_v_negative_step = __pyx_t_4;
-
- /* "View.MemoryView":799
- * negative_step = have_step != 0 and step < 0
- *
- * if have_step and step == 0: # <<<<<<<<<<<<<<
- * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
- *
- */
- if ((__pyx_v_have_step != 0)) {
- __pyx_t_4 = (__pyx_v_step == 0);
- __pyx_t_2 = __pyx_t_4;
- } else {
- __pyx_t_2 = (__pyx_v_have_step != 0);
- }
- if (__pyx_t_2) {
-
- /* "View.MemoryView":800
- *
- * if have_step and step == 0:
- * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_47, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":803
- *
- *
- * if have_start: # <<<<<<<<<<<<<<
- * if start < 0:
- * start += shape
- */
- __pyx_t_2 = (__pyx_v_have_start != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":804
- *
- * if have_start:
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if start < 0:
- */
- __pyx_t_2 = ((__pyx_v_start < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":805
- * if have_start:
- * if start < 0:
- * start += shape # <<<<<<<<<<<<<<
- * if start < 0:
- * start = 0
- */
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
-
- /* "View.MemoryView":806
- * if start < 0:
- * start += shape
- * if start < 0: # <<<<<<<<<<<<<<
- * start = 0
- * elif start >= shape:
- */
- __pyx_t_2 = ((__pyx_v_start < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":807
- * start += shape
- * if start < 0:
- * start = 0 # <<<<<<<<<<<<<<
- * elif start >= shape:
- * if negative_step:
- */
- __pyx_v_start = 0;
- goto __pyx_L9;
- }
- __pyx_L9:;
- goto __pyx_L8;
- }
-
- /* "View.MemoryView":808
- * if start < 0:
- * start = 0
- * elif start >= shape: # <<<<<<<<<<<<<<
- * if negative_step:
- * start = shape - 1
- */
- __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":809
- * start = 0
- * elif start >= shape:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- __pyx_t_2 = (__pyx_v_negative_step != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":810
- * elif start >= shape:
- * if negative_step:
- * start = shape - 1 # <<<<<<<<<<<<<<
- * else:
- * start = shape
- */
- __pyx_v_start = (__pyx_v_shape - 1);
- goto __pyx_L10;
- }
- /*else*/ {
-
- /* "View.MemoryView":812
- * start = shape - 1
- * else:
- * start = shape # <<<<<<<<<<<<<<
- * else:
- * if negative_step:
- */
- __pyx_v_start = __pyx_v_shape;
- }
- __pyx_L10:;
- goto __pyx_L8;
- }
- __pyx_L8:;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":814
- * start = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- __pyx_t_2 = (__pyx_v_negative_step != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":815
- * else:
- * if negative_step:
- * start = shape - 1 # <<<<<<<<<<<<<<
- * else:
- * start = 0
- */
- __pyx_v_start = (__pyx_v_shape - 1);
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "View.MemoryView":817
- * start = shape - 1
- * else:
- * start = 0 # <<<<<<<<<<<<<<
- *
- * if have_stop:
- */
- __pyx_v_start = 0;
- }
- __pyx_L11:;
- }
- __pyx_L7:;
-
- /* "View.MemoryView":819
- * start = 0
- *
- * if have_stop: # <<<<<<<<<<<<<<
- * if stop < 0:
- * stop += shape
- */
- __pyx_t_2 = (__pyx_v_have_stop != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":820
- *
- * if have_stop:
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop += shape
- * if stop < 0:
- */
- __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":821
- * if have_stop:
- * if stop < 0:
- * stop += shape # <<<<<<<<<<<<<<
- * if stop < 0:
- * stop = 0
- */
- __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
-
- /* "View.MemoryView":822
- * if stop < 0:
- * stop += shape
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop = 0
- * elif stop > shape:
- */
- __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":823
- * stop += shape
- * if stop < 0:
- * stop = 0 # <<<<<<<<<<<<<<
- * elif stop > shape:
- * stop = shape
- */
- __pyx_v_stop = 0;
- goto __pyx_L14;
- }
- __pyx_L14:;
- goto __pyx_L13;
- }
-
- /* "View.MemoryView":824
- * if stop < 0:
- * stop = 0
- * elif stop > shape: # <<<<<<<<<<<<<<
- * stop = shape
- * else:
- */
- __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":825
- * stop = 0
- * elif stop > shape:
- * stop = shape # <<<<<<<<<<<<<<
- * else:
- * if negative_step:
- */
- __pyx_v_stop = __pyx_v_shape;
- goto __pyx_L13;
- }
- __pyx_L13:;
- goto __pyx_L12;
- }
- /*else*/ {
-
- /* "View.MemoryView":827
- * stop = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * stop = -1
- * else:
- */
- __pyx_t_2 = (__pyx_v_negative_step != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":828
- * else:
- * if negative_step:
- * stop = -1 # <<<<<<<<<<<<<<
- * else:
- * stop = shape
- */
- __pyx_v_stop = -1;
- goto __pyx_L15;
- }
- /*else*/ {
-
- /* "View.MemoryView":830
- * stop = -1
- * else:
- * stop = shape # <<<<<<<<<<<<<<
- *
- * if not have_step:
- */
- __pyx_v_stop = __pyx_v_shape;
- }
- __pyx_L15:;
- }
- __pyx_L12:;
-
- /* "View.MemoryView":832
- * stop = shape
- *
- * if not have_step: # <<<<<<<<<<<<<<
- * step = 1
- *
- */
- __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":833
- *
- * if not have_step:
- * step = 1 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_step = 1;
- goto __pyx_L16;
- }
- __pyx_L16:;
-
- /* "View.MemoryView":837
- *
- * with cython.cdivision(True):
- * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
- *
- * if (stop - start) - step * new_shape:
- */
- __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
-
- /* "View.MemoryView":839
- * new_shape = (stop - start) // step
- *
- * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
- * new_shape += 1
- *
- */
- __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":840
- *
- * if (stop - start) - step * new_shape:
- * new_shape += 1 # <<<<<<<<<<<<<<
- *
- * if new_shape < 0:
- */
- __pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L17;
- }
- __pyx_L17:;
-
- /* "View.MemoryView":842
- * new_shape += 1
- *
- * if new_shape < 0: # <<<<<<<<<<<<<<
- * new_shape = 0
- *
- */
- __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":843
- *
- * if new_shape < 0:
- * new_shape = 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_new_shape = 0;
- goto __pyx_L18;
- }
- __pyx_L18:;
-
- /* "View.MemoryView":846
- *
- *
- * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
- * dst.shape[new_ndim] = new_shape
- * dst.suboffsets[new_ndim] = suboffset
- */
- (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
-
- /* "View.MemoryView":847
- *
- * dst.strides[new_ndim] = stride * step
- * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
- * dst.suboffsets[new_ndim] = suboffset
- *
- */
- (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
-
- /* "View.MemoryView":848
- * dst.strides[new_ndim] = stride * step
- * dst.shape[new_ndim] = new_shape
- * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
- *
- *
- */
- (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":851
- *
- *
- * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
- * dst.data += start * stride
- * else:
- */
- __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":852
- *
- * if suboffset_dim[0] < 0:
- * dst.data += start * stride # <<<<<<<<<<<<<<
- * else:
- * dst.suboffsets[suboffset_dim[0]] += start * stride
- */
- __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
- goto __pyx_L19;
- }
- /*else*/ {
-
- /* "View.MemoryView":854
- * dst.data += start * stride
- * else:
- * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
- *
- * if suboffset >= 0:
- */
- __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
- (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
- }
- __pyx_L19:;
-
- /* "View.MemoryView":856
- * dst.suboffsets[suboffset_dim[0]] += start * stride
- *
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * if not is_slice:
- * if new_ndim == 0:
- */
- __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":857
- *
- * if suboffset >= 0:
- * if not is_slice: # <<<<<<<<<<<<<<
- * if new_ndim == 0:
- * dst.data = (<char **> dst.data)[0] + suboffset
- */
- __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":858
- * if suboffset >= 0:
- * if not is_slice:
- * if new_ndim == 0: # <<<<<<<<<<<<<<
- * dst.data = (<char **> dst.data)[0] + suboffset
- * else:
- */
- __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":859
- * if not is_slice:
- * if new_ndim == 0:
- * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
- * else:
- * _err_dim(IndexError, "All dimensions preceding dimension %d "
- */
- __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
- goto __pyx_L22;
- }
- /*else*/ {
-
- /* "View.MemoryView":862
- * else:
- * _err_dim(IndexError, "All dimensions preceding dimension %d "
- * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
- * else:
- * suboffset_dim[0] = new_ndim
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_48, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L22:;
- goto __pyx_L21;
- }
- /*else*/ {
-
- /* "View.MemoryView":864
- * "must be indexed and not sliced", dim)
- * else:
- * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
- *
- * return 0
- */
- (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
- }
- __pyx_L21:;
- goto __pyx_L20;
- }
- __pyx_L20:;
-
- /* "View.MemoryView":866
- * suboffset_dim[0] = new_ndim
- *
- * return 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = -1;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":872
- *
- * @cname('__pyx_pybuffer_index')
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
- * int dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1
- */
-
-static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, int __pyx_v_dim) {
- Py_ssize_t __pyx_v_shape;
- Py_ssize_t __pyx_v_stride;
- Py_ssize_t __pyx_v_suboffset;
- Py_ssize_t __pyx_v_itemsize;
- char *__pyx_v_resultp;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("pybuffer_index", 0);
-
- /* "View.MemoryView":874
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
- * int dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
- * cdef Py_ssize_t itemsize = view.itemsize
- * cdef char *resultp
- */
- __pyx_v_suboffset = -1;
-
- /* "View.MemoryView":875
- * int dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1
- * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
- * cdef char *resultp
- *
- */
- __pyx_t_1 = __pyx_v_view->itemsize;
- __pyx_v_itemsize = __pyx_t_1;
-
- /* "View.MemoryView":878
- * cdef char *resultp
- *
- * if view.ndim == 0: # <<<<<<<<<<<<<<
- * shape = view.len / itemsize
- * stride = itemsize
- */
- __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":879
- *
- * if view.ndim == 0:
- * shape = view.len / itemsize # <<<<<<<<<<<<<<
- * stride = itemsize
- * else:
- */
- if (unlikely(__pyx_v_itemsize == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
-
- /* "View.MemoryView":880
- * if view.ndim == 0:
- * shape = view.len / itemsize
- * stride = itemsize # <<<<<<<<<<<<<<
- * else:
- * shape = view.shape[dim]
- */
- __pyx_v_stride = __pyx_v_itemsize;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":882
- * stride = itemsize
- * else:
- * shape = view.shape[dim] # <<<<<<<<<<<<<<
- * stride = view.strides[dim]
- * if view.suboffsets != NULL:
- */
- __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
-
- /* "View.MemoryView":883
- * else:
- * shape = view.shape[dim]
- * stride = view.strides[dim] # <<<<<<<<<<<<<<
- * if view.suboffsets != NULL:
- * suboffset = view.suboffsets[dim]
- */
- __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
-
- /* "View.MemoryView":884
- * shape = view.shape[dim]
- * stride = view.strides[dim]
- * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * suboffset = view.suboffsets[dim]
- *
- */
- __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":885
- * stride = view.strides[dim]
- * if view.suboffsets != NULL:
- * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
- *
- * if index < 0:
- */
- __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
- }
- __pyx_L4:;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":887
- * suboffset = view.suboffsets[dim]
- *
- * if index < 0: # <<<<<<<<<<<<<<
- * index += view.shape[dim]
- * if index < 0:
- */
- __pyx_t_2 = ((__pyx_v_index < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":888
- *
- * if index < 0:
- * index += view.shape[dim] # <<<<<<<<<<<<<<
- * if index < 0:
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- */
- __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
-
- /* "View.MemoryView":889
- * if index < 0:
- * index += view.shape[dim]
- * if index < 0: # <<<<<<<<<<<<<<
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- */
- __pyx_t_2 = ((__pyx_v_index < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":890
- * index += view.shape[dim]
- * if index < 0:
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
- *
- * if index >= shape:
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":892
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- * if index >= shape: # <<<<<<<<<<<<<<
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- */
- __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":893
- *
- * if index >= shape:
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
- *
- * resultp = bufp + index * stride
- */
- __pyx_t_4 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_49), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "View.MemoryView":895
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- * resultp = bufp + index * stride # <<<<<<<<<<<<<<
- * if suboffset >= 0:
- * resultp = (<char **> resultp)[0] + suboffset
- */
- __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
-
- /* "View.MemoryView":896
- *
- * resultp = bufp + index * stride
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * resultp = (<char **> resultp)[0] + suboffset
- *
- */
- __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":897
- * resultp = bufp + index * stride
- * if suboffset >= 0:
- * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
- *
- * return resultp
- */
- __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "View.MemoryView":899
- * resultp = (<char **> resultp)[0] + suboffset
- *
- * return resultp # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_resultp;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":905
- *
- * @cname('__pyx_memslice_transpose')
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
- * cdef int ndim = memslice.memview.view.ndim
- *
- */
-
-static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
- int __pyx_v_ndim;
- Py_ssize_t *__pyx_v_shape;
- Py_ssize_t *__pyx_v_strides;
- int __pyx_v_i;
- int __pyx_v_j;
- int __pyx_r;
- int __pyx_t_1;
- Py_ssize_t *__pyx_t_2;
- long __pyx_t_3;
- Py_ssize_t __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":906
- * @cname('__pyx_memslice_transpose')
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
- * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
- *
- * cdef Py_ssize_t *shape = memslice.shape
- */
- __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
- __pyx_v_ndim = __pyx_t_1;
-
- /* "View.MemoryView":908
- * cdef int ndim = memslice.memview.view.ndim
- *
- * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
- * cdef Py_ssize_t *strides = memslice.strides
- *
- */
- __pyx_t_2 = __pyx_v_memslice->shape;
- __pyx_v_shape = __pyx_t_2;
-
- /* "View.MemoryView":909
- *
- * cdef Py_ssize_t *shape = memslice.shape
- * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = __pyx_v_memslice->strides;
- __pyx_v_strides = __pyx_t_2;
-
- /* "View.MemoryView":913
- *
- * cdef int i, j
- * for i in range(ndim / 2): # <<<<<<<<<<<<<<
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i]
- */
- __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
- for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
- __pyx_v_i = __pyx_t_1;
-
- /* "View.MemoryView":914
- * cdef int i, j
- * for i in range(ndim / 2):
- * j = ndim - 1 - i # <<<<<<<<<<<<<<
- * strides[i], strides[j] = strides[j], strides[i]
- * shape[i], shape[j] = shape[j], shape[i]
- */
- __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
-
- /* "View.MemoryView":915
- * for i in range(ndim / 2):
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
- * shape[i], shape[j] = shape[j], shape[i]
- *
- */
- __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
- __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
- (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
- (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
-
- /* "View.MemoryView":916
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i]
- * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
- */
- __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
- __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
- (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
- (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
-
- /* "View.MemoryView":918
- * shape[i], shape[j] = shape[j], shape[i]
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
- *
- */
- __pyx_t_6 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
- if (!__pyx_t_6) {
- __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
- __pyx_t_8 = __pyx_t_7;
- } else {
- __pyx_t_8 = __pyx_t_6;
- }
- if (__pyx_t_8) {
-
- /* "View.MemoryView":919
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
- *
- * return 1
- */
- __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_50); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
- }
-
- /* "View.MemoryView":921
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
- *
- * return 1 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 1;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* Python wrapper */
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":938
- * cdef int (*to_dtype_func)(char *, object) except 0
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
- *
- */
-
-static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":939
- *
- * def __dealloc__(self):
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
- *
- * cdef convert_item_to_object(self, char *itemp):
- */
- __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":941
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * if self.to_object_func != NULL:
- * return self.to_object_func(itemp)
- */
-
-static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
-
- /* "View.MemoryView":942
- *
- * cdef convert_item_to_object(self, char *itemp):
- * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
- * return self.to_object_func(itemp)
- * else:
- */
- __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":943
- * cdef convert_item_to_object(self, char *itemp):
- * if self.to_object_func != NULL:
- * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
- * else:
- * return memoryview.convert_item_to_object(self, itemp)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":945
- * return self.to_object_func(itemp)
- * else:
- * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":947
- * return memoryview.convert_item_to_object(self, itemp)
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * if self.to_dtype_func != NULL:
- * self.to_dtype_func(itemp, value)
- */
-
-static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
-
- /* "View.MemoryView":948
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
- * self.to_dtype_func(itemp, value)
- * else:
- */
- __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":949
- * cdef assign_item_from_object(self, char *itemp, object value):
- * if self.to_dtype_func != NULL:
- * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
- * else:
- * memoryview.assign_item_from_object(self, itemp, value)
- */
- __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":951
- * self.to_dtype_func(itemp, value)
- * else:
- * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
- *
- * property base:
- */
- __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":955
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
- *
- */
-
-static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":956
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self):
- * return self.from_object # <<<<<<<<<<<<<<
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->from_object);
- __pyx_r = __pyx_v_self->from_object;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":962
- *
- * @cname('__pyx_memoryview_fromslice')
- * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
- * int ndim,
- * object (*to_object_func)(char *),
- */
-
-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) {
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_TypeInfo *__pyx_t_4;
- Py_buffer __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
-
- /* "View.MemoryView":971
- * cdef int i
- *
- * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
- * return None
- *
- */
- __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":972
- *
- * if <PyObject *> memviewslice.memview == Py_None:
- * return None # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_None);
- __pyx_r = Py_None;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":977
- *
- *
- * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
- *
- * result.from_slice = memviewslice
- */
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":979
- * result = _memoryviewslice(None, 0, dtype_is_object)
- *
- * result.from_slice = memviewslice # <<<<<<<<<<<<<<
- * __PYX_INC_MEMVIEW(&memviewslice, 1)
- *
- */
- __pyx_v_result->from_slice = __pyx_v_memviewslice;
-
- /* "View.MemoryView":980
- *
- * result.from_slice = memviewslice
- * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
- *
- * result.from_object = (<memoryview> memviewslice.memview).base
- */
- __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
-
- /* "View.MemoryView":982
- * __PYX_INC_MEMVIEW(&memviewslice, 1)
- *
- * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
- * result.typeinfo = memviewslice.memview.typeinfo
- *
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s__base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_v_result->from_object);
- __Pyx_DECREF(__pyx_v_result->from_object);
- __pyx_v_result->from_object = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":983
- *
- * result.from_object = (<memoryview> memviewslice.memview).base
- * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
- *
- * result.view = memviewslice.memview.view
- */
- __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
- __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
-
- /* "View.MemoryView":985
- * result.typeinfo = memviewslice.memview.typeinfo
- *
- * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
- * result.view.buf = <void *> memviewslice.data
- * result.view.ndim = ndim
- */
- __pyx_t_5 = __pyx_v_memviewslice.memview->view;
- __pyx_v_result->__pyx_base.view = __pyx_t_5;
-
- /* "View.MemoryView":986
- *
- * result.view = memviewslice.memview.view
- * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None
- */
- __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
-
- /* "View.MemoryView":987
- * result.view = memviewslice.memview.view
- * result.view.buf = <void *> memviewslice.data
- * result.view.ndim = ndim # <<<<<<<<<<<<<<
- * (<__pyx_buffer *> &result.view).obj = Py_None
- * Py_INCREF(Py_None)
- */
- __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
-
- /* "View.MemoryView":988
- * result.view.buf = <void *> memviewslice.data
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
-
- /* "View.MemoryView":989
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * result.flags = PyBUF_RECORDS
- */
- Py_INCREF(Py_None);
-
- /* "View.MemoryView":991
- * Py_INCREF(Py_None)
- *
- * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
- *
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape
- */
- __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
-
- /* "View.MemoryView":993
- * result.flags = PyBUF_RECORDS
- *
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
- * result.view.strides = <Py_ssize_t *> result.from_slice.strides
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
- */
- __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
-
- /* "View.MemoryView":994
- *
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape
- * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
- *
- */
- __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
-
- /* "View.MemoryView":995
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape
- * result.view.strides = <Py_ssize_t *> result.from_slice.strides
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
- *
- * result.view.len = result.view.itemsize
- */
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
-
- /* "View.MemoryView":997
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
- *
- * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
- */
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
-
- /* "View.MemoryView":998
- *
- * result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
- *
- */
- __pyx_t_7 = __pyx_v_ndim;
- for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "View.MemoryView":999
- * result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
- *
- * result.to_object_func = to_object_func
- */
- __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i]));
- }
-
- /* "View.MemoryView":1001
- * result.view.len *= result.view.shape[i]
- *
- * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
- * result.to_dtype_func = to_dtype_func
- *
- */
- __pyx_v_result->to_object_func = __pyx_v_to_object_func;
-
- /* "View.MemoryView":1002
- *
- * result.to_object_func = to_object_func
- * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
- *
- * return result
- */
- __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
-
- /* "View.MemoryView":1004
- * result.to_dtype_func = to_dtype_func
- *
- * return result # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_get_slice_from_memoryview')
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1007
- *
- * @cname('__pyx_memoryview_get_slice_from_memoryview')
- * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *mslice):
- * cdef _memoryviewslice obj
- */
-
-static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
- struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
- __Pyx_memviewslice *__pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
-
- /* "View.MemoryView":1010
- * __Pyx_memviewslice *mslice):
- * cdef _memoryviewslice obj
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * obj = memview
- * return &obj.from_slice
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1011
- * cdef _memoryviewslice obj
- * if isinstance(memview, _memoryviewslice):
- * obj = memview # <<<<<<<<<<<<<<
- * return &obj.from_slice
- * else:
- */
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(((PyObject *)__pyx_v_memview));
- __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview);
-
- /* "View.MemoryView":1012
- * if isinstance(memview, _memoryviewslice):
- * obj = memview
- * return &obj.from_slice # <<<<<<<<<<<<<<
- * else:
- * slice_copy(memview, mslice)
- */
- __pyx_r = (&__pyx_v_obj->from_slice);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1014
- * return &obj.from_slice
- * else:
- * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
- * return mslice
- *
- */
- __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
-
- /* "View.MemoryView":1015
- * else:
- * slice_copy(memview, mslice)
- * return mslice # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_slice_copy')
- */
- __pyx_r = __pyx_v_mslice;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_obj);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1018
- *
- * @cname('__pyx_memoryview_slice_copy')
- * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
- * cdef int dim
- * cdef Py_ssize_t *shape, *strides, *suboffsets
- */
-
-static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
- int __pyx_v_dim;
- Py_ssize_t *__pyx_v_shape;
- Py_ssize_t *__pyx_v_strides;
- Py_ssize_t *__pyx_v_suboffsets;
- __Pyx_RefNannyDeclarations
- Py_ssize_t *__pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- __Pyx_RefNannySetupContext("slice_copy", 0);
-
- /* "View.MemoryView":1022
- * cdef Py_ssize_t *shape, *strides, *suboffsets
- *
- * shape = memview.view.shape # <<<<<<<<<<<<<<
- * strides = memview.view.strides
- * suboffsets = memview.view.suboffsets
- */
- __pyx_t_1 = __pyx_v_memview->view.shape;
- __pyx_v_shape = __pyx_t_1;
-
- /* "View.MemoryView":1023
- *
- * shape = memview.view.shape
- * strides = memview.view.strides # <<<<<<<<<<<<<<
- * suboffsets = memview.view.suboffsets
- *
- */
- __pyx_t_1 = __pyx_v_memview->view.strides;
- __pyx_v_strides = __pyx_t_1;
-
- /* "View.MemoryView":1024
- * shape = memview.view.shape
- * strides = memview.view.strides
- * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
- *
- * dst.memview = <__pyx_memoryview *> memview
- */
- __pyx_t_1 = __pyx_v_memview->view.suboffsets;
- __pyx_v_suboffsets = __pyx_t_1;
-
- /* "View.MemoryView":1026
- * suboffsets = memview.view.suboffsets
- *
- * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
- * dst.data = <char *> memview.view.buf
- *
- */
- __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
-
- /* "View.MemoryView":1027
- *
- * dst.memview = <__pyx_memoryview *> memview
- * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
- *
- * for dim in range(memview.view.ndim):
- */
- __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
-
- /* "View.MemoryView":1029
- * dst.data = <char *> memview.view.buf
- *
- * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
- * dst.shape[dim] = shape[dim]
- * dst.strides[dim] = strides[dim]
- */
- __pyx_t_2 = __pyx_v_memview->view.ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_dim = __pyx_t_3;
-
- /* "View.MemoryView":1030
- *
- * for dim in range(memview.view.ndim):
- * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
- * dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
- */
- (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
-
- /* "View.MemoryView":1031
- * for dim in range(memview.view.ndim):
- * dst.shape[dim] = shape[dim]
- * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
- */
- (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
-
- /* "View.MemoryView":1032
- * dst.shape[dim] = shape[dim]
- * dst.strides[dim] = strides[dim]
- * if suboffsets == NULL: # <<<<<<<<<<<<<<
- * dst.suboffsets[dim] = -1
- * else:
- */
- __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0);
- if (__pyx_t_4) {
-
- /* "View.MemoryView":1033
- * dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<<
- * else:
- * dst.suboffsets[dim] = suboffsets[dim]
- */
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":1035
- * dst.suboffsets[dim] = -1
- * else:
- * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_object')
- */
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
- }
- __pyx_L5:;
- }
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":1038
- *
- * @cname('__pyx_memoryview_copy_object')
- * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
- * "Create a new memoryview object"
- * cdef __Pyx_memviewslice memviewslice
- */
-
-static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
- __Pyx_memviewslice __pyx_v_memviewslice;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_copy", 0);
-
- /* "View.MemoryView":1041
- * "Create a new memoryview object"
- * cdef __Pyx_memviewslice memviewslice
- * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
- * return memoryview_copy_from_slice(memview, &memviewslice)
- *
- */
- __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
-
- /* "View.MemoryView":1042
- * cdef __Pyx_memviewslice memviewslice
- * slice_copy(memview, &memviewslice)
- * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_object_from_slice')
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1045
- *
- * @cname('__pyx_memoryview_copy_object_from_slice')
- * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
- * """
- * Create a new memoryview object from a given memoryview object and slice.
- */
-
-static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
- PyObject *(*__pyx_v_to_object_func)(char *);
- int (*__pyx_v_to_dtype_func)(char *, PyObject *);
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *(*__pyx_t_3)(char *);
- int (*__pyx_t_4)(char *, PyObject *);
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
-
- /* "View.MemoryView":1052
- * cdef int (*to_dtype_func)(char *, object) except 0
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * to_object_func = (<_memoryviewslice> memview).to_object_func
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1053
- *
- * if isinstance(memview, _memoryviewslice):
- * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
- * else:
- */
- __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
- __pyx_v_to_object_func = __pyx_t_3;
-
- /* "View.MemoryView":1054
- * if isinstance(memview, _memoryviewslice):
- * to_object_func = (<_memoryviewslice> memview).to_object_func
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
- * else:
- * to_object_func = NULL
- */
- __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
- __pyx_v_to_dtype_func = __pyx_t_4;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1056
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
- * else:
- * to_object_func = NULL # <<<<<<<<<<<<<<
- * to_dtype_func = NULL
- *
- */
- __pyx_v_to_object_func = NULL;
-
- /* "View.MemoryView":1057
- * else:
- * to_object_func = NULL
- * to_dtype_func = NULL # <<<<<<<<<<<<<<
- *
- * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
- */
- __pyx_v_to_dtype_func = NULL;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1059
- * to_dtype_func = NULL
- *
- * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
- * to_object_func, to_dtype_func,
- * memview.dtype_is_object)
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "View.MemoryView":1061
- * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
- * to_object_func, to_dtype_func,
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
- *
- *
- */
- __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_filename = __pyx_f[4]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1067
- *
- *
- * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
- * if arg < 0:
- * return -arg
- */
-
-static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
- Py_ssize_t __pyx_r;
- int __pyx_t_1;
-
- /* "View.MemoryView":1068
- *
- * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
- * if arg < 0: # <<<<<<<<<<<<<<
- * return -arg
- * else:
- */
- __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1069
- * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
- * if arg < 0:
- * return -arg # <<<<<<<<<<<<<<
- * else:
- * return arg
- */
- __pyx_r = (-__pyx_v_arg);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1071
- * return -arg
- * else:
- * return arg # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_get_best_slice_order')
- */
- __pyx_r = __pyx_v_arg;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1074
- *
- * @cname('__pyx_get_best_slice_order')
- * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
- * """
- * Figure out the best memory access order for a given slice.
- */
-
-static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
- int __pyx_v_i;
- Py_ssize_t __pyx_v_c_stride;
- Py_ssize_t __pyx_v_f_stride;
- char __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
-
- /* "View.MemoryView":1079
- * """
- * cdef int i
- * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
- * cdef Py_ssize_t f_stride = 0
- *
- */
- __pyx_v_c_stride = 0;
-
- /* "View.MemoryView":1080
- * cdef int i
- * cdef Py_ssize_t c_stride = 0
- * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
- *
- * for i in range(ndim - 1, -1, -1):
- */
- __pyx_v_f_stride = 0;
-
- /* "View.MemoryView":1082
- * cdef Py_ssize_t f_stride = 0
- *
- * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
- * if mslice.shape[i] > 1:
- * c_stride = mslice.strides[i]
- */
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
- __pyx_v_i = __pyx_t_1;
-
- /* "View.MemoryView":1083
- *
- * for i in range(ndim - 1, -1, -1):
- * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
- * c_stride = mslice.strides[i]
- * break
- */
- __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1084
- * for i in range(ndim - 1, -1, -1):
- * if mslice.shape[i] > 1:
- * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
- * break
- *
- */
- __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
-
- /* "View.MemoryView":1085
- * if mslice.shape[i] > 1:
- * c_stride = mslice.strides[i]
- * break # <<<<<<<<<<<<<<
- *
- * for i in range(ndim):
- */
- goto __pyx_L4_break;
- goto __pyx_L5;
- }
- __pyx_L5:;
- }
- __pyx_L4_break:;
-
- /* "View.MemoryView":1087
- * break
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if mslice.shape[i] > 1:
- * f_stride = mslice.strides[i]
- */
- __pyx_t_1 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1088
- *
- * for i in range(ndim):
- * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
- * f_stride = mslice.strides[i]
- * break
- */
- __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1089
- * for i in range(ndim):
- * if mslice.shape[i] > 1:
- * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
- * break
- *
- */
- __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
-
- /* "View.MemoryView":1090
- * if mslice.shape[i] > 1:
- * f_stride = mslice.strides[i]
- * break # <<<<<<<<<<<<<<
- *
- * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
- */
- goto __pyx_L7_break;
- goto __pyx_L8;
- }
- __pyx_L8:;
- }
- __pyx_L7_break:;
-
- /* "View.MemoryView":1092
- * break
- *
- * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
- * return 'C'
- * else:
- */
- __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1093
- *
- * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
- * return 'C' # <<<<<<<<<<<<<<
- * else:
- * return 'F'
- */
- __pyx_r = 'C';
- goto __pyx_L0;
- goto __pyx_L9;
- }
- /*else*/ {
-
- /* "View.MemoryView":1095
- * return 'C'
- * else:
- * return 'F' # <<<<<<<<<<<<<<
- *
- * @cython.cdivision(True)
- */
- __pyx_r = 'F';
- goto __pyx_L0;
- }
- __pyx_L9:;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1098
- *
- * @cython.cdivision(True)
- * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
- * char *dst_data, Py_ssize_t *dst_strides,
- * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
- */
-
-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) {
- CYTHON_UNUSED Py_ssize_t __pyx_v_i;
- CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
- Py_ssize_t __pyx_v_dst_extent;
- Py_ssize_t __pyx_v_src_stride;
- Py_ssize_t __pyx_v_dst_stride;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- Py_ssize_t __pyx_t_6;
-
- /* "View.MemoryView":1105
- *
- * cdef Py_ssize_t i
- * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dst_extent = dst_shape[0]
- * cdef Py_ssize_t src_stride = src_strides[0]
- */
- __pyx_v_src_extent = (__pyx_v_src_shape[0]);
-
- /* "View.MemoryView":1106
- * cdef Py_ssize_t i
- * cdef Py_ssize_t src_extent = src_shape[0]
- * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t src_stride = src_strides[0]
- * cdef Py_ssize_t dst_stride = dst_strides[0]
- */
- __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
-
- /* "View.MemoryView":1107
- * cdef Py_ssize_t src_extent = src_shape[0]
- * cdef Py_ssize_t dst_extent = dst_shape[0]
- * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dst_stride = dst_strides[0]
- *
- */
- __pyx_v_src_stride = (__pyx_v_src_strides[0]);
-
- /* "View.MemoryView":1108
- * cdef Py_ssize_t dst_extent = dst_shape[0]
- * cdef Py_ssize_t src_stride = src_strides[0]
- * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
- *
- * if ndim == 1:
- */
- __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
-
- /* "View.MemoryView":1110
- * cdef Py_ssize_t dst_stride = dst_strides[0]
- *
- * if ndim == 1: # <<<<<<<<<<<<<<
- * if (src_stride > 0 and dst_stride > 0 and
- * <size_t> src_stride == itemsize == <size_t> dst_stride):
- */
- __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1111
- *
- * if ndim == 1:
- * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
- * <size_t> src_stride == itemsize == <size_t> dst_stride):
- * memcpy(dst_data, src_data, itemsize * dst_extent)
- */
- __pyx_t_1 = ((__pyx_v_src_stride > 0) != 0);
- if (__pyx_t_1) {
- __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1112
- * if ndim == 1:
- * if (src_stride > 0 and dst_stride > 0 and
- * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
- * memcpy(dst_data, src_data, itemsize * dst_extent)
- * else:
- */
- __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
- if (__pyx_t_3) {
- __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
- }
- __pyx_t_4 = (__pyx_t_3 != 0);
- } else {
- __pyx_t_4 = __pyx_t_2;
- }
- __pyx_t_2 = __pyx_t_4;
- } else {
- __pyx_t_2 = __pyx_t_1;
- }
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1113
- * if (src_stride > 0 and dst_stride > 0 and
- * <size_t> src_stride == itemsize == <size_t> dst_stride):
- * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
- * else:
- * for i in range(dst_extent):
- */
- memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "View.MemoryView":1115
- * memcpy(dst_data, src_data, itemsize * dst_extent)
- * else:
- * for i in range(dst_extent): # <<<<<<<<<<<<<<
- * memcpy(dst_data, src_data, itemsize)
- * src_data += src_stride
- */
- __pyx_t_5 = __pyx_v_dst_extent;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_i = __pyx_t_6;
-
- /* "View.MemoryView":1116
- * else:
- * for i in range(dst_extent):
- * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
- * src_data += src_stride
- * dst_data += dst_stride
- */
- memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
-
- /* "View.MemoryView":1117
- * for i in range(dst_extent):
- * memcpy(dst_data, src_data, itemsize)
- * src_data += src_stride # <<<<<<<<<<<<<<
- * dst_data += dst_stride
- * else:
- */
- __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
-
- /* "View.MemoryView":1118
- * memcpy(dst_data, src_data, itemsize)
- * src_data += src_stride
- * dst_data += dst_stride # <<<<<<<<<<<<<<
- * else:
- * for i in range(dst_extent):
- */
- __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
- }
- }
- __pyx_L4:;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1120
- * dst_data += dst_stride
- * else:
- * for i in range(dst_extent): # <<<<<<<<<<<<<<
- * _copy_strided_to_strided(src_data, src_strides + 1,
- * dst_data, dst_strides + 1,
- */
- __pyx_t_5 = __pyx_v_dst_extent;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_i = __pyx_t_6;
-
- /* "View.MemoryView":1124
- * dst_data, dst_strides + 1,
- * src_shape + 1, dst_shape + 1,
- * ndim - 1, itemsize) # <<<<<<<<<<<<<<
- * src_data += src_stride
- * dst_data += dst_stride
- */
- _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);
-
- /* "View.MemoryView":1125
- * src_shape + 1, dst_shape + 1,
- * ndim - 1, itemsize)
- * src_data += src_stride # <<<<<<<<<<<<<<
- * dst_data += dst_stride
- *
- */
- __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
-
- /* "View.MemoryView":1126
- * ndim - 1, itemsize)
- * src_data += src_stride
- * dst_data += dst_stride # <<<<<<<<<<<<<<
- *
- * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
- */
- __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
- }
- }
- __pyx_L3:;
-
-}
-
-/* "View.MemoryView":1128
- * dst_data += dst_stride
- *
- * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *dst,
- * int ndim, size_t itemsize) nogil:
- */
-
-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) {
-
- /* "View.MemoryView":1132
- * int ndim, size_t itemsize) nogil:
- * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,
- * src.shape, dst.shape, ndim, itemsize) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_slice_get_size')
- */
- _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);
-
-}
-
-/* "View.MemoryView":1135
- *
- * @cname('__pyx_memoryview_slice_get_size')
- * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
- * "Return the size of the memory occupied by the slice in number of bytes"
- * cdef int i
- */
-
-static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
- int __pyx_v_i;
- Py_ssize_t __pyx_v_size;
- Py_ssize_t __pyx_r;
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
-
- /* "View.MemoryView":1138
- * "Return the size of the memory occupied by the slice in number of bytes"
- * cdef int i
- * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
- *
- * for i in range(ndim):
- */
- __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
- __pyx_v_size = __pyx_t_1;
-
- /* "View.MemoryView":1140
- * cdef Py_ssize_t size = src.memview.view.itemsize
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * size *= src.shape[i]
- *
- */
- __pyx_t_2 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1141
- *
- * for i in range(ndim):
- * size *= src.shape[i] # <<<<<<<<<<<<<<
- *
- * return size
- */
- __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
- }
-
- /* "View.MemoryView":1143
- * size *= src.shape[i]
- *
- * return size # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_fill_contig_strides_array')
- */
- __pyx_r = __pyx_v_size;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1146
- *
- * @cname('__pyx_fill_contig_strides_array')
- * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
- * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
- * int ndim, char order) nogil:
- */
-
-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) {
- int __pyx_v_idx;
- Py_ssize_t __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
-
- /* "View.MemoryView":1155
- * cdef int idx
- *
- * if order == 'F': # <<<<<<<<<<<<<<
- * for idx in range(ndim):
- * strides[idx] = stride
- */
- __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1156
- *
- * if order == 'F':
- * for idx in range(ndim): # <<<<<<<<<<<<<<
- * strides[idx] = stride
- * stride = stride * shape[idx]
- */
- __pyx_t_2 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_idx = __pyx_t_3;
-
- /* "View.MemoryView":1157
- * if order == 'F':
- * for idx in range(ndim):
- * strides[idx] = stride # <<<<<<<<<<<<<<
- * stride = stride * shape[idx]
- * else:
- */
- (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
-
- /* "View.MemoryView":1158
- * for idx in range(ndim):
- * strides[idx] = stride
- * stride = stride * shape[idx] # <<<<<<<<<<<<<<
- * else:
- * for idx in range(ndim - 1, -1, -1):
- */
- __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1160
- * stride = stride * shape[idx]
- * else:
- * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
- * strides[idx] = stride
- * stride = stride * shape[idx]
- */
- for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
- __pyx_v_idx = __pyx_t_2;
-
- /* "View.MemoryView":1161
- * else:
- * for idx in range(ndim - 1, -1, -1):
- * strides[idx] = stride # <<<<<<<<<<<<<<
- * stride = stride * shape[idx]
- *
- */
- (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
-
- /* "View.MemoryView":1162
- * for idx in range(ndim - 1, -1, -1):
- * strides[idx] = stride
- * stride = stride * shape[idx] # <<<<<<<<<<<<<<
- *
- * return stride
- */
- __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
- }
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1164
- * stride = stride * shape[idx]
- *
- * return stride # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_data_to_temp')
- */
- __pyx_r = __pyx_v_stride;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1167
- *
- * @cname('__pyx_memoryview_copy_data_to_temp')
- * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *tmpslice,
- * char order,
- */
-
-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) {
- int __pyx_v_i;
- void *__pyx_v_result;
- size_t __pyx_v_itemsize;
- size_t __pyx_v_size;
- void *__pyx_r;
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- struct __pyx_memoryview_obj *__pyx_t_4;
- int __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":1178
- * cdef void *result
- *
- * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
- * cdef size_t size = slice_get_size(src, ndim)
- *
- */
- __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
- __pyx_v_itemsize = __pyx_t_1;
-
- /* "View.MemoryView":1179
- *
- * cdef size_t itemsize = src.memview.view.itemsize
- * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
- *
- * result = malloc(size)
- */
- __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
-
- /* "View.MemoryView":1181
- * cdef size_t size = slice_get_size(src, ndim)
- *
- * result = malloc(size) # <<<<<<<<<<<<<<
- * if not result:
- * _err(MemoryError, NULL)
- */
- __pyx_v_result = malloc(__pyx_v_size);
-
- /* "View.MemoryView":1182
- *
- * result = malloc(size)
- * if not result: # <<<<<<<<<<<<<<
- * _err(MemoryError, NULL)
- *
- */
- __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1183
- * result = malloc(size)
- * if not result:
- * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1186
- *
- *
- * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
- * tmpslice.memview = src.memview
- * for i in range(ndim):
- */
- __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
-
- /* "View.MemoryView":1187
- *
- * tmpslice.data = <char *> result
- * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * tmpslice.shape[i] = src.shape[i]
- */
- __pyx_t_4 = __pyx_v_src->memview;
- __pyx_v_tmpslice->memview = __pyx_t_4;
-
- /* "View.MemoryView":1188
- * tmpslice.data = <char *> result
- * tmpslice.memview = src.memview
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * tmpslice.shape[i] = src.shape[i]
- * tmpslice.suboffsets[i] = -1
- */
- __pyx_t_3 = __pyx_v_ndim;
- for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
- __pyx_v_i = __pyx_t_5;
-
- /* "View.MemoryView":1189
- * tmpslice.memview = src.memview
- * for i in range(ndim):
- * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
- * tmpslice.suboffsets[i] = -1
- *
- */
- (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
-
- /* "View.MemoryView":1190
- * for i in range(ndim):
- * tmpslice.shape[i] = src.shape[i]
- * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
- *
- * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
- */
- (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1;
- }
-
- /* "View.MemoryView":1193
- *
- * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
- * ndim, order) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);
-
- /* "View.MemoryView":1196
- *
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if tmpslice.shape[i] == 1:
- * tmpslice.strides[i] = 0
- */
- __pyx_t_3 = __pyx_v_ndim;
- for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
- __pyx_v_i = __pyx_t_5;
-
- /* "View.MemoryView":1197
- *
- * for i in range(ndim):
- * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
- * tmpslice.strides[i] = 0
- *
- */
- __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1198
- * for i in range(ndim):
- * if tmpslice.shape[i] == 1:
- * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
- *
- * if slice_is_contig(src, order, ndim):
- */
- (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
- }
- __pyx_L8:;
- }
-
- /* "View.MemoryView":1200
- * tmpslice.strides[i] = 0
- *
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
- * memcpy(result, src.data, size)
- * else:
- */
- __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1201
- *
- * if slice_is_contig(src, order, ndim):
- * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
- * else:
- * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
- */
- memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);
- goto __pyx_L9;
- }
- /*else*/ {
-
- /* "View.MemoryView":1203
- * memcpy(result, src.data, size)
- * else:
- * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
- *
- * return result
- */
- copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
- }
- __pyx_L9:;
-
- /* "View.MemoryView":1205
- * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
- *
- * return result # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = NULL;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1210
- *
- * @cname('__pyx_memoryview_err_extents')
- * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
- * Py_ssize_t extent2) except -1 with gil:
- * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
- */
-
-static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("_err_extents", 0);
-
- /* "View.MemoryView":1213
- * Py_ssize_t extent2) except -1 with gil:
- * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
- * (i, extent1, extent2)) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_err_dim')
- */
- __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_51), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- return __pyx_r;
-}
-
-/* "View.MemoryView":1216
- *
- * @cname('__pyx_memoryview_err_dim')
- * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
- * raise error(msg.decode('ascii') % dim)
- *
- */
-
-static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("_err_dim", 0);
- __Pyx_INCREF(__pyx_v_error);
-
- /* "View.MemoryView":1217
- * @cname('__pyx_memoryview_err_dim')
- * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
- * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_err')
- */
- __pyx_t_1 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_t_1), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_v_error, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_error);
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- return __pyx_r;
-}
-
-/* "View.MemoryView":1220
- *
- * @cname('__pyx_memoryview_err')
- * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
- * if msg != NULL:
- * raise error(msg.decode('ascii'))
- */
-
-static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("_err", 0);
- __Pyx_INCREF(__pyx_v_error);
-
- /* "View.MemoryView":1221
- * @cname('__pyx_memoryview_err')
- * cdef int _err(object error, char *msg) except -1 with gil:
- * if msg != NULL: # <<<<<<<<<<<<<<
- * raise error(msg.decode('ascii'))
- * else:
- */
- __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1222
- * cdef int _err(object error, char *msg) except -1 with gil:
- * if msg != NULL:
- * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
- * else:
- * raise error
- */
- __pyx_t_2 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_v_error, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1224
- * raise error(msg.decode('ascii'))
- * else:
- * raise error # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_contents')
- */
- __Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L3:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_error);
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- return __pyx_r;
-}
-
-/* "View.MemoryView":1227
- *
- * @cname('__pyx_memoryview_copy_contents')
- * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice dst,
- * int src_ndim, int dst_ndim,
- */
-
-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) {
- void *__pyx_v_tmpdata;
- size_t __pyx_v_itemsize;
- int __pyx_v_i;
- char __pyx_v_order;
- int __pyx_v_broadcasting;
- int __pyx_v_direct_copy;
- __Pyx_memviewslice __pyx_v_tmp;
- int __pyx_v_ndim;
- int __pyx_r;
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- int __pyx_t_5;
- void *__pyx_t_6;
- int __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":1235
- * Check for overlapping memory and verify the shapes.
- * """
- * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
- * cdef size_t itemsize = src.memview.view.itemsize
- * cdef int i
- */
- __pyx_v_tmpdata = NULL;
-
- /* "View.MemoryView":1236
- * """
- * cdef void *tmpdata = NULL
- * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
- * cdef int i
- * cdef char order = get_best_order(&src, src_ndim)
- */
- __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
- __pyx_v_itemsize = __pyx_t_1;
-
- /* "View.MemoryView":1238
- * cdef size_t itemsize = src.memview.view.itemsize
- * cdef int i
- * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
- * cdef bint broadcasting = False
- * cdef bint direct_copy = False
- */
- __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
-
- /* "View.MemoryView":1239
- * cdef int i
- * cdef char order = get_best_order(&src, src_ndim)
- * cdef bint broadcasting = False # <<<<<<<<<<<<<<
- * cdef bint direct_copy = False
- * cdef __Pyx_memviewslice tmp
- */
- __pyx_v_broadcasting = 0;
-
- /* "View.MemoryView":1240
- * cdef char order = get_best_order(&src, src_ndim)
- * cdef bint broadcasting = False
- * cdef bint direct_copy = False # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice tmp
- *
- */
- __pyx_v_direct_copy = 0;
-
- /* "View.MemoryView":1243
- * cdef __Pyx_memviewslice tmp
- *
- * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
- * broadcast_leading(&src, src_ndim, dst_ndim)
- * elif dst_ndim < src_ndim:
- */
- __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1244
- *
- * if src_ndim < dst_ndim:
- * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
- * elif dst_ndim < src_ndim:
- * broadcast_leading(&dst, dst_ndim, src_ndim)
- */
- __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":1245
- * if src_ndim < dst_ndim:
- * broadcast_leading(&src, src_ndim, dst_ndim)
- * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
- * broadcast_leading(&dst, dst_ndim, src_ndim)
- *
- */
- __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1246
- * broadcast_leading(&src, src_ndim, dst_ndim)
- * elif dst_ndim < src_ndim:
- * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
- *
- * cdef int ndim = max(src_ndim, dst_ndim)
- */
- __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1248
- * broadcast_leading(&dst, dst_ndim, src_ndim)
- *
- * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
- *
- * for i in range(ndim):
- */
- __pyx_t_3 = __pyx_v_dst_ndim;
- __pyx_t_4 = __pyx_v_src_ndim;
- if (((__pyx_t_3 > __pyx_t_4) != 0)) {
- __pyx_t_5 = __pyx_t_3;
- } else {
- __pyx_t_5 = __pyx_t_4;
- }
- __pyx_v_ndim = __pyx_t_5;
-
- /* "View.MemoryView":1250
- * cdef int ndim = max(src_ndim, dst_ndim)
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if src.shape[i] != dst.shape[i]:
- * if src.shape[i] == 1:
- */
- __pyx_t_5 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1251
- *
- * for i in range(ndim):
- * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
- * if src.shape[i] == 1:
- * broadcasting = True
- */
- __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1252
- * for i in range(ndim):
- * if src.shape[i] != dst.shape[i]:
- * if src.shape[i] == 1: # <<<<<<<<<<<<<<
- * broadcasting = True
- * src.strides[i] = 0
- */
- __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1253
- * if src.shape[i] != dst.shape[i]:
- * if src.shape[i] == 1:
- * broadcasting = True # <<<<<<<<<<<<<<
- * src.strides[i] = 0
- * else:
- */
- __pyx_v_broadcasting = 1;
-
- /* "View.MemoryView":1254
- * if src.shape[i] == 1:
- * broadcasting = True
- * src.strides[i] = 0 # <<<<<<<<<<<<<<
- * else:
- * _err_extents(i, dst.shape[i], src.shape[i])
- */
- (__pyx_v_src.strides[__pyx_v_i]) = 0;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":1256
- * src.strides[i] = 0
- * else:
- * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
- *
- * if src.suboffsets[i] >= 0:
- */
- __pyx_t_4 = __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_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L7:;
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":1258
- * _err_extents(i, dst.shape[i], src.shape[i])
- *
- * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
- * _err_dim(ValueError, "Dimension %d is not direct", i)
- *
- */
- __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1259
- *
- * if src.suboffsets[i] >= 0:
- * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
- *
- * if slices_overlap(&src, &dst, ndim, itemsize):
- */
- __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_52, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
- }
-
- /* "View.MemoryView":1261
- * _err_dim(ValueError, "Dimension %d is not direct", i)
- *
- * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
- *
- * if not slice_is_contig(&src, order, ndim):
- */
- __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1263
- * if slices_overlap(&src, &dst, ndim, itemsize):
- *
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
- * order = get_best_order(&dst, ndim)
- *
- */
- __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1264
- *
- * if not slice_is_contig(&src, order, ndim):
- * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
- *
- * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
- */
- __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
- goto __pyx_L10;
- }
- __pyx_L10:;
-
- /* "View.MemoryView":1266
- * order = get_best_order(&dst, ndim)
- *
- * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
- * src = tmp
- *
- */
- __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_tmpdata = __pyx_t_6;
-
- /* "View.MemoryView":1267
- *
- * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
- * src = tmp # <<<<<<<<<<<<<<
- *
- * if not broadcasting:
- */
- __pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "View.MemoryView":1269
- * src = tmp
- *
- * if not broadcasting: # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1272
- *
- *
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
- */
- __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1273
- *
- * if slice_is_contig(&src, 'C', ndim):
- * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<<
- * elif slice_is_contig(&src, 'F', ndim):
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
- */
- __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
- goto __pyx_L12;
- }
-
- /* "View.MemoryView":1274
- * if slice_is_contig(&src, 'C', ndim):
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
- *
- */
- __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1275
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
- * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<<
- *
- * if direct_copy:
- */
- __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim);
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "View.MemoryView":1277
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
- *
- * if direct_copy: # <<<<<<<<<<<<<<
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- */
- __pyx_t_2 = (__pyx_v_direct_copy != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1279
- * if direct_copy:
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
-
- /* "View.MemoryView":1280
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- * return 0
- */
- memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
-
- /* "View.MemoryView":1281
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
- * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
- * return 0
- *
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
-
- /* "View.MemoryView":1282
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- * return 0 # <<<<<<<<<<<<<<
- *
- * if order == 'F' == get_best_order(&dst, ndim):
- */
- __pyx_r = 0;
- goto __pyx_L0;
- goto __pyx_L13;
- }
- __pyx_L13:;
- goto __pyx_L11;
- }
- __pyx_L11:;
-
- /* "View.MemoryView":1284
- * return 0
- *
- * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = (__pyx_v_order == 'F');
- if (__pyx_t_2) {
- __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
- }
- __pyx_t_7 = (__pyx_t_2 != 0);
- if (__pyx_t_7) {
-
- /* "View.MemoryView":1287
- *
- *
- * transpose_memslice(&src) # <<<<<<<<<<<<<<
- * transpose_memslice(&dst)
- *
- */
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":1288
- *
- * transpose_memslice(&src)
- * transpose_memslice(&dst) # <<<<<<<<<<<<<<
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- */
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
- }
- __pyx_L14:;
-
- /* "View.MemoryView":1290
- * transpose_memslice(&dst)
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
- * copy_strided_to_strided(&src, &dst, ndim, itemsize)
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
-
- /* "View.MemoryView":1291
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- *
- */
- copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
-
- /* "View.MemoryView":1292
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * copy_strided_to_strided(&src, &dst, ndim, itemsize)
- * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
- *
- * free(tmpdata)
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
-
- /* "View.MemoryView":1294
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- *
- * free(tmpdata) # <<<<<<<<<<<<<<
- * return 0
- *
- */
- free(__pyx_v_tmpdata);
-
- /* "View.MemoryView":1295
- *
- * free(tmpdata)
- * return 0 # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_broadcast_leading')
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = -1;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1298
- *
- * @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
- * int ndim,
- * int ndim_other) nogil:
- */
-
-static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
- int __pyx_v_i;
- int __pyx_v_offset;
- int __pyx_t_1;
- int __pyx_t_2;
-
- /* "View.MemoryView":1302
- * int ndim_other) nogil:
- * cdef int i
- * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
- *
- * for i in range(ndim - 1, -1, -1):
- */
- __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
-
- /* "View.MemoryView":1304
- * cdef int offset = ndim_other - ndim
- *
- * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
- * slice.shape[i + offset] = slice.shape[i]
- * slice.strides[i + offset] = slice.strides[i]
- */
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
- __pyx_v_i = __pyx_t_1;
-
- /* "View.MemoryView":1305
- *
- * for i in range(ndim - 1, -1, -1):
- * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<<
- * slice.strides[i + offset] = slice.strides[i]
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
- */
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
-
- /* "View.MemoryView":1306
- * for i in range(ndim - 1, -1, -1):
- * slice.shape[i + offset] = slice.shape[i]
- * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<<
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
- *
- */
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
-
- /* "View.MemoryView":1307
- * slice.shape[i + offset] = slice.shape[i]
- * slice.strides[i + offset] = slice.strides[i]
- * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<<
- *
- * for i in range(offset):
- */
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
- }
-
- /* "View.MemoryView":1309
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
- *
- * for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- */
- __pyx_t_1 = __pyx_v_offset;
- for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
- __pyx_v_i = __pyx_t_2;
-
- /* "View.MemoryView":1310
- *
- * for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
- */
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
-
- /* "View.MemoryView":1311
- * for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
- *
- */
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
-
- /* "View.MemoryView":1312
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
- *
- *
- */
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
- }
-
-}
-
-/* "View.MemoryView":1320
- *
- * @cname('__pyx_memoryview_refcount_copying')
- * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
- * int ndim, bint inc) nogil:
- *
- */
-
-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) {
- int __pyx_t_1;
-
- /* "View.MemoryView":1324
- *
- *
- * if dtype_is_object: # <<<<<<<<<<<<<<
- * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
- * dst.strides, ndim, inc)
- */
- __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1326
- * if dtype_is_object:
- * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
- * dst.strides, ndim, inc) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
- */
- __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);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
-}
-
-/* "View.MemoryView":1329
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
- * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim,
- * bint inc) with gil:
- */
-
-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) {
- __Pyx_RefNannyDeclarations
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
-
- /* "View.MemoryView":1332
- * Py_ssize_t *strides, int ndim,
- * bint inc) with gil:
- * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice')
- */
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
-
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
-}
-
-/* "View.MemoryView":1335
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice')
- * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim, bint inc):
- * cdef Py_ssize_t i
- */
-
-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) {
- CYTHON_UNUSED Py_ssize_t __pyx_v_i;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- Py_ssize_t __pyx_t_2;
- int __pyx_t_3;
- __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
-
- /* "View.MemoryView":1339
- * cdef Py_ssize_t i
- *
- * for i in range(shape[0]): # <<<<<<<<<<<<<<
- * if ndim == 1:
- * if inc:
- */
- __pyx_t_1 = (__pyx_v_shape[0]);
- for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
- __pyx_v_i = __pyx_t_2;
-
- /* "View.MemoryView":1340
- *
- * for i in range(shape[0]):
- * if ndim == 1: # <<<<<<<<<<<<<<
- * if inc:
- * Py_INCREF((<PyObject **> data)[0])
- */
- __pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":1341
- * for i in range(shape[0]):
- * if ndim == 1:
- * if inc: # <<<<<<<<<<<<<<
- * Py_INCREF((<PyObject **> data)[0])
- * else:
- */
- __pyx_t_3 = (__pyx_v_inc != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":1342
- * if ndim == 1:
- * if inc:
- * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
- * else:
- * Py_DECREF((<PyObject **> data)[0])
- */
- Py_INCREF((((PyObject **)__pyx_v_data)[0]));
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":1344
- * Py_INCREF((<PyObject **> data)[0])
- * else:
- * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
- * else:
- * refcount_objects_in_slice(data, shape + 1, strides + 1,
- */
- Py_DECREF((((PyObject **)__pyx_v_data)[0]));
- }
- __pyx_L6:;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":1347
- * else:
- * refcount_objects_in_slice(data, shape + 1, strides + 1,
- * ndim - 1, inc) # <<<<<<<<<<<<<<
- *
- * data += strides[0]
- */
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
- }
- __pyx_L5:;
-
- /* "View.MemoryView":1349
- * ndim - 1, inc)
- *
- * data += strides[0] # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
- }
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":1355
- *
- * @cname('__pyx_memoryview_slice_assign_scalar')
- * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
- * size_t itemsize, void *item,
- * bint dtype_is_object) nogil:
- */
-
-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) {
-
- /* "View.MemoryView":1358
- * size_t itemsize, void *item,
- * bint dtype_is_object) nogil:
- * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
- * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
- * itemsize, item)
- */
- __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
-
- /* "View.MemoryView":1360
- * refcount_copying(dst, dtype_is_object, ndim, False)
- * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
- * itemsize, item) # <<<<<<<<<<<<<<
- * refcount_copying(dst, dtype_is_object, ndim, True)
- *
- */
- __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);
-
- /* "View.MemoryView":1361
- * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
- * itemsize, item)
- * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
-
-}
-
-/* "View.MemoryView":1365
- *
- * @cname('__pyx_memoryview__slice_assign_scalar')
- * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim,
- * size_t itemsize, void *item) nogil:
- */
-
-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) {
- CYTHON_UNUSED Py_ssize_t __pyx_v_i;
- Py_ssize_t __pyx_v_stride;
- Py_ssize_t __pyx_v_extent;
- int __pyx_t_1;
- Py_ssize_t __pyx_t_2;
- Py_ssize_t __pyx_t_3;
-
- /* "View.MemoryView":1369
- * size_t itemsize, void *item) nogil:
- * cdef Py_ssize_t i
- * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t extent = shape[0]
- *
- */
- __pyx_v_stride = (__pyx_v_strides[0]);
-
- /* "View.MemoryView":1370
- * cdef Py_ssize_t i
- * cdef Py_ssize_t stride = strides[0]
- * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
- *
- * if ndim == 1:
- */
- __pyx_v_extent = (__pyx_v_shape[0]);
-
- /* "View.MemoryView":1372
- * cdef Py_ssize_t extent = shape[0]
- *
- * if ndim == 1: # <<<<<<<<<<<<<<
- * for i in range(extent):
- * memcpy(data, item, itemsize)
- */
- __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1373
- *
- * if ndim == 1:
- * for i in range(extent): # <<<<<<<<<<<<<<
- * memcpy(data, item, itemsize)
- * data += stride
- */
- __pyx_t_2 = __pyx_v_extent;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1374
- * if ndim == 1:
- * for i in range(extent):
- * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
- * data += stride
- * else:
- */
- memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
-
- /* "View.MemoryView":1375
- * for i in range(extent):
- * memcpy(data, item, itemsize)
- * data += stride # <<<<<<<<<<<<<<
- * else:
- * for i in range(extent):
- */
- __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1377
- * data += stride
- * else:
- * for i in range(extent): # <<<<<<<<<<<<<<
- * _slice_assign_scalar(data, shape + 1, strides + 1,
- * ndim - 1, itemsize, item)
- */
- __pyx_t_2 = __pyx_v_extent;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1379
- * for i in range(extent):
- * _slice_assign_scalar(data, shape + 1, strides + 1,
- * ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
- * data += stride
- *
- */
- __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);
-
- /* "View.MemoryView":1380
- * _slice_assign_scalar(data, shape + 1, strides + 1,
- * ndim - 1, itemsize, item)
- * data += stride # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
- }
- }
- __pyx_L3:;
-
-}
-static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
-
-static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_memoryview_obj *p;
- PyObject *o;
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_memoryview_obj *)o);
- p->__pyx_vtab = __pyx_vtabptr_memoryview;
- p->obj = Py_None; Py_INCREF(Py_None);
- p->_size = Py_None; Py_INCREF(Py_None);
- p->_array_interface = Py_None; Py_INCREF(Py_None);
- p->view.obj = NULL;
- if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) {
- Py_DECREF(o); o = 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_memoryview(PyObject *o) {
- struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
- PyObject_GC_UnTrack(o);
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_memoryview___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- Py_CLEAR(p->obj);
- Py_CLEAR(p->_size);
- Py_CLEAR(p->_array_interface);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
- if (p->obj) {
- e = (*v)(p->obj, a); if (e) return e;
- }
- if (p->_size) {
- e = (*v)(p->_size, a); if (e) return e;
- }
- if (p->_array_interface) {
- e = (*v)(p->_array_interface, a); if (e) return e;
- }
- if (p->view.obj) {
- e = (*v)(p->view.obj, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_memoryview(PyObject *o) {
- struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->obj);
- p->obj = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_size);
- p->_size = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_array_interface);
- p->_array_interface = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- Py_CLEAR(p->view.obj);
- return 0;
-}
-static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
- PyObject *r;
- PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
- r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
- Py_DECREF(x);
- return r;
-}
-
-static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
- if (v) {
- return __pyx_memoryview___setitem__(o, i, v);
- }
- else {
- PyErr_Format(PyExc_NotImplementedError,
- "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
-}
-
-static PyMethodDef __pyx_methods_memoryview[] = {
- {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_memoryview[] = {
- {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
- {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
- {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
- {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
- {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
- {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
- {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
- {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
- {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
- __pyx_memoryview___len__, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- __pyx_sq_item_memoryview, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
- __pyx_memoryview___len__, /*mp_length*/
- __pyx_memoryview___getitem__, /*mp_subscript*/
- __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getreadbuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getwritebuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getsegcount*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getcharbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- __pyx_memoryview_getbuffer, /*bf_getbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_releasebuffer*/
- #endif
-};
-
-static PyTypeObject __pyx_type___pyx_memoryview = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaGraph.ctools._ctools.memoryview"), /*tp_name*/
- sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- __pyx_memoryview___repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- __pyx_memoryview___str__, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_memoryview, /*tp_traverse*/
- __pyx_tp_clear_memoryview, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_memoryview, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_memoryview, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_memoryview, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_array_obj *p;
- PyObject *o;
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_array_obj *)o);
- p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
- p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
- if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) {
- Py_DECREF(o); o = 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_array(PyObject *o) {
- struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
- PyObject_GC_UnTrack(o);
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_array___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- Py_CLEAR(p->mode);
- Py_CLEAR(p->_format);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_array(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
- if (p->mode) {
- e = (*v)(p->mode, a); if (e) return e;
- }
- if (p->_format) {
- e = (*v)(p->_format, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_array(PyObject *o) {
- struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->mode);
- p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_format);
- p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
- PyObject *r;
- PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
- r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
- Py_DECREF(x);
- return r;
-}
-
-static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
- if (v) {
- return __pyx_array___setitem__(o, i, v);
- }
- else {
- PyErr_Format(PyExc_NotImplementedError,
- "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
- return -1;
- }
-}
-
-static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
- PyObject *v = PyObject_GenericGetAttr(o, n);
- if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Clear();
- v = __pyx_array___getattr__(o, n);
- }
- return v;
-}
-
-static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
-}
-
-static PyMethodDef __pyx_methods_array[] = {
- {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_array = {
- 0, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- __pyx_sq_item_array, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_array = {
- 0, /*mp_length*/
- __pyx_array___getitem__, /*mp_subscript*/
- __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer_array = {
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getreadbuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getwritebuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getsegcount*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getcharbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- __pyx_array_getbuffer, /*bf_getbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_releasebuffer*/
- #endif
-};
-
-static PyTypeObject __pyx_type___pyx_array = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaGraph.ctools._ctools.array"), /*tp_name*/
- sizeof(struct __pyx_array_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_array, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- __pyx_tp_getattro_array, /*tp_getattro*/
- 0, /*tp_setattro*/
- &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_array, /*tp_traverse*/
- __pyx_tp_clear_array, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_array, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_array, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_array, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_MemviewEnum_obj *p;
- PyObject *o;
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_MemviewEnum_obj *)o);
- p->name = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_Enum(PyObject *o) {
- struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->name);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
- if (p->name) {
- e = (*v)(p->name, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_Enum(PyObject *o) {
- struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->name);
- p->name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyMethodDef __pyx_methods_Enum[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type___pyx_MemviewEnum = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaGraph.ctools._ctools.Enum"), /*tp_name*/
- sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_Enum, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- __pyx_MemviewEnum___repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_Enum, /*tp_traverse*/
- __pyx_tp_clear_Enum, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_Enum, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_MemviewEnum___init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_Enum, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
-
-static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_memoryviewslice_obj *p;
- PyObject *o = __pyx_tp_new_memoryview(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_memoryviewslice_obj *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
- p->from_object = Py_None; Py_INCREF(Py_None);
- p->from_slice.memview = NULL;
- return o;
-}
-
-static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
- struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
- PyObject_GC_UnTrack(o);
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_memoryviewslice___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- Py_CLEAR(p->from_object);
- PyObject_GC_Track(o);
- __pyx_tp_dealloc_memoryview(o);
-}
-
-static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
- e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
- if (p->from_object) {
- e = (*v)(p->from_object, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
- struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
- PyObject* tmp;
- __pyx_tp_clear_memoryview(o);
- tmp = ((PyObject*)p->from_object);
- p->from_object = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
- return 0;
-}
-
-static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
-}
-
-static PyMethodDef __pyx_methods__memoryviewslice[] = {
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type___pyx_memoryviewslice = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaGraph.ctools._ctools._memoryviewslice"), /*tp_name*/
- sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_memoryview___repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_memoryview___str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
- __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
- __pyx_tp_clear__memoryviewslice, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods__memoryviewslice, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets__memoryviewslice, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new__memoryviewslice, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
- {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
- #if PY_VERSION_HEX < 0x03020000
- { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
- #else
- PyModuleDef_HEAD_INIT,
- #endif
- __Pyx_NAMESTR("_ctools"),
- 0, /* m_doc */
- -1, /* m_size */
- __pyx_methods /* m_methods */,
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_u_10, __pyx_k_10, sizeof(__pyx_k_10), 0, 1, 0, 0},
- {&__pyx_kp_u_12, __pyx_k_12, sizeof(__pyx_k_12), 0, 1, 0, 0},
- {&__pyx_kp_u_14, __pyx_k_14, sizeof(__pyx_k_14), 0, 1, 0, 0},
- {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
- {&__pyx_kp_u_18, __pyx_k_18, sizeof(__pyx_k_18), 0, 1, 0, 0},
- {&__pyx_kp_s_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 1, 0},
- {&__pyx_kp_s_20, __pyx_k_20, sizeof(__pyx_k_20), 0, 0, 1, 0},
- {&__pyx_kp_s_22, __pyx_k_22, sizeof(__pyx_k_22), 0, 0, 1, 0},
- {&__pyx_kp_s_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 1, 0},
- {&__pyx_kp_s_27, __pyx_k_27, sizeof(__pyx_k_27), 0, 0, 1, 0},
- {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
- {&__pyx_kp_s_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 1, 0},
- {&__pyx_kp_s_32, __pyx_k_32, sizeof(__pyx_k_32), 0, 0, 1, 0},
- {&__pyx_kp_s_34, __pyx_k_34, sizeof(__pyx_k_34), 0, 0, 1, 0},
- {&__pyx_kp_s_36, __pyx_k_36, sizeof(__pyx_k_36), 0, 0, 1, 0},
- {&__pyx_kp_s_38, __pyx_k_38, sizeof(__pyx_k_38), 0, 0, 1, 0},
- {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
- {&__pyx_kp_s_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 0, 1, 0},
- {&__pyx_kp_s_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 0, 1, 0},
- {&__pyx_kp_s_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 0, 1, 0},
- {&__pyx_kp_s_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 0, 1, 0},
- {&__pyx_kp_s_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 0, 1, 0},
- {&__pyx_n_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 1},
- {&__pyx_kp_s_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 0, 1, 0},
- {&__pyx_kp_s_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 1, 0},
- {&__pyx_kp_s_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 0, 1, 0},
- {&__pyx_kp_s_74, __pyx_k_74, sizeof(__pyx_k_74), 0, 0, 1, 0},
- {&__pyx_kp_s_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 1, 0},
- {&__pyx_kp_s_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 0, 1, 0},
- {&__pyx_kp_u_8, __pyx_k_8, sizeof(__pyx_k_8), 0, 1, 0, 0},
- {&__pyx_kp_s_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 1, 0},
- {&__pyx_n_s__ASCII, __pyx_k__ASCII, sizeof(__pyx_k__ASCII), 0, 0, 1, 1},
- {&__pyx_n_s__C, __pyx_k__C, sizeof(__pyx_k__C), 0, 0, 1, 1},
- {&__pyx_n_s__Ellipsis, __pyx_k__Ellipsis, sizeof(__pyx_k__Ellipsis), 0, 0, 1, 1},
- {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
- {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
- {&__pyx_n_b__O, __pyx_k__O, sizeof(__pyx_k__O), 0, 0, 0, 1},
- {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
- {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
- {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
- {&__pyx_n_s___NUMPY_TO_TYPE_DESC, __pyx_k___NUMPY_TO_TYPE_DESC, sizeof(__pyx_k___NUMPY_TO_TYPE_DESC), 0, 0, 1, 1},
- {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
- {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
- {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
- {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
- {&__pyx_n_s____pyx_getbuffer, __pyx_k____pyx_getbuffer, sizeof(__pyx_k____pyx_getbuffer), 0, 0, 1, 1},
- {&__pyx_n_s____pyx_releasebuffer, __pyx_k____pyx_releasebuffer, sizeof(__pyx_k____pyx_releasebuffer), 0, 0, 1, 1},
- {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1},
- {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
- {&__pyx_n_s___pnpolyFloat, __pyx_k___pnpolyFloat, sizeof(__pyx_k___pnpolyFloat), 0, 0, 1, 1},
- {&__pyx_n_s___pnpolyInt, __pyx_k___pnpolyInt, sizeof(__pyx_k___pnpolyInt), 0, 0, 1, 1},
- {&__pyx_n_s___pnpolyd, __pyx_k___pnpolyd, sizeof(__pyx_k___pnpolyd), 0, 0, 1, 1},
- {&__pyx_n_s__allocate_buffer, __pyx_k__allocate_buffer, sizeof(__pyx_k__allocate_buffer), 0, 0, 1, 1},
- {&__pyx_n_s__asarray, __pyx_k__asarray, sizeof(__pyx_k__asarray), 0, 0, 1, 1},
- {&__pyx_n_s__ascontiguousarray, __pyx_k__ascontiguousarray, sizeof(__pyx_k__ascontiguousarray), 0, 0, 1, 1},
- {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1},
- {&__pyx_n_s__border, __pyx_k__border, sizeof(__pyx_k__border), 0, 0, 1, 1},
- {&__pyx_n_b__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 0, 1},
- {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 1, 1},
- {&__pyx_n_u__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 1, 0, 1},
- {&__pyx_n_s__c_colormap, __pyx_k__c_colormap, sizeof(__pyx_k__c_colormap), 0, 0, 1, 1},
- {&__pyx_n_s__c_colormapLength, __pyx_k__c_colormapLength, sizeof(__pyx_k__c_colormapLength), 0, 0, 1, 1},
- {&__pyx_n_s__c_data, __pyx_k__c_data, sizeof(__pyx_k__c_data), 0, 0, 1, 1},
- {&__pyx_n_s__c_dataItemSize, __pyx_k__c_dataItemSize, sizeof(__pyx_k__c_dataItemSize), 0, 0, 1, 1},
- {&__pyx_n_s__c_dataMax, __pyx_k__c_dataMax, sizeof(__pyx_k__c_dataMax), 0, 0, 1, 1},
- {&__pyx_n_s__c_dataMin, __pyx_k__c_dataMin, sizeof(__pyx_k__c_dataMin), 0, 0, 1, 1},
- {&__pyx_n_s__c_dataMinPos, __pyx_k__c_dataMinPos, sizeof(__pyx_k__c_dataMinPos), 0, 0, 1, 1},
- {&__pyx_n_s__c_dataPtr, __pyx_k__c_dataPtr, sizeof(__pyx_k__c_dataPtr), 0, 0, 1, 1},
- {&__pyx_n_s__c_dataSize, __pyx_k__c_dataSize, sizeof(__pyx_k__c_dataSize), 0, 0, 1, 1},
- {&__pyx_n_s__c_end, __pyx_k__c_end, sizeof(__pyx_k__c_end), 0, 0, 1, 1},
- {&__pyx_n_s__c_nanColor, __pyx_k__c_nanColor, sizeof(__pyx_k__c_nanColor), 0, 0, 1, 1},
- {&__pyx_n_s__c_nanColorPtr, __pyx_k__c_nanColorPtr, sizeof(__pyx_k__c_nanColorPtr), 0, 0, 1, 1},
- {&__pyx_n_s__c_pixmap, __pyx_k__c_pixmap, sizeof(__pyx_k__c_pixmap), 0, 0, 1, 1},
- {&__pyx_n_s__c_points, __pyx_k__c_points, sizeof(__pyx_k__c_points), 0, 0, 1, 1},
- {&__pyx_n_s__c_start, __pyx_k__c_start, sizeof(__pyx_k__c_start), 0, 0, 1, 1},
- {&__pyx_n_s__c_startExtra, __pyx_k__c_startExtra, sizeof(__pyx_k__c_startExtra), 0, 0, 1, 1},
- {&__pyx_n_s__c_type, __pyx_k__c_type, sizeof(__pyx_k__c_type), 0, 0, 1, 1},
- {&__pyx_n_s__c_vertices, __pyx_k__c_vertices, sizeof(__pyx_k__c_vertices), 0, 0, 1, 1},
- {&__pyx_n_s__colormap, __pyx_k__colormap, sizeof(__pyx_k__colormap), 0, 0, 1, 1},
- {&__pyx_n_s__data, __pyx_k__data, sizeof(__pyx_k__data), 0, 0, 1, 1},
- {&__pyx_n_s__dataToRGBAColormap, __pyx_k__dataToRGBAColormap, sizeof(__pyx_k__dataToRGBAColormap), 0, 0, 1, 1},
- {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
- {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
- {&__pyx_n_s__dtype_is_object, __pyx_k__dtype_is_object, sizeof(__pyx_k__dtype_is_object), 0, 0, 1, 1},
- {&__pyx_n_s__empty, __pyx_k__empty, sizeof(__pyx_k__empty), 0, 0, 1, 1},
- {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
- {&__pyx_n_s__endValue, __pyx_k__endValue, sizeof(__pyx_k__endValue), 0, 0, 1, 1},
- {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
- {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
- {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
- {&__pyx_n_s__f2, __pyx_k__f2, sizeof(__pyx_k__f2), 0, 0, 1, 1},
- {&__pyx_n_s__f4, __pyx_k__f4, sizeof(__pyx_k__f4), 0, 0, 1, 1},
- {&__pyx_n_s__f8, __pyx_k__f8, sizeof(__pyx_k__f8), 0, 0, 1, 1},
- {&__pyx_n_s__fastLog10, __pyx_k__fastLog10, sizeof(__pyx_k__fastLog10), 0, 0, 1, 1},
- {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
- {&__pyx_n_s__float32, __pyx_k__float32, sizeof(__pyx_k__float32), 0, 0, 1, 1},
- {&__pyx_n_s__float64, __pyx_k__float64, sizeof(__pyx_k__float64), 0, 0, 1, 1},
- {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
- {&__pyx_n_b__fortran, __pyx_k__fortran, sizeof(__pyx_k__fortran), 0, 0, 0, 1},
- {&__pyx_n_s__fortran, __pyx_k__fortran, sizeof(__pyx_k__fortran), 0, 0, 1, 1},
- {&__pyx_n_s__i1, __pyx_k__i1, sizeof(__pyx_k__i1), 0, 0, 1, 1},
- {&__pyx_n_s__i2, __pyx_k__i2, sizeof(__pyx_k__i2), 0, 0, 1, 1},
- {&__pyx_n_s__i4, __pyx_k__i4, sizeof(__pyx_k__i4), 0, 0, 1, 1},
- {&__pyx_n_s__i8, __pyx_k__i8, sizeof(__pyx_k__i8), 0, 0, 1, 1},
- {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
- {&__pyx_n_s__int16, __pyx_k__int16, sizeof(__pyx_k__int16), 0, 0, 1, 1},
- {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
- {&__pyx_n_s__int8, __pyx_k__int8, sizeof(__pyx_k__int8), 0, 0, 1, 1},
- {&__pyx_n_s__isLog10Mapping, __pyx_k__isLog10Mapping, sizeof(__pyx_k__isLog10Mapping), 0, 0, 1, 1},
- {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1},
- {&__pyx_n_s__mask, __pyx_k__mask, sizeof(__pyx_k__mask), 0, 0, 1, 1},
- {&__pyx_n_s__memview, __pyx_k__memview, sizeof(__pyx_k__memview), 0, 0, 1, 1},
- {&__pyx_n_s__minMax, __pyx_k__minMax, sizeof(__pyx_k__minMax), 0, 0, 1, 1},
- {&__pyx_n_s__minPositive, __pyx_k__minPositive, sizeof(__pyx_k__minPositive), 0, 0, 1, 1},
- {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1},
- {&__pyx_n_s__n_points, __pyx_k__n_points, sizeof(__pyx_k__n_points), 0, 0, 1, 1},
- {&__pyx_n_s__n_vertices, __pyx_k__n_vertices, sizeof(__pyx_k__n_vertices), 0, 0, 1, 1},
- {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
- {&__pyx_n_s__nanColor, __pyx_k__nanColor, sizeof(__pyx_k__nanColor), 0, 0, 1, 1},
- {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
- {&__pyx_n_s__np, __pyx_k__np, sizeof(__pyx_k__np), 0, 0, 1, 1},
- {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
- {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
- {&__pyx_n_s__order, __pyx_k__order, sizeof(__pyx_k__order), 0, 0, 1, 1},
- {&__pyx_n_s__pack, __pyx_k__pack, sizeof(__pyx_k__pack), 0, 0, 1, 1},
- {&__pyx_n_s__pixmap, __pyx_k__pixmap, sizeof(__pyx_k__pixmap), 0, 0, 1, 1},
- {&__pyx_n_s__pnpoly, __pyx_k__pnpoly, sizeof(__pyx_k__pnpoly), 0, 0, 1, 1},
- {&__pyx_n_s__points, __pyx_k__points, sizeof(__pyx_k__points), 0, 0, 1, 1},
- {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
- {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
- {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
- {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
- {&__pyx_n_s__startValue, __pyx_k__startValue, sizeof(__pyx_k__startValue), 0, 0, 1, 1},
- {&__pyx_n_s__step, __pyx_k__step, sizeof(__pyx_k__step), 0, 0, 1, 1},
- {&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 0, 0, 1, 1},
- {&__pyx_n_s__str, __pyx_k__str, sizeof(__pyx_k__str), 0, 0, 1, 1},
- {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
- {&__pyx_n_s__u1, __pyx_k__u1, sizeof(__pyx_k__u1), 0, 0, 1, 1},
- {&__pyx_n_s__u2, __pyx_k__u2, sizeof(__pyx_k__u2), 0, 0, 1, 1},
- {&__pyx_n_s__u4, __pyx_k__u4, sizeof(__pyx_k__u4), 0, 0, 1, 1},
- {&__pyx_n_s__u8, __pyx_k__u8, sizeof(__pyx_k__u8), 0, 0, 1, 1},
- {&__pyx_n_s__uint16, __pyx_k__uint16, sizeof(__pyx_k__uint16), 0, 0, 1, 1},
- {&__pyx_n_s__uint32, __pyx_k__uint32, sizeof(__pyx_k__uint32), 0, 0, 1, 1},
- {&__pyx_n_s__uint8, __pyx_k__uint8, sizeof(__pyx_k__uint8), 0, 0, 1, 1},
- {&__pyx_n_s__unpack, __pyx_k__unpack, sizeof(__pyx_k__unpack), 0, 0, 1, 1},
- {&__pyx_n_s__value, __pyx_k__value, sizeof(__pyx_k__value), 0, 0, 1, 1},
- {&__pyx_n_s__vertices, __pyx_k__vertices, sizeof(__pyx_k__vertices), 0, 0, 1, 1},
- {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
- {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
- {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s__Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if PY_MAJOR_VERSION >= 3
- __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s__id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static int __Pyx_InitCachedConstants(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":70
- * """
- * #Convert float16 to float32
- * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
- * data = np.asarray(data, dtype=np.float32)
- *
- */
- __pyx_k_slice_1 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_1);
- __Pyx_GIVEREF(__pyx_k_slice_1);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":78
- *
- * if c_dataSize == 0:
- * raise ValueError("zero-size array") # <<<<<<<<<<<<<<
- *
- * cdef double c_dataMin, c_dataMinPos, c_dataMax
- */
- __pyx_k_tuple_3 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_2)); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 78; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_3);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":82
- * cdef double c_dataMin, c_dataMinPos, c_dataMax
- *
- * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
- *
- * if minPositive:
- */
- __pyx_k_slice_4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_4);
- __Pyx_GIVEREF(__pyx_k_slice_4);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":83
- * """
- * #Convert float16 to float32
- * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
- * data = np.asarray(data, dtype=np.float32)
- *
- */
- __pyx_k_slice_5 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_5);
- __Pyx_GIVEREF(__pyx_k_slice_5);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":105
- * cdef unsigned char[:, :] c_pixmap = pixmap
- *
- * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
- *
- * cdef double c_start, c_startExtra, c_end
- */
- __pyx_k_slice_6 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_k_slice_6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 105; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_slice_6);
- __Pyx_GIVEREF(__pyx_k_slice_6);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":138
- * &c_pixmap[0, 0])
- *
- * pixmap.shape = data.shape + (4,) # <<<<<<<<<<<<<<
- * return pixmap, (c_start, c_end)
- *
- */
- __pyx_k_tuple_7 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_7);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
-
- /* "numpy.pxd":215
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- */
- __pyx_k_tuple_9 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_8)); if (unlikely(!__pyx_k_tuple_9)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_9);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_9));
-
- /* "numpy.pxd":219
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
- *
- * info.buf = PyArray_DATA(self)
- */
- __pyx_k_tuple_11 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_10)); if (unlikely(!__pyx_k_tuple_11)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_11);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_11));
-
- /* "numpy.pxd":257
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
- */
- __pyx_k_tuple_13 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_12)); if (unlikely(!__pyx_k_tuple_13)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_13);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_13));
-
- /* "numpy.pxd":799
- *
- * if (end - f) - (new_offset - offset[0]) < 15:
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
- *
- * if ((child.byteorder == c'>' and little_endian) or
- */
- __pyx_k_tuple_16 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_15)); if (unlikely(!__pyx_k_tuple_16)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_16);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_16));
-
- /* "numpy.pxd":803
- * if ((child.byteorder == c'>' and little_endian) or
- * (child.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * # One could encode it in the format string and have Cython
- * # complain instead, BUT: < and > in format strings also imply
- */
- __pyx_k_tuple_17 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_12)); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_17);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
-
- /* "numpy.pxd":823
- * t = child.type_num
- * if end - f < 5:
- * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
- *
- * # Until ticket #99 is fixed, use integers to avoid warnings
- */
- __pyx_k_tuple_19 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_18)); if (unlikely(!__pyx_k_tuple_19)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_19);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_19));
-
- /* "View.MemoryView":124
- *
- * if not self.ndim:
- * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
- *
- * if self.itemsize <= 0:
- */
- __pyx_k_tuple_21 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_20)); if (unlikely(!__pyx_k_tuple_21)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_21);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_21));
-
- /* "View.MemoryView":127
- *
- * if self.itemsize <= 0:
- * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
- *
- * encode = getattr(format, 'encode', None)
- */
- __pyx_k_tuple_23 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_22)); if (unlikely(!__pyx_k_tuple_23)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_23);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_23));
-
- /* "View.MemoryView":131
- * encode = getattr(format, 'encode', None)
- * if encode:
- * format = encode('ASCII') # <<<<<<<<<<<<<<
- * self._format = format
- * self.format = self._format
- */
- __pyx_k_tuple_24 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ASCII)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_24);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
-
- /* "View.MemoryView":141
- * free(self._shape)
- * free(self._strides)
- * raise MemoryError("unable to allocate shape or strides.") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_26 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_25)); if (unlikely(!__pyx_k_tuple_26)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_26);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_26));
-
- /* "View.MemoryView":166
- * decode = getattr(mode, 'decode', None)
- * if decode:
- * mode = decode('ASCII') # <<<<<<<<<<<<<<
- * self.mode = mode
- *
- */
- __pyx_k_tuple_29 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ASCII)); if (unlikely(!__pyx_k_tuple_29)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_29);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_29));
-
- /* "View.MemoryView":174
- * self.data = <char *>malloc(self.len)
- * if not self.data:
- * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
- *
- * if self.dtype_is_object:
- */
- __pyx_k_tuple_31 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_30)); if (unlikely(!__pyx_k_tuple_31)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_31);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_31));
-
- /* "View.MemoryView":190
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
- * info.buf = self.data
- * info.len = self.len
- */
- __pyx_k_tuple_33 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_32)); if (unlikely(!__pyx_k_tuple_33)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_33);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_33));
-
- /* "View.MemoryView":452
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
- * else:
- * if len(self.view.format) == 1:
- */
- __pyx_k_tuple_35 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_34)); if (unlikely(!__pyx_k_tuple_35)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_35);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_35));
-
- /* "View.MemoryView":528
- * if self.view.strides == NULL:
- *
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
- *
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
- */
- __pyx_k_tuple_37 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_36)); if (unlikely(!__pyx_k_tuple_37)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_37);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_37));
-
- /* "View.MemoryView":643
- * if item is Ellipsis:
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
- * seen_ellipsis = True
- * else:
- */
- __pyx_k_tuple_40 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_40)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_40);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_40));
-
- /* "View.MemoryView":646
- * seen_ellipsis = True
- * else:
- * result.append(slice(None)) # <<<<<<<<<<<<<<
- * have_slices = True
- * else:
- */
- __pyx_k_tuple_41 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_41);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
-
- /* "View.MemoryView":657
- * nslices = ndim - len(result)
- * if nslices:
- * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
- *
- * return have_slices or nslices, tuple(result)
- */
- __pyx_k_tuple_43 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_43)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_43);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_43));
-
- /* "View.MemoryView":665
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
- * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_45 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_44)); if (unlikely(!__pyx_k_tuple_45)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_45);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_45));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":55
- * @cython.boundscheck(False)
- * @cython.wraparound(False)
- * def minMax(np.ndarray data, bint minPositive=False): # <<<<<<<<<<<<<<
- * """Get min, max and optionally min positive of data.
- *
- */
- __pyx_k_tuple_53 = PyTuple_Pack(9, ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__minPositive), ((PyObject *)__pyx_n_s__c_data), ((PyObject *)__pyx_n_s__c_dataPtr), ((PyObject *)__pyx_n_s__c_dataSize), ((PyObject *)__pyx_n_s__c_dataMin), ((PyObject *)__pyx_n_s__c_dataMinPos), ((PyObject *)__pyx_n_s__c_dataMax), ((PyObject *)__pyx_n_s__c_type)); if (unlikely(!__pyx_k_tuple_53)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_53);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_53));
- __pyx_k_codeobj_54 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_53, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_55, __pyx_n_s__minMax, 55, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":61
- * @cython.boundscheck(False)
- * @cython.wraparound(False)
- * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
- * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
- * startValue=None, endValue=None,
- */
- __pyx_k_tuple_57 = PyTuple_Pack(20, ((PyObject *)__pyx_n_s__data), ((PyObject *)__pyx_n_s__colormap), ((PyObject *)__pyx_n_s__startValue), ((PyObject *)__pyx_n_s__endValue), ((PyObject *)__pyx_n_s__isLog10Mapping), ((PyObject *)__pyx_n_s__nanColor), ((PyObject *)__pyx_n_s__c_data), ((PyObject *)__pyx_n_s__c_dataPtr), ((PyObject *)__pyx_n_s__c_dataSize), ((PyObject *)__pyx_n_s__c_dataItemSize), ((PyObject *)__pyx_n_s__c_colormap), ((PyObject *)__pyx_n_s__c_colormapLength), ((PyObject *)__pyx_n_s__c_nanColorPtr), ((PyObject *)__pyx_n_s__c_nanColor), ((PyObject *)__pyx_n_s__pixmap), ((PyObject *)__pyx_n_s__c_pixmap), ((PyObject *)__pyx_n_s__c_type), ((PyObject *)__pyx_n_s__c_start), ((PyObject *)__pyx_n_s__c_startExtra), ((PyObject *)__pyx_n_s__c_end)); if (unlikely(!__pyx_k_tuple_57)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_57);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_57));
- __pyx_k_codeobj_58 = (PyObject*)__Pyx_PyCode_New(6, 0, 20, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_57, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_59, __pyx_n_s__dataToRGBAColormap, 61, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_58)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":141
- * return pixmap, (c_start, c_end)
- *
- * def fastLog10(double value): # <<<<<<<<<<<<<<
- * return _fastLog10(value)
- */
- __pyx_k_tuple_60 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__value), ((PyObject *)__pyx_n_s__value)); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_60);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
- __pyx_k_codeobj_61 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_59, __pyx_n_s__fastLog10, 141, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_61)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":54
- *
- * @cython.boundscheck(False)
- * def pnpoly(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * """
- * :param vertices: Array Nx2 with the coordenates of the polygon vertices
- */
- __pyx_k_tuple_62 = PyTuple_Pack(3, ((PyObject *)__pyx_n_s__vertices), ((PyObject *)__pyx_n_s__points), ((PyObject *)__pyx_n_s__border)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_62);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
- __pyx_k_codeobj_63 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_64, __pyx_n_s__pnpoly, 54, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_63)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":72
- *
- * @cython.boundscheck(False)
- * def _pnpolyd(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_k_tuple_65 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__vertices), ((PyObject *)__pyx_n_s__points), ((PyObject *)__pyx_n_s__border), ((PyObject *)__pyx_n_s__c_vertices), ((PyObject *)__pyx_n_s__n_vertices), ((PyObject *)__pyx_n_s__c_points), ((PyObject *)__pyx_n_s__n_points), ((PyObject *)__pyx_n_s__mask)); if (unlikely(!__pyx_k_tuple_65)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_65);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_65));
- __pyx_k_codeobj_66 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_65, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_64, __pyx_n_s___pnpolyd, 72, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_66)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":90
- *
- * @cython.boundscheck(False)
- * def _pnpolyFloat(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_k_tuple_67 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__vertices), ((PyObject *)__pyx_n_s__points), ((PyObject *)__pyx_n_s__border), ((PyObject *)__pyx_n_s__c_vertices), ((PyObject *)__pyx_n_s__n_vertices), ((PyObject *)__pyx_n_s__c_points), ((PyObject *)__pyx_n_s__n_points), ((PyObject *)__pyx_n_s__mask)); if (unlikely(!__pyx_k_tuple_67)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_67);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_67));
- __pyx_k_codeobj_68 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_67, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_64, __pyx_n_s___pnpolyFloat, 90, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":108
- *
- * @cython.boundscheck(False)
- * def _pnpolyInt(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_k_tuple_69 = PyTuple_Pack(8, ((PyObject *)__pyx_n_s__vertices), ((PyObject *)__pyx_n_s__points), ((PyObject *)__pyx_n_s__border), ((PyObject *)__pyx_n_s__c_vertices), ((PyObject *)__pyx_n_s__n_vertices), ((PyObject *)__pyx_n_s__c_points), ((PyObject *)__pyx_n_s__n_points), ((PyObject *)__pyx_n_s__mask)); if (unlikely(!__pyx_k_tuple_69)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_69);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_69));
- __pyx_k_codeobj_70 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_69, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_64, __pyx_n_s___pnpolyInt, 108, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_70)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":282
- * return self.name
- *
- * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>")
- */
- __pyx_k_tuple_73 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_72)); if (unlikely(!__pyx_k_tuple_73)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_73);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_73));
-
- /* "View.MemoryView":283
- *
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
- * cdef indirect = Enum("<strided and indirect>")
- *
- */
- __pyx_k_tuple_75 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_74)); if (unlikely(!__pyx_k_tuple_75)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_75);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_75));
-
- /* "View.MemoryView":284
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_77 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_76)); if (unlikely(!__pyx_k_tuple_77)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_77);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_77));
-
- /* "View.MemoryView":287
- *
- *
- * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
- * cdef indirect_contiguous = Enum("<contiguous and indirect>")
- *
- */
- __pyx_k_tuple_79 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_78)); if (unlikely(!__pyx_k_tuple_79)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_79);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_79));
-
- /* "View.MemoryView":288
- *
- * cdef contiguous = Enum("<contiguous and direct>")
- * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_81 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_80)); if (unlikely(!__pyx_k_tuple_81)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_81);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_81));
- __Pyx_RefNannyFinishContext();
- return 0;
- __pyx_L1_error:;
- __Pyx_RefNannyFinishContext();
- return -1;
-}
-
-static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC init_ctools(void); /*proto*/
-PyMODINIT_FUNC init_ctools(void)
-#else
-PyMODINIT_FUNC PyInit__ctools(void); /*proto*/
-PyMODINIT_FUNC PyInit__ctools(void)
-#endif
-{
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannyDeclarations
- #if CYTHON_REFNANNY
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
- if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
- }
- #endif
- __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__ctools(void)", 0);
- if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- #ifdef __Pyx_FusedFunction_USED
- if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- #ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- #ifdef WITH_THREAD /* Python build with threading support? */
- PyEval_InitThreads();
- #endif
- #endif
- /*--- Module creation code ---*/
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_ctools"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_d);
- #if PY_MAJOR_VERSION >= 3
- {
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "PyMca5.PyMcaGraph.ctools._ctools")) {
- if (unlikely(PyDict_SetItemString(modules, "PyMca5.PyMcaGraph.ctools._ctools", __pyx_m) < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- }
- #endif
- __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if CYTHON_COMPILING_IN_PYPY
- Py_INCREF(__pyx_b);
- #endif
- if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- /*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- if (__pyx_module_is_main_PyMca5__PyMcaGraph__ctools___ctools) {
- if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- }
- /*--- Builtin init code ---*/
- if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Constants init code ---*/
- if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Global init code ---*/
- generic = Py_None; Py_INCREF(Py_None);
- strided = Py_None; Py_INCREF(Py_None);
- indirect = Py_None; Py_INCREF(Py_None);
- contiguous = Py_None; Py_INCREF(Py_None);
- indirect_contiguous = Py_None; Py_INCREF(Py_None);
- /*--- Variable export code ---*/
- /*--- Function export code ---*/
- /*--- Type init code ---*/
- __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
- __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
- __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
- __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
- __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
- __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
- __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
- __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
- if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
- __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
- __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
- __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
- __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
- __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
- if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
- /*--- Type import code ---*/
- __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
- #if CYTHON_COMPILING_IN_PYPY
- sizeof(PyTypeObject),
- #else
- sizeof(PyHeapTypeObject),
- #endif
- 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[5]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Variable import code ---*/
- /*--- Function import code ---*/
- /*--- Execution code ---*/
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":34
- * from InsidePolygonWithBounds cimport PointsInsidePolygonInt as _pnpolyInt32
- * cimport numpy
- * import numpy # <<<<<<<<<<<<<<
- *
- * # From numpy_common.pxi to avoid warnings while compiling C code
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 34; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":44
- * void import_umath()
- *
- * if FALSE: # <<<<<<<<<<<<<<
- * import_array()
- * import_umath()
- */
- __pyx_t_2 = (0 != 0);
- if (__pyx_t_2) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":45
- *
- * if FALSE:
- * import_array() # <<<<<<<<<<<<<<
- * import_umath()
- *
- */
- import_array();
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":46
- * if FALSE:
- * import_array()
- * import_umath() # <<<<<<<<<<<<<<
- *
- *
- */
- import_umath();
- goto __pyx_L2;
- }
- __pyx_L2:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":31
- * cimport cython
- * cimport numpy as np
- * import numpy as np # <<<<<<<<<<<<<<
- *
- * from MinMax cimport getMinMax
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":40
- * # 3rd bit for signedness (int only): 1: unsigned, 0: signed
- * # 1st and 2nd bits for size: 00: 8 bits, 01: 16 bits, 10: 32 bits, 11: 64 bits.
- * _NUMPY_TO_TYPE_DESC = { # <<<<<<<<<<<<<<
- * 'f8': 0b1011,
- * 'f4': 0b1010,
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__f8), __pyx_int_11) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__f4), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i1), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u1), __pyx_int_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i2), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u2), __pyx_int_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i4), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u4), __pyx_int_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i8), __pyx_int_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u8), __pyx_int_7) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___NUMPY_TO_TYPE_DESC, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\MinMax.pyx":55
- * @cython.boundscheck(False)
- * @cython.wraparound(False)
- * def minMax(np.ndarray data, bint minPositive=False): # <<<<<<<<<<<<<<
- * """Get min, max and optionally min positive of data.
- *
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__minMax, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":31
- * cimport cython
- * cimport numpy as np
- * import numpy as np # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":40
- *
- * # Init fastLog10 look-up table
- * initFastLog10() # <<<<<<<<<<<<<<
- *
- * # Convert numpy dtype array-protocol string to bit field to pass to C function
- */
- initFastLog10();
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":46
- * # 3rd bit for signedness (int only): 1: unsigned, 0: signed
- * # 1st and 2nd bits for size: 00: 8 bits, 01: 16 bits, 10: 32 bits, 11: 64 bits.
- * _NUMPY_TO_TYPE_DESC = { # <<<<<<<<<<<<<<
- * 'f8': 0b1011,
- * 'f4': 0b1010,
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__f8), __pyx_int_11) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__f4), __pyx_int_10) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i1), __pyx_int_0) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u1), __pyx_int_4) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i2), __pyx_int_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u2), __pyx_int_5) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i4), __pyx_int_2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u4), __pyx_int_6) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__i8), __pyx_int_3) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__u8), __pyx_int_7) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___NUMPY_TO_TYPE_DESC, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 46; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":61
- * @cython.boundscheck(False)
- * @cython.wraparound(False)
- * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
- * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
- * startValue=None, endValue=None,
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__dataToRGBAColormap, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\Colormap.pyx":141
- * return pixmap, (c_start, c_end)
- *
- * def fastLog10(double value): # <<<<<<<<<<<<<<
- * return _fastLog10(value)
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__fastLog10, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":54
- *
- * @cython.boundscheck(False)
- * def pnpoly(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * """
- * :param vertices: Array Nx2 with the coordenates of the polygon vertices
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__pnpoly, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":72
- *
- * @cython.boundscheck(False)
- * def _pnpolyd(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___pnpolyd, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":90
- *
- * @cython.boundscheck(False)
- * def _pnpolyFloat(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___pnpolyFloat, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":108
- *
- * @cython.boundscheck(False)
- * def _pnpolyInt(vertices, points, bint border=True): # <<<<<<<<<<<<<<
- * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
- * dtype=numpy.float64)
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt, NULL, __pyx_n_s_56); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___pnpolyInt, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaGraph\ctools\_ctools\cython\_ctools.pyx":1
- * #/[inserted by cython to avoid comment start]*########################################################################## # <<<<<<<<<<<<<<
- * #
- * # The PyMca X-Ray Fluorescence Toolkit
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-
- /* "View.MemoryView":207
- * info.obj = self
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
- *
- * def __dealloc__(array self):
- */
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_71); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_array_type);
-
- /* "View.MemoryView":282
- * return self.name
- *
- * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>")
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_73), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(generic);
- __Pyx_DECREF(generic);
- __Pyx_GIVEREF(__pyx_t_1);
- generic = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":283
- *
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
- * cdef indirect = Enum("<strided and indirect>")
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_75), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(strided);
- __Pyx_DECREF(strided);
- __Pyx_GIVEREF(__pyx_t_1);
- strided = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":284
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_77), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(indirect);
- __Pyx_DECREF(indirect);
- __Pyx_GIVEREF(__pyx_t_1);
- indirect = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":287
- *
- *
- * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
- * cdef indirect_contiguous = Enum("<contiguous and indirect>")
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_79), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(contiguous);
- __Pyx_DECREF(contiguous);
- __Pyx_GIVEREF(__pyx_t_1);
- contiguous = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":288
- *
- * cdef contiguous = Enum("<contiguous and direct>")
- * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_81), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(indirect_contiguous);
- __Pyx_DECREF(indirect_contiguous);
- __Pyx_GIVEREF(__pyx_t_1);
- indirect_contiguous = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":503
- * info.obj = self
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_71); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_memoryview_type);
-
- /* "View.MemoryView":958
- * return self.from_object
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_71); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_memoryviewslice_type);
-
- /* "View.MemoryView":1365
- *
- * @cname('__pyx_memoryview__slice_assign_scalar')
- * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim,
- * size_t itemsize, void *item) nogil:
- */
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- if (__pyx_m) {
- __Pyx_AddTraceback("init PyMca5.PyMcaGraph.ctools._ctools", __pyx_clineno, __pyx_lineno, __pyx_filename);
- Py_DECREF(__pyx_m); __pyx_m = 0;
- } else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init PyMca5.PyMcaGraph.ctools._ctools");
- }
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #if PY_MAJOR_VERSION < 3
- return;
- #else
- return __pyx_m;
- #endif
-}
-
-/* Runtime support code */
-#if CYTHON_REFNANNY
-static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule((char *)modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
-end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
-}
-#endif /* CYTHON_REFNANNY */
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
- PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
- if (unlikely(!result)) {
- PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
- "name '%U' is not defined", name);
-#else
- "name '%s' is not defined", PyString_AS_STRING(name));
-#endif
- }
- return result;
-}
-
-static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name,
- PyObject* kw_name)
-{
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION >= 3
- "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
- #else
- "%s() got multiple values for keyword argument '%s'", func_name,
- PyString_AsString(kw_name));
- #endif
-}
-
-static int __Pyx_ParseOptionalKeywords(
- PyObject *kwds,
- PyObject **argnames[],
- PyObject *kwds2,
- PyObject *values[],
- Py_ssize_t num_pos_args,
- const char* function_name)
-{
- PyObject *key = 0, *value = 0;
- Py_ssize_t pos = 0;
- PyObject*** name;
- PyObject*** first_kw_arg = argnames + num_pos_args;
- while (PyDict_Next(kwds, &pos, &key, &value)) {
- name = first_kw_arg;
- while (*name && (**name != key)) name++;
- if (*name) {
- values[name-argnames] = value;
- continue;
- }
- name = first_kw_arg;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
- while (*name) {
- if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
- && _PyString_Eq(**name, key)) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- if ((**argname == key) || (
- (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
- && _PyString_Eq(**argname, key))) {
- goto arg_passed_twice;
- }
- argname++;
- }
- }
- } else
- #endif
- if (likely(PyUnicode_Check(key))) {
- while (*name) {
- int cmp = (**name == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**name, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- int cmp = (**argname == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**argname, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) goto arg_passed_twice;
- argname++;
- }
- }
- } else
- goto invalid_keyword_type;
- if (kwds2) {
- if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
- } else {
- goto invalid_keyword;
- }
- }
- return 0;
-arg_passed_twice:
- __Pyx_RaiseDoubleKeywordsError(function_name, key);
- goto bad;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%s() keywords must be strings", function_name);
- goto bad;
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%s() got an unexpected keyword argument '%s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
-bad:
- return -1;
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
- const char* func_name,
- int exact,
- Py_ssize_t num_min,
- Py_ssize_t num_max,
- Py_ssize_t num_found)
-{
- Py_ssize_t num_expected;
- const char *more_or_less;
- if (num_found < num_min) {
- num_expected = num_min;
- more_or_less = "at least";
- } else {
- num_expected = num_max;
- more_or_less = "at most";
- }
- if (exact) {
- more_or_less = "exactly";
- }
- PyErr_Format(PyExc_TypeError,
- "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
- func_name, more_or_less, num_expected,
- (num_expected == 1) ? "" : "s", num_found);
-}
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact)
-{
- if (!type) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (none_allowed && obj == Py_None) return 1;
- else if (exact) {
- if (Py_TYPE(obj) == type) return 1;
- }
- else {
- if (PyObject_TypeCheck(obj, type)) return 1;
- }
- PyErr_Format(PyExc_TypeError,
- "Argument '%s' has incorrect type (expected %s, got %s)",
- name, type->tp_name, Py_TYPE(obj)->tp_name);
- return 0;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
- PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
- PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
- int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyMappingMethods* mp;
-#if PY_MAJOR_VERSION < 3
- PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
- if (likely(ms && ms->sq_slice)) {
- if (!has_cstart) {
- if (_py_start && (*_py_start != Py_None)) {
- cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
- if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstart = 0;
- }
- if (!has_cstop) {
- if (_py_stop && (*_py_stop != Py_None)) {
- cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
- if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
- } else
- cstop = PY_SSIZE_T_MAX;
- }
- if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
- Py_ssize_t l = ms->sq_length(obj);
- if (likely(l >= 0)) {
- if (cstop < 0) {
- cstop += l;
- if (cstop < 0) cstop = 0;
- }
- if (cstart < 0) {
- cstart += l;
- if (cstart < 0) cstart = 0;
- }
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- goto bad;
- }
- }
- return ms->sq_slice(obj, cstart, cstop);
- }
-#endif
- mp = Py_TYPE(obj)->tp_as_mapping;
- if (likely(mp && mp->mp_subscript))
-#endif
- {
- PyObject* result;
- PyObject *py_slice, *py_start, *py_stop;
- if (_py_slice) {
- py_slice = *_py_slice;
- } else {
- PyObject* owned_start = NULL;
- PyObject* owned_stop = NULL;
- if (_py_start) {
- py_start = *_py_start;
- } else {
- if (has_cstart) {
- owned_start = py_start = PyInt_FromSsize_t(cstart);
- if (unlikely(!py_start)) goto bad;
- } else
- py_start = Py_None;
- }
- if (_py_stop) {
- py_stop = *_py_stop;
- } else {
- if (has_cstop) {
- owned_stop = py_stop = PyInt_FromSsize_t(cstop);
- if (unlikely(!py_stop)) {
- Py_XDECREF(owned_start);
- goto bad;
- }
- } else
- py_stop = Py_None;
- }
- py_slice = PySlice_New(py_start, py_stop, Py_None);
- Py_XDECREF(owned_start);
- Py_XDECREF(owned_stop);
- if (unlikely(!py_slice)) goto bad;
- }
-#if CYTHON_COMPILING_IN_CPYTHON
- result = mp->mp_subscript(obj, py_slice);
-#else
- result = PyObject_GetItem(obj, py_slice);
-#endif
- if (!_py_slice) {
- Py_DECREF(py_slice);
- }
- return result;
- }
- PyErr_Format(PyExc_TypeError,
- "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
-bad:
- return NULL;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
- PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
- result = PyDict_GetItem(__pyx_d, name);
- if (result) {
- Py_INCREF(result);
- } else {
-#else
- result = PyObject_GetItem(__pyx_d, name);
- if (!result) {
- PyErr_Clear();
-#endif
- result = __Pyx_GetBuiltinName(name);
- }
- return result;
-}
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
- if (unlikely(!type)) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (likely(PyObject_TypeCheck(obj, type)))
- return 1;
- PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
- Py_TYPE(obj)->tp_name, type->tp_name);
- return 0;
-}
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- tmp_type = tstate->curexc_type;
- tmp_value = tstate->curexc_value;
- tmp_tb = tstate->curexc_traceback;
- tstate->curexc_type = type;
- tstate->curexc_value = value;
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_Restore(type, value, tb);
-#endif
-}
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- *type = tstate->curexc_type;
- *value = tstate->curexc_value;
- *tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
-}
-
-#if PY_MAJOR_VERSION < 3
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
- CYTHON_UNUSED PyObject *cause) {
- Py_XINCREF(type);
- if (!value || value == Py_None)
- value = NULL;
- else
- Py_INCREF(value);
- if (!tb || tb == Py_None)
- tb = NULL;
- else {
- Py_INCREF(tb);
- if (!PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto raise_error;
- }
- }
- #if PY_VERSION_HEX < 0x02050000
- if (PyClass_Check(type)) {
- #else
- if (PyType_Check(type)) {
- #endif
-#if CYTHON_COMPILING_IN_PYPY
- if (!value) {
- Py_INCREF(Py_None);
- value = Py_None;
- }
-#endif
- PyErr_NormalizeException(&type, &value, &tb);
- } else {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto raise_error;
- }
- value = type;
- #if PY_VERSION_HEX < 0x02050000
- if (PyInstance_Check(type)) {
- type = (PyObject*) ((PyInstanceObject*)type)->in_class;
- Py_INCREF(type);
- } else {
- type = 0;
- PyErr_SetString(PyExc_TypeError,
- "raise: exception must be an old-style class or instance");
- goto raise_error;
- }
- #else
- type = (PyObject*) Py_TYPE(type);
- Py_INCREF(type);
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto raise_error;
- }
- #endif
- }
- __Pyx_ErrRestore(type, value, tb);
- return;
-raise_error:
- Py_XDECREF(value);
- Py_XDECREF(type);
- Py_XDECREF(tb);
- return;
-}
-#else /* Python 3+ */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
- PyObject* owned_instance = NULL;
- if (tb == Py_None) {
- tb = 0;
- } else if (tb && !PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto bad;
- }
- if (value == Py_None)
- value = 0;
- if (PyExceptionInstance_Check(type)) {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto bad;
- }
- value = type;
- type = (PyObject*) Py_TYPE(value);
- } else if (PyExceptionClass_Check(type)) {
- PyObject *args;
- if (!value)
- args = PyTuple_New(0);
- else if (PyTuple_Check(value)) {
- Py_INCREF(value);
- args = value;
- } else
- args = PyTuple_Pack(1, value);
- if (!args)
- goto bad;
- owned_instance = PyEval_CallObject(type, args);
- Py_DECREF(args);
- if (!owned_instance)
- goto bad;
- value = owned_instance;
- if (!PyExceptionInstance_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "calling %R should have returned an instance of "
- "BaseException, not %R",
- type, Py_TYPE(value));
- goto bad;
- }
- } else {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto bad;
- }
-#if PY_VERSION_HEX >= 0x03030000
- if (cause) {
-#else
- if (cause && cause != Py_None) {
-#endif
- PyObject *fixed_cause;
- if (cause == Py_None) {
- fixed_cause = NULL;
- } else if (PyExceptionClass_Check(cause)) {
- fixed_cause = PyObject_CallObject(cause, NULL);
- if (fixed_cause == NULL)
- goto bad;
- } else if (PyExceptionInstance_Check(cause)) {
- fixed_cause = cause;
- Py_INCREF(fixed_cause);
- } else {
- PyErr_SetString(PyExc_TypeError,
- "exception causes must derive from "
- "BaseException");
- goto bad;
- }
- PyException_SetCause(value, fixed_cause);
- }
- PyErr_SetObject(type, value);
- if (tb) {
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* tmp_tb = tstate->curexc_traceback;
- if (tb != tmp_tb) {
- Py_INCREF(tb);
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_tb);
- }
- }
-bad:
- Py_XDECREF(owned_instance);
- return;
-}
-#endif
-
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
- unsigned int n = 1;
- return *(unsigned char*)(&n) != 0;
-}
-static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
- __Pyx_BufFmt_StackElem* stack,
- __Pyx_TypeInfo* type) {
- stack[0].field = &ctx->root;
- stack[0].parent_offset = 0;
- ctx->root.type = type;
- ctx->root.name = "buffer dtype";
- ctx->root.offset = 0;
- ctx->head = stack;
- ctx->head->field = &ctx->root;
- ctx->fmt_offset = 0;
- ctx->head->parent_offset = 0;
- ctx->new_packmode = '@';
- ctx->enc_packmode = '@';
- ctx->new_count = 1;
- ctx->enc_count = 0;
- ctx->enc_type = 0;
- ctx->is_complex = 0;
- ctx->is_valid_array = 0;
- ctx->struct_alignment = 0;
- while (type->typegroup == 'S') {
- ++ctx->head;
- ctx->head->field = type->fields;
- ctx->head->parent_offset = 0;
- type = type->fields->type;
- }
-}
-static int __Pyx_BufFmt_ParseNumber(const char** ts) {
- int count;
- const char* t = *ts;
- if (*t < '0' || *t > '9') {
- return -1;
- } else {
- count = *t++ - '0';
- while (*t >= '0' && *t < '9') {
- count *= 10;
- count += *t++ - '0';
- }
- }
- *ts = t;
- return count;
-}
-static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
- int number = __Pyx_BufFmt_ParseNumber(ts);
- if (number == -1) /* First char was not a digit */
- PyErr_Format(PyExc_ValueError,\
- "Does not understand character buffer dtype format string ('%c')", **ts);
- return number;
-}
-static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
- PyErr_Format(PyExc_ValueError,
- "Unexpected format string character: '%c'", ch);
-}
-static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
- switch (ch) {
- case 'c': return "'char'";
- case 'b': return "'signed char'";
- case 'B': return "'unsigned char'";
- case 'h': return "'short'";
- case 'H': return "'unsigned short'";
- case 'i': return "'int'";
- case 'I': return "'unsigned int'";
- case 'l': return "'long'";
- case 'L': return "'unsigned long'";
- case 'q': return "'long long'";
- case 'Q': return "'unsigned long long'";
- case 'f': return (is_complex ? "'complex float'" : "'float'");
- case 'd': return (is_complex ? "'complex double'" : "'double'");
- case 'g': return (is_complex ? "'complex long double'" : "'long double'");
- case 'T': return "a struct";
- case 'O': return "Python object";
- case 'P': return "a pointer";
- case 's': case 'p': return "a string";
- case 0: return "end";
- default: return "unparseable format string";
- }
-}
-static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
- switch (ch) {
- case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return 2;
- case 'i': case 'I': case 'l': case 'L': return 4;
- case 'q': case 'Q': return 8;
- case 'f': return (is_complex ? 8 : 4);
- case 'd': return (is_complex ? 16 : 8);
- case 'g': {
- PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
- return 0;
- }
- case 'O': case 'P': return sizeof(void*);
- default:
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
-}
-static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
- switch (ch) {
- case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return sizeof(short);
- case 'i': case 'I': return sizeof(int);
- case 'l': case 'L': return sizeof(long);
- #ifdef HAVE_LONG_LONG
- case 'q': case 'Q': return sizeof(PY_LONG_LONG);
- #endif
- case 'f': return sizeof(float) * (is_complex ? 2 : 1);
- case 'd': return sizeof(double) * (is_complex ? 2 : 1);
- case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
- case 'O': case 'P': return sizeof(void*);
- default: {
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
- }
-}
-typedef struct { char c; short x; } __Pyx_st_short;
-typedef struct { char c; int x; } __Pyx_st_int;
-typedef struct { char c; long x; } __Pyx_st_long;
-typedef struct { char c; float x; } __Pyx_st_float;
-typedef struct { char c; double x; } __Pyx_st_double;
-typedef struct { char c; long double x; } __Pyx_st_longdouble;
-typedef struct { char c; void *x; } __Pyx_st_void_p;
-#ifdef HAVE_LONG_LONG
-typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
-#endif
-static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
- switch (ch) {
- case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
- case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
- case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
-#ifdef HAVE_LONG_LONG
- case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
-#endif
- case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
- case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
- case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
- case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
- default:
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
-}
-/* These are for computing the padding at the end of the struct to align
- on the first member of the struct. This will probably the same as above,
- but we don't have any guarantees.
- */
-typedef struct { short x; char c; } __Pyx_pad_short;
-typedef struct { int x; char c; } __Pyx_pad_int;
-typedef struct { long x; char c; } __Pyx_pad_long;
-typedef struct { float x; char c; } __Pyx_pad_float;
-typedef struct { double x; char c; } __Pyx_pad_double;
-typedef struct { long double x; char c; } __Pyx_pad_longdouble;
-typedef struct { void *x; char c; } __Pyx_pad_void_p;
-#ifdef HAVE_LONG_LONG
-typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
-#endif
-static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
- switch (ch) {
- case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
- case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
- case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
-#ifdef HAVE_LONG_LONG
- case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
-#endif
- case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
- case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
- case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
- case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
- default:
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
-}
-static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
- switch (ch) {
- case 'c':
- return 'H';
- case 'b': case 'h': case 'i':
- case 'l': case 'q': case 's': case 'p':
- return 'I';
- case 'B': case 'H': case 'I': case 'L': case 'Q':
- return 'U';
- case 'f': case 'd': case 'g':
- return (is_complex ? 'C' : 'R');
- case 'O':
- return 'O';
- case 'P':
- return 'P';
- default: {
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
- }
-}
-static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
- if (ctx->head == NULL || ctx->head->field == &ctx->root) {
- const char* expected;
- const char* quote;
- if (ctx->head == NULL) {
- expected = "end";
- quote = "";
- } else {
- expected = ctx->head->field->type->name;
- quote = "'";
- }
- PyErr_Format(PyExc_ValueError,
- "Buffer dtype mismatch, expected %s%s%s but got %s",
- quote, expected, quote,
- __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
- } else {
- __Pyx_StructField* field = ctx->head->field;
- __Pyx_StructField* parent = (ctx->head - 1)->field;
- PyErr_Format(PyExc_ValueError,
- "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
- field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
- parent->type->name, field->name);
- }
-}
-static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
- char group;
- size_t size, offset, arraysize = 1;
- if (ctx->enc_type == 0) return 0;
- if (ctx->head->field->type->arraysize[0]) {
- int i, ndim = 0;
- if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
- ctx->is_valid_array = ctx->head->field->type->ndim == 1;
- ndim = 1;
- if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
- PyErr_Format(PyExc_ValueError,
- "Expected a dimension of size %zu, got %zu",
- ctx->head->field->type->arraysize[0], ctx->enc_count);
- return -1;
- }
- }
- if (!ctx->is_valid_array) {
- PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
- ctx->head->field->type->ndim, ndim);
- return -1;
- }
- for (i = 0; i < ctx->head->field->type->ndim; i++) {
- arraysize *= ctx->head->field->type->arraysize[i];
- }
- ctx->is_valid_array = 0;
- ctx->enc_count = 1;
- }
- group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
- do {
- __Pyx_StructField* field = ctx->head->field;
- __Pyx_TypeInfo* type = field->type;
- if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
- size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
- } else {
- size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
- }
- if (ctx->enc_packmode == '@') {
- size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
- size_t align_mod_offset;
- if (align_at == 0) return -1;
- align_mod_offset = ctx->fmt_offset % align_at;
- if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
- if (ctx->struct_alignment == 0)
- ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
- ctx->is_complex);
- }
- if (type->size != size || type->typegroup != group) {
- if (type->typegroup == 'C' && type->fields != NULL) {
- size_t parent_offset = ctx->head->parent_offset + field->offset;
- ++ctx->head;
- ctx->head->field = type->fields;
- ctx->head->parent_offset = parent_offset;
- continue;
- }
- if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
- } else {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return -1;
- }
- }
- offset = ctx->head->parent_offset + field->offset;
- if (ctx->fmt_offset != offset) {
- PyErr_Format(PyExc_ValueError,
- "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
- (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
- return -1;
- }
- ctx->fmt_offset += size;
- if (arraysize)
- ctx->fmt_offset += (arraysize - 1) * size;
- --ctx->enc_count; /* Consume from buffer string */
- while (1) {
- if (field == &ctx->root) {
- ctx->head = NULL;
- if (ctx->enc_count != 0) {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return -1;
- }
- break; /* breaks both loops as ctx->enc_count == 0 */
- }
- ctx->head->field = ++field;
- if (field->type == NULL) {
- --ctx->head;
- field = ctx->head->field;
- continue;
- } else if (field->type->typegroup == 'S') {
- size_t parent_offset = ctx->head->parent_offset + field->offset;
- if (field->type->fields->type == NULL) continue; /* empty struct */
- field = field->type->fields;
- ++ctx->head;
- ctx->head->field = field;
- ctx->head->parent_offset = parent_offset;
- break;
- } else {
- break;
- }
- }
- } while (ctx->enc_count);
- ctx->enc_type = 0;
- ctx->is_complex = 0;
- return 0;
-}
-static CYTHON_INLINE PyObject *
-__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
-{
- const char *ts = *tsp;
- int i = 0, number;
- int ndim = ctx->head->field->type->ndim;
-;
- ++ts;
- if (ctx->new_count != 1) {
- PyErr_SetString(PyExc_ValueError,
- "Cannot handle repeated arrays in format string");
- return NULL;
- }
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- while (*ts && *ts != ')') {
- if (isspace(*ts))
- continue;
- number = __Pyx_BufFmt_ExpectNumber(&ts);
- if (number == -1) return NULL;
- if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
- return PyErr_Format(PyExc_ValueError,
- "Expected a dimension of size %zu, got %d",
- ctx->head->field->type->arraysize[i], number);
- if (*ts != ',' && *ts != ')')
- return PyErr_Format(PyExc_ValueError,
- "Expected a comma in format string, got '%c'", *ts);
- if (*ts == ',') ts++;
- i++;
- }
- if (i != ndim)
- return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
- ctx->head->field->type->ndim, i);
- if (!*ts) {
- PyErr_SetString(PyExc_ValueError,
- "Unexpected end of format string, expected ')'");
- return NULL;
- }
- ctx->is_valid_array = 1;
- ctx->new_count = 1;
- *tsp = ++ts;
- return Py_None;
-}
-static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
- int got_Z = 0;
- while (1) {
- switch(*ts) {
- case 0:
- if (ctx->enc_type != 0 && ctx->head == NULL) {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return NULL;
- }
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- if (ctx->head != NULL) {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return NULL;
- }
- return ts;
- case ' ':
- case 10:
- case 13:
- ++ts;
- break;
- case '<':
- if (!__Pyx_IsLittleEndian()) {
- PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
- return NULL;
- }
- ctx->new_packmode = '=';
- ++ts;
- break;
- case '>':
- case '!':
- if (__Pyx_IsLittleEndian()) {
- PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
- return NULL;
- }
- ctx->new_packmode = '=';
- ++ts;
- break;
- case '=':
- case '@':
- case '^':
- ctx->new_packmode = *ts++;
- break;
- case 'T': /* substruct */
- {
- const char* ts_after_sub;
- size_t i, struct_count = ctx->new_count;
- size_t struct_alignment = ctx->struct_alignment;
- ctx->new_count = 1;
- ++ts;
- if (*ts != '{') {
- PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
- return NULL;
- }
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->enc_type = 0; /* Erase processed last struct element */
- ctx->enc_count = 0;
- ctx->struct_alignment = 0;
- ++ts;
- ts_after_sub = ts;
- for (i = 0; i != struct_count; ++i) {
- ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
- if (!ts_after_sub) return NULL;
- }
- ts = ts_after_sub;
- if (struct_alignment) ctx->struct_alignment = struct_alignment;
- }
- break;
- case '}': /* end of substruct; either repeat or move on */
- {
- size_t alignment = ctx->struct_alignment;
- ++ts;
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->enc_type = 0; /* Erase processed last struct element */
- if (alignment && ctx->fmt_offset % alignment) {
- ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
- }
- }
- return ts;
- case 'x':
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->fmt_offset += ctx->new_count;
- ctx->new_count = 1;
- ctx->enc_count = 0;
- ctx->enc_type = 0;
- ctx->enc_packmode = ctx->new_packmode;
- ++ts;
- break;
- case 'Z':
- got_Z = 1;
- ++ts;
- if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
- __Pyx_BufFmt_RaiseUnexpectedChar('Z');
- return NULL;
- } /* fall through */
- case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
- case 'l': case 'L': case 'q': case 'Q':
- case 'f': case 'd': case 'g':
- case 'O': case 's': case 'p':
- if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
- ctx->enc_packmode == ctx->new_packmode) {
- ctx->enc_count += ctx->new_count;
- } else {
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->enc_count = ctx->new_count;
- ctx->enc_packmode = ctx->new_packmode;
- ctx->enc_type = *ts;
- ctx->is_complex = got_Z;
- }
- ++ts;
- ctx->new_count = 1;
- got_Z = 0;
- break;
- case ':':
- ++ts;
- while(*ts != ':') ++ts;
- ++ts;
- break;
- case '(':
- if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
- break;
- default:
- {
- int number = __Pyx_BufFmt_ExpectNumber(&ts);
- if (number == -1) return NULL;
- ctx->new_count = (size_t)number;
- }
- }
- }
-}
-static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
- buf->buf = NULL;
- buf->obj = NULL;
- buf->strides = __Pyx_zeros;
- buf->shape = __Pyx_zeros;
- buf->suboffsets = __Pyx_minusones;
-}
-static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
- Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
- int nd, int cast, __Pyx_BufFmt_StackElem* stack)
-{
- if (obj == Py_None || obj == NULL) {
- __Pyx_ZeroBuffer(buf);
- return 0;
- }
- buf->buf = NULL;
- if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
- if (buf->ndim != nd) {
- PyErr_Format(PyExc_ValueError,
- "Buffer has wrong number of dimensions (expected %d, got %d)",
- nd, buf->ndim);
- goto fail;
- }
- if (!cast) {
- __Pyx_BufFmt_Context ctx;
- __Pyx_BufFmt_Init(&ctx, stack, dtype);
- if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
- }
- if ((unsigned)buf->itemsize != dtype->size) {
- PyErr_Format(PyExc_ValueError,
- "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
- buf->itemsize, (buf->itemsize > 1) ? "s" : "",
- dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
- goto fail;
- }
- if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
- return 0;
-fail:;
- __Pyx_ZeroBuffer(buf);
- return -1;
-}
-static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
- if (info->buf == NULL) return;
- if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
- __Pyx_ReleaseBuffer(info);
-}
-
-static int
-__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
- int ndim,
- __Pyx_memviewslice *memviewslice,
- int memview_is_new_reference)
-{
- __Pyx_RefNannyDeclarations
- int i, retval=-1;
- Py_buffer *buf = &memview->view;
- __Pyx_RefNannySetupContext("init_memviewslice", 0);
- if (!buf) {
- PyErr_SetString(PyExc_ValueError,
- "buf is NULL.");
- goto fail;
- } else if (memviewslice->memview || memviewslice->data) {
- PyErr_SetString(PyExc_ValueError,
- "memviewslice is already initialized!");
- goto fail;
- }
- if (buf->strides) {
- for (i = 0; i < ndim; i++) {
- memviewslice->strides[i] = buf->strides[i];
- }
- } else {
- Py_ssize_t stride = buf->itemsize;
- for (i = ndim - 1; i >= 0; i--) {
- memviewslice->strides[i] = stride;
- stride *= buf->shape[i];
- }
- }
- for (i = 0; i < ndim; i++) {
- memviewslice->shape[i] = buf->shape[i];
- if (buf->suboffsets) {
- memviewslice->suboffsets[i] = buf->suboffsets[i];
- } else {
- memviewslice->suboffsets[i] = -1;
- }
- }
- memviewslice->memview = memview;
- memviewslice->data = (char *)buf->buf;
- if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
- Py_INCREF(memview);
- }
- retval = 0;
- goto no_fail;
-fail:
- memviewslice->memview = 0;
- memviewslice->data = 0;
- retval = -1;
-no_fail:
- __Pyx_RefNannyFinishContext();
- return retval;
-}
-static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
- va_list vargs;
- char msg[200];
- va_start(vargs, fmt);
-#ifdef HAVE_STDARG_PROTOTYPES
- va_start(vargs, fmt);
-#else
- va_start(vargs);
-#endif
- vsnprintf(msg, 200, fmt, vargs);
- Py_FatalError(msg);
- va_end(vargs);
-}
-static CYTHON_INLINE int
-__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
- PyThread_type_lock lock)
-{
- int result;
- PyThread_acquire_lock(lock, 1);
- result = (*acquisition_count)++;
- PyThread_release_lock(lock);
- return result;
-}
-static CYTHON_INLINE int
-__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
- PyThread_type_lock lock)
-{
- int result;
- PyThread_acquire_lock(lock, 1);
- result = (*acquisition_count)--;
- PyThread_release_lock(lock);
- return result;
-}
-static CYTHON_INLINE void
-__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
-{
- int first_time;
- struct __pyx_memoryview_obj *memview = memslice->memview;
- if (!memview || (PyObject *) memview == Py_None)
- return; /* allow uninitialized memoryview assignment */
- if (__pyx_get_slice_count(memview) < 0)
- __pyx_fatalerror("Acquisition count is %d (line %d)",
- __pyx_get_slice_count(memview), lineno);
- first_time = __pyx_add_acquisition_count(memview) == 0;
- if (first_time) {
- if (have_gil) {
- Py_INCREF((PyObject *) memview);
- } else {
- PyGILState_STATE _gilstate = PyGILState_Ensure();
- Py_INCREF((PyObject *) memview);
- PyGILState_Release(_gilstate);
- }
- }
-}
-static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
- int have_gil, int lineno) {
- int last_time;
- struct __pyx_memoryview_obj *memview = memslice->memview;
- if (!memview ) {
- return;
- } else if ((PyObject *) memview == Py_None) {
- memslice->memview = NULL;
- return;
- }
- if (__pyx_get_slice_count(memview) <= 0)
- __pyx_fatalerror("Acquisition count is %d (line %d)",
- __pyx_get_slice_count(memview), lineno);
- last_time = __pyx_sub_acquisition_count(memview) == 1;
- memslice->data = NULL;
- if (last_time) {
- if (have_gil) {
- Py_CLEAR(memslice->memview);
- } else {
- PyGILState_STATE _gilstate = PyGILState_Ensure();
- Py_CLEAR(memslice->memview);
- PyGILState_Release(_gilstate);
- }
- } else {
- memslice->memview = NULL;
- }
-}
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
- PyErr_Format(PyExc_ValueError,
- "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
- PyErr_Format(PyExc_ValueError,
- "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
- index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* exc_type = tstate->curexc_type;
- if (unlikely(exc_type)) {
- if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
- PyObject *exc_value, *exc_tb;
- exc_value = tstate->curexc_value;
- exc_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
- Py_DECREF(exc_type);
- Py_XDECREF(exc_value);
- Py_XDECREF(exc_tb);
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#else
- if (unlikely(PyErr_Occurred())) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
- PyErr_Clear();
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
- if (unlikely(retval)) {
- Py_DECREF(retval);
- __Pyx_RaiseTooManyValuesError(expected);
- return -1;
- } else {
- return __Pyx_IterFinish();
- }
- return 0;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
-#if PY_MAJOR_VERSION >= 3
- if (likely(PyUnicode_Check(n)))
-#else
- if (likely(PyString_Check(n)))
-#endif
- return __Pyx_PyObject_GetAttrStr(o, n);
-#endif
- return PyObject_GetAttr(o, n);
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
- PyObject *r = __Pyx_GetAttr(o, n);
- if (!r) {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError))
- goto bad;
- PyErr_Clear();
- r = d;
- Py_INCREF(d);
- }
- return r;
-bad:
- return NULL;
-}
-
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
- Py_ssize_t q = a / b;
- Py_ssize_t r = a - q*b;
- q -= ((r != 0) & ((r ^ b) < 0));
- return q;
-}
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyObject_RichCompareBool(s1, s2, equals);
-#else
- if (s1 == s2) {
- return (equals == Py_EQ);
- } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) {
- #if CYTHON_PEP393_ENABLED
- if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0))
- return -1;
- if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) {
- return (equals == Py_NE);
- } else if (PyUnicode_GET_LENGTH(s1) == 1) {
- Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0);
- Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0);
- return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
- #else
- if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) {
- return (equals == Py_NE);
- } else if (PyUnicode_GET_SIZE(s1) == 1) {
- Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0];
- Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0];
- return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
- #endif
- } else {
- int result = PyUnicode_Compare(s1, s2);
- if ((result == -1) && unlikely(PyErr_Occurred()))
- return -1;
- return (equals == Py_EQ) ? (result == 0) : (result != 0);
- }
- } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) {
- return (equals == Py_NE);
- } else if ((s2 == Py_None) & PyUnicode_CheckExact(s1)) {
- return (equals == Py_NE);
- } else {
- int result;
- PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
- if (!py_result)
- return -1;
- result = __Pyx_PyObject_IsTrue(py_result);
- Py_DECREF(py_result);
- return result;
- }
-#endif
-}
-
-static CYTHON_INLINE PyObject* __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)) {
- Py_ssize_t length;
- if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
- if (start < 0) {
- start += length;
- if (start < 0)
- start = 0;
- }
- if (stop < 0)
- stop += length;
- }
- length = stop - start;
- if (unlikely(length <= 0))
- return PyUnicode_FromUnicode(NULL, 0);
- cstring += start;
- if (decode_func) {
- return decode_func(cstring, length, errors);
- } else {
- return PyUnicode_Decode(cstring, length, encoding, errors);
- }
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- local_type = tstate->curexc_type;
- local_value = tstate->curexc_value;
- local_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
- PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(tstate->curexc_type))
-#else
- if (unlikely(PyErr_Occurred()))
-#endif
- goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
- goto bad;
- #endif
- Py_INCREF(local_type);
- Py_INCREF(local_value);
- Py_INCREF(local_tb);
- *type = local_type;
- *value = local_value;
- *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = local_type;
- tstate->exc_value = local_value;
- tstate->exc_traceback = local_tb;
- /* Make sure tstate is in a consistent state when we XDECREF
- these objects (DECREF may run arbitrary code). */
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
- return 0;
-bad:
- *type = 0;
- *value = 0;
- *tb = 0;
- Py_XDECREF(local_type);
- Py_XDECREF(local_value);
- Py_XDECREF(local_tb);
- return -1;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
- if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
- PyObject *r = PyList_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- }
- else if (PyTuple_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- return NULL;
- }
- }
- return m->sq_item(o, i);
- }
- }
-#else
- if (is_list || PySequence_Check(o)) {
- return PySequence_GetItem(o, i);
- }
-#endif
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
- PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
-}
-
-static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
- long q = a / b;
- long r = a - q*b;
- q -= ((r != 0) & ((r ^ b) < 0));
- return q;
-}
-
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
- CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
- PyObject *old_exc, *old_val, *old_tb;
- PyObject *ctx;
- __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
- #if PY_MAJOR_VERSION < 3
- ctx = PyString_FromString(name);
- #else
- ctx = PyUnicode_FromString(name);
- #endif
- __Pyx_ErrRestore(old_exc, old_val, old_tb);
- if (!ctx) {
- PyErr_WriteUnraisable(Py_None);
- } else {
- PyErr_WriteUnraisable(ctx);
- Py_DECREF(ctx);
- }
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
- PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
- PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
- if (!ob)
- goto bad;
- if (PyDict_SetItem(dict, __pyx_n_s____pyx_vtable__, ob) < 0)
- goto bad;
- Py_DECREF(ob);
- return 0;
-bad:
- Py_XDECREF(ob);
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
- #if PY_VERSION_HEX >= 0x02060000
- if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
- #endif
- if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
- if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
- if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
- #if PY_VERSION_HEX < 0x02060000
- if (obj->ob_type->tp_dict) {
- PyObject *getbuffer_cobj = PyObject_GetItem(
- obj->ob_type->tp_dict, __pyx_n_s____pyx_getbuffer);
- if (getbuffer_cobj) {
- getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
- Py_DECREF(getbuffer_cobj);
- if (!func)
- goto fail;
- return func(obj, view, flags);
- } else {
- PyErr_Clear();
- }
- }
- #endif
- PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
- return -1;
-}
-static void __Pyx_ReleaseBuffer(Py_buffer *view) {
- PyObject *obj = view->obj;
- if (!obj) return;
- #if PY_VERSION_HEX >= 0x02060000
- if (PyObject_CheckBuffer(obj)) {
- PyBuffer_Release(view);
- return;
- }
- #endif
- if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
- #if PY_VERSION_HEX < 0x02060000
- if (obj->ob_type->tp_dict) {
- PyObject *releasebuffer_cobj = PyObject_GetItem(
- obj->ob_type->tp_dict, __pyx_n_s____pyx_releasebuffer);
- if (releasebuffer_cobj) {
- releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
- Py_DECREF(releasebuffer_cobj);
- if (!func)
- goto fail;
- func(obj, view);
- return;
- } else {
- PyErr_Clear();
- }
- }
- #endif
- goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
- PyErr_WriteUnraisable(obj);
-nofail:
- Py_DECREF(obj);
- view->obj = NULL;
-}
-#endif /* PY_MAJOR_VERSION < 3 */
-
-
- static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_import;
- py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
- if (!py_import)
- goto bad;
- #endif
- if (from_list)
- list = from_list;
- else {
- empty_list = PyList_New(0);
- if (!empty_list)
- goto bad;
- list = empty_list;
- }
- global_dict = PyModule_GetDict(__pyx_m);
- if (!global_dict)
- goto bad;
- empty_dict = PyDict_New();
- if (!empty_dict)
- goto bad;
- #if PY_VERSION_HEX >= 0x02050000
- {
- #if PY_MAJOR_VERSION >= 3
- if (level == -1) {
- if (strchr(__Pyx_MODULE_NAME, '.')) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(1);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, 1);
- #endif
- if (!module) {
- if (!PyErr_ExceptionMatches(PyExc_ImportError))
- goto bad;
- PyErr_Clear();
- }
- }
- level = 0; /* try absolute import on failure */
- }
- #endif
- if (!module) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(level);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, level);
- #endif
- }
- }
- #else
- if (level>0) {
- PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
- goto bad;
- }
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, NULL);
- #endif
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
- return ::std::complex< float >(x, y);
- }
- #else
- static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
- return x + y*(__pyx_t_float_complex)_Complex_I;
- }
- #endif
-#else
- static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
- __pyx_t_float_complex z;
- z.real = x;
- z.imag = y;
- return z;
- }
-#endif
-
-#if CYTHON_CCOMPLEX
-#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- return (a.real == b.real) && (a.imag == b.imag);
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- z.real = a.real + b.real;
- z.imag = a.imag + b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- z.real = a.real - b.real;
- z.imag = a.imag - b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- z.real = a.real * b.real - a.imag * b.imag;
- z.imag = a.real * b.imag + a.imag * b.real;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- float denom = b.real * b.real + b.imag * b.imag;
- z.real = (a.real * b.real + a.imag * b.imag) / denom;
- z.imag = (a.imag * b.real - a.real * b.imag) / denom;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
- __pyx_t_float_complex z;
- z.real = -a.real;
- z.imag = -a.imag;
- return z;
- }
- static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
- return (a.real == 0) && (a.imag == 0);
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
- __pyx_t_float_complex z;
- z.real = a.real;
- z.imag = -a.imag;
- return z;
- }
- #if 1
- static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
- #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
- return sqrtf(z.real*z.real + z.imag*z.imag);
- #else
- return hypotf(z.real, z.imag);
- #endif
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- float r, lnr, theta, z_r, z_theta;
- if (b.imag == 0 && b.real == (int)b.real) {
- if (b.real < 0) {
- float denom = a.real * a.real + a.imag * a.imag;
- a.real = a.real / denom;
- a.imag = -a.imag / denom;
- b.real = -b.real;
- }
- switch ((int)b.real) {
- case 0:
- z.real = 1;
- z.imag = 0;
- return z;
- case 1:
- return a;
- case 2:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(a, a);
- case 3:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, a);
- case 4:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, z);
- }
- }
- if (a.imag == 0) {
- if (a.real == 0) {
- return a;
- }
- r = a.real;
- theta = 0;
- } else {
- r = __Pyx_c_absf(a);
- theta = atan2f(a.imag, a.real);
- }
- lnr = logf(r);
- z_r = expf(lnr * b.real - theta * b.imag);
- z_theta = theta * b.real + lnr * b.imag;
- z.real = z_r * cosf(z_theta);
- z.imag = z_r * sinf(z_theta);
- return z;
- }
- #endif
-#endif
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
- return ::std::complex< double >(x, y);
- }
- #else
- static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
- return x + y*(__pyx_t_double_complex)_Complex_I;
- }
- #endif
-#else
- static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
- __pyx_t_double_complex z;
- z.real = x;
- z.imag = y;
- return z;
- }
-#endif
-
-#if CYTHON_CCOMPLEX
-#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- return (a.real == b.real) && (a.imag == b.imag);
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- z.real = a.real + b.real;
- z.imag = a.imag + b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- z.real = a.real - b.real;
- z.imag = a.imag - b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- z.real = a.real * b.real - a.imag * b.imag;
- z.imag = a.real * b.imag + a.imag * b.real;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- double denom = b.real * b.real + b.imag * b.imag;
- z.real = (a.real * b.real + a.imag * b.imag) / denom;
- z.imag = (a.imag * b.real - a.real * b.imag) / denom;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
- __pyx_t_double_complex z;
- z.real = -a.real;
- z.imag = -a.imag;
- return z;
- }
- static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
- return (a.real == 0) && (a.imag == 0);
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
- __pyx_t_double_complex z;
- z.real = a.real;
- z.imag = -a.imag;
- return z;
- }
- #if 1
- static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
- #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
- return sqrt(z.real*z.real + z.imag*z.imag);
- #else
- return hypot(z.real, z.imag);
- #endif
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- double r, lnr, theta, z_r, z_theta;
- if (b.imag == 0 && b.real == (int)b.real) {
- if (b.real < 0) {
- double denom = a.real * a.real + a.imag * a.imag;
- a.real = a.real / denom;
- a.imag = -a.imag / denom;
- b.real = -b.real;
- }
- switch ((int)b.real) {
- case 0:
- z.real = 1;
- z.imag = 0;
- return z;
- case 1:
- return a;
- case 2:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(a, a);
- case 3:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, a);
- case 4:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, z);
- }
- }
- if (a.imag == 0) {
- if (a.real == 0) {
- return a;
- }
- r = a.real;
- theta = 0;
- } else {
- r = __Pyx_c_abs(a);
- theta = atan2(a.imag, a.real);
- }
- lnr = log(r);
- z_r = exp(lnr * b.real - theta * b.imag);
- z_theta = theta * b.real + lnr * b.imag;
- z.real = z_r * cos(z_theta);
- z.imag = z_r * sin(z_theta);
- return z;
- }
- #endif
-#endif
-
-static int
-__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
- char order, int ndim)
-{
- int i, index, step, start;
- Py_ssize_t itemsize = mvs->memview->view.itemsize;
- if (order == 'F') {
- step = 1;
- start = 0;
- } else {
- step = -1;
- start = ndim - 1;
- }
- for (i = 0; i < ndim; i++) {
- index = start + step * i;
- if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
- return 0;
- itemsize *= mvs->shape[index];
- }
- return 1;
-}
-
-static void
-__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
- void **out_start, void **out_end,
- int ndim, size_t itemsize)
-{
- char *start, *end;
- int i;
- start = end = slice->data;
- for (i = 0; i < ndim; i++) {
- Py_ssize_t stride = slice->strides[i];
- Py_ssize_t extent = slice->shape[i];
- if (extent == 0) {
- *out_start = *out_end = start;
- return;
- } else {
- if (stride > 0)
- end += stride * (extent - 1);
- else
- start += stride * (extent - 1);
- }
- }
- *out_start = start;
- *out_end = end + itemsize;
-}
-static int
-__pyx_slices_overlap(__Pyx_memviewslice *slice1,
- __Pyx_memviewslice *slice2,
- int ndim, size_t itemsize)
-{
- void *start1, *end1, *start2, *end2;
- __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
- __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
- return (start1 < end2) && (start2 < end1);
-}
-
-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)
-{
- __Pyx_RefNannyDeclarations
- int i;
- __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
- struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
- Py_buffer *buf = &from_memview->view;
- PyObject *shape_tuple = NULL;
- PyObject *temp_int = NULL;
- struct __pyx_array_obj *array_obj = NULL;
- struct __pyx_memoryview_obj *memview_obj = NULL;
- __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
- for (i = 0; i < ndim; i++) {
- if (from_mvs->suboffsets[i] >= 0) {
- PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
- "indirect dimensions (axis %d)", i);
- goto fail;
- }
- }
- shape_tuple = PyTuple_New(ndim);
- if (unlikely(!shape_tuple)) {
- goto fail;
- }
- __Pyx_GOTREF(shape_tuple);
- for(i = 0; i < ndim; i++) {
- temp_int = PyInt_FromLong(from_mvs->shape[i]);
- if(unlikely(!temp_int)) {
- goto fail;
- } else {
- PyTuple_SET_ITEM(shape_tuple, i, temp_int);
- temp_int = NULL;
- }
- }
- array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
- if (unlikely(!array_obj)) {
- goto fail;
- }
- __Pyx_GOTREF(array_obj);
- memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
- (PyObject *) array_obj, contig_flag,
- dtype_is_object,
- from_mvs->memview->typeinfo);
- if (unlikely(!memview_obj))
- goto fail;
- if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
- goto fail;
- if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
- dtype_is_object) < 0))
- goto fail;
- goto no_fail;
-fail:
- __Pyx_XDECREF(new_mvs.memview);
- new_mvs.memview = NULL;
- new_mvs.data = NULL;
-no_fail:
- __Pyx_XDECREF(shape_tuple);
- __Pyx_XDECREF(temp_int);
- __Pyx_XDECREF(array_obj);
- __Pyx_RefNannyFinishContext();
- return new_mvs;
-}
-
-static CYTHON_INLINE PyObject *
-__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
-{
- PyObject *cobj;
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
- cobj = PyCapsule_New(p, sig, NULL);
-#else
- cobj = PyCObject_FromVoidPtr(p, NULL);
-#endif
- return cobj;
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- *type = tstate->exc_type;
- *value = tstate->exc_value;
- *tb = tstate->exc_traceback;
- Py_XINCREF(*type);
- Py_XINCREF(*value);
- Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = type;
- tstate->exc_value = value;
- tstate->exc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
- const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned char" :
- "value too large to convert to unsigned char");
- }
- return (unsigned char)-1;
- }
- return (unsigned char)val;
- }
- return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
- const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned short" :
- "value too large to convert to unsigned short");
- }
- return (unsigned short)-1;
- }
- return (unsigned short)val;
- }
- return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
- const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned int" :
- "value too large to convert to unsigned int");
- }
- return (unsigned int)-1;
- }
- return (unsigned int)val;
- }
- return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
- const char neg_one = (char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to char" :
- "value too large to convert to char");
- }
- return (char)-1;
- }
- return (char)val;
- }
- return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
- const short neg_one = (short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to short" :
- "value too large to convert to short");
- }
- return (short)-1;
- }
- return (short)val;
- }
- return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
- const int neg_one = (int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to int" :
- "value too large to convert to int");
- }
- return (int)-1;
- }
- return (int)val;
- }
- return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
- const signed char neg_one = (signed char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed char" :
- "value too large to convert to signed char");
- }
- return (signed char)-1;
- }
- return (signed char)val;
- }
- return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
- const signed short neg_one = (signed short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed short" :
- "value too large to convert to signed short");
- }
- return (signed short)-1;
- }
- return (signed short)val;
- }
- return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
- const signed int neg_one = (signed int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed int" :
- "value too large to convert to signed int");
- }
- return (signed int)-1;
- }
- return (signed int)val;
- }
- return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
- const int neg_one = (int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to int" :
- "value too large to convert to int");
- }
- return (int)-1;
- }
- return (int)val;
- }
- return (int)__Pyx_PyInt_AsLong(x);
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
- const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return (unsigned long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return (unsigned long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (unsigned long)PyLong_AsLong(x);
- }
- } else {
- unsigned long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned long)-1;
- val = __Pyx_PyInt_AsUnsignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
- const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return (unsigned PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- unsigned PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
- const long neg_one = (long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return (long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return (long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (long)PyLong_AsLong(x);
- }
- } else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (long)-1;
- val = __Pyx_PyInt_AsLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
- const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return (PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
- const signed long neg_one = (signed long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return (signed long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return (signed long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (signed long)PyLong_AsLong(x);
- }
- } else {
- signed long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed long)-1;
- val = __Pyx_PyInt_AsSignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
- const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return (signed PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- signed PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsSignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static int
-__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
-{
- int i;
- if (!a || !b)
- return 0;
- if (a == b)
- return 1;
- if (a->size != b->size || a->typegroup != b->typegroup ||
- a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
- if (a->typegroup == 'H' || b->typegroup == 'H') {
- return a->size == b->size;
- } else {
- return 0;
- }
- }
- if (a->ndim) {
- for (i = 0; i < a->ndim; i++)
- if (a->arraysize[i] != b->arraysize[i])
- return 0;
- }
- if (a->typegroup == 'S') {
- if (a->flags != b->flags)
- return 0;
- if (a->fields || b->fields) {
- if (!(a->fields && b->fields))
- return 0;
- for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
- __Pyx_StructField *field_a = a->fields + i;
- __Pyx_StructField *field_b = b->fields + i;
- if (field_a->offset != field_b->offset ||
- !__pyx_typeinfo_cmp(field_a->type, field_b->type))
- return 0;
- }
- return !a->fields[i].type && !b->fields[i].type;
- }
- }
- return 1;
-}
-
-static int
-__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
-{
- if (buf->shape[dim] <= 1)
- return 1;
- if (buf->strides) {
- if (spec & __Pyx_MEMVIEW_CONTIG) {
- if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
- if (buf->strides[dim] != sizeof(void *)) {
- PyErr_Format(PyExc_ValueError,
- "Buffer is not indirectly contiguous "
- "in dimension %d.", dim);
- goto fail;
- }
- } else if (buf->strides[dim] != buf->itemsize) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer and memoryview are not contiguous "
- "in the same dimension.");
- goto fail;
- }
- }
- if (spec & __Pyx_MEMVIEW_FOLLOW) {
- Py_ssize_t stride = buf->strides[dim];
- if (stride < 0)
- stride = -stride;
- if (stride < buf->itemsize) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer and memoryview are not contiguous "
- "in the same dimension.");
- goto fail;
- }
- }
- } else {
- if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
- PyErr_Format(PyExc_ValueError,
- "C-contiguous buffer is not contiguous in "
- "dimension %d", dim);
- goto fail;
- } else if (spec & (__Pyx_MEMVIEW_PTR)) {
- PyErr_Format(PyExc_ValueError,
- "C-contiguous buffer is not indirect in "
- "dimension %d", dim);
- goto fail;
- } else if (buf->suboffsets) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer exposes suboffsets but no strides");
- goto fail;
- }
- }
- return 1;
-fail:
- return 0;
-}
-static int
-__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
-{
- if (spec & __Pyx_MEMVIEW_DIRECT) {
- if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
- PyErr_Format(PyExc_ValueError,
- "Buffer not compatible with direct access "
- "in dimension %d.", dim);
- goto fail;
- }
- }
- if (spec & __Pyx_MEMVIEW_PTR) {
- if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
- PyErr_Format(PyExc_ValueError,
- "Buffer is not indirectly accessisble "
- "in dimension %d.", dim);
- goto fail;
- }
- }
- return 1;
-fail:
- return 0;
-}
-static int
-__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
-{
- int i;
- if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
- Py_ssize_t stride = 1;
- for (i = 0; i < ndim; i++) {
- if (stride * buf->itemsize != buf->strides[i] &&
- buf->shape[i] > 1)
- {
- PyErr_SetString(PyExc_ValueError,
- "Buffer not fortran contiguous.");
- goto fail;
- }
- stride = stride * buf->shape[i];
- }
- } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
- Py_ssize_t stride = 1;
- for (i = ndim - 1; i >- 1; i--) {
- if (stride * buf->itemsize != buf->strides[i] &&
- buf->shape[i] > 1) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer not C contiguous.");
- goto fail;
- }
- stride = stride * buf->shape[i];
- }
- }
- return 1;
-fail:
- return 0;
-}
-static int __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)
-{
- struct __pyx_memoryview_obj *memview, *new_memview;
- __Pyx_RefNannyDeclarations
- Py_buffer *buf;
- int i, spec = 0, retval = -1;
- __Pyx_BufFmt_Context ctx;
- int from_memoryview = __pyx_memoryview_check(original_obj);
- __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
- if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
- original_obj)->typeinfo)) {
- memview = (struct __pyx_memoryview_obj *) original_obj;
- new_memview = NULL;
- } else {
- memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
- original_obj, buf_flags, 0, dtype);
- new_memview = memview;
- if (unlikely(!memview))
- goto fail;
- }
- buf = &memview->view;
- if (buf->ndim != ndim) {
- PyErr_Format(PyExc_ValueError,
- "Buffer has wrong number of dimensions (expected %d, got %d)",
- ndim, buf->ndim);
- goto fail;
- }
- if (new_memview) {
- __Pyx_BufFmt_Init(&ctx, stack, dtype);
- if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
- }
- if ((unsigned) buf->itemsize != dtype->size) {
- PyErr_Format(PyExc_ValueError,
- "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
- "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
- buf->itemsize,
- (buf->itemsize > 1) ? "s" : "",
- dtype->name,
- dtype->size,
- (dtype->size > 1) ? "s" : "");
- goto fail;
- }
- for (i = 0; i < ndim; i++) {
- spec = axes_specs[i];
- if (!__pyx_check_strides(buf, i, ndim, spec))
- goto fail;
- if (!__pyx_check_suboffsets(buf, i, ndim, spec))
- goto fail;
- }
- if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
- goto fail;
- if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
- new_memview != NULL) == -1)) {
- goto fail;
- }
- retval = 0;
- goto no_fail;
-fail:
- Py_XDECREF(new_memview);
- retval = -1;
-no_fail:
- __Pyx_RefNannyFinishContext();
- return retval;
-}
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(PyObject *obj) {
- __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_BufFmt_StackElem stack[1];
- int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
- int retcode;
- if (obj == Py_None) {
- result.memview = (struct __pyx_memoryview_obj *) Py_None;
- return result;
- }
- retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
- PyBUF_RECORDS, 2,
- &__Pyx_TypeInfo_unsigned_char, stack,
- &result, obj);
- if (unlikely(retcode == -1))
- goto __pyx_fail;
- return result;
-__pyx_fail:
- result.memview = NULL;
- result.data = NULL;
- return result;
-}
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *obj) {
- __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_BufFmt_StackElem stack[1];
- int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
- int retcode;
- if (obj == Py_None) {
- result.memview = (struct __pyx_memoryview_obj *) Py_None;
- return result;
- }
- retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
- PyBUF_RECORDS, 2,
- &__Pyx_TypeInfo_double, stack,
- &result, obj);
- if (unlikely(retcode == -1))
- goto __pyx_fail;
- return result;
-__pyx_fail:
- result.memview = NULL;
- result.data = NULL;
- return result;
-}
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *obj) {
- __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_BufFmt_StackElem stack[1];
- int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
- int retcode;
- if (obj == Py_None) {
- result.memview = (struct __pyx_memoryview_obj *) Py_None;
- return result;
- }
- retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
- PyBUF_RECORDS, 2,
- &__Pyx_TypeInfo_float, stack,
- &result, obj);
- if (unlikely(retcode == -1))
- goto __pyx_fail;
- return result;
-__pyx_fail:
- result.memview = NULL;
- result.data = NULL;
- return result;
-}
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj) {
- __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_BufFmt_StackElem stack[1];
- int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
- int retcode;
- if (obj == Py_None) {
- result.memview = (struct __pyx_memoryview_obj *) Py_None;
- return result;
- }
- retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
- PyBUF_RECORDS, 2,
- &__Pyx_TypeInfo_int, stack,
- &result, obj);
- if (unlikely(retcode == -1))
- goto __pyx_fail;
- return result;
-__pyx_fail:
- result.memview = NULL;
- result.data = NULL;
- return result;
-}
-
-static int __Pyx_check_binary_version(void) {
- char ctversion[4], rtversion[4];
- PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
- PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
- if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
- char message[200];
- PyOS_snprintf(message, sizeof(message),
- "compiletime version %s of module '%.100s' "
- "does not match runtime version %s",
- ctversion, __Pyx_MODULE_NAME, rtversion);
- #if PY_VERSION_HEX < 0x02050000
- return PyErr_Warn(NULL, message);
- #else
- return PyErr_WarnEx(NULL, message, 1);
- #endif
- }
- return 0;
-}
-
-#ifndef __PYX_HAVE_RT_ImportModule
-#define __PYX_HAVE_RT_ImportModule
-static PyObject *__Pyx_ImportModule(const char *name) {
- PyObject *py_name = 0;
- PyObject *py_module = 0;
- py_name = __Pyx_PyIdentifier_FromString(name);
- if (!py_name)
- goto bad;
- py_module = PyImport_Import(py_name);
- Py_DECREF(py_name);
- return py_module;
-bad:
- Py_XDECREF(py_name);
- return 0;
-}
-#endif
-
-#ifndef __PYX_HAVE_RT_ImportType
-#define __PYX_HAVE_RT_ImportType
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
- size_t size, int strict)
-{
- PyObject *py_module = 0;
- PyObject *result = 0;
- PyObject *py_name = 0;
- char warning[200];
- Py_ssize_t basicsize;
-#ifdef Py_LIMITED_API
- PyObject *py_basicsize;
-#endif
- py_module = __Pyx_ImportModule(module_name);
- if (!py_module)
- goto bad;
- py_name = __Pyx_PyIdentifier_FromString(class_name);
- if (!py_name)
- goto bad;
- result = PyObject_GetAttr(py_module, py_name);
- Py_DECREF(py_name);
- py_name = 0;
- Py_DECREF(py_module);
- py_module = 0;
- if (!result)
- goto bad;
- if (!PyType_Check(result)) {
- PyErr_Format(PyExc_TypeError,
- "%s.%s is not a type object",
- module_name, class_name);
- goto bad;
- }
-#ifndef Py_LIMITED_API
- basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
- py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
- if (!py_basicsize)
- goto bad;
- basicsize = PyLong_AsSsize_t(py_basicsize);
- Py_DECREF(py_basicsize);
- py_basicsize = 0;
- if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
- goto bad;
-#endif
- if (!strict && (size_t)basicsize > size) {
- PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
- #if PY_VERSION_HEX < 0x02050000
- if (PyErr_Warn(NULL, warning) < 0) goto bad;
- #else
- if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
- #endif
- }
- else if ((size_t)basicsize != size) {
- PyErr_Format(PyExc_ValueError,
- "%s.%s has the wrong size, try recompiling",
- module_name, class_name);
- goto bad;
- }
- return (PyTypeObject *)result;
-bad:
- Py_XDECREF(py_module);
- Py_XDECREF(result);
- return NULL;
-}
-#endif
-
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
- int start = 0, mid = 0, end = count - 1;
- if (end >= 0 && code_line > entries[end].code_line) {
- return count;
- }
- while (start < end) {
- mid = (start + end) / 2;
- if (code_line < entries[mid].code_line) {
- end = mid;
- } else if (code_line > entries[mid].code_line) {
- start = mid + 1;
- } else {
- return mid;
- }
- }
- if (code_line <= entries[mid].code_line) {
- return mid;
- } else {
- return mid + 1;
- }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
- PyCodeObject* code_object;
- int pos;
- if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
- return NULL;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
- return NULL;
- }
- code_object = __pyx_code_cache.entries[pos].code_object;
- Py_INCREF(code_object);
- return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
- int pos, i;
- __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
- if (unlikely(!code_line)) {
- return;
- }
- if (unlikely(!entries)) {
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
- if (likely(entries)) {
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = 64;
- __pyx_code_cache.count = 1;
- entries[0].code_line = code_line;
- entries[0].code_object = code_object;
- Py_INCREF(code_object);
- }
- return;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
- PyCodeObject* tmp = entries[pos].code_object;
- entries[pos].code_object = code_object;
- Py_DECREF(tmp);
- return;
- }
- if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
- int new_max = __pyx_code_cache.max_count + 64;
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
- __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
- if (unlikely(!entries)) {
- return;
- }
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = new_max;
- }
- for (i=__pyx_code_cache.count; i>pos; i--) {
- entries[i] = entries[i-1];
- }
- entries[pos].code_line = code_line;
- entries[pos].code_object = code_object;
- __pyx_code_cache.count++;
- Py_INCREF(code_object);
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
- const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
- #if PY_MAJOR_VERSION < 3
- py_srcfile = PyString_FromString(filename);
- #else
- py_srcfile = PyUnicode_FromString(filename);
- #endif
- if (!py_srcfile) goto bad;
- if (c_line) {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #else
- py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #endif
- }
- else {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromString(funcname);
- #else
- py_funcname = PyUnicode_FromString(funcname);
- #endif
- }
- if (!py_funcname) goto bad;
- py_code = __Pyx_PyCode_New(
- 0, /*int argcount,*/
- 0, /*int kwonlyargcount,*/
- 0, /*int nlocals,*/
- 0, /*int stacksize,*/
- 0, /*int flags,*/
- __pyx_empty_bytes, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- py_line, /*int firstlineno,*/
- __pyx_empty_bytes /*PyObject *lnotab*/
- );
- Py_DECREF(py_srcfile);
- Py_DECREF(py_funcname);
- return py_code;
-bad:
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_globals = 0;
- PyFrameObject *py_frame = 0;
- py_code = __pyx_find_code_object(c_line ? c_line : py_line);
- if (!py_code) {
- py_code = __Pyx_CreateCodeObjectForTraceback(
- funcname, c_line, py_line, filename);
- if (!py_code) goto bad;
- __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
- }
- py_globals = PyModule_GetDict(__pyx_m);
- if (!py_globals) goto bad;
- py_frame = PyFrame_New(
- PyThreadState_GET(), /*PyThreadState *tstate,*/
- py_code, /*PyCodeObject *code,*/
- py_globals, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- #if PY_MAJOR_VERSION < 3
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else if (t->intern) {
- *t->p = PyString_InternFromString(t->s);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
- #else /* Python 3+ has unicode identifiers */
- if (t->is_unicode | t->is_str) {
- if (t->intern) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->encoding) {
- *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
- } else {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
- }
- } else {
- *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
- }
- #endif
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
- return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
- Py_ssize_t ignore;
- return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
- if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
- PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
- char* defenc_c;
- PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
- if (!defenc) return NULL;
- defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- {
- char* end = defenc_c + PyBytes_GET_SIZE(defenc);
- char* c;
- for (c = defenc_c; c < end; c++) {
- if ((unsigned char) (*c) >= 128) {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
- }
- }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
- *length = PyBytes_GET_SIZE(defenc);
- return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
- if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- if (PyUnicode_IS_ASCII(o)) {
- *length = PyUnicode_GET_DATA_SIZE(o);
- return PyUnicode_AsUTF8(o);
- } else {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
- return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
- } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
- {
- char* result;
- int r = PyBytes_AsStringAndSize(o, &result, length);
- if (r < 0) {
- return NULL;
- } else {
- return result;
- }
- }
-}
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- int is_true = x == Py_True;
- if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
- else return PyObject_IsTrue(x);
-}
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
- PyNumberMethods *m;
- const char *name = NULL;
- PyObject *res = NULL;
-#if PY_MAJOR_VERSION < 3
- if (PyInt_Check(x) || PyLong_Check(x))
-#else
- if (PyLong_Check(x))
-#endif
- return Py_INCREF(x), x;
- m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Int(x);
- }
- else if (m && m->nb_long) {
- name = "long";
- res = PyNumber_Long(x);
- }
-#else
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Long(x);
- }
-#endif
- if (res) {
-#if PY_MAJOR_VERSION < 3
- if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
- if (!PyLong_Check(res)) {
-#endif
- PyErr_Format(PyExc_TypeError,
- "__%s__ returned non-%s (type %.200s)",
- name, name, Py_TYPE(res)->tp_name);
- Py_DECREF(res);
- return NULL;
- }
- }
- else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "an integer is required");
- }
- return res;
-}
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject* x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
-#if PY_VERSION_HEX < 0x02050000
- if (ival <= LONG_MAX)
- return PyInt_FromLong((long)ival);
- else {
- unsigned char *bytes = (unsigned char *) &ival;
- int one = 1; int little = (int)*(unsigned char*)&one;
- return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
- }
-#else
- return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
- unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
- if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
- if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to size_t");
- return (size_t)-1;
- }
- return (size_t)val;
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/PyMca5/PyMcaGraph/ctools/_ctools/cython/default/_ctools.c b/PyMca5/PyMcaGraph/ctools/_ctools/cython/default/_ctools.c
new file mode 100644
index 0000000..4732da9
--- /dev/null
+++ b/PyMca5/PyMcaGraph/ctools/_ctools/cython/default/_ctools.c
@@ -0,0 +1,28414 @@
+/* Generated by Cython 0.28.3 */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+ #error Cython requires Python 2.6+ or Python 3.3+.
+#else
+#define CYTHON_ABI "0_28_3"
+#define CYTHON_FUTURE_DIVISION 0
+#include <stddef.h>
+#ifndef offsetof
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#define __PYX_COMMA ,
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x02070000
+ #define HAVE_LONG_LONG
+ #endif
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #if PY_VERSION_HEX < 0x03050000
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+#else
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+#ifndef __has_cpp_attribute
+ #define __has_cpp_attribute(x) 0
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+#ifdef _MSC_VER
+ #ifndef _MSC_STDINT_H_
+ #if _MSC_VER < 1300
+ typedef unsigned char uint8_t;
+ typedef unsigned int uint32_t;
+ #else
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int32 uint32_t;
+ #endif
+ #endif
+#else
+ #include <stdint.h>
+#endif
+#ifndef CYTHON_FALLTHROUGH
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #if __has_cpp_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
+ #elif __has_cpp_attribute(clang::fallthrough)
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
+ #endif
+ #endif
+ #ifndef CYTHON_FALLTHROUGH
+ #if __has_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+#endif
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#ifndef Py_TPFLAGS_CHECKTYPES
+ #define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
+ #ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ #endif
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
+#endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
+#include "pythread.h"
+#define Py_tss_NEEDS_INIT 0
+typedef int Py_tss_t;
+static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
+ *key = PyThread_create_key();
+ return 0; // PyThread_create_key reports success always
+}
+static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
+ *key = Py_tss_NEEDS_INIT;
+ return key;
+}
+static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
+ PyObject_Free(key);
+}
+static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
+ return *key != Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
+ PyThread_delete_key(*key);
+ *key = Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
+ return PyThread_set_key_value(*key, value);
+}
+static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
+ return PyThread_get_key_value(*key);
+}
+#endif // TSS (Thread Specific Storage) API
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n) PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
+#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
+#else
+#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+ #define PyObject_Unicode PyObject_Str
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#if CYTHON_ASSUME_SAFE_MACROS
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
+#else
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
+ #else
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+ #endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
+#endif
+
+
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#define __PYX_HAVE__PyMca5__PyMcaGraph__ctools___ctools
+#define __PYX_HAVE_API__PyMca5__PyMcaGraph__ctools___ctools
+/* Early includes */
+#include "InsidePolygonWithBounds.h"
+#include <string.h>
+#include <stdio.h>
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "MinMax.h"
+#include "Colormap.h"
+#include "pythread.h"
+#include <stdlib.h>
+#include "pystate.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER)
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_ASSUME_SAFE_MACROS
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
+
+static PyObject *__pyx_m = NULL;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_cython_runtime = NULL;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+/* Header.proto */
+#if !defined(CYTHON_CCOMPLEX)
+ #if defined(__cplusplus)
+ #define CYTHON_CCOMPLEX 1
+ #elif defined(_Complex_I)
+ #define CYTHON_CCOMPLEX 1
+ #else
+ #define CYTHON_CCOMPLEX 0
+ #endif
+#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #include <complex>
+ #else
+ #include <complex.h>
+ #endif
+#endif
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+ #undef _Complex_I
+ #define _Complex_I 1.0fj
+#endif
+
+
+static const char *__pyx_f[] = {
+ "PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\MinMax.pyx",
+ "PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\Colormap.pyx",
+ "PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\_ctools.pyx",
+ "__init__.pxd",
+ "stringsource",
+ "type.pxd",
+};
+/* NoFastGil.proto */
+#define __Pyx_PyGILState_Ensure PyGILState_Ensure
+#define __Pyx_PyGILState_Release PyGILState_Release
+#define __Pyx_FastGIL_Remember()
+#define __Pyx_FastGIL_Forget()
+#define __Pyx_FastGilFuncInit()
+
+/* BufferFormatStructs.proto */
+#define IS_UNSIGNED(type) (((type) -1) > 0)
+struct __Pyx_StructField_;
+#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
+typedef struct {
+ const char* name;
+ struct __Pyx_StructField_* fields;
+ size_t size;
+ size_t arraysize[8];
+ int ndim;
+ char typegroup;
+ char is_unsigned;
+ int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+ __Pyx_TypeInfo* type;
+ const char* name;
+ size_t offset;
+} __Pyx_StructField;
+typedef struct {
+ __Pyx_StructField* field;
+ size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+ __Pyx_StructField root;
+ __Pyx_BufFmt_StackElem* head;
+ size_t fmt_offset;
+ size_t new_count, enc_count;
+ size_t struct_alignment;
+ int is_complex;
+ char enc_type;
+ char new_packmode;
+ char enc_packmode;
+ char is_valid_array;
+} __Pyx_BufFmt_Context;
+
+/* MemviewSliceStruct.proto */
+struct __pyx_memoryview_obj;
+typedef struct {
+ struct __pyx_memoryview_obj *memview;
+ char *data;
+ Py_ssize_t shape[8];
+ Py_ssize_t strides[8];
+ Py_ssize_t suboffsets[8];
+} __Pyx_memviewslice;
+#define __Pyx_MemoryView_Len(m) (m.shape[0])
+
+/* Atomics.proto */
+#include <pythread.h>
+#ifndef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 1
+#endif
+#define __pyx_atomic_int_type int
+#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
+ !defined(__i386__)
+ #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
+ #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using GNU atomics"
+ #endif
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
+ #include <Windows.h>
+ #undef __pyx_atomic_int_type
+ #define __pyx_atomic_int_type LONG
+ #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #pragma message ("Using MSVC atomics")
+ #endif
+#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
+ #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using Intel atomics"
+ #endif
+#else
+ #undef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 0
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Not using atomics"
+ #endif
+#endif
+typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
+#if CYTHON_ATOMICS
+ #define __pyx_add_acquisition_count(memview)\
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview)\
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+#else
+ #define __pyx_add_acquisition_count(memview)\
+ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview)\
+ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+#endif
+
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":730
+ * # in Cython to enable them only on the right systems.
+ *
+ * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ */
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":731
+ *
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t
+ */
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":732
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int64 int64_t
+ * #ctypedef npy_int96 int96_t
+ */
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":733
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_int96 int96_t
+ * #ctypedef npy_int128 int128_t
+ */
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":737
+ * #ctypedef npy_int128 int128_t
+ *
+ * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ */
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":738
+ *
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t
+ */
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":739
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint64 uint64_t
+ * #ctypedef npy_uint96 uint96_t
+ */
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":740
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_uint96 uint96_t
+ * #ctypedef npy_uint128 uint128_t
+ */
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":744
+ * #ctypedef npy_uint128 uint128_t
+ *
+ * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_float64 float64_t
+ * #ctypedef npy_float80 float80_t
+ */
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":745
+ *
+ * ctypedef npy_float32 float32_t
+ * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_float80 float80_t
+ * #ctypedef npy_float128 float128_t
+ */
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":754
+ * # The int types are mapped a bit surprising --
+ * # numpy.int corresponds to 'l' and numpy.long to 'q'
+ * ctypedef npy_long int_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t
+ */
+typedef npy_long __pyx_t_5numpy_int_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":755
+ * # numpy.int corresponds to 'l' and numpy.long to 'q'
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong longlong_t
+ *
+ */
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":756
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_ulong uint_t
+ */
+typedef npy_longlong __pyx_t_5numpy_longlong_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":758
+ * ctypedef npy_longlong longlong_t
+ *
+ * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t
+ */
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":759
+ *
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":760
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_intp intp_t
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":762
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uintp uintp_t
+ *
+ */
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":763
+ *
+ * ctypedef npy_intp intp_t
+ * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_double float_t
+ */
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":765
+ * ctypedef npy_uintp uintp_t
+ *
+ * ctypedef npy_double float_t # <<<<<<<<<<<<<<
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t
+ */
+typedef npy_double __pyx_t_5numpy_float_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":766
+ *
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longdouble longdouble_t
+ *
+ */
+typedef npy_double __pyx_t_5numpy_double_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":767
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cfloat cfloat_t
+ */
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+
+/* "Colormap.pxd":29
+ * #
+ * #############################################################################*[inserted by cython to avoid comment closer]/
+ * ctypedef unsigned char uint8_t # TODO use libc.stdint when available # <<<<<<<<<<<<<<
+ *
+ * cdef extern from "Colormap.h":
+ */
+typedef unsigned char __pyx_t_8Colormap_uint8_t;
+/* Declarations.proto */
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+
+/* Declarations.proto */
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+
+
+/*--- Type declarations ---*/
+struct __pyx_array_obj;
+struct __pyx_MemviewEnum_obj;
+struct __pyx_memoryview_obj;
+struct __pyx_memoryviewslice_obj;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":769
+ * ctypedef npy_longdouble longdouble_t
+ *
+ * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t
+ */
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":770
+ *
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ */
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cdouble complex_t
+ */
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":773
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ */
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+
+/* "View.MemoryView":104
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+struct __pyx_array_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
+ char *data;
+ Py_ssize_t len;
+ char *format;
+ int ndim;
+ Py_ssize_t *_shape;
+ Py_ssize_t *_strides;
+ Py_ssize_t itemsize;
+ PyObject *mode;
+ PyObject *_format;
+ void (*callback_free_data)(void *);
+ int free_data;
+ int dtype_is_object;
+};
+
+
+/* "View.MemoryView":278
+ *
+ * @cname('__pyx_MemviewEnum')
+ * cdef class Enum(object): # <<<<<<<<<<<<<<
+ * cdef object name
+ * def __init__(self, name):
+ */
+struct __pyx_MemviewEnum_obj {
+ PyObject_HEAD
+ PyObject *name;
+};
+
+
+/* "View.MemoryView":329
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+struct __pyx_memoryview_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_memoryview *__pyx_vtab;
+ PyObject *obj;
+ PyObject *_size;
+ PyObject *_array_interface;
+ PyThread_type_lock lock;
+ __pyx_atomic_int acquisition_count[2];
+ __pyx_atomic_int *acquisition_count_aligned_p;
+ Py_buffer view;
+ int flags;
+ int dtype_is_object;
+ __Pyx_TypeInfo *typeinfo;
+};
+
+
+/* "View.MemoryView":960
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+struct __pyx_memoryviewslice_obj {
+ struct __pyx_memoryview_obj __pyx_base;
+ __Pyx_memviewslice from_slice;
+ PyObject *from_object;
+ PyObject *(*to_object_func)(char *);
+ int (*to_dtype_func)(char *, PyObject *);
+};
+
+
+
+/* "View.MemoryView":104
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":329
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+
+struct __pyx_vtabstruct_memoryview {
+ char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
+ PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
+};
+static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
+
+
+/* "View.MemoryView":960
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+
+struct __pyx_vtabstruct__memoryviewslice {
+ struct __pyx_vtabstruct_memoryview __pyx_base;
+};
+static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ if (acquire_gil) {\
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ PyGILState_Release(__pyx_gilstate_save);\
+ } else {\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext()\
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_XDECREF(tmp);\
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_DECREF(tmp);\
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+/* GetBuiltinName.proto */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+/* RaiseDoubleKeywords.proto */
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
+ const char* function_name);
+
+/* RaiseArgTupleInvalid.proto */
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+/* ArgTypeTest.proto */
+#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
+ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
+ __Pyx__ArgTypeTest(obj, type, name, exact))
+static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
+
+/* SliceObject.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(
+ PyObject* obj, Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** py_start, PyObject** py_stop, PyObject** py_slice,
+ int has_cstart, int has_cstop, int wraparound);
+
+/* IncludeStringH.proto */
+#include <string.h>
+
+/* BytesEquals.proto */
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+
+/* UnicodeEquals.proto */
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+
+/* StrEquals.proto */
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
+
+/* GetModuleGlobalName.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+/* PyObjectCall.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+/* ExtTypeTest.proto */
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCallMethO.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+/* PyObjectCallOneArg.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred() PyErr_Occurred()
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
+ __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck);
+
+/* ObjectGetItem.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
+#else
+#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
+#endif
+
+/* IsLittleEndian.proto */
+static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
+
+/* BufferFormatCheck.proto */
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type);
+
+/* BufferGetAndValidate.proto */
+#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
+ ((obj == Py_None || obj == NULL) ?\
+ (__Pyx_ZeroBuffer(buf), 0) :\
+ __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
+static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
+ __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
+static void __Pyx_ZeroBuffer(Py_buffer* buf);
+static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
+static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
+static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+/* PyObjectSetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
+static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
+#else
+#define __Pyx_PyObject_DelAttrStr(o,n) PyObject_DelAttr(o,n)
+#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
+#endif
+
+/* MemviewSliceInit.proto */
+#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
+#define __Pyx_MEMVIEW_DIRECT 1
+#define __Pyx_MEMVIEW_PTR 2
+#define __Pyx_MEMVIEW_FULL 4
+#define __Pyx_MEMVIEW_CONTIG 8
+#define __Pyx_MEMVIEW_STRIDED 16
+#define __Pyx_MEMVIEW_FOLLOW 32
+#define __Pyx_IS_C_CONTIG 1
+#define __Pyx_IS_F_CONTIG 2
+static int __Pyx_init_memviewslice(
+ struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference);
+static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
+#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
+#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
+#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
+static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+
+#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
+#define __Pyx_PyObject_Dict_GetItem(obj, name)\
+ (likely(PyDict_CheckExact(obj)) ?\
+ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
+#else
+#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
+#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
+#endif
+
+/* RaiseTooManyValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+/* RaiseNeedMoreValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+/* RaiseNoneIterError.proto */
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
+
+/* UnaryNegOverflows.proto */
+#define UNARY_NEG_WOULD_OVERFLOW(x)\
+ (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* GetAttr.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+/* decode_c_string_utf16.proto */
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = 0;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = -1;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = 1;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+
+/* decode_c_string.proto */
+static CYTHON_INLINE PyObject* __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));
+
+/* GetAttr3.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
+
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
+
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* ListExtend.proto */
+static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject* none = _PyList_Extend((PyListObject*)L, v);
+ if (unlikely(!none))
+ return -1;
+ Py_DECREF(none);
+ return 0;
+#else
+ return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
+#endif
+}
+
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+/* None.proto */
+static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
+
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
+
+/* WriteUnraisableException.proto */
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback, int nogil);
+
+/* ImportFrom.proto */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+/* HasAttr.proto */
+static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
+
+/* PyObject_GenericGetAttrNoDict.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
+#endif
+
+/* PyObject_GenericGetAttr.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
+#endif
+
+/* SetVTable.proto */
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+/* SetupReduce.proto */
+static int __Pyx_setup_reduce(PyObject* type_obj);
+
+/* CLineInTraceback.proto */
+#ifdef CYTHON_CLINE_IN_TRACEBACK
+#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
+#else
+static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
+#endif
+
+/* CodeObjectCache.proto */
+typedef struct {
+ PyCodeObject* code_object;
+ int code_line;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+/* AddTraceback.proto */
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+#if PY_MAJOR_VERSION < 3
+ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+ static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+ #define __Pyx_GetBuffer PyObject_GetBuffer
+ #define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+
+/* BufferStructDeclare.proto */
+typedef struct {
+ Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+ size_t refcount;
+ Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+ __Pyx_Buffer *rcbuffer;
+ char *data;
+ __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
+
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+/* RealImag.proto */
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #define __Pyx_CREAL(z) ((z).real())
+ #define __Pyx_CIMAG(z) ((z).imag())
+ #else
+ #define __Pyx_CREAL(z) (__real__(z))
+ #define __Pyx_CIMAG(z) (__imag__(z))
+ #endif
+#else
+ #define __Pyx_CREAL(z) ((z).real)
+ #define __Pyx_CIMAG(z) ((z).imag)
+#endif
+#if defined(__cplusplus) && CYTHON_CCOMPLEX\
+ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
+ #define __Pyx_SET_CREAL(z,x) ((z).real(x))
+ #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
+#else
+ #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+ #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
+#endif
+
+/* Arithmetic.proto */
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq_float(a, b) ((a)==(b))
+ #define __Pyx_c_sum_float(a, b) ((a)+(b))
+ #define __Pyx_c_diff_float(a, b) ((a)-(b))
+ #define __Pyx_c_prod_float(a, b) ((a)*(b))
+ #define __Pyx_c_quot_float(a, b) ((a)/(b))
+ #define __Pyx_c_neg_float(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
+ #define __Pyx_c_conj_float(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs_float(z) (::std::abs(z))
+ #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero_float(z) ((z)==0)
+ #define __Pyx_c_conj_float(z) (conjf(z))
+ #if 1
+ #define __Pyx_c_abs_float(z) (cabsf(z))
+ #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ #endif
+#endif
+
+/* Arithmetic.proto */
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq_double(a, b) ((a)==(b))
+ #define __Pyx_c_sum_double(a, b) ((a)+(b))
+ #define __Pyx_c_diff_double(a, b) ((a)-(b))
+ #define __Pyx_c_prod_double(a, b) ((a)*(b))
+ #define __Pyx_c_quot_double(a, b) ((a)/(b))
+ #define __Pyx_c_neg_double(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
+ #define __Pyx_c_conj_double(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs_double(z) (::std::abs(z))
+ #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero_double(z) ((z)==0)
+ #define __Pyx_c_conj_double(z) (conj(z))
+ #if 1
+ #define __Pyx_c_abs_double(z) (cabs(z))
+ #define __Pyx_c_pow_double(a, b) (cpow(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ #endif
+#endif
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
+
+/* MemviewSliceCopyTemplate.proto */
+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);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+/* TypeInfoCompare.proto */
+static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+
+/* MemviewSliceValidateAndInit.proto */
+static int __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);
+
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(PyObject *, int writable_flag);
+
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *, int writable_flag);
+
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *, int writable_flag);
+
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *, int writable_flag);
+
+/* CheckBinaryVersion.proto */
+static int __Pyx_check_binary_version(void);
+
+/* PyIdentifierFromString.proto */
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+/* ModuleImport.proto */
+static PyObject *__Pyx_ImportModule(const char *name);
+
+/* TypeImport.proto */
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+/* InitStrings.proto */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
+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*/
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+
+/* Module declarations from 'cython.view' */
+
+/* Module declarations from 'cython' */
+
+/* Module declarations from 'InsidePolygonWithBounds' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'numpy' */
+
+/* Module declarations from 'numpy' */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+
+/* Module declarations from 'MinMax' */
+
+/* Module declarations from 'Colormap' */
+
+/* Module declarations from 'PyMca5.PyMcaGraph.ctools._ctools' */
+static PyTypeObject *__pyx_array_type = 0;
+static PyTypeObject *__pyx_MemviewEnum_type = 0;
+static PyTypeObject *__pyx_memoryview_type = 0;
+static PyTypeObject *__pyx_memoryviewslice_type = 0;
+static PyObject *generic = 0;
+static PyObject *strided = 0;
+static PyObject *indirect = 0;
+static PyObject *contiguous = 0;
+static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
+static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
+static void *__pyx_align_pointer(void *, size_t); /*proto*/
+static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
+static PyObject *_unellipsify(PyObject *, int); /*proto*/
+static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
+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*/
+static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
+static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
+static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
+static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
+static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
+static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
+static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
+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 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_unsigned_char = { "unsigned char", NULL, sizeof(unsigned char), { 0 }, 0, IS_UNSIGNED(unsigned char) ? 'U' : 'I', IS_UNSIGNED(unsigned char), 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_float = { "float", NULL, sizeof(float), { 0 }, 0, 'R', 0, 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
+#define __Pyx_MODULE_NAME "PyMca5.PyMcaGraph.ctools._ctools"
+extern int __pyx_module_is_main_PyMca5__PyMcaGraph__ctools___ctools;
+int __pyx_module_is_main_PyMca5__PyMcaGraph__ctools___ctools = 0;
+
+/* Implementation of 'PyMca5.PyMcaGraph.ctools._ctools' */
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_ImportError;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_enumerate;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_Ellipsis;
+static PyObject *__pyx_builtin_id;
+static PyObject *__pyx_builtin_IndexError;
+static const char __pyx_k_C[] = "C";
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_f2[] = "f2";
+static const char __pyx_k_f4[] = "f4";
+static const char __pyx_k_f8[] = "f8";
+static const char __pyx_k_i1[] = "i1";
+static const char __pyx_k_i2[] = "i2";
+static const char __pyx_k_i4[] = "i4";
+static const char __pyx_k_i8[] = "i8";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_np[] = "np";
+static const char __pyx_k_u1[] = "u1";
+static const char __pyx_k_u2[] = "u2";
+static const char __pyx_k_u4[] = "u4";
+static const char __pyx_k_u8[] = "u8";
+static const char __pyx_k_new[] = "__new__";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_str[] = "str";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_data[] = "data";
+static const char __pyx_k_dict[] = "__dict__";
+static const char __pyx_k_int8[] = "int8";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mask[] = "mask";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_c_end[] = "c_end";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_empty[] = "empty";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_int16[] = "int16";
+static const char __pyx_k_int32[] = "int32";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_order[] = "order";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_uint8[] = "uint8";
+static const char __pyx_k_value[] = "value";
+static const char __pyx_k_zeros[] = "zeros";
+static const char __pyx_k_border[] = "border";
+static const char __pyx_k_c_data[] = "c_data";
+static const char __pyx_k_c_type[] = "c_type";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_minMax[] = "minMax";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_pickle[] = "pickle";
+static const char __pyx_k_pixmap[] = "pixmap";
+static const char __pyx_k_pnpoly[] = "pnpoly";
+static const char __pyx_k_points[] = "points";
+static const char __pyx_k_reduce[] = "__reduce__";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_uint16[] = "uint16";
+static const char __pyx_k_uint32[] = "uint32";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_update[] = "update";
+static const char __pyx_k_asarray[] = "asarray";
+static const char __pyx_k_c_start[] = "c_start";
+static const char __pyx_k_float32[] = "float32";
+static const char __pyx_k_float64[] = "float64";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_pnpolyd[] = "_pnpolyd";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_c_pixmap[] = "c_pixmap";
+static const char __pyx_k_c_points[] = "c_points";
+static const char __pyx_k_colormap[] = "colormap";
+static const char __pyx_k_endValue[] = "endValue";
+static const char __pyx_k_getstate[] = "__getstate__";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_n_points[] = "n_points";
+static const char __pyx_k_nanColor[] = "nanColor";
+static const char __pyx_k_pyx_type[] = "__pyx_type";
+static const char __pyx_k_setstate[] = "__setstate__";
+static const char __pyx_k_vertices[] = "vertices";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_c_dataMax[] = "c_dataMax";
+static const char __pyx_k_c_dataMin[] = "c_dataMin";
+static const char __pyx_k_c_dataPtr[] = "c_dataPtr";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_fastLog10[] = "fastLog10";
+static const char __pyx_k_pnpolyInt[] = "_pnpolyInt";
+static const char __pyx_k_pyx_state[] = "__pyx_state";
+static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_c_colormap[] = "c_colormap";
+static const char __pyx_k_c_dataSize[] = "c_dataSize";
+static const char __pyx_k_c_nanColor[] = "c_nanColor";
+static const char __pyx_k_c_vertices[] = "c_vertices";
+static const char __pyx_k_n_vertices[] = "n_vertices";
+static const char __pyx_k_pyx_result[] = "__pyx_result";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_startValue[] = "startValue";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_PickleError[] = "PickleError";
+static const char __pyx_k_minPositive[] = "minPositive";
+static const char __pyx_k_pnpolyFloat[] = "_pnpolyFloat";
+static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_c_dataMinPos[] = "c_dataMinPos";
+static const char __pyx_k_c_startExtra[] = "c_startExtra";
+static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
+static const char __pyx_k_stringsource[] = "stringsource";
+static const char __pyx_k_c_nanColorPtr[] = "c_nanColorPtr";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
+static const char __pyx_k_c_dataItemSize[] = "c_dataItemSize";
+static const char __pyx_k_isLog10Mapping[] = "isLog10Mapping";
+static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
+static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
+static const char __pyx_k_zero_size_array[] = "zero-size array";
+static const char __pyx_k_c_colormapLength[] = "c_colormapLength";
+static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
+static const char __pyx_k_NUMPY_TO_TYPE_DESC[] = "_NUMPY_TO_TYPE_DESC";
+static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_dataToRGBAColormap[] = "dataToRGBAColormap";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
+static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
+static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_PyMca5_PyMcaGraph_ctools__ctools[] = "PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\MinMax.pyx";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
+static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static const char __pyx_k_PyMca5_PyMcaGraph_ctools__ctools_2[] = "PyMca5.PyMcaGraph.ctools._ctools";
+static const char __pyx_k_PyMca5_PyMcaGraph_ctools__ctools_3[] = "PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\Colormap.pyx";
+static const char __pyx_k_PyMca5_PyMcaGraph_ctools__ctools_4[] = "PyMca5\\PyMcaGraph\\ctools\\_ctools\\cython\\_ctools.pyx";
+static PyObject *__pyx_n_s_ASCII;
+static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
+static PyObject *__pyx_n_s_C;
+static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
+static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
+static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
+static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
+static PyObject *__pyx_n_s_Ellipsis;
+static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_n_s_ImportError;
+static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
+static PyObject *__pyx_n_s_IndexError;
+static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
+static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
+static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
+static PyObject *__pyx_kp_s_MemoryView_of_r_object;
+static PyObject *__pyx_n_s_NUMPY_TO_TYPE_DESC;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_b_O;
+static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
+static PyObject *__pyx_n_s_PickleError;
+static PyObject *__pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools;
+static PyObject *__pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2;
+static PyObject *__pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_3;
+static PyObject *__pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_4;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_View_MemoryView;
+static PyObject *__pyx_n_s_allocate_buffer;
+static PyObject *__pyx_n_s_asarray;
+static PyObject *__pyx_n_s_ascontiguousarray;
+static PyObject *__pyx_n_s_base;
+static PyObject *__pyx_n_s_border;
+static PyObject *__pyx_n_s_c;
+static PyObject *__pyx_n_u_c;
+static PyObject *__pyx_n_s_c_colormap;
+static PyObject *__pyx_n_s_c_colormapLength;
+static PyObject *__pyx_n_s_c_data;
+static PyObject *__pyx_n_s_c_dataItemSize;
+static PyObject *__pyx_n_s_c_dataMax;
+static PyObject *__pyx_n_s_c_dataMin;
+static PyObject *__pyx_n_s_c_dataMinPos;
+static PyObject *__pyx_n_s_c_dataPtr;
+static PyObject *__pyx_n_s_c_dataSize;
+static PyObject *__pyx_n_s_c_end;
+static PyObject *__pyx_n_s_c_nanColor;
+static PyObject *__pyx_n_s_c_nanColorPtr;
+static PyObject *__pyx_n_s_c_pixmap;
+static PyObject *__pyx_n_s_c_points;
+static PyObject *__pyx_n_s_c_start;
+static PyObject *__pyx_n_s_c_startExtra;
+static PyObject *__pyx_n_s_c_type;
+static PyObject *__pyx_n_s_c_vertices;
+static PyObject *__pyx_n_s_class;
+static PyObject *__pyx_n_s_cline_in_traceback;
+static PyObject *__pyx_n_s_colormap;
+static PyObject *__pyx_kp_s_contiguous_and_direct;
+static PyObject *__pyx_kp_s_contiguous_and_indirect;
+static PyObject *__pyx_n_s_data;
+static PyObject *__pyx_n_s_dataToRGBAColormap;
+static PyObject *__pyx_n_s_dict;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_empty;
+static PyObject *__pyx_n_s_encode;
+static PyObject *__pyx_n_s_endValue;
+static PyObject *__pyx_n_s_enumerate;
+static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_f2;
+static PyObject *__pyx_n_s_f4;
+static PyObject *__pyx_n_s_f8;
+static PyObject *__pyx_n_s_fastLog10;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_float32;
+static PyObject *__pyx_n_s_float64;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fortran;
+static PyObject *__pyx_n_u_fortran;
+static PyObject *__pyx_n_s_getstate;
+static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
+static PyObject *__pyx_n_s_i1;
+static PyObject *__pyx_n_s_i2;
+static PyObject *__pyx_n_s_i4;
+static PyObject *__pyx_n_s_i8;
+static PyObject *__pyx_n_s_id;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_int16;
+static PyObject *__pyx_n_s_int32;
+static PyObject *__pyx_n_s_int8;
+static PyObject *__pyx_n_s_isLog10Mapping;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_mask;
+static PyObject *__pyx_n_s_memview;
+static PyObject *__pyx_n_s_minMax;
+static PyObject *__pyx_n_s_minPositive;
+static PyObject *__pyx_n_s_mode;
+static PyObject *__pyx_n_s_n_points;
+static PyObject *__pyx_n_s_n_vertices;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_name_2;
+static PyObject *__pyx_n_s_nanColor;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_ndim;
+static PyObject *__pyx_n_s_new;
+static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
+static PyObject *__pyx_n_s_np;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
+static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
+static PyObject *__pyx_n_s_obj;
+static PyObject *__pyx_n_s_order;
+static PyObject *__pyx_n_s_pack;
+static PyObject *__pyx_n_s_pickle;
+static PyObject *__pyx_n_s_pixmap;
+static PyObject *__pyx_n_s_pnpoly;
+static PyObject *__pyx_n_s_pnpolyFloat;
+static PyObject *__pyx_n_s_pnpolyInt;
+static PyObject *__pyx_n_s_pnpolyd;
+static PyObject *__pyx_n_s_points;
+static PyObject *__pyx_n_s_pyx_PickleError;
+static PyObject *__pyx_n_s_pyx_checksum;
+static PyObject *__pyx_n_s_pyx_getbuffer;
+static PyObject *__pyx_n_s_pyx_result;
+static PyObject *__pyx_n_s_pyx_state;
+static PyObject *__pyx_n_s_pyx_type;
+static PyObject *__pyx_n_s_pyx_unpickle_Enum;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_reduce;
+static PyObject *__pyx_n_s_reduce_cython;
+static PyObject *__pyx_n_s_reduce_ex;
+static PyObject *__pyx_n_s_setstate;
+static PyObject *__pyx_n_s_setstate_cython;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_size;
+static PyObject *__pyx_n_s_start;
+static PyObject *__pyx_n_s_startValue;
+static PyObject *__pyx_n_s_step;
+static PyObject *__pyx_n_s_stop;
+static PyObject *__pyx_n_s_str;
+static PyObject *__pyx_kp_s_strided_and_direct;
+static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
+static PyObject *__pyx_kp_s_strided_and_indirect;
+static PyObject *__pyx_kp_s_stringsource;
+static PyObject *__pyx_n_s_struct;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_n_s_u1;
+static PyObject *__pyx_n_s_u2;
+static PyObject *__pyx_n_s_u4;
+static PyObject *__pyx_n_s_u8;
+static PyObject *__pyx_n_s_uint16;
+static PyObject *__pyx_n_s_uint32;
+static PyObject *__pyx_n_s_uint8;
+static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
+static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_unpack;
+static PyObject *__pyx_n_s_update;
+static PyObject *__pyx_n_s_value;
+static PyObject *__pyx_n_s_vertices;
+static PyObject *__pyx_kp_s_zero_size_array;
+static PyObject *__pyx_n_s_zeros;
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, int __pyx_v_minPositive); /* proto */
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyArrayObject *__pyx_v_colormap, PyObject *__pyx_v_startValue, PyObject *__pyx_v_endValue, int __pyx_v_isLog10Mapping, PyObject *__pyx_v_nanColor); /* proto */
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_4fastLog10(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value); /* proto */
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_8_pnpolyd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_10_pnpolyFloat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_12_pnpolyInt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border); /* proto */
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
+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 */
+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 */
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+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 */
+static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
+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 */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
+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 */
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+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 */
+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 */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+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 */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+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 */
+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 */
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2;
+static PyObject *__pyx_int_3;
+static PyObject *__pyx_int_4;
+static PyObject *__pyx_int_5;
+static PyObject *__pyx_int_6;
+static PyObject *__pyx_int_7;
+static PyObject *__pyx_int_10;
+static PyObject *__pyx_int_11;
+static PyObject *__pyx_int_184977713;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_slice_;
+static PyObject *__pyx_slice__3;
+static PyObject *__pyx_slice__4;
+static PyObject *__pyx_slice__5;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_slice__31;
+static PyObject *__pyx_slice__32;
+static PyObject *__pyx_slice__33;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__15;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__17;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__21;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__23;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__34;
+static PyObject *__pyx_tuple__35;
+static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__37;
+static PyObject *__pyx_tuple__39;
+static PyObject *__pyx_tuple__41;
+static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_tuple__45;
+static PyObject *__pyx_tuple__47;
+static PyObject *__pyx_tuple__49;
+static PyObject *__pyx_tuple__51;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__53;
+static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_tuple__55;
+static PyObject *__pyx_tuple__56;
+static PyObject *__pyx_codeobj__38;
+static PyObject *__pyx_codeobj__40;
+static PyObject *__pyx_codeobj__42;
+static PyObject *__pyx_codeobj__44;
+static PyObject *__pyx_codeobj__46;
+static PyObject *__pyx_codeobj__48;
+static PyObject *__pyx_codeobj__50;
+static PyObject *__pyx_codeobj__57;
+/* Late includes */
+
+/* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":55
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def minMax(np.ndarray data, bint minPositive=False): # <<<<<<<<<<<<<<
+ * """Get min, max and optionally min positive of data.
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax[] = "Get min, max and optionally min positive of data.\n\n NaNs are ignored while computing min/max.\n If all data is NaNs, returned min/max are NaNs and\n returned minPositive is None.\n\n :param np.ndarray data: Array of data\n :param bool minPositive: Wheither to compute min positive or not.\n :returns: (min, max) or (min, minPositive, max) if minPositive is True\n If all data < 0, minPositive is None.\n :rtype: tuple of float\n :raises: ValueError if data is empty\n ";
+static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax = {"minMax", (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax};
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyArrayObject *__pyx_v_data = 0;
+ int __pyx_v_minPositive;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("minMax (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_minPositive,0};
+ PyObject* values[2] = {0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_minPositive);
+ if (value) { values[1] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "minMax") < 0)) __PYX_ERR(0, 55, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_data = ((PyArrayObject *)values[0]);
+ if (values[1]) {
+ __pyx_v_minPositive = __Pyx_PyObject_IsTrue(values[1]); if (unlikely((__pyx_v_minPositive == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 55, __pyx_L3_error)
+ } else {
+ __pyx_v_minPositive = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("minMax", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 55, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.minMax", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data), __pyx_ptype_5numpy_ndarray, 1, "data", 0))) __PYX_ERR(0, 55, __pyx_L1_error)
+ __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax(__pyx_self, __pyx_v_data, __pyx_v_minPositive);
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_minMax(CYTHON_UNUSED PyObject *__pyx_self, PyArrayObject *__pyx_v_data, int __pyx_v_minPositive) {
+ PyArrayObject *__pyx_v_c_data = 0;
+ void *__pyx_v_c_dataPtr;
+ unsigned long __pyx_v_c_dataSize;
+ double __pyx_v_c_dataMin;
+ double __pyx_v_c_dataMinPos;
+ double __pyx_v_c_dataMax;
+ unsigned int __pyx_v_c_type;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ char *__pyx_t_7;
+ unsigned long __pyx_t_8;
+ unsigned int __pyx_t_9;
+ __Pyx_RefNannySetupContext("minMax", 0);
+ __Pyx_INCREF((PyObject *)__pyx_v_data);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":70
+ * """
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_slice_, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_f2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_3) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":71
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2':
+ * data = np.asarray(data, dtype=np.float32) # <<<<<<<<<<<<<<
+ *
+ * cdef np.ndarray c_data = np.ascontiguousarray(data)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)__pyx_v_data));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_data));
+ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 71, __pyx_L1_error)
+ __Pyx_DECREF_SET(__pyx_v_data, ((PyArrayObject *)__pyx_t_6));
+ __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":70
+ * """
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":73
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ * cdef np.ndarray c_data = np.ascontiguousarray(data) # <<<<<<<<<<<<<<
+ * cdef void * c_dataPtr = c_data.data
+ * cdef unsigned long c_dataSize = c_data.size
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, ((PyObject *)__pyx_v_data)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_data)};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, ((PyObject *)__pyx_v_data)};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(((PyObject *)__pyx_v_data));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_data));
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, ((PyObject *)__pyx_v_data));
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 73, __pyx_L1_error)
+ __pyx_v_c_data = ((PyArrayObject *)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":74
+ *
+ * cdef np.ndarray c_data = np.ascontiguousarray(data)
+ * cdef void * c_dataPtr = c_data.data # <<<<<<<<<<<<<<
+ * cdef unsigned long c_dataSize = c_data.size
+ *
+ */
+ __pyx_t_7 = __pyx_v_c_data->data;
+ __pyx_v_c_dataPtr = __pyx_t_7;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":75
+ * cdef np.ndarray c_data = np.ascontiguousarray(data)
+ * cdef void * c_dataPtr = c_data.data
+ * cdef unsigned long c_dataSize = c_data.size # <<<<<<<<<<<<<<
+ *
+ * if c_dataSize == 0:
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_data), __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 75, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = __Pyx_PyInt_As_unsigned_long(__pyx_t_6); if (unlikely((__pyx_t_8 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(0, 75, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_c_dataSize = __pyx_t_8;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":77
+ * cdef unsigned long c_dataSize = c_data.size
+ *
+ * if c_dataSize == 0: # <<<<<<<<<<<<<<
+ * raise ValueError("zero-size array")
+ *
+ */
+ __pyx_t_3 = ((__pyx_v_c_dataSize == 0) != 0);
+ if (unlikely(__pyx_t_3)) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":78
+ *
+ * if c_dataSize == 0:
+ * raise ValueError("zero-size array") # <<<<<<<<<<<<<<
+ *
+ * cdef double c_dataMin, c_dataMinPos, c_dataMax
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(0, 78, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":77
+ * cdef unsigned long c_dataSize = c_data.size
+ *
+ * if c_dataSize == 0: # <<<<<<<<<<<<<<
+ * raise ValueError("zero-size array")
+ *
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":82
+ * cdef double c_dataMin, c_dataMinPos, c_dataMax
+ *
+ * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
+ *
+ * if minPositive:
+ */
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_NUMPY_TO_TYPE_DESC); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_data), __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_slice__3, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_9 = __Pyx_PyInt_As_unsigned_int(__pyx_t_2); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_c_type = __pyx_t_9;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":84
+ * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]]
+ *
+ * if minPositive: # <<<<<<<<<<<<<<
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ */
+ __pyx_t_3 = (__pyx_v_minPositive != 0);
+ if (__pyx_t_3) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":85
+ *
+ * if minPositive:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_dataMin, &c_dataMinPos, &c_dataMax)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":86
+ * if minPositive:
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize, # <<<<<<<<<<<<<<
+ * &c_dataMin, &c_dataMinPos, &c_dataMax)
+ * if c_dataMinPos == 0:
+ */
+ getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_dataMin), (&__pyx_v_c_dataMinPos), (&__pyx_v_c_dataMax));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":85
+ *
+ * if minPositive:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_dataMin, &c_dataMinPos, &c_dataMax)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L8;
+ }
+ __pyx_L8:;
+ }
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":88
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_dataMin, &c_dataMinPos, &c_dataMax)
+ * if c_dataMinPos == 0: # <<<<<<<<<<<<<<
+ * return c_dataMin, None, c_dataMax
+ * else:
+ */
+ __pyx_t_3 = ((__pyx_v_c_dataMinPos == 0.0) != 0);
+ if (__pyx_t_3) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":89
+ * &c_dataMin, &c_dataMinPos, &c_dataMax)
+ * if c_dataMinPos == 0:
+ * return c_dataMin, None, c_dataMax # <<<<<<<<<<<<<<
+ * else:
+ * return c_dataMin, c_dataMinPos, c_dataMax
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_c_dataMin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 89, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c_dataMax); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 89, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, Py_None);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_1);
+ __pyx_t_2 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":88
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_dataMin, &c_dataMinPos, &c_dataMax)
+ * if c_dataMinPos == 0: # <<<<<<<<<<<<<<
+ * return c_dataMin, None, c_dataMax
+ * else:
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":91
+ * return c_dataMin, None, c_dataMax
+ * else:
+ * return c_dataMin, c_dataMinPos, c_dataMax # <<<<<<<<<<<<<<
+ * else:
+ * with nogil:
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_6 = PyFloat_FromDouble(__pyx_v_c_dataMin); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = PyFloat_FromDouble(__pyx_v_c_dataMinPos); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_c_dataMax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_2);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":84
+ * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]]
+ *
+ * if minPositive: # <<<<<<<<<<<<<<
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":93
+ * return c_dataMin, c_dataMinPos, c_dataMax
+ * else:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_dataMin, NULL, &c_dataMax)
+ */
+ /*else*/ {
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":94
+ * else:
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize, # <<<<<<<<<<<<<<
+ * &c_dataMin, NULL, &c_dataMax)
+ * return c_dataMin, c_dataMax
+ */
+ getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_dataMin), NULL, (&__pyx_v_c_dataMax));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":93
+ * return c_dataMin, c_dataMinPos, c_dataMax
+ * else:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_dataMin, NULL, &c_dataMax)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L12;
+ }
+ __pyx_L12:;
+ }
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":96
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_dataMin, NULL, &c_dataMax)
+ * return c_dataMin, c_dataMax # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = PyFloat_FromDouble(__pyx_v_c_dataMin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 96, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = PyFloat_FromDouble(__pyx_v_c_dataMax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 96, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 96, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
+ __pyx_t_4 = 0;
+ __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":55
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def minMax(np.ndarray data, bint minPositive=False): # <<<<<<<<<<<<<<
+ * """Get min, max and optionally min positive of data.
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.minMax", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_c_data);
+ __Pyx_XDECREF((PyObject *)__pyx_v_data);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":61
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
+ * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
+ * startValue=None, endValue=None,
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap[] = "Compute a pixmap by applying a colormap to data.\n\n :param numpy.ndarray data: Array of data value to convert to pixmap.\n :param numpy.ndarray colormap: palette to use as colormap as an array of\n RGBA color.\n :param startValue: The value to map to the first color of the colormap.\n :param endValue: The value to map to the last color of the colormap.\n :param bool isLog10Mapping: The mapping: False for linear, True for log10.\n :param nanColor: RGBA color to use for NaNs.\n If None, the first color of the colormap.\n :type nanColor: None (the default) or a container that can be converted\n to a numpy.ndarray containing 4 elements in [0, 255].\n :returns: The corresponding pixmap of RGBA pixels as an array of 4 uint8\n with same dimensions as data and used min and max.\n :rtype: A tuple : (pixmap , (usedMin, usedMax)).\n ";
+static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap = {"dataToRGBAColormap", (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap};
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_data = 0;
+ PyArrayObject *__pyx_v_colormap = 0;
+ PyObject *__pyx_v_startValue = 0;
+ PyObject *__pyx_v_endValue = 0;
+ int __pyx_v_isLog10Mapping;
+ PyObject *__pyx_v_nanColor = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("dataToRGBAColormap (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_data,&__pyx_n_s_colormap,&__pyx_n_s_startValue,&__pyx_n_s_endValue,&__pyx_n_s_isLog10Mapping,&__pyx_n_s_nanColor,0};
+ PyObject* values[6] = {0,0,0,0,0,0};
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":63
+ * def dataToRGBAColormap(data,
+ * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
+ * startValue=None, endValue=None, # <<<<<<<<<<<<<<
+ * bint isLog10Mapping=False,
+ * nanColor=None):
+ */
+ values[2] = ((PyObject *)Py_None);
+ values[3] = ((PyObject *)Py_None);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":65
+ * startValue=None, endValue=None,
+ * bint isLog10Mapping=False,
+ * nanColor=None): # <<<<<<<<<<<<<<
+ * """Compute a pixmap by applying a colormap to data.
+ *
+ */
+ values[5] = ((PyObject *)Py_None);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_data)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_colormap)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("dataToRGBAColormap", 0, 2, 6, 1); __PYX_ERR(1, 61, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_startValue);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_endValue);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_isLog10Mapping);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 5:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nanColor);
+ if (value) { values[5] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "dataToRGBAColormap") < 0)) __PYX_ERR(1, 61, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_data = values[0];
+ __pyx_v_colormap = ((PyArrayObject *)values[1]);
+ __pyx_v_startValue = values[2];
+ __pyx_v_endValue = values[3];
+ if (values[4]) {
+ __pyx_v_isLog10Mapping = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_isLog10Mapping == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 64, __pyx_L3_error)
+ } else {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":64
+ * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
+ * startValue=None, endValue=None,
+ * bint isLog10Mapping=False, # <<<<<<<<<<<<<<
+ * nanColor=None):
+ * """Compute a pixmap by applying a colormap to data.
+ */
+ __pyx_v_isLog10Mapping = ((int)0);
+ }
+ __pyx_v_nanColor = values[5];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("dataToRGBAColormap", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 61, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.dataToRGBAColormap", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_colormap), __pyx_ptype_5numpy_ndarray, 1, "colormap", 0))) __PYX_ERR(1, 62, __pyx_L1_error)
+ __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap(__pyx_self, __pyx_v_data, __pyx_v_colormap, __pyx_v_startValue, __pyx_v_endValue, __pyx_v_isLog10Mapping, __pyx_v_nanColor);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":61
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
+ * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
+ * startValue=None, endValue=None,
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_2dataToRGBAColormap(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_data, PyArrayObject *__pyx_v_colormap, PyObject *__pyx_v_startValue, PyObject *__pyx_v_endValue, int __pyx_v_isLog10Mapping, PyObject *__pyx_v_nanColor) {
+ PyArrayObject *__pyx_v_c_data = 0;
+ void *__pyx_v_c_dataPtr;
+ unsigned long __pyx_v_c_dataSize;
+ CYTHON_UNUSED unsigned int __pyx_v_c_dataItemSize;
+ __Pyx_memviewslice __pyx_v_c_colormap = { 0, 0, { 0 }, { 0 }, { 0 } };
+ unsigned int __pyx_v_c_colormapLength;
+ unsigned char *__pyx_v_c_nanColorPtr;
+ PyArrayObject *__pyx_v_c_nanColor = 0;
+ PyObject *__pyx_v_pixmap = NULL;
+ __Pyx_memviewslice __pyx_v_c_pixmap = { 0, 0, { 0 }, { 0 }, { 0 } };
+ unsigned int __pyx_v_c_type;
+ double __pyx_v_c_start;
+ double __pyx_v_c_startExtra;
+ double __pyx_v_c_end;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_colormap;
+ __Pyx_Buffer __pyx_pybuffer_colormap;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ char *__pyx_t_7;
+ unsigned long __pyx_t_8;
+ unsigned int __pyx_t_9;
+ __Pyx_memviewslice __pyx_t_10 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_11;
+ int __pyx_t_12;
+ int __pyx_t_13;
+ double __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ Py_ssize_t __pyx_t_16;
+ Py_ssize_t __pyx_t_17;
+ Py_ssize_t __pyx_t_18;
+ __Pyx_RefNannySetupContext("dataToRGBAColormap", 0);
+ __Pyx_INCREF(__pyx_v_data);
+ __pyx_pybuffer_colormap.pybuffer.buf = NULL;
+ __pyx_pybuffer_colormap.refcount = 0;
+ __pyx_pybuffernd_colormap.data = NULL;
+ __pyx_pybuffernd_colormap.rcbuffer = &__pyx_pybuffer_colormap;
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_colormap.rcbuffer->pybuffer, (PyObject*)__pyx_v_colormap, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 2, 0, __pyx_stack) == -1)) __PYX_ERR(1, 61, __pyx_L1_error)
+ }
+ __pyx_pybuffernd_colormap.diminfo[0].strides = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_colormap.diminfo[0].shape = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.shape[0]; __pyx_pybuffernd_colormap.diminfo[1].strides = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.strides[1]; __pyx_pybuffernd_colormap.diminfo[1].shape = __pyx_pybuffernd_colormap.rcbuffer->pybuffer.shape[1];
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":83
+ * """
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_str); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetSlice(__pyx_t_2, 1, 0, NULL, NULL, &__pyx_slice__4, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_3 = (__Pyx_PyString_Equals(__pyx_t_1, __pyx_n_s_f2, Py_EQ)); if (unlikely(__pyx_t_3 < 0)) __PYX_ERR(1, 83, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_3) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":84
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2':
+ * data = np.asarray(data, dtype=np.float32) # <<<<<<<<<<<<<<
+ *
+ * cdef np.ndarray c_data = np.ascontiguousarray(data)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_asarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_data);
+ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_float32); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 84, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(__pyx_v_data, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":83
+ * """
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":86
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ * cdef np.ndarray c_data = np.ascontiguousarray(data) # <<<<<<<<<<<<<<
+ * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim
+ * cdef unsigned long c_dataSize = c_data.size
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
+ __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_1);
+ if (likely(__pyx_t_4)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_1, function);
+ }
+ }
+ if (!__pyx_t_4) {
+ __pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_v_data); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_data};
+ __pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_data};
+ __pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_6);
+ } else
+ #endif
+ {
+ __pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4); __pyx_t_4 = NULL;
+ __Pyx_INCREF(__pyx_v_data);
+ __Pyx_GIVEREF(__pyx_v_data);
+ PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_data);
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 86, __pyx_L1_error)
+ __pyx_v_c_data = ((PyArrayObject *)__pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":87
+ *
+ * cdef np.ndarray c_data = np.ascontiguousarray(data)
+ * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim # <<<<<<<<<<<<<<
+ * cdef unsigned long c_dataSize = c_data.size
+ * cdef unsigned int c_dataItemSize = c_data.itemsize
+ */
+ __pyx_t_7 = __pyx_v_c_data->data;
+ __pyx_v_c_dataPtr = __pyx_t_7;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":88
+ * cdef np.ndarray c_data = np.ascontiguousarray(data)
+ * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim
+ * cdef unsigned long c_dataSize = c_data.size # <<<<<<<<<<<<<<
+ * cdef unsigned int c_dataItemSize = c_data.itemsize
+ *
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_data), __pyx_n_s_size); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = __Pyx_PyInt_As_unsigned_long(__pyx_t_6); if (unlikely((__pyx_t_8 == (unsigned long)-1) && PyErr_Occurred())) __PYX_ERR(1, 88, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_c_dataSize = __pyx_t_8;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":89
+ * cdef void * c_dataPtr = c_data.data # &c_data[0] needs dim
+ * cdef unsigned long c_dataSize = c_data.size
+ * cdef unsigned int c_dataItemSize = c_data.itemsize # <<<<<<<<<<<<<<
+ *
+ * cdef unsigned char[:, :] c_colormap = colormap
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_c_data), __pyx_n_s_itemsize); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 89, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_9 = __Pyx_PyInt_As_unsigned_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_c_dataItemSize = __pyx_t_9;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":91
+ * cdef unsigned int c_dataItemSize = c_data.itemsize
+ *
+ * cdef unsigned char[:, :] c_colormap = colormap # <<<<<<<<<<<<<<
+ * cdef unsigned int c_colormapLength = len(colormap)
+ *
+ */
+ __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(((PyObject *)__pyx_v_colormap), PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(1, 91, __pyx_L1_error)
+ __pyx_v_c_colormap = __pyx_t_10;
+ __pyx_t_10.memview = NULL;
+ __pyx_t_10.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":92
+ *
+ * cdef unsigned char[:, :] c_colormap = colormap
+ * cdef unsigned int c_colormapLength = len(colormap) # <<<<<<<<<<<<<<
+ *
+ * cdef unsigned char * c_nanColorPtr
+ */
+ __pyx_t_11 = PyObject_Length(((PyObject *)__pyx_v_colormap)); if (unlikely(__pyx_t_11 == ((Py_ssize_t)-1))) __PYX_ERR(1, 92, __pyx_L1_error)
+ __pyx_v_c_colormapLength = __pyx_t_11;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":96
+ * cdef unsigned char * c_nanColorPtr
+ * cdef np.ndarray c_nanColor
+ * if nanColor is None: # <<<<<<<<<<<<<<
+ * c_nanColorPtr = NULL
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_nanColor == Py_None);
+ __pyx_t_12 = (__pyx_t_3 != 0);
+ if (__pyx_t_12) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":97
+ * cdef np.ndarray c_nanColor
+ * if nanColor is None:
+ * c_nanColorPtr = NULL # <<<<<<<<<<<<<<
+ * else:
+ * c_nanColor = np.asarray(nanColor, dtype=np.uint8, order='C')
+ */
+ __pyx_v_c_nanColorPtr = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":96
+ * cdef unsigned char * c_nanColorPtr
+ * cdef np.ndarray c_nanColor
+ * if nanColor is None: # <<<<<<<<<<<<<<
+ * c_nanColorPtr = NULL
+ * else:
+ */
+ goto __pyx_L4;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":99
+ * c_nanColorPtr = NULL
+ * else:
+ * c_nanColor = np.asarray(nanColor, dtype=np.uint8, order='C') # <<<<<<<<<<<<<<
+ * c_nanColorPtr = <unsigned char *> c_nanColor.data
+ *
+ */
+ /*else*/ {
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_asarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_nanColor);
+ __Pyx_GIVEREF(__pyx_v_nanColor);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_nanColor);
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_uint8); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_order, __pyx_n_s_C) < 0) __PYX_ERR(1, 99, __pyx_L1_error)
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 99, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(1, 99, __pyx_L1_error)
+ __pyx_v_c_nanColor = ((PyArrayObject *)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":100
+ * else:
+ * c_nanColor = np.asarray(nanColor, dtype=np.uint8, order='C')
+ * c_nanColorPtr = <unsigned char *> c_nanColor.data # <<<<<<<<<<<<<<
+ *
+ * pixmap = np.empty((data.size, 4), dtype=np.uint8)
+ */
+ __pyx_v_c_nanColorPtr = ((unsigned char *)__pyx_v_c_nanColor->data);
+ }
+ __pyx_L4:;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":102
+ * c_nanColorPtr = <unsigned char *> c_nanColor.data
+ *
+ * pixmap = np.empty((data.size, 4), dtype=np.uint8) # <<<<<<<<<<<<<<
+ * cdef unsigned char[:, :] c_pixmap = pixmap
+ *
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_empty); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_size); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
+ __Pyx_INCREF(__pyx_int_4);
+ __Pyx_GIVEREF(__pyx_int_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_4);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_uint8); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_pixmap = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":103
+ *
+ * pixmap = np.empty((data.size, 4), dtype=np.uint8)
+ * cdef unsigned char[:, :] c_pixmap = pixmap # <<<<<<<<<<<<<<
+ *
+ * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]]
+ */
+ __pyx_t_10 = __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(__pyx_v_pixmap, PyBUF_WRITABLE); if (unlikely(!__pyx_t_10.memview)) __PYX_ERR(1, 103, __pyx_L1_error)
+ __pyx_v_c_pixmap = __pyx_t_10;
+ __pyx_t_10.memview = NULL;
+ __pyx_t_10.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":105
+ * cdef unsigned char[:, :] c_pixmap = pixmap
+ *
+ * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
+ *
+ * cdef double c_start, c_startExtra, c_end
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_NUMPY_TO_TYPE_DESC); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_dtype); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_str); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetSlice(__pyx_t_5, 1, 0, NULL, NULL, &__pyx_slice__5, 1, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_GetItem(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_9 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 105, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_c_type = __pyx_t_9;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":108
+ *
+ * cdef double c_start, c_startExtra, c_end
+ * if startValue is None or endValue is None: # <<<<<<<<<<<<<<
+ * if isLog10Mapping:
+ * with nogil:
+ */
+ __pyx_t_3 = (__pyx_v_startValue == Py_None);
+ __pyx_t_13 = (__pyx_t_3 != 0);
+ if (!__pyx_t_13) {
+ } else {
+ __pyx_t_12 = __pyx_t_13;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_13 = (__pyx_v_endValue == Py_None);
+ __pyx_t_3 = (__pyx_t_13 != 0);
+ __pyx_t_12 = __pyx_t_3;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_12) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":109
+ * cdef double c_start, c_startExtra, c_end
+ * if startValue is None or endValue is None:
+ * if isLog10Mapping: # <<<<<<<<<<<<<<
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ */
+ __pyx_t_12 = (__pyx_v_isLog10Mapping != 0);
+ if (__pyx_t_12) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":110
+ * if startValue is None or endValue is None:
+ * if isLog10Mapping:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_startExtra, &c_start, &c_end)
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":111
+ * if isLog10Mapping:
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize, # <<<<<<<<<<<<<<
+ * &c_startExtra, &c_start, &c_end)
+ * else:
+ */
+ getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_startExtra), (&__pyx_v_c_start), (&__pyx_v_c_end));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":110
+ * if startValue is None or endValue is None:
+ * if isLog10Mapping:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_startExtra, &c_start, &c_end)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L11;
+ }
+ __pyx_L11:;
+ }
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":109
+ * cdef double c_start, c_startExtra, c_end
+ * if startValue is None or endValue is None:
+ * if isLog10Mapping: # <<<<<<<<<<<<<<
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ */
+ goto __pyx_L8;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":114
+ * &c_startExtra, &c_start, &c_end)
+ * else:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_start, NULL, &c_end)
+ */
+ /*else*/ {
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":115
+ * else:
+ * with nogil:
+ * getMinMax(c_dataPtr, c_type, c_dataSize, # <<<<<<<<<<<<<<
+ * &c_start, NULL, &c_end)
+ *
+ */
+ getMinMax(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, (&__pyx_v_c_start), NULL, (&__pyx_v_c_end));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":114
+ * &c_startExtra, &c_start, &c_end)
+ * else:
+ * with nogil: # <<<<<<<<<<<<<<
+ * getMinMax(c_dataPtr, c_type, c_dataSize,
+ * &c_start, NULL, &c_end)
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L14;
+ }
+ __pyx_L14:;
+ }
+ }
+ }
+ __pyx_L8:;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":118
+ * &c_start, NULL, &c_end)
+ *
+ * if startValue is not None: # <<<<<<<<<<<<<<
+ * c_start = startValue
+ * if endValue is not None:
+ */
+ __pyx_t_12 = (__pyx_v_startValue != Py_None);
+ __pyx_t_3 = (__pyx_t_12 != 0);
+ if (__pyx_t_3) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":119
+ *
+ * if startValue is not None:
+ * c_start = startValue # <<<<<<<<<<<<<<
+ * if endValue is not None:
+ * c_end = endValue
+ */
+ __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_startValue); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 119, __pyx_L1_error)
+ __pyx_v_c_start = __pyx_t_14;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":118
+ * &c_start, NULL, &c_end)
+ *
+ * if startValue is not None: # <<<<<<<<<<<<<<
+ * c_start = startValue
+ * if endValue is not None:
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":120
+ * if startValue is not None:
+ * c_start = startValue
+ * if endValue is not None: # <<<<<<<<<<<<<<
+ * c_end = endValue
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_endValue != Py_None);
+ __pyx_t_12 = (__pyx_t_3 != 0);
+ if (__pyx_t_12) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":121
+ * c_start = startValue
+ * if endValue is not None:
+ * c_end = endValue # <<<<<<<<<<<<<<
+ * else:
+ * c_start = startValue
+ */
+ __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_endValue); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L1_error)
+ __pyx_v_c_end = __pyx_t_14;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":120
+ * if startValue is not None:
+ * c_start = startValue
+ * if endValue is not None: # <<<<<<<<<<<<<<
+ * c_end = endValue
+ * else:
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":108
+ *
+ * cdef double c_start, c_startExtra, c_end
+ * if startValue is None or endValue is None: # <<<<<<<<<<<<<<
+ * if isLog10Mapping:
+ * with nogil:
+ */
+ goto __pyx_L5;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":123
+ * c_end = endValue
+ * else:
+ * c_start = startValue # <<<<<<<<<<<<<<
+ * c_end = endValue
+ *
+ */
+ /*else*/ {
+ __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_startValue); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 123, __pyx_L1_error)
+ __pyx_v_c_start = __pyx_t_14;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":124
+ * else:
+ * c_start = startValue
+ * c_end = endValue # <<<<<<<<<<<<<<
+ *
+ * with nogil:
+ */
+ __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_endValue); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 124, __pyx_L1_error)
+ __pyx_v_c_end = __pyx_t_14;
+ }
+ __pyx_L5:;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":126
+ * c_end = endValue
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * colormapFillPixmap(c_dataPtr,
+ * c_type,
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":133
+ * c_end,
+ * isLog10Mapping,
+ * &c_colormap[0, 0], # <<<<<<<<<<<<<<
+ * c_colormapLength,
+ * c_nanColorPtr,
+ */
+ __pyx_t_15 = 0;
+ __pyx_t_16 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":136
+ * c_colormapLength,
+ * c_nanColorPtr,
+ * &c_pixmap[0, 0]) # <<<<<<<<<<<<<<
+ *
+ * pixmap.shape = data.shape + (4,)
+ */
+ __pyx_t_17 = 0;
+ __pyx_t_18 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":127
+ *
+ * with nogil:
+ * colormapFillPixmap(c_dataPtr, # <<<<<<<<<<<<<<
+ * c_type,
+ * c_dataSize,
+ */
+ colormapFillPixmap(__pyx_v_c_dataPtr, __pyx_v_c_type, __pyx_v_c_dataSize, __pyx_v_c_start, __pyx_v_c_end, __pyx_v_isLog10Mapping, (&(*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_colormap.data + __pyx_t_15 * __pyx_v_c_colormap.strides[0]) ) + __pyx_t_16 * __pyx_v_c_colormap.strides[1]) )))), __pyx_v_c_colormapLength, __pyx_v_c_nanColorPtr, (&(*((unsigned char *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_pixmap.data + __pyx_t_17 * __pyx_v_c_pixmap.strides[0]) ) + __pyx_t_18 * __pyx_v_c_pixmap.strides[1]) )))));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":126
+ * c_end = endValue
+ *
+ * with nogil: # <<<<<<<<<<<<<<
+ * colormapFillPixmap(c_dataPtr,
+ * c_type,
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L19;
+ }
+ __pyx_L19:;
+ }
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":138
+ * &c_pixmap[0, 0])
+ *
+ * pixmap.shape = data.shape + (4,) # <<<<<<<<<<<<<<
+ * return pixmap, (c_start, c_end)
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_data, __pyx_n_s_shape); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_tuple__6); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (__Pyx_PyObject_SetAttrStr(__pyx_v_pixmap, __pyx_n_s_shape, __pyx_t_6) < 0) __PYX_ERR(1, 138, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":139
+ *
+ * pixmap.shape = data.shape + (4,)
+ * return pixmap, (c_start, c_end) # <<<<<<<<<<<<<<
+ *
+ * def fastLog10(double value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_6 = PyFloat_FromDouble(__pyx_v_c_start); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 139, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_5 = PyFloat_FromDouble(__pyx_v_c_end); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 139, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_5);
+ __pyx_t_6 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 139, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_pixmap);
+ __Pyx_GIVEREF(__pyx_v_pixmap);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_pixmap);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":61
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
+ * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
+ * startValue=None, endValue=None,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_10, 1);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colormap.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.dataToRGBAColormap", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_colormap.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_c_data);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_colormap, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_c_nanColor);
+ __Pyx_XDECREF(__pyx_v_pixmap);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_pixmap, 1);
+ __Pyx_XDECREF(__pyx_v_data);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":141
+ * return pixmap, (c_start, c_end)
+ *
+ * def fastLog10(double value): # <<<<<<<<<<<<<<
+ * return _fastLog10(value)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10(PyObject *__pyx_self, PyObject *__pyx_arg_value); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10 = {"fastLog10", (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10, METH_O, 0};
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10(PyObject *__pyx_self, PyObject *__pyx_arg_value) {
+ double __pyx_v_value;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("fastLog10 (wrapper)", 0);
+ assert(__pyx_arg_value); {
+ __pyx_v_value = __pyx_PyFloat_AsDouble(__pyx_arg_value); if (unlikely((__pyx_v_value == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L3_error)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.fastLog10", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_4fastLog10(__pyx_self, ((double)__pyx_v_value));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_4fastLog10(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_value) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("fastLog10", 0);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":142
+ *
+ * def fastLog10(double value):
+ * return _fastLog10(value) # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyFloat_FromDouble(fastLog10(__pyx_v_value)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 142, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":141
+ * return pixmap, (c_start, c_end)
+ *
+ * def fastLog10(double value): # <<<<<<<<<<<<<<
+ * return _fastLog10(value)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.fastLog10", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":54
+ *
+ * @cython.boundscheck(False)
+ * def pnpoly(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * """
+ * :param vertices: Array Nx2 with the coordenates of the polygon vertices
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static char __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly[] = "\n :param vertices: Array Nx2 with the coordenates of the polygon vertices\n :type vertices: ndarray\n :param points: Points to be checked out.\n :type points: ndarray Nx2 or list of [x, y] pairs\n :param border: Flag to indicate if a pointon a vertex is to be in or out\n :type border: boolean (default True)\n ";
+static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly = {"pnpoly", (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly, METH_VARARGS|METH_KEYWORDS, __pyx_doc_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly};
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_vertices = 0;
+ PyObject *__pyx_v_points = 0;
+ int __pyx_v_border;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("pnpoly (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_points,&__pyx_n_s_border,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("pnpoly", 0, 2, 3, 1); __PYX_ERR(2, 54, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_border);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "pnpoly") < 0)) __PYX_ERR(2, 54, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_vertices = values[0];
+ __pyx_v_points = values[1];
+ if (values[2]) {
+ __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 54, __pyx_L3_error)
+ } else {
+ __pyx_v_border = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("pnpoly", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 54, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.pnpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_6pnpoly(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("pnpoly", 0);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":63
+ * :type border: boolean (default True)
+ * """
+ * if isinstance(points, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border)
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_points, __pyx_ptype_5numpy_ndarray);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":64
+ * """
+ * if isinstance(points, numpy.ndarray):
+ * if points.dtype == numpy.float32: # <<<<<<<<<<<<<<
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_dtype); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float32); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 64, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 64, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_2) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":65
+ * if isinstance(points, numpy.ndarray):
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border) # <<<<<<<<<<<<<<
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pnpolyFloat); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_border); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_vertices, __pyx_v_points, __pyx_t_3};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 65, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_6, __pyx_v_vertices, __pyx_v_points, __pyx_t_3};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 65, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_6) {
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_vertices);
+ __Pyx_GIVEREF(__pyx_v_vertices);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_v_vertices);
+ __Pyx_INCREF(__pyx_v_points);
+ __Pyx_GIVEREF(__pyx_v_points);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_points);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 65, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":64
+ * """
+ * if isinstance(points, numpy.ndarray):
+ * if points.dtype == numpy.float32: # <<<<<<<<<<<<<<
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":66
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16, # <<<<<<<<<<<<<<
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ * return _pnpolyInt(vertices, points, border)
+ */
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_points, __pyx_n_s_dtype); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int32); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int8); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_int16); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":67
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
+ * numpy.uint32, numpy.uint8, numpy.uint16]: # <<<<<<<<<<<<<<
+ * return _pnpolyInt(vertices, points, border)
+ * return _pnpolyd(vertices, points, border)
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint32); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":66
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16, # <<<<<<<<<<<<<<
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ * return _pnpolyInt(vertices, points, border)
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":67
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
+ * numpy.uint32, numpy.uint8, numpy.uint16]: # <<<<<<<<<<<<<<
+ * return _pnpolyInt(vertices, points, border)
+ * return _pnpolyd(vertices, points, border)
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint8); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":66
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16, # <<<<<<<<<<<<<<
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ * return _pnpolyInt(vertices, points, border)
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":67
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
+ * numpy.uint32, numpy.uint8, numpy.uint16]: # <<<<<<<<<<<<<<
+ * return _pnpolyInt(vertices, points, border)
+ * return _pnpolyd(vertices, points, border)
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_uint16); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_t_8, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":66
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16, # <<<<<<<<<<<<<<
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ * return _pnpolyInt(vertices, points, border)
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L5_bool_binop_done:;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":68
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16,
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ * return _pnpolyInt(vertices, points, border) # <<<<<<<<<<<<<<
+ * return _pnpolyd(vertices, points, border)
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pnpolyInt); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_8 = __Pyx_PyBool_FromLong(__pyx_v_border); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __pyx_t_3 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_vertices, __pyx_v_points, __pyx_t_8};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_3, __pyx_v_vertices, __pyx_v_points, __pyx_t_8};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_vertices);
+ __Pyx_GIVEREF(__pyx_v_vertices);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_7, __pyx_v_vertices);
+ __Pyx_INCREF(__pyx_v_points);
+ __Pyx_GIVEREF(__pyx_v_points);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_7, __pyx_v_points);
+ __Pyx_GIVEREF(__pyx_t_8);
+ PyTuple_SET_ITEM(__pyx_t_6, 2+__pyx_t_7, __pyx_t_8);
+ __pyx_t_8 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":66
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border)
+ * elif points.dtype in [numpy.int32, numpy.int8, numpy.int16, # <<<<<<<<<<<<<<
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ * return _pnpolyInt(vertices, points, border)
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":63
+ * :type border: boolean (default True)
+ * """
+ * if isinstance(points, numpy.ndarray): # <<<<<<<<<<<<<<
+ * if points.dtype == numpy.float32:
+ * return _pnpolyFloat(vertices, points, border)
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":69
+ * numpy.uint32, numpy.uint8, numpy.uint16]:
+ * return _pnpolyInt(vertices, points, border)
+ * return _pnpolyd(vertices, points, border) # <<<<<<<<<<<<<<
+ *
+ * @cython.boundscheck(False)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pnpolyd); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyBool_FromLong(__pyx_v_border); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_vertices, __pyx_v_points, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 69, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[4] = {__pyx_t_8, __pyx_v_vertices, __pyx_v_points, __pyx_t_6};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 3+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 69, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(3+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (__pyx_t_8) {
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_vertices);
+ __Pyx_GIVEREF(__pyx_v_vertices);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+__pyx_t_7, __pyx_v_vertices);
+ __Pyx_INCREF(__pyx_v_points);
+ __Pyx_GIVEREF(__pyx_v_points);
+ PyTuple_SET_ITEM(__pyx_t_3, 1+__pyx_t_7, __pyx_v_points);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 2+__pyx_t_7, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 69, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":54
+ *
+ * @cython.boundscheck(False)
+ * def pnpoly(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * """
+ * :param vertices: Array Nx2 with the coordenates of the polygon vertices
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools.pnpoly", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":72
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyd(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd = {"_pnpolyd", (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_vertices = 0;
+ PyObject *__pyx_v_points = 0;
+ int __pyx_v_border;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_pnpolyd (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_points,&__pyx_n_s_border,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_pnpolyd", 0, 2, 3, 1); __PYX_ERR(2, 72, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_border);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_pnpolyd") < 0)) __PYX_ERR(2, 72, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_vertices = values[0];
+ __pyx_v_points = values[1];
+ if (values[2]) {
+ __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 72, __pyx_L3_error)
+ } else {
+ __pyx_v_border = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_pnpolyd", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 72, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_8_pnpolyd(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_8_pnpolyd(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
+ __Pyx_memviewslice __pyx_v_c_vertices = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_n_vertices;
+ __Pyx_memviewslice __pyx_v_c_points = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_n_points;
+ PyArrayObject *__pyx_v_mask = 0;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
+ __Pyx_Buffer __pyx_pybuffer_mask;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyArrayObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ __Pyx_RefNannySetupContext("_pnpolyd", 0);
+ __pyx_pybuffer_mask.pybuffer.buf = NULL;
+ __pyx_pybuffer_mask.refcount = 0;
+ __pyx_pybuffernd_mask.data = NULL;
+ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":73
+ * @cython.boundscheck(False)
+ * def _pnpolyd(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_vertices);
+ __Pyx_GIVEREF(__pyx_v_vertices);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":74
+ * def _pnpolyd(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ */
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 74, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(2, 74, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":73
+ * @cython.boundscheck(False)
+ * def _pnpolyd(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(2, 73, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_c_vertices = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":75
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0] # <<<<<<<<<<<<<<
+ * assert c_vertices.shape[1] == 2
+ * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
+ */
+ __pyx_v_n_vertices = (__pyx_v_c_vertices.shape[0]);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":76
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2 # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.float64)
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!(((__pyx_v_c_vertices.shape[1]) == 2) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(2, 76, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":77
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ * cdef double[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_points = c_points.shape[0]
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 77, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 77, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 77, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_points);
+ __Pyx_GIVEREF(__pyx_v_points);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_points);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":78
+ * assert c_vertices.shape[1] == 2
+ * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef int n_points = c_points.shape[0]
+ * assert c_points.shape[1] == 2
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(2, 78, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":77
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ * cdef double[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_points = c_points.shape[0]
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 77, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(2, 77, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_c_points = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":79
+ * cdef double[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.float64)
+ * cdef int n_points = c_points.shape[0] # <<<<<<<<<<<<<<
+ * assert c_points.shape[1] == 2
+ *
+ */
+ __pyx_v_n_points = (__pyx_v_c_points.shape[0]);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":80
+ * dtype=numpy.float64)
+ * cdef int n_points = c_points.shape[0]
+ * assert c_points.shape[1] == 2 # <<<<<<<<<<<<<<
+ *
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!(((__pyx_v_c_points.shape[1]) == 2) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(2, 80, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":83
+ *
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8) # <<<<<<<<<<<<<<
+ * with nogil:
+ * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_points); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 83, __pyx_L1_error)
+ __pyx_t_7 = ((PyArrayObject *)__pyx_t_2);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_mask = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf = NULL;
+ __PYX_ERR(2, 82, __pyx_L1_error)
+ } else {__pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_7 = 0;
+ __pyx_v_mask = ((PyArrayObject *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":84
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil: # <<<<<<<<<<<<<<
+ * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":85
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil:
+ * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
+ * border, &mask[0])
+ * return mask
+ */
+ __pyx_t_8 = 0;
+ __pyx_t_9 = 0;
+ if (__pyx_t_8 < 0) __pyx_t_8 += __pyx_v_c_vertices.shape[0];
+ if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_c_vertices.shape[1];
+ __pyx_t_10 = 0;
+ __pyx_t_11 = 0;
+ if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_c_points.shape[0];
+ if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_c_points.shape[1];
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":86
+ * with nogil:
+ * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0]) # <<<<<<<<<<<<<<
+ * return mask
+ *
+ */
+ __pyx_t_12 = 0;
+ if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_pybuffernd_mask.diminfo[0].shape;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":85
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil:
+ * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
+ * border, &mask[0])
+ * return mask
+ */
+ PointsInsidePolygon((&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_vertices.data + __pyx_t_8 * __pyx_v_c_vertices.strides[0]) ) + __pyx_t_9 * __pyx_v_c_vertices.strides[1]) )))), __pyx_v_n_vertices, (&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_points.data + __pyx_t_10 * __pyx_v_c_points.strides[0]) ) + __pyx_t_11 * __pyx_v_c_points.strides[1]) )))), __pyx_v_n_points, __pyx_v_border, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_12, __pyx_pybuffernd_mask.diminfo[0].strides))));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":84
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil: # <<<<<<<<<<<<<<
+ * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":87
+ * _pnpoly(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ * return mask # <<<<<<<<<<<<<<
+ *
+ * @cython.boundscheck(False)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_mask));
+ __pyx_r = ((PyObject *)__pyx_v_mask);
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":72
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyd(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyd", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_vertices, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_points, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_mask);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":90
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyFloat(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat = {"_pnpolyFloat", (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_vertices = 0;
+ PyObject *__pyx_v_points = 0;
+ int __pyx_v_border;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_pnpolyFloat (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_points,&__pyx_n_s_border,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_pnpolyFloat", 0, 2, 3, 1); __PYX_ERR(2, 90, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_border);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_pnpolyFloat") < 0)) __PYX_ERR(2, 90, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_vertices = values[0];
+ __pyx_v_points = values[1];
+ if (values[2]) {
+ __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 90, __pyx_L3_error)
+ } else {
+ __pyx_v_border = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_pnpolyFloat", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 90, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyFloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_10_pnpolyFloat(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_10_pnpolyFloat(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
+ __Pyx_memviewslice __pyx_v_c_vertices = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_n_vertices;
+ __Pyx_memviewslice __pyx_v_c_points = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_n_points;
+ PyArrayObject *__pyx_v_mask = 0;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
+ __Pyx_Buffer __pyx_pybuffer_mask;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyArrayObject *__pyx_t_8 = NULL;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ __Pyx_RefNannySetupContext("_pnpolyFloat", 0);
+ __pyx_pybuffer_mask.pybuffer.buf = NULL;
+ __pyx_pybuffer_mask.refcount = 0;
+ __pyx_pybuffernd_mask.data = NULL;
+ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":91
+ * @cython.boundscheck(False)
+ * def _pnpolyFloat(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_vertices);
+ __Pyx_GIVEREF(__pyx_v_vertices);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":92
+ * def _pnpolyFloat(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ */
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 92, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 92, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 92, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(2, 92, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":91
+ * @cython.boundscheck(False)
+ * def _pnpolyFloat(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 91, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(2, 91, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_c_vertices = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":93
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0] # <<<<<<<<<<<<<<
+ * assert c_vertices.shape[1] == 2
+ * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
+ */
+ __pyx_v_n_vertices = (__pyx_v_c_vertices.shape[0]);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":94
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2 # <<<<<<<<<<<<<<
+ * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.float32)
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!(((__pyx_v_c_vertices.shape[1]) == 2) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(2, 94, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":95
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ * cdef float[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
+ * dtype=numpy.float32)
+ * cdef int n_points = c_points.shape[0]
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 95, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 95, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 95, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_points);
+ __Pyx_GIVEREF(__pyx_v_points);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_points);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":96
+ * assert c_vertices.shape[1] == 2
+ * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.float32) # <<<<<<<<<<<<<<
+ * cdef int n_points = c_points.shape[0]
+ * assert c_points.shape[1] == 2
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 96, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 96, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float32); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 96, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(2, 96, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":95
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ * cdef float[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
+ * dtype=numpy.float32)
+ * cdef int n_points = c_points.shape[0]
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 95, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_float(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(2, 95, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_c_points = __pyx_t_7;
+ __pyx_t_7.memview = NULL;
+ __pyx_t_7.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":97
+ * cdef float[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.float32)
+ * cdef int n_points = c_points.shape[0] # <<<<<<<<<<<<<<
+ * assert c_points.shape[1] == 2
+ *
+ */
+ __pyx_v_n_points = (__pyx_v_c_points.shape[0]);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":98
+ * dtype=numpy.float32)
+ * cdef int n_points = c_points.shape[0]
+ * assert c_points.shape[1] == 2 # <<<<<<<<<<<<<<
+ *
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!(((__pyx_v_c_points.shape[1]) == 2) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(2, 98, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":101
+ *
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8) # <<<<<<<<<<<<<<
+ * with nogil:
+ * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_points); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 101, __pyx_L1_error)
+ __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_mask = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf = NULL;
+ __PYX_ERR(2, 100, __pyx_L1_error)
+ } else {__pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_8 = 0;
+ __pyx_v_mask = ((PyArrayObject *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":102
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil: # <<<<<<<<<<<<<<
+ * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":103
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil:
+ * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
+ * border, &mask[0])
+ * return mask
+ */
+ __pyx_t_9 = 0;
+ __pyx_t_10 = 0;
+ if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_c_vertices.shape[0];
+ if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_c_vertices.shape[1];
+ __pyx_t_11 = 0;
+ __pyx_t_12 = 0;
+ if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_c_points.shape[0];
+ if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_c_points.shape[1];
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":104
+ * with nogil:
+ * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0]) # <<<<<<<<<<<<<<
+ * return mask
+ *
+ */
+ __pyx_t_13 = 0;
+ if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_mask.diminfo[0].shape;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":103
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil:
+ * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
+ * border, &mask[0])
+ * return mask
+ */
+ PointsInsidePolygonF((&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_vertices.data + __pyx_t_9 * __pyx_v_c_vertices.strides[0]) ) + __pyx_t_10 * __pyx_v_c_vertices.strides[1]) )))), __pyx_v_n_vertices, (&(*((float *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_points.data + __pyx_t_11 * __pyx_v_c_points.strides[0]) ) + __pyx_t_12 * __pyx_v_c_points.strides[1]) )))), __pyx_v_n_points, __pyx_v_border, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides))));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":102
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil: # <<<<<<<<<<<<<<
+ * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":105
+ * _pnpolyf(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ * return mask # <<<<<<<<<<<<<<
+ *
+ * @cython.boundscheck(False)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_mask));
+ __pyx_r = ((PyObject *)__pyx_v_mask);
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":90
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyFloat(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyFloat", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_vertices, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_points, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_mask);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":108
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyInt(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt = {"_pnpolyInt", (PyCFunction)__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_vertices = 0;
+ PyObject *__pyx_v_points = 0;
+ int __pyx_v_border;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_pnpolyInt (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_vertices,&__pyx_n_s_points,&__pyx_n_s_border,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_vertices)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_points)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("_pnpolyInt", 0, 2, 3, 1); __PYX_ERR(2, 108, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_border);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_pnpolyInt") < 0)) __PYX_ERR(2, 108, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_vertices = values[0];
+ __pyx_v_points = values[1];
+ if (values[2]) {
+ __pyx_v_border = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_border == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 108, __pyx_L3_error)
+ } else {
+ __pyx_v_border = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("_pnpolyInt", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 108, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_12_pnpolyInt(__pyx_self, __pyx_v_vertices, __pyx_v_points, __pyx_v_border);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_10PyMcaGraph_6ctools_7_ctools_12_pnpolyInt(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_vertices, PyObject *__pyx_v_points, int __pyx_v_border) {
+ __Pyx_memviewslice __pyx_v_c_vertices = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_n_vertices;
+ __Pyx_memviewslice __pyx_v_c_points = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_n_points;
+ PyArrayObject *__pyx_v_mask = 0;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_mask;
+ __Pyx_Buffer __pyx_pybuffer_mask;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyArrayObject *__pyx_t_8 = NULL;
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ __Pyx_RefNannySetupContext("_pnpolyInt", 0);
+ __pyx_pybuffer_mask.pybuffer.buf = NULL;
+ __pyx_pybuffer_mask.refcount = 0;
+ __pyx_pybuffernd_mask.data = NULL;
+ __pyx_pybuffernd_mask.rcbuffer = &__pyx_pybuffer_mask;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":109
+ * @cython.boundscheck(False)
+ * def _pnpolyInt(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_vertices);
+ __Pyx_GIVEREF(__pyx_v_vertices);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_vertices);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":110
+ * def _pnpolyInt(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ */
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 110, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 110, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 110, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(2, 110, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":109
+ * @cython.boundscheck(False)
+ * def _pnpolyInt(vertices, points, bint border=True):
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 109, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_dsds_double(__pyx_t_5, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(2, 109, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_c_vertices = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":111
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0] # <<<<<<<<<<<<<<
+ * assert c_vertices.shape[1] == 2
+ * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
+ */
+ __pyx_v_n_vertices = (__pyx_v_c_vertices.shape[0]);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":112
+ * dtype=numpy.float64)
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2 # <<<<<<<<<<<<<<
+ * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.int32)
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!(((__pyx_v_c_vertices.shape[1]) == 2) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(2, 112, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":113
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ * cdef int[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
+ * dtype=numpy.int32)
+ * cdef int n_points = c_points.shape[0]
+ */
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_points);
+ __Pyx_GIVEREF(__pyx_v_points);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_points);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":114
+ * assert c_vertices.shape[1] == 2
+ * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.int32) # <<<<<<<<<<<<<<
+ * cdef int n_points = c_points.shape[0]
+ * assert c_points.shape[1] == 2
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 114, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 114, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_int32); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 114, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(2, 114, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":113
+ * cdef int n_vertices = c_vertices.shape[0]
+ * assert c_vertices.shape[1] == 2
+ * cdef int[:,:] c_points = numpy.ascontiguousarray(points, # <<<<<<<<<<<<<<
+ * dtype=numpy.int32)
+ * cdef int n_points = c_points.shape[0]
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_dsds_int(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_7.memview)) __PYX_ERR(2, 113, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_c_points = __pyx_t_7;
+ __pyx_t_7.memview = NULL;
+ __pyx_t_7.data = NULL;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":115
+ * cdef int[:,:] c_points = numpy.ascontiguousarray(points,
+ * dtype=numpy.int32)
+ * cdef int n_points = c_points.shape[0] # <<<<<<<<<<<<<<
+ * assert c_points.shape[1] == 2
+ *
+ */
+ __pyx_v_n_points = (__pyx_v_c_points.shape[0]);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":116
+ * dtype=numpy.int32)
+ * cdef int n_points = c_points.shape[0]
+ * assert c_points.shape[1] == 2 # <<<<<<<<<<<<<<
+ *
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!(((__pyx_v_c_points.shape[1]) == 2) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(2, 116, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":119
+ *
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8) # <<<<<<<<<<<<<<
+ * with nogil:
+ * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n_points); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_uint8); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 119, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(2, 119, __pyx_L1_error)
+ __pyx_t_8 = ((PyArrayObject *)__pyx_t_2);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_mask.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_nn___pyx_t_5numpy_uint8_t, PyBUF_FORMAT| PyBUF_STRIDES, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_mask = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf = NULL;
+ __PYX_ERR(2, 118, __pyx_L1_error)
+ } else {__pyx_pybuffernd_mask.diminfo[0].strides = __pyx_pybuffernd_mask.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_mask.diminfo[0].shape = __pyx_pybuffernd_mask.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_8 = 0;
+ __pyx_v_mask = ((PyArrayObject *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":120
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil: # <<<<<<<<<<<<<<
+ * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ */
+ {
+ #ifdef WITH_THREAD
+ PyThreadState *_save;
+ Py_UNBLOCK_THREADS
+ __Pyx_FastGIL_Remember();
+ #endif
+ /*try:*/ {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":121
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil:
+ * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
+ * border, &mask[0])
+ * return mask
+ */
+ __pyx_t_9 = 0;
+ __pyx_t_10 = 0;
+ if (__pyx_t_9 < 0) __pyx_t_9 += __pyx_v_c_vertices.shape[0];
+ if (__pyx_t_10 < 0) __pyx_t_10 += __pyx_v_c_vertices.shape[1];
+ __pyx_t_11 = 0;
+ __pyx_t_12 = 0;
+ if (__pyx_t_11 < 0) __pyx_t_11 += __pyx_v_c_points.shape[0];
+ if (__pyx_t_12 < 0) __pyx_t_12 += __pyx_v_c_points.shape[1];
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":122
+ * with nogil:
+ * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0]) # <<<<<<<<<<<<<<
+ * return mask
+ */
+ __pyx_t_13 = 0;
+ if (__pyx_t_13 < 0) __pyx_t_13 += __pyx_pybuffernd_mask.diminfo[0].shape;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":121
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil:
+ * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points, # <<<<<<<<<<<<<<
+ * border, &mask[0])
+ * return mask
+ */
+ PointsInsidePolygonInt((&(*((double *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_vertices.data + __pyx_t_9 * __pyx_v_c_vertices.strides[0]) ) + __pyx_t_10 * __pyx_v_c_vertices.strides[1]) )))), __pyx_v_n_vertices, (&(*((int *) ( /* dim=1 */ (( /* dim=0 */ (__pyx_v_c_points.data + __pyx_t_11 * __pyx_v_c_points.strides[0]) ) + __pyx_t_12 * __pyx_v_c_points.strides[1]) )))), __pyx_v_n_points, __pyx_v_border, (&(*__Pyx_BufPtrStrided1d(__pyx_t_5numpy_uint8_t *, __pyx_pybuffernd_mask.rcbuffer->pybuffer.buf, __pyx_t_13, __pyx_pybuffernd_mask.diminfo[0].strides))));
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":120
+ * cdef numpy.ndarray[numpy.uint8_t, ndim=1] mask = \
+ * numpy.zeros((n_points, ), dtype=numpy.uint8)
+ * with nogil: # <<<<<<<<<<<<<<
+ * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ #ifdef WITH_THREAD
+ __Pyx_FastGIL_Forget();
+ Py_BLOCK_THREADS
+ #endif
+ goto __pyx_L5;
+ }
+ __pyx_L5:;
+ }
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":123
+ * _pnpolyInt32(&c_vertices[0,0], n_vertices, &c_points[0,0], n_points,
+ * border, &mask[0])
+ * return mask # <<<<<<<<<<<<<<
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_mask));
+ __pyx_r = ((PyObject *)__pyx_v_mask);
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":108
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyInt(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("PyMca5.PyMcaGraph.ctools._ctools._pnpolyInt", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_mask.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_vertices, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_points, 1);
+ __Pyx_XDECREF((PyObject *)__pyx_v_mask);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":215
+ * # experimental exception made for __getbuffer__ and __releasebuffer__
+ * # -- the details of this may change.
+ * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
+ * # This implementation of getbuffer is geared towards Cython
+ * # requirements, and does not yet fulfill the PEP.
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_v_i;
+ int __pyx_v_ndim;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ int __pyx_v_t;
+ char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ int __pyx_v_offset;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ char *__pyx_t_8;
+ if (__pyx_v_info == NULL) {
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
+ return -1;
+ }
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":222
+ *
+ * cdef int i, ndim
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":223
+ * cdef int i, ndim
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ *
+ * ndim = PyArray_NDIM(self)
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":225
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":227
+ * ndim = PyArray_NDIM(self)
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous")
+ */
+ __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":228
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ */
+ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":227
+ * ndim = PyArray_NDIM(self)
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous")
+ */
+ if (unlikely(__pyx_t_1)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":229
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 229, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(3, 229, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":227
+ * ndim = PyArray_NDIM(self)
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ */
+ __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L7_bool_binop_done;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":232
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ */
+ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L7_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ */
+ if (unlikely(__pyx_t_1)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":233
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
+ *
+ * info.buf = PyArray_DATA(self)
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(3, 233, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":235
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = ndim
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":236
+ *
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * # Allocate new buffer for strides and shape info.
+ */
+ __pyx_v_info->ndim = __pyx_v_ndim;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":237
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ */
+ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":240
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":241
+ * # This is allocated as one block, strides first.
+ * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
+ * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":242
+ * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
+ * info.shape = info.strides + ndim
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ */
+ __pyx_t_4 = __pyx_v_ndim;
+ __pyx_t_5 = __pyx_t_4;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":243
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":244
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":237
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ */
+ goto __pyx_L9;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":246
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ */
+ /*else*/ {
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":247
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
+ }
+ __pyx_L9:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":248
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":249
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
+ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":250
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
+ *
+ * cdef int t
+ */
+ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":253
+ *
+ * cdef int t
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * cdef dtype descr = self.descr
+ * cdef int offset
+ */
+ __pyx_v_f = NULL;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":254
+ * cdef int t
+ * cdef char* f = NULL
+ * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
+ * cdef int offset
+ *
+ */
+ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
+ * cdef int offset
+ *
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(descr):
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
+ * info.obj = self
+ *
+ * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
+ __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":260
+ *
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num # <<<<<<<<<<<<<<
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ */
+ __pyx_t_4 = __pyx_v_descr->type_num;
+ __pyx_v_t = __pyx_t_4;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":261
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L15_next_or;
+ } else {
+ }
+ __pyx_t_2 = (__pyx_v_little_endian != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_L15_next_or:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":262
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b"
+ */
+ __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L14_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":261
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ if (unlikely(__pyx_t_1)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":263
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(3, 263, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":261
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":264
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ */
+ switch (__pyx_v_t) {
+ case NPY_BYTE:
+ __pyx_v_f = ((char *)"b");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":265
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ */
+ case NPY_UBYTE:
+ __pyx_v_f = ((char *)"B");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":266
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ */
+ case NPY_SHORT:
+ __pyx_v_f = ((char *)"h");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":267
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ */
+ case NPY_USHORT:
+ __pyx_v_f = ((char *)"H");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":268
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ */
+ case NPY_INT:
+ __pyx_v_f = ((char *)"i");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":269
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ */
+ case NPY_UINT:
+ __pyx_v_f = ((char *)"I");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":270
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ */
+ case NPY_LONG:
+ __pyx_v_f = ((char *)"l");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":271
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ */
+ case NPY_ULONG:
+ __pyx_v_f = ((char *)"L");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":272
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ */
+ case NPY_LONGLONG:
+ __pyx_v_f = ((char *)"q");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":273
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ */
+ case NPY_ULONGLONG:
+ __pyx_v_f = ((char *)"Q");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ */
+ case NPY_FLOAT:
+ __pyx_v_f = ((char *)"f");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":275
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ */
+ case NPY_DOUBLE:
+ __pyx_v_f = ((char *)"d");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":276
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ */
+ case NPY_LONGDOUBLE:
+ __pyx_v_f = ((char *)"g");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":277
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ */
+ case NPY_CFLOAT:
+ __pyx_v_f = ((char *)"Zf");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":278
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O"
+ */
+ case NPY_CDOUBLE:
+ __pyx_v_f = ((char *)"Zd");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":279
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ */
+ case NPY_CLONGDOUBLE:
+ __pyx_v_f = ((char *)"Zg");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":280
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ case NPY_OBJECT:
+ __pyx_v_f = ((char *)"O");
+ break;
+ default:
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":282
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
+ * info.format = f
+ * return
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(3, 282, __pyx_L1_error)
+ break;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":284
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
+ * info.obj = self
+ *
+ * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":286
+ * return
+ * else:
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ */
+ /*else*/ {
+ __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":287
+ * else:
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
+ * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1,
+ */
+ (__pyx_v_info->format[0]) = '^';
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0 # <<<<<<<<<<<<<<
+ * f = _util_dtypestring(descr, info.format + 1,
+ * info.format + _buffer_format_string_len,
+ */
+ __pyx_v_offset = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":289
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ */
+ __pyx_t_8 = __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_8 == ((char *)NULL))) __PYX_ERR(3, 289, __pyx_L1_error)
+ __pyx_v_f = __pyx_t_8;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":292
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ (__pyx_v_f[0]) = '\x00';
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":215
+ * # experimental exception made for __getbuffer__ and __releasebuffer__
+ * # -- the details of this may change.
+ * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
+ * # This implementation of getbuffer is geared towards Cython
+ * # requirements, and does not yet fulfill the PEP.
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":294
+ * f[0] = c'\0' # Terminate format string
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
+ __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__releasebuffer__", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":295
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":296
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * PyObject_Free(info.strides)
+ */
+ PyObject_Free(__pyx_v_info->format);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":295
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":297
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.strides)
+ * # info.shape was stored after info.strides in the same block
+ */
+ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":298
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
+ * # info.shape was stored after info.strides in the same block
+ *
+ */
+ PyObject_Free(__pyx_v_info->strides);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":297
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.strides)
+ * # info.shape was stored after info.strides in the same block
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":294
+ * f[0] = c'\0' # Terminate format string
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":775
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":776
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 776, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":775
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":778
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":779
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 779, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":778
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":781
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":782
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(3, 782, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":781
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":784
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ */
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":785
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(3, 785, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":784
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":787
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ */
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":788
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(3, 788, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":787
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":790
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
+ * if PyDataType_HASSUBARRAY(d):
+ * return <tuple>d.subarray.shape
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":791
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
+ * return <tuple>d.subarray.shape
+ * else:
+ */
+ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":792
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ * if PyDataType_HASSUBARRAY(d):
+ * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
+ * else:
+ * return ()
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
+ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":791
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
+ * return <tuple>d.subarray.shape
+ * else:
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ * return <tuple>d.subarray.shape
+ * else:
+ * return () # <<<<<<<<<<<<<<
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_empty_tuple);
+ __pyx_r = __pyx_empty_tuple;
+ goto __pyx_L0;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":790
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
+ * if PyDataType_HASSUBARRAY(d):
+ * return <tuple>d.subarray.shape
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":796
+ * return ()
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
+ * # Recursive utility function used in __getbuffer__ to get format
+ * # string. The new location in the format string is returned.
+ */
+
+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) {
+ PyArray_Descr *__pyx_v_child = 0;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ PyObject *__pyx_v_fields = 0;
+ PyObject *__pyx_v_childname = NULL;
+ PyObject *__pyx_v_new_offset = NULL;
+ PyObject *__pyx_v_t = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ long __pyx_t_8;
+ char *__pyx_t_9;
+ __Pyx_RefNannySetupContext("_util_dtypestring", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
+ *
+ * cdef dtype child
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ * cdef tuple fields
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":802
+ * cdef dtype child
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ * cdef tuple fields
+ *
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":805
+ * cdef tuple fields
+ *
+ * for childname in descr.names: # <<<<<<<<<<<<<<
+ * fields = descr.fields[childname]
+ * child, new_offset = fields
+ */
+ if (unlikely(__pyx_v_descr->names == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(3, 805, __pyx_L1_error)
+ }
+ __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ for (;;) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(3, 805, __pyx_L1_error)
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":806
+ *
+ * for childname in descr.names:
+ * fields = descr.fields[childname] # <<<<<<<<<<<<<<
+ * child, new_offset = fields
+ *
+ */
+ if (unlikely(__pyx_v_descr->fields == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(3, 806, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 806, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ 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(3, 806, __pyx_L1_error)
+ __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
+ __pyx_t_3 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":807
+ * for childname in descr.names:
+ * fields = descr.fields[childname]
+ * child, new_offset = fields # <<<<<<<<<<<<<<
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ */
+ if (likely(__pyx_v_fields != Py_None)) {
+ PyObject* sequence = __pyx_v_fields;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(3, 807, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ #endif
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 807, __pyx_L1_error)
+ }
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 807, __pyx_L1_error)
+ __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":809
+ * child, new_offset = fields
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 809, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+ if (unlikely(__pyx_t_6)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":810
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
+ *
+ * if ((child.byteorder == c'>' and little_endian) or
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 810, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(3, 810, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":809
+ * child, new_offset = fields
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":812
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+ if (!__pyx_t_7) {
+ goto __pyx_L8_next_or;
+ } else {
+ }
+ __pyx_t_7 = (__pyx_v_little_endian != 0);
+ if (!__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_L8_next_or:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":813
+ *
+ * if ((child.byteorder == c'>' and little_endian) or
+ * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"Non-native byte order not supported")
+ * # One could encode it in the format string and have Cython
+ */
+ __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+ if (__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L7_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":812
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ if (unlikely(__pyx_t_6)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":814
+ * if ((child.byteorder == c'>' and little_endian) or
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * # One could encode it in the format string and have Cython
+ * # complain instead, BUT: < and > in format strings also imply
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(3, 814, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":812
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":824
+ *
+ * # Output padding bytes
+ * while offset[0] < new_offset: # <<<<<<<<<<<<<<
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ */
+ while (1) {
+ __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 824, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 824, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 824, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (!__pyx_t_6) break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":825
+ * # Output padding bytes
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
+ * f += 1
+ * offset[0] += 1
+ */
+ (__pyx_v_f[0]) = 0x78;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":826
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte
+ * f += 1 # <<<<<<<<<<<<<<
+ * offset[0] += 1
+ *
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":827
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ * offset[0] += 1 # <<<<<<<<<<<<<<
+ *
+ * offset[0] += child.itemsize
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":829
+ * offset[0] += 1
+ *
+ * offset[0] += child.itemsize # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(child):
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":831
+ * offset[0] += child.itemsize
+ *
+ * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
+ * t = child.type_num
+ * if end - f < 5:
+ */
+ __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":832
+ *
+ * if not PyDataType_HASFIELDS(child):
+ * t = child.type_num # <<<<<<<<<<<<<<
+ * if end - f < 5:
+ * raise RuntimeError(u"Format string allocated too short.")
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
+ * if not PyDataType_HASFIELDS(child):
+ * t = child.type_num
+ * if end - f < 5: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short.")
+ *
+ */
+ __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+ if (unlikely(__pyx_t_6)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":834
+ * t = child.type_num
+ * if end - f < 5:
+ * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(3, 834, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
+ * if not PyDataType_HASFIELDS(child):
+ * t = child.type_num
+ * if end - f < 5: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short.")
+ *
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":837
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 837, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 98;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":838
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ * if t == NPY_BYTE: f[0] = 98 #"b"
+ * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 838, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 66;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":839
+ * if t == NPY_BYTE: f[0] = 98 #"b"
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 839, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x68;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":840
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 840, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 72;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":841
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 841, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x69;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":842
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 842, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 73;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":843
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 843, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 843, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 843, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x6C;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":844
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 844, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 844, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 76;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":845
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 845, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 845, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 845, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x71;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":846
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 846, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 846, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 846, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 81;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":847
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 847, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 847, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 847, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x66;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":848
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 848, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 848, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 848, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x64;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":849
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 849, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 849, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 849, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x67;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":850
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 850, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 850, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 850, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 0x66;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":851
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 851, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 851, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 0x64;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":852
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ * else:
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(3, 852, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 852, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 0x67;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":853
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
+ * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(3, 853, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 853, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (likely(__pyx_t_6)) {
+ (__pyx_v_f[0]) = 79;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":855
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
+ * f += 1
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(3, 855, __pyx_L1_error)
+ }
+ __pyx_L15:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":856
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * f += 1 # <<<<<<<<<<<<<<
+ * else:
+ * # Cython ignores struct boundary information ("T{...}"),
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":831
+ * offset[0] += child.itemsize
+ *
+ * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
+ * t = child.type_num
+ * if end - f < 5:
+ */
+ goto __pyx_L13;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":860
+ * # Cython ignores struct boundary information ("T{...}"),
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
+ * return f
+ *
+ */
+ /*else*/ {
+ __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(3, 860, __pyx_L1_error)
+ __pyx_v_f = __pyx_t_9;
+ }
+ __pyx_L13:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":805
+ * cdef tuple fields
+ *
+ * for childname in descr.names: # <<<<<<<<<<<<<<
+ * fields = descr.fields[childname]
+ * child, new_offset = fields
+ */
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":861
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset)
+ * return f # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_f;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":796
+ * return ()
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
+ * # Recursive utility function used in __getbuffer__ to get format
+ * # string. The new location in the format string is returned.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_child);
+ __Pyx_XDECREF(__pyx_v_fields);
+ __Pyx_XDECREF(__pyx_v_childname);
+ __Pyx_XDECREF(__pyx_v_new_offset);
+ __Pyx_XDECREF(__pyx_v_t);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
+ PyObject *__pyx_v_baseptr;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("set_array_base", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":979
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_base == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":980
+ * cdef PyObject* baseptr
+ * if base is None:
+ * baseptr = NULL # <<<<<<<<<<<<<<
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ */
+ __pyx_v_baseptr = NULL;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":979
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":982
+ * baseptr = NULL
+ * else:
+ * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ */
+ /*else*/ {
+ Py_INCREF(__pyx_v_base);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":983
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr
+ */
+ __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
+ }
+ __pyx_L3:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":984
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
+ * arr.base = baseptr
+ *
+ */
+ Py_XDECREF(__pyx_v_arr->base);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":985
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr # <<<<<<<<<<<<<<
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ */
+ __pyx_v_arr->base = __pyx_v_baseptr;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":987
+ * arr.base = baseptr
+ *
+ * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
+ * if arr.base is NULL:
+ * return None
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("get_array_base", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":988
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL: # <<<<<<<<<<<<<<
+ * return None
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":989
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL:
+ * return None # <<<<<<<<<<<<<<
+ * else:
+ * return <object>arr.base
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":988
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL: # <<<<<<<<<<<<<<
+ * return None
+ * else:
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":991
+ * return None
+ * else:
+ * return <object>arr.base # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
+ __pyx_r = ((PyObject *)__pyx_v_arr->base);
+ goto __pyx_L0;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":987
+ * arr.base = baseptr
+ *
+ * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
+ * if arr.base is NULL:
+ * return None
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":996
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_array", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":998
+ * cdef inline int import_array() except -1:
+ * try:
+ * _import_array() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import")
+ */
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 998, __pyx_L3_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L8_try_end;
+ __pyx_L3_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":999
+ * try:
+ * _import_array()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 999, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1000, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(3, 1000, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L8_try_end:;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":996
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1002
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_umath", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1003
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1004
+ * cdef inline int import_umath() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1004, __pyx_L3_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1003
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L8_try_end;
+ __pyx_L3_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1005
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1005, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1006
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1006, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(3, 1006, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1003
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L8_try_end:;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1002
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1008
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1009
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1010
+ * cdef inline int import_ufunc() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1010, __pyx_L3_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1009
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L8_try_end;
+ __pyx_L3_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1011
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1011, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1012
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1012, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(3, 1012, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1009
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L8_try_end:;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1008
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":121
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_shape = 0;
+ Py_ssize_t __pyx_v_itemsize;
+ PyObject *__pyx_v_format = 0;
+ PyObject *__pyx_v_mode = 0;
+ int __pyx_v_allocate_buffer;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ 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};
+ PyObject* values[5] = {0,0,0,0,0};
+ values[3] = ((PyObject *)__pyx_n_s_c);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(4, 121, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(4, 121, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 121, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_shape = ((PyObject*)values[0]);
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 121, __pyx_L3_error)
+ __pyx_v_format = values[2];
+ __pyx_v_mode = values[3];
+ if (values[4]) {
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 122, __pyx_L3_error)
+ } else {
+
+ /* "View.MemoryView":122
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
+ * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
+ *
+ * cdef int idx
+ */
+ __pyx_v_allocate_buffer = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 121, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(4, 121, __pyx_L1_error)
+ if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(4, 121, __pyx_L1_error)
+ }
+ __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);
+
+ /* "View.MemoryView":121
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_dim;
+ PyObject **__pyx_v_p;
+ char __pyx_v_order;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ Py_ssize_t __pyx_t_11;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+ __Pyx_INCREF(__pyx_v_format);
+
+ /* "View.MemoryView":128
+ * cdef PyObject **p
+ *
+ * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
+ * self.itemsize = itemsize
+ *
+ */
+ if (unlikely(__pyx_v_shape == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(4, 128, __pyx_L1_error)
+ }
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(4, 128, __pyx_L1_error)
+ __pyx_v_self->ndim = ((int)__pyx_t_1);
+
+ /* "View.MemoryView":129
+ *
+ * self.ndim = <int> len(shape)
+ * self.itemsize = itemsize # <<<<<<<<<<<<<<
+ *
+ * if not self.ndim:
+ */
+ __pyx_v_self->itemsize = __pyx_v_itemsize;
+
+ /* "View.MemoryView":131
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":132
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(4, 132, __pyx_L1_error)
+
+ /* "View.MemoryView":131
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
+ }
+
+ /* "View.MemoryView":134
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":135
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(format, bytes):
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(4, 135, __pyx_L1_error)
+
+ /* "View.MemoryView":134
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
+ }
+
+ /* "View.MemoryView":137
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":138
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":137
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
+ }
+
+ /* "View.MemoryView":139
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
+ * self.format = self._format
+ *
+ */
+ 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(4, 139, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_v_self->_format);
+ __Pyx_DECREF(__pyx_v_self->_format);
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":140
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ if (unlikely(__pyx_v_self->_format == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+ __PYX_ERR(4, 140, __pyx_L1_error)
+ }
+ __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(4, 140, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
+
+ /* "View.MemoryView":143
+ *
+ *
+ * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._strides = self._shape + self.ndim
+ *
+ */
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
+
+ /* "View.MemoryView":144
+ *
+ * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
+ *
+ * if not self._shape:
+ */
+ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
+
+ /* "View.MemoryView":146
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":147
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(4, 147, __pyx_L1_error)
+
+ /* "View.MemoryView":146
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
+ }
+
+ /* "View.MemoryView":150
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
+ for (;;) {
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(4, 150, __pyx_L1_error)
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 150, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_dim = __pyx_t_8;
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
+
+ /* "View.MemoryView":151
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
+ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":152
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
+ * self._shape[idx] = dim
+ *
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(4, 152, __pyx_L1_error)
+
+ /* "View.MemoryView":151
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
+ }
+
+ /* "View.MemoryView":153
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim # <<<<<<<<<<<<<<
+ *
+ * cdef char order
+ */
+ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
+
+ /* "View.MemoryView":150
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "View.MemoryView":156
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 156, __pyx_L1_error)
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":157
+ * cdef char order
+ * if mode == 'fortran':
+ * order = b'F' # <<<<<<<<<<<<<<
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ */
+ __pyx_v_order = 'F';
+
+ /* "View.MemoryView":158
+ * if mode == 'fortran':
+ * order = b'F'
+ * self.mode = u'fortran' # <<<<<<<<<<<<<<
+ * elif mode == 'c':
+ * order = b'C'
+ */
+ __Pyx_INCREF(__pyx_n_u_fortran);
+ __Pyx_GIVEREF(__pyx_n_u_fortran);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":156
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":159
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(4, 159, __pyx_L1_error)
+ if (likely(__pyx_t_4)) {
+
+ /* "View.MemoryView":160
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ * order = b'C' # <<<<<<<<<<<<<<
+ * self.mode = u'c'
+ * else:
+ */
+ __pyx_v_order = 'C';
+
+ /* "View.MemoryView":161
+ * elif mode == 'c':
+ * order = b'C'
+ * self.mode = u'c' # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ */
+ __Pyx_INCREF(__pyx_n_u_c);
+ __Pyx_GIVEREF(__pyx_n_u_c);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":159
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":163
+ * self.mode = u'c'
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides,
+ */
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 163, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 163, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(4, 163, __pyx_L1_error)
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":165
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
+ * itemsize, self.ndim, order)
+ *
+ */
+ __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);
+
+ /* "View.MemoryView":168
+ * itemsize, self.ndim, order)
+ *
+ * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer:
+ */
+ __pyx_v_self->free_data = __pyx_v_allocate_buffer;
+
+ /* "View.MemoryView":169
+ *
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
+ * if allocate_buffer:
+ *
+ */
+ __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(4, 169, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 169, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_4;
+
+ /* "View.MemoryView":170
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":173
+ *
+ *
+ * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.")
+ */
+ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
+
+ /* "View.MemoryView":174
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":175
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(4, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(4, 175, __pyx_L1_error)
+
+ /* "View.MemoryView":174
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
+ }
+
+ /* "View.MemoryView":177
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
+ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":178
+ *
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data # <<<<<<<<<<<<<<
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ */
+ __pyx_v_p = ((PyObject **)__pyx_v_self->data);
+
+ /* "View.MemoryView":179
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
+ * p[i] = Py_None
+ * Py_INCREF(Py_None)
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+ __PYX_ERR(4, 179, __pyx_L1_error)
+ }
+ 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))) {
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ __PYX_ERR(4, 179, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
+ __pyx_t_8 = __pyx_t_1;
+ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
+ __pyx_v_i = __pyx_t_11;
+
+ /* "View.MemoryView":180
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ (__pyx_v_p[__pyx_v_i]) = Py_None;
+
+ /* "View.MemoryView":181
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ Py_INCREF(Py_None);
+ }
+
+ /* "View.MemoryView":177
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
+ }
+
+ /* "View.MemoryView":170
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ }
+
+ /* "View.MemoryView":121
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_format);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":184
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_v_bufmode;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ char *__pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ if (__pyx_v_info == NULL) {
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
+ return -1;
+ }
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+
+ /* "View.MemoryView":185
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1 # <<<<<<<<<<<<<<
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = -1;
+
+ /* "View.MemoryView":186
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ */
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 186, __pyx_L1_error)
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":187
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":186
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":188
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ */
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 188, __pyx_L1_error)
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":189
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ */
+ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":188
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ */
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":190
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ */
+ __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":191
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(4, 191, __pyx_L1_error)
+
+ /* "View.MemoryView":190
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ */
+ }
+
+ /* "View.MemoryView":192
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data # <<<<<<<<<<<<<<
+ * info.len = self.len
+ * info.ndim = self.ndim
+ */
+ __pyx_t_4 = __pyx_v_self->data;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":193
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ * info.len = self.len # <<<<<<<<<<<<<<
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ */
+ __pyx_t_5 = __pyx_v_self->len;
+ __pyx_v_info->len = __pyx_t_5;
+
+ /* "View.MemoryView":194
+ * info.buf = self.data
+ * info.len = self.len
+ * info.ndim = self.ndim # <<<<<<<<<<<<<<
+ * info.shape = self._shape
+ * info.strides = self._strides
+ */
+ __pyx_t_6 = __pyx_v_self->ndim;
+ __pyx_v_info->ndim = __pyx_t_6;
+
+ /* "View.MemoryView":195
+ * info.len = self.len
+ * info.ndim = self.ndim
+ * info.shape = self._shape # <<<<<<<<<<<<<<
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ */
+ __pyx_t_7 = __pyx_v_self->_shape;
+ __pyx_v_info->shape = __pyx_t_7;
+
+ /* "View.MemoryView":196
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ * info.strides = self._strides # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ */
+ __pyx_t_7 = __pyx_v_self->_strides;
+ __pyx_v_info->strides = __pyx_t_7;
+
+ /* "View.MemoryView":197
+ * info.shape = self._shape
+ * info.strides = self._strides
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = self.itemsize
+ * info.readonly = 0
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "View.MemoryView":198
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ *
+ */
+ __pyx_t_5 = __pyx_v_self->itemsize;
+ __pyx_v_info->itemsize = __pyx_t_5;
+
+ /* "View.MemoryView":199
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":201
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":202
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->format;
+ __pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":201
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
+ goto __pyx_L5;
+ }
+
+ /* "View.MemoryView":204
+ * info.format = self.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.obj = self
+ */
+ /*else*/ {
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":206
+ * info.format = NULL
+ *
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":184
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":210
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+/* Python wrapper */
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":211
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
+ __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":212
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ */
+ __pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":211
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":213
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ * elif self.free_data: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape,
+ */
+ __pyx_t_1 = (__pyx_v_self->free_data != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":214
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":215
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
+
+ /* "View.MemoryView":214
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ */
+ }
+
+ /* "View.MemoryView":217
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ * free(self.data) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape)
+ *
+ */
+ free(__pyx_v_self->data);
+
+ /* "View.MemoryView":213
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ * elif self.free_data: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape,
+ */
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":218
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ PyObject_Free(__pyx_v_self->_shape);
+
+ /* "View.MemoryView":210
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":221
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":222
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 222, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":221
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":225
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("get_memview", 0);
+
+ /* "View.MemoryView":226
+ * @cname('get_memview')
+ * cdef get_memview(self):
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ */
+ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
+
+ /* "View.MemoryView":227
+ * cdef get_memview(self):
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":225
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":229
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * return self._shape[0]
+ *
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "View.MemoryView":230
+ *
+ * def __len__(self):
+ * return self._shape[0] # <<<<<<<<<<<<<<
+ *
+ * def __getattr__(self, attr):
+ */
+ __pyx_r = (__pyx_v_self->_shape[0]);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":229
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * return self._shape[0]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":232
+ * return self._shape[0]
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__getattr__", 0);
+
+ /* "View.MemoryView":233
+ *
+ * def __getattr__(self, attr):
+ * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
+ *
+ * def __getitem__(self, item):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":232
+ * return self._shape[0]
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":235
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":236
+ *
+ * def __getitem__(self, item):
+ * return self.memview[item] # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(self, item, value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":235
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":238
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+
+ /* "View.MemoryView":239
+ *
+ * def __setitem__(self, item, value):
+ * self.memview[item] = value # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 239, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(4, 239, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":238
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(4, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(4, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":243
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+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) {
+ struct __pyx_array_obj *__pyx_v_result = 0;
+ struct __pyx_array_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("array_cwrapper", 0);
+
+ /* "View.MemoryView":247
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":248
+ *
+ * if buf == NULL:
+ * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ */
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(4, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "View.MemoryView":247
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":250
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __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(4, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":251
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False) # <<<<<<<<<<<<<<
+ * result.data = buf
+ *
+ */
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 251, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(4, 251, __pyx_L1_error)
+
+ /* "View.MemoryView":250
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":252
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False)
+ * result.data = buf # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->data = __pyx_v_buf;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":254
+ * result.data = buf
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":243
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":280
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+/* Python wrapper */
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_name = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
+ PyObject* values[1] = {0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(4, 280, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ }
+ __pyx_v_name = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 280, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "View.MemoryView":281
+ * cdef object name
+ * def __init__(self, name):
+ * self.name = name # <<<<<<<<<<<<<<
+ * def __repr__(self):
+ * return self.name
+ */
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ __Pyx_GOTREF(__pyx_v_self->name);
+ __Pyx_DECREF(__pyx_v_self->name);
+ __pyx_v_self->name = __pyx_v_name;
+
+ /* "View.MemoryView":280
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":282
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":283
+ * self.name = name
+ * def __repr__(self):
+ * return self.name # <<<<<<<<<<<<<<
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __pyx_r = __pyx_v_self->name;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":282
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef bint use_setstate
+ * state = (self.name,)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
+ int __pyx_v_use_setstate;
+ PyObject *__pyx_v_state = NULL;
+ PyObject *__pyx_v__dict = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * cdef bint use_setstate
+ * state = (self.name,) # <<<<<<<<<<<<<<
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __Pyx_GIVEREF(__pyx_v_self->name);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
+ __pyx_v_state = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":4
+ * cdef bint use_setstate
+ * state = (self.name,)
+ * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
+ * if _dict is not None:
+ * state += (_dict,)
+ */
+ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v__dict = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":5
+ * state = (self.name,)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ __pyx_t_2 = (__pyx_v__dict != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":6
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ * state += (_dict,) # <<<<<<<<<<<<<<
+ * use_setstate = True
+ * else:
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v__dict);
+ __Pyx_GIVEREF(__pyx_v__dict);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
+ __pyx_t_4 = 0;
+
+ /* "(tree fragment)":7
+ * if _dict is not None:
+ * state += (_dict,)
+ * use_setstate = True # <<<<<<<<<<<<<<
+ * else:
+ * use_setstate = self.name is not None
+ */
+ __pyx_v_use_setstate = 1;
+
+ /* "(tree fragment)":5
+ * state = (self.name,)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ goto __pyx_L3;
+ }
+
+ /* "(tree fragment)":9
+ * use_setstate = True
+ * else:
+ * use_setstate = self.name is not None # <<<<<<<<<<<<<<
+ * if use_setstate:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ */
+ /*else*/ {
+ __pyx_t_3 = (__pyx_v_self->name != Py_None);
+ __pyx_v_use_setstate = __pyx_t_3;
+ }
+ __pyx_L3:;
+
+ /* "(tree fragment)":10
+ * else:
+ * use_setstate = self.name is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_use_setstate != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":11
+ * use_setstate = self.name is not None
+ * if use_setstate:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_184977713);
+ __Pyx_GIVEREF(__pyx_int_184977713);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":10
+ * else:
+ * use_setstate = self.name is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ * else:
+ */
+ }
+
+ /* "(tree fragment)":13
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_184977713);
+ __Pyx_GIVEREF(__pyx_int_184977713);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef bint use_setstate
+ * state = (self.name,)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_state);
+ __Pyx_XDECREF(__pyx_v__dict);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":14
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":15
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
+ */
+ 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(4, 15, __pyx_L1_error)
+ __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":14
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":297
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
+ Py_intptr_t __pyx_v_aligned_p;
+ size_t __pyx_v_offset;
+ void *__pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":299
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil:
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
+ * cdef size_t offset
+ *
+ */
+ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
+
+ /* "View.MemoryView":303
+ *
+ * with cython.cdivision(True):
+ * offset = aligned_p % alignment # <<<<<<<<<<<<<<
+ *
+ * if offset > 0:
+ */
+ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
+
+ /* "View.MemoryView":305
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":306
+ *
+ * if offset > 0:
+ * aligned_p += alignment - offset # <<<<<<<<<<<<<<
+ *
+ * return <void *> aligned_p
+ */
+ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
+
+ /* "View.MemoryView":305
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
+ }
+
+ /* "View.MemoryView":308
+ * aligned_p += alignment - offset
+ *
+ * return <void *> aligned_p # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = ((void *)__pyx_v_aligned_p);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":297
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":344
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_obj = 0;
+ int __pyx_v_flags;
+ int __pyx_v_dtype_is_object;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(4, 344, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(4, 344, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_obj = values[0];
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 344, __pyx_L3_error)
+ if (values[2]) {
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 344, __pyx_L3_error)
+ } else {
+ __pyx_v_dtype_is_object = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 344, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __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);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "View.MemoryView":345
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj # <<<<<<<<<<<<<<
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ */
+ __Pyx_INCREF(__pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ __Pyx_GOTREF(__pyx_v_self->obj);
+ __Pyx_DECREF(__pyx_v_self->obj);
+ __pyx_v_self->obj = __pyx_v_obj;
+
+ /* "View.MemoryView":346
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj
+ * self.flags = flags # <<<<<<<<<<<<<<
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ */
+ __pyx_v_self->flags = __pyx_v_flags;
+
+ /* "View.MemoryView":347
+ * self.obj = obj
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ */
+ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_obj != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":348
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ */
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 348, __pyx_L1_error)
+
+ /* "View.MemoryView":349
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":350
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
+
+ /* "View.MemoryView":351
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * global __pyx_memoryview_thread_locks_used
+ */
+ Py_INCREF(Py_None);
+
+ /* "View.MemoryView":349
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ }
+
+ /* "View.MemoryView":347
+ * self.obj = obj
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ */
+ }
+
+ /* "View.MemoryView":354
+ *
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":355
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":356
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":354
+ *
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":357
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":358
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":359
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":360
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ PyErr_NoMemory(); __PYX_ERR(4, 360, __pyx_L1_error)
+
+ /* "View.MemoryView":359
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":357
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
+ }
+
+ /* "View.MemoryView":362
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":363
+ *
+ * if flags & PyBUF_FORMAT:
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
+ * else:
+ * self.dtype_is_object = dtype_is_object
+ */
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_self->dtype_is_object = __pyx_t_1;
+
+ /* "View.MemoryView":362
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":365
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ */
+ /*else*/ {
+ __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":367
+ * self.dtype_is_object = dtype_is_object
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL
+ */
+ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
+
+ /* "View.MemoryView":369
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(memoryview self):
+ */
+ __pyx_v_self->typeinfo = NULL;
+
+ /* "View.MemoryView":344
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":371
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+/* Python wrapper */
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
+ PyThread_type_lock __pyx_t_7;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":372
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->obj != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":373
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
+ *
+ * cdef int i
+ */
+ __Pyx_ReleaseBuffer((&__pyx_v_self->view));
+
+ /* "View.MemoryView":372
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ */
+ }
+
+ /* "View.MemoryView":377
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
+ __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":378
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ __pyx_t_4 = __pyx_t_3;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":379
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":381
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":383
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":382
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
+
+ /* "View.MemoryView":381
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":384
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":379
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":386
+ * break
+ * else:
+ * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ */
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":377
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
+ }
+
+ /* "View.MemoryView":371
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":388
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ Py_ssize_t __pyx_v_dim;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_v_idx = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *(*__pyx_t_4)(PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ char *__pyx_t_7;
+ __Pyx_RefNannySetupContext("get_item_pointer", 0);
+
+ /* "View.MemoryView":390
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim, idx in enumerate(index):
+ */
+ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
+
+ /* "View.MemoryView":392
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ __pyx_t_1 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
+ __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+ __pyx_t_4 = NULL;
+ } else {
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 392, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 392, __pyx_L1_error)
+ }
+ for (;;) {
+ if (likely(!__pyx_t_4)) {
+ if (likely(PyList_CheckExact(__pyx_t_2))) {
+ if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(4, 392, __pyx_L1_error)
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 392, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ } else {
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(4, 392, __pyx_L1_error)
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 392, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ }
+ } else {
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+ if (unlikely(!__pyx_t_5)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(4, 392, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_v_dim = __pyx_t_1;
+ __pyx_t_1 = (__pyx_t_1 + 1);
+
+ /* "View.MemoryView":393
+ *
+ * for dim, idx in enumerate(index):
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
+ *
+ * return itemp
+ */
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 393, __pyx_L1_error)
+ __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(4, 393, __pyx_L1_error)
+ __pyx_v_itemp = __pyx_t_7;
+
+ /* "View.MemoryView":392
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":395
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ * return itemp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_itemp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":388
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":398
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_indices = NULL;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":399
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":400
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis:
+ * return self # <<<<<<<<<<<<<<
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __pyx_r = ((PyObject *)__pyx_v_self);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":399
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+ }
+
+ /* "View.MemoryView":402
+ * return self
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef char *itemp
+ */
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 402, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(__pyx_t_3 != Py_None)) {
+ PyObject* sequence = __pyx_t_3;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(4, 402, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 402, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 402, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 402, __pyx_L1_error)
+ }
+ __pyx_v_have_slices = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_v_indices = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":405
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(4, 405, __pyx_L1_error)
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":406
+ * cdef char *itemp
+ * if have_slices:
+ * return memview_slice(self, indices) # <<<<<<<<<<<<<<
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 406, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":405
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":408
+ * return memview_slice(self, indices)
+ * else:
+ * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
+ * return self.convert_item_to_object(itemp)
+ *
+ */
+ /*else*/ {
+ __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(4, 408, __pyx_L1_error)
+ __pyx_v_itemp = __pyx_t_6;
+
+ /* "View.MemoryView":409
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(4, 409, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":398
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_indices);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":411
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview")
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_obj = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+ __Pyx_INCREF(__pyx_v_index);
+
+ /* "View.MemoryView":412
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly: # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot assign to read-only memoryview")
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":413
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(4, 413, __pyx_L1_error)
+
+ /* "View.MemoryView":412
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly: # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot assign to read-only memoryview")
+ *
+ */
+ }
+
+ /* "View.MemoryView":415
+ * raise TypeError("Cannot assign to read-only memoryview")
+ *
+ * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * if have_slices:
+ */
+ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (likely(__pyx_t_2 != Py_None)) {
+ PyObject* sequence = __pyx_t_2;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(4, 415, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ #endif
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(4, 415, __pyx_L1_error)
+ }
+ __pyx_v_have_slices = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "View.MemoryView":417
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 417, __pyx_L1_error)
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":418
+ *
+ * if have_slices:
+ * obj = self.is_slice(value) # <<<<<<<<<<<<<<
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj)
+ */
+ __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(4, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_obj = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":419
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 419, __pyx_L1_error)
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":420
+ * obj = self.is_slice(value)
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 420, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __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(4, 420, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "View.MemoryView":419
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
+ goto __pyx_L5;
+ }
+
+ /* "View.MemoryView":422
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_indexed(index, value)
+ */
+ /*else*/ {
+ __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 422, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(4, 422, __pyx_L1_error)
+ __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(4, 422, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":417
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
+ goto __pyx_L4;
+ }
+
+ /* "View.MemoryView":424
+ * self.setitem_slice_assign_scalar(self[index], value)
+ * else:
+ * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
+ *
+ * cdef is_slice(self, obj):
+ */
+ /*else*/ {
+ __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(4, 424, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":411
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview")
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":426
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
+ __Pyx_RefNannySetupContext("is_slice", 0);
+ __Pyx_INCREF(__pyx_v_obj);
+
+ /* "View.MemoryView":427
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":428
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ /*try:*/ {
+
+ /* "View.MemoryView":429
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 429, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":430
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object) # <<<<<<<<<<<<<<
+ * except TypeError:
+ * return None
+ */
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 430, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "View.MemoryView":429
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 429, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 429, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":428
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ goto __pyx_L9_try_end;
+ __pyx_L4_error:;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":431
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ * except TypeError: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(4, 431, __pyx_L6_except_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":432
+ * self.dtype_is_object)
+ * except TypeError:
+ * return None # <<<<<<<<<<<<<<
+ *
+ * return obj
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ goto __pyx_L7_except_return;
+ }
+ goto __pyx_L6_except_error;
+ __pyx_L6_except_error:;
+
+ /* "View.MemoryView":428
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L1_error;
+ __pyx_L7_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L0;
+ __pyx_L9_try_end:;
+ }
+
+ /* "View.MemoryView":427
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
+ }
+
+ /* "View.MemoryView":434
+ * return None
+ *
+ * return obj # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assignment(self, dst, src):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_obj);
+ __pyx_r = __pyx_v_obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":426
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":436
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
+ __Pyx_memviewslice __pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_src_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
+
+ /* "View.MemoryView":440
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(4, 440, __pyx_L1_error)
+
+ /* "View.MemoryView":441
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(4, 441, __pyx_L1_error)
+
+ /* "View.MemoryView":442
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 442, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 442, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 442, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(4, 442, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":440
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ __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(4, 440, __pyx_L1_error)
+
+ /* "View.MemoryView":436
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":444
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+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) {
+ int __pyx_v_array[0x80];
+ void *__pyx_v_tmp;
+ void *__pyx_v_item;
+ __Pyx_memviewslice *__pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_tmp_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char const *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
+
+ /* "View.MemoryView":446
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ * cdef int array[128]
+ * cdef void *tmp = NULL # <<<<<<<<<<<<<<
+ * cdef void *item
+ *
+ */
+ __pyx_v_tmp = NULL;
+
+ /* "View.MemoryView":451
+ * cdef __Pyx_memviewslice *dst_slice
+ * cdef __Pyx_memviewslice tmp_slice
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ */
+ __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
+
+ /* "View.MemoryView":453
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
+ *
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ */
+ __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":454
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
+ * if tmp == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
+
+ /* "View.MemoryView":455
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
+ __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":456
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ * item = tmp
+ * else:
+ */
+ PyErr_NoMemory(); __PYX_ERR(4, 456, __pyx_L1_error)
+
+ /* "View.MemoryView":455
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
+ }
+
+ /* "View.MemoryView":457
+ * if tmp == NULL:
+ * raise MemoryError
+ * item = tmp # <<<<<<<<<<<<<<
+ * else:
+ * item = <void *> array
+ */
+ __pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":453
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
+ *
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":459
+ * item = tmp
+ * else:
+ * item = <void *> array # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ /*else*/ {
+ __pyx_v_item = ((void *)__pyx_v_array);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":461
+ * item = <void *> array
+ *
+ * try: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value
+ */
+ /*try:*/ {
+
+ /* "View.MemoryView":462
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":463
+ * try:
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
+ * else:
+ * self.assign_item_from_object(<char *> item, value)
+ */
+ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":462
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
+ goto __pyx_L8;
+ }
+
+ /* "View.MemoryView":465
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else*/ {
+ __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(4, 465, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":469
+ *
+ *
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":470
+ *
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ * item, self.dtype_is_object)
+ */
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 470, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":469
+ *
+ *
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ */
+ }
+
+ /* "View.MemoryView":471
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
+ * item, self.dtype_is_object)
+ * finally:
+ */
+ __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);
+ }
+
+ /* "View.MemoryView":474
+ * item, self.dtype_is_object)
+ * finally:
+ * PyMem_Free(tmp) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_indexed(self, index, value):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ PyMem_Free(__pyx_v_tmp);
+ goto __pyx_L7;
+ }
+ __pyx_L6_error:;
+ /*exception exit:*/{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+ 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);
+ __Pyx_XGOTREF(__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_10);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
+ {
+ PyMem_Free(__pyx_v_tmp);
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_XGIVEREF(__pyx_t_10);
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+ }
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
+ goto __pyx_L1_error;
+ }
+ __pyx_L7:;
+ }
+
+ /* "View.MemoryView":444
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":476
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ char *__pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("setitem_indexed", 0);
+
+ /* "View.MemoryView":477
+ *
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
+ * self.assign_item_from_object(itemp, value)
+ *
+ */
+ __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(4, 477, __pyx_L1_error)
+ __pyx_v_itemp = __pyx_t_1;
+
+ /* "View.MemoryView":478
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __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(4, 478, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":476
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":480
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_v_struct = NULL;
+ PyObject *__pyx_v_bytesitem = 0;
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ size_t __pyx_t_10;
+ int __pyx_t_11;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":483
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef bytes bytesitem
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 483, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":486
+ * cdef bytes bytesitem
+ *
+ * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ */
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 486, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":487
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "View.MemoryView":488
+ * bytesitem = itemp[:self.view.itemsize]
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object")
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __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(4, 488, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __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(4, 488, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":487
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ }
+
+ /* "View.MemoryView":492
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
+ /*else:*/ {
+ __pyx_t_10 = strlen(__pyx_v_self->view.format);
+ __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
+ if (__pyx_t_11) {
+
+ /* "View.MemoryView":493
+ * else:
+ * if len(self.view.format) == 1:
+ * return result[0] # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(4, 493, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L6_except_return;
+
+ /* "View.MemoryView":492
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
+ }
+
+ /* "View.MemoryView":494
+ * if len(self.view.format) == 1:
+ * return result[0]
+ * return result # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":489
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error: # <<<<<<<<<<<<<<
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ */
+ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 489, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
+ __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
+ if (__pyx_t_8) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(4, 489, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_1);
+
+ /* "View.MemoryView":490
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 490, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(4, 490, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "View.MemoryView":487
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":480
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesitem);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":496
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_struct = NULL;
+ char __pyx_v_c;
+ PyObject *__pyx_v_bytesvalue = 0;
+ Py_ssize_t __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
+ char *__pyx_t_11;
+ char *__pyx_t_12;
+ char *__pyx_t_13;
+ char *__pyx_t_14;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":499
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef char c
+ * cdef bytes bytesvalue
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 499, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":504
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
+ __pyx_t_2 = PyTuple_Check(__pyx_v_value);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":505
+ *
+ * if isinstance(value, tuple):
+ * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ 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(4, 505, __pyx_L1_error)
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "View.MemoryView":504
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":507
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
+ *
+ * for i, c in enumerate(bytesvalue):
+ */
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __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(4, 507, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __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(4, 507, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
+ __pyx_t_1 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ 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(4, 507, __pyx_L1_error)
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":509
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_9 = 0;
+ if (unlikely(__pyx_v_bytesvalue == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
+ __PYX_ERR(4, 509, __pyx_L1_error)
+ }
+ __Pyx_INCREF(__pyx_v_bytesvalue);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
+
+ /* "View.MemoryView":510
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ __pyx_v_i = __pyx_t_9;
+
+ /* "View.MemoryView":509
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_9 = (__pyx_t_9 + 1);
+
+ /* "View.MemoryView":510
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
+ }
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+ /* "View.MemoryView":496
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesvalue);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":513
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ char *__pyx_t_5;
+ void *__pyx_t_6;
+ int __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ if (__pyx_v_info == NULL) {
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
+ return -1;
+ }
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+
+ /* "View.MemoryView":514
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":515
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 515, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(4, 515, __pyx_L1_error)
+
+ /* "View.MemoryView":514
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ */
+ }
+
+ /* "View.MemoryView":517
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":518
+ *
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape # <<<<<<<<<<<<<<
+ * else:
+ * info.shape = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->view.shape;
+ __pyx_v_info->shape = __pyx_t_4;
+
+ /* "View.MemoryView":517
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":520
+ * info.shape = self.view.shape
+ * else:
+ * info.shape = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ /*else*/ {
+ __pyx_v_info->shape = NULL;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":522
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":523
+ *
+ * if flags & PyBUF_STRIDES:
+ * info.strides = self.view.strides # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->view.strides;
+ __pyx_v_info->strides = __pyx_t_4;
+
+ /* "View.MemoryView":522
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
+ goto __pyx_L7;
+ }
+
+ /* "View.MemoryView":525
+ * info.strides = self.view.strides
+ * else:
+ * info.strides = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_INDIRECT:
+ */
+ /*else*/ {
+ __pyx_v_info->strides = NULL;
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":527
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":528
+ *
+ * if flags & PyBUF_INDIRECT:
+ * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
+ * else:
+ * info.suboffsets = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->view.suboffsets;
+ __pyx_v_info->suboffsets = __pyx_t_4;
+
+ /* "View.MemoryView":527
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
+ goto __pyx_L8;
+ }
+
+ /* "View.MemoryView":530
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ /*else*/ {
+ __pyx_v_info->suboffsets = NULL;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":532
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":533
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.view.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_5 = __pyx_v_self->view.format;
+ __pyx_v_info->format = __pyx_t_5;
+
+ /* "View.MemoryView":532
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
+ goto __pyx_L9;
+ }
+
+ /* "View.MemoryView":535
+ * info.format = self.view.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.buf = self.view.buf
+ */
+ /*else*/ {
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":537
+ * info.format = NULL
+ *
+ * info.buf = self.view.buf # <<<<<<<<<<<<<<
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ */
+ __pyx_t_6 = __pyx_v_self->view.buf;
+ __pyx_v_info->buf = __pyx_t_6;
+
+ /* "View.MemoryView":538
+ *
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ */
+ __pyx_t_7 = __pyx_v_self->view.ndim;
+ __pyx_v_info->ndim = __pyx_t_7;
+
+ /* "View.MemoryView":539
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
+ * info.len = self.view.len
+ * info.readonly = self.view.readonly
+ */
+ __pyx_t_8 = __pyx_v_self->view.itemsize;
+ __pyx_v_info->itemsize = __pyx_t_8;
+
+ /* "View.MemoryView":540
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len # <<<<<<<<<<<<<<
+ * info.readonly = self.view.readonly
+ * info.obj = self
+ */
+ __pyx_t_8 = __pyx_v_self->view.len;
+ __pyx_v_info->len = __pyx_t_8;
+
+ /* "View.MemoryView":541
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
+ * info.obj = self
+ *
+ */
+ __pyx_t_1 = __pyx_v_self->view.readonly;
+ __pyx_v_info->readonly = __pyx_t_1;
+
+ /* "View.MemoryView":542
+ * info.len = self.view.len
+ * info.readonly = self.view.readonly
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":513
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":548
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":549
+ * @property
+ * def T(self):
+ * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
+ * transpose_memslice(&result.from_slice)
+ * return result
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 549, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(4, 549, __pyx_L1_error)
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":550
+ * def T(self):
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(4, 550, __pyx_L1_error)
+
+ /* "View.MemoryView":551
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":548
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":554
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":555
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->obj);
+ __pyx_r = __pyx_v_self->obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":554
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":558
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":559
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(4, 559, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":558
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":562
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":563
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":565
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(4, 565, __pyx_L1_error)
+
+ /* "View.MemoryView":563
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
+ }
+
+ /* "View.MemoryView":567
+ * raise ValueError("Buffer view does not expose strides")
+ *
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(4, 567, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":562
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":570
+ *
+ * @property
+ * def suboffsets(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":571
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":572
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 572, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__28, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 572, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":571
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
+ }
+
+ /* "View.MemoryView":574
+ * return (-1,) * self.view.ndim
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 574, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 574, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(4, 574, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 574, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":570
+ *
+ * @property
+ * def suboffsets(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":577
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":578
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 578, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":577
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":581
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":582
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 582, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":581
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":585
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":586
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 586, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 586, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 586, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":585
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":589
+ *
+ * @property
+ * def size(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_v_length = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":590
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->_size == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":591
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
+ *
+ * for length in self.view.shape[:self.view.ndim]:
+ */
+ __Pyx_INCREF(__pyx_int_1);
+ __pyx_v_result = __pyx_int_1;
+
+ /* "View.MemoryView":593
+ * result = 1
+ *
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 593, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "View.MemoryView":594
+ *
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
+ *
+ * self._size = result
+ */
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 594, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
+ }
+
+ /* "View.MemoryView":596
+ * result *= length
+ *
+ * self._size = result # <<<<<<<<<<<<<<
+ *
+ * return self._size
+ */
+ __Pyx_INCREF(__pyx_v_result);
+ __Pyx_GIVEREF(__pyx_v_result);
+ __Pyx_GOTREF(__pyx_v_self->_size);
+ __Pyx_DECREF(__pyx_v_self->_size);
+ __pyx_v_self->_size = __pyx_v_result;
+
+ /* "View.MemoryView":590
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
+ }
+
+ /* "View.MemoryView":598
+ * self._size = result
+ *
+ * return self._size # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->_size);
+ __pyx_r = __pyx_v_self->_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":589
+ *
+ * @property
+ * def size(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":600
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "View.MemoryView":601
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":602
+ * def __len__(self):
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0] # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ __pyx_r = (__pyx_v_self->view.shape[0]);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":601
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
+ }
+
+ /* "View.MemoryView":604
+ * return self.view.shape[0]
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * def __repr__(self):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":600
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":606
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":607
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":608
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self)) # <<<<<<<<<<<<<<
+ *
+ * def __str__(self):
+ */
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 608, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+
+ /* "View.MemoryView":607
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __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(4, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":606
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":610
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__str__", 0);
+
+ /* "View.MemoryView":611
+ *
+ * def __str__(self):
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":610
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":614
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("is_c_contig", 0);
+
+ /* "View.MemoryView":617
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":618
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def is_f_contig(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(4, 618, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":614
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":620
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("is_f_contig", 0);
+
+ /* "View.MemoryView":623
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":624
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def copy(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(4, 624, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":620
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":626
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_mslice;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("copy", 0);
+
+ /* "View.MemoryView":628
+ * def copy(self):
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &mslice)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
+
+ /* "View.MemoryView":630
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ *
+ * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
+
+ /* "View.MemoryView":631
+ *
+ * slice_copy(self, &mslice)
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_C_CONTIGUOUS,
+ */
+ __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(4, 631, __pyx_L1_error)
+ __pyx_v_mslice = __pyx_t_1;
+
+ /* "View.MemoryView":636
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
+ *
+ * def copy_fortran(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 636, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":626
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":638
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("copy_fortran", 0);
+
+ /* "View.MemoryView":640
+ * def copy_fortran(self):
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &src)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
+
+ /* "View.MemoryView":642
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ *
+ * slice_copy(self, &src) # <<<<<<<<<<<<<<
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
+
+ /* "View.MemoryView":643
+ *
+ * slice_copy(self, &src)
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_F_CONTIGUOUS,
+ */
+ __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(4, 643, __pyx_L1_error)
+ __pyx_v_dst = __pyx_t_1;
+
+ /* "View.MemoryView":648
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 648, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":638
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(4, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(4, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":652
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
+ struct __pyx_memoryview_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
+
+ /* "View.MemoryView":653
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
+ * result.typeinfo = typeinfo
+ * return result
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_o);
+ __Pyx_GIVEREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":654
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_v_result->typeinfo = __pyx_v_typeinfo;
+
+ /* "View.MemoryView":655
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_check')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":652
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":658
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("memoryview_check", 0);
+
+ /* "View.MemoryView":659
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o):
+ * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
+ *
+ * cdef tuple _unellipsify(object index, int ndim):
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":658
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":661
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
+ PyObject *__pyx_v_tup = NULL;
+ PyObject *__pyx_v_result = NULL;
+ int __pyx_v_have_slices;
+ int __pyx_v_seen_ellipsis;
+ CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
+ PyObject *__pyx_v_item = NULL;
+ Py_ssize_t __pyx_v_nslices;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ __Pyx_RefNannySetupContext("_unellipsify", 0);
+
+ /* "View.MemoryView":666
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
+ __pyx_t_1 = PyTuple_Check(__pyx_v_index);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":667
+ * """
+ * if not isinstance(index, tuple):
+ * tup = (index,) # <<<<<<<<<<<<<<
+ * else:
+ * tup = index
+ */
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 667, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_index);
+ __Pyx_GIVEREF(__pyx_v_index);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
+ __pyx_v_tup = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":666
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":669
+ * tup = (index,)
+ * else:
+ * tup = index # <<<<<<<<<<<<<<
+ *
+ * result = []
+ */
+ /*else*/ {
+ __Pyx_INCREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_v_index;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":671
+ * tup = index
+ *
+ * result = [] # <<<<<<<<<<<<<<
+ * have_slices = False
+ * seen_ellipsis = False
+ */
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_v_result = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":672
+ *
+ * result = []
+ * have_slices = False # <<<<<<<<<<<<<<
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ */
+ __pyx_v_have_slices = 0;
+
+ /* "View.MemoryView":673
+ * result = []
+ * have_slices = False
+ * seen_ellipsis = False # <<<<<<<<<<<<<<
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ */
+ __pyx_v_seen_ellipsis = 0;
+
+ /* "View.MemoryView":674
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_t_3 = __pyx_int_0;
+ if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
+ __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 674, __pyx_L1_error)
+ }
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(4, 674, __pyx_L1_error)
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(4, 674, __pyx_L1_error)
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ #endif
+ }
+ } else {
+ __pyx_t_7 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_7)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(4, 674, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3);
+ __pyx_t_3 = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":675
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ */
+ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":676
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True
+ */
+ __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":677
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(4, 677, __pyx_L1_error)
+ __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(4, 677, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__31);
+ __Pyx_GIVEREF(__pyx_slice__31);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__31);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 677, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":678
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True # <<<<<<<<<<<<<<
+ * else:
+ * result.append(slice(None))
+ */
+ __pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":676
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True
+ */
+ goto __pyx_L7;
+ }
+
+ /* "View.MemoryView":680
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__32); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 680, __pyx_L1_error)
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":681
+ * else:
+ * result.append(slice(None))
+ * have_slices = True # <<<<<<<<<<<<<<
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ */
+ __pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":675
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":683
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
+ /*else*/ {
+ __pyx_t_2 = PySlice_Check(__pyx_v_item);
+ __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_10;
+ __pyx_L9_bool_binop_done:;
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":684
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ */
+ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 684, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 684, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_11, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __PYX_ERR(4, 684, __pyx_L1_error)
+
+ /* "View.MemoryView":683
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
+ }
+
+ /* "View.MemoryView":686
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
+ * result.append(item)
+ *
+ */
+ __pyx_t_10 = (__pyx_v_have_slices != 0);
+ if (!__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = PySlice_Check(__pyx_v_item);
+ __pyx_t_2 = (__pyx_t_10 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_have_slices = __pyx_t_1;
+
+ /* "View.MemoryView":687
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ * result.append(item) # <<<<<<<<<<<<<<
+ *
+ * nslices = ndim - len(result)
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 687, __pyx_L1_error)
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":674
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":689
+ * result.append(item)
+ *
+ * nslices = ndim - len(result) # <<<<<<<<<<<<<<
+ * if nslices:
+ * result.extend([slice(None)] * nslices)
+ */
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(4, 689, __pyx_L1_error)
+ __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
+
+ /* "View.MemoryView":690
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_nslices != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":691
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 691, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__33);
+ __Pyx_GIVEREF(__pyx_slice__33);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__33);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(4, 691, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":690
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
+ }
+
+ /* "View.MemoryView":693
+ * result.extend([slice(None)] * nslices)
+ *
+ * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (!__pyx_v_have_slices) {
+ } else {
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_L14_bool_binop_done:;
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(4, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_r = ((PyObject*)__pyx_t_11);
+ __pyx_t_11 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":661
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_tup);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_XDECREF(__pyx_v_item);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":695
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+
+static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
+
+ /* "View.MemoryView":696
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * raise ValueError("Indirect dimensions not supported")
+ */
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
+
+ /* "View.MemoryView":697
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":698
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 698, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(4, 698, __pyx_L1_error)
+
+ /* "View.MemoryView":697
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":695
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":705
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
+ int __pyx_v_new_ndim;
+ int __pyx_v_suboffset_dim;
+ int __pyx_v_dim;
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ __Pyx_memviewslice *__pyx_v_p_src;
+ struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
+ __Pyx_memviewslice *__pyx_v_p_dst;
+ int *__pyx_v_p_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;
+ PyObject *__pyx_v_index = NULL;
+ struct __pyx_memoryview_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ PyObject *(*__pyx_t_8)(PyObject *);
+ PyObject *__pyx_t_9 = NULL;
+ Py_ssize_t __pyx_t_10;
+ int __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ __Pyx_RefNannySetupContext("memview_slice", 0);
+
+ /* "View.MemoryView":706
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices):
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
+ * cdef bint negative_step
+ * cdef __Pyx_memviewslice src, dst
+ */
+ __pyx_v_new_ndim = 0;
+ __pyx_v_suboffset_dim = -1;
+
+ /* "View.MemoryView":713
+ *
+ *
+ * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
+ *
+ * cdef _memoryviewslice memviewsliceobj
+ */
+ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
+
+ /* "View.MemoryView":717
+ * cdef _memoryviewslice memviewsliceobj
+ *
+ * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(4, 717, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "View.MemoryView":719
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":720
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview # <<<<<<<<<<<<<<
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(4, 720, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":721
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, &src)
+ */
+ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":719
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":723
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ * slice_copy(memview, &src) # <<<<<<<<<<<<<<
+ * p_src = &src
+ *
+ */
+ /*else*/ {
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
+
+ /* "View.MemoryView":724
+ * else:
+ * slice_copy(memview, &src)
+ * p_src = &src # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_p_src = (&__pyx_v_src);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":730
+ *
+ *
+ * dst.memview = p_src.memview # <<<<<<<<<<<<<<
+ * dst.data = p_src.data
+ *
+ */
+ __pyx_t_4 = __pyx_v_p_src->memview;
+ __pyx_v_dst.memview = __pyx_t_4;
+
+ /* "View.MemoryView":731
+ *
+ * dst.memview = p_src.memview
+ * dst.data = p_src.data # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_v_p_src->data;
+ __pyx_v_dst.data = __pyx_t_5;
+
+ /* "View.MemoryView":736
+ *
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
+ * cdef int *p_suboffset_dim = &suboffset_dim
+ * cdef Py_ssize_t start, stop, step
+ */
+ __pyx_v_p_dst = (&__pyx_v_dst);
+
+ /* "View.MemoryView":737
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst
+ * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t start, stop, step
+ * cdef bint have_start, have_stop, have_step
+ */
+ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
+
+ /* "View.MemoryView":741
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ __pyx_t_6 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
+ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
+ __pyx_t_8 = NULL;
+ } else {
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 741, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(4, 741, __pyx_L1_error)
+ }
+ for (;;) {
+ if (likely(!__pyx_t_8)) {
+ if (likely(PyList_CheckExact(__pyx_t_3))) {
+ if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(4, 741, __pyx_L1_error)
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 741, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ #endif
+ } else {
+ if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(4, 741, __pyx_L1_error)
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 741, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ #endif
+ }
+ } else {
+ __pyx_t_9 = __pyx_t_8(__pyx_t_3);
+ if (unlikely(!__pyx_t_9)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(4, 741, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_9);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_v_dim = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":742
+ *
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
+ * slice_memviewslice(
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ */
+ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":746
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ */
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 746, __pyx_L1_error)
+
+ /* "View.MemoryView":743
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index):
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __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(4, 743, __pyx_L1_error)
+
+ /* "View.MemoryView":742
+ *
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
+ * slice_memviewslice(
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":749
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
+ __pyx_t_2 = (__pyx_v_index == Py_None);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":750
+ * False)
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ */
+ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
+
+ /* "View.MemoryView":751
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1
+ */
+ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
+
+ /* "View.MemoryView":752
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
+ * new_ndim += 1
+ * else:
+ */
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
+
+ /* "View.MemoryView":753
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = index.start or 0
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":749
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":755
+ * new_ndim += 1
+ * else:
+ * start = index.start or 0 # <<<<<<<<<<<<<<
+ * stop = index.stop or 0
+ * step = index.step or 0
+ */
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 755, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 755, __pyx_L1_error)
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 755, __pyx_L1_error)
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L7_bool_binop_done:;
+ __pyx_v_start = __pyx_t_10;
+
+ /* "View.MemoryView":756
+ * else:
+ * start = index.start or 0
+ * stop = index.stop or 0 # <<<<<<<<<<<<<<
+ * step = index.step or 0
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 756, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 756, __pyx_L1_error)
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 756, __pyx_L1_error)
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L9_bool_binop_done:;
+ __pyx_v_stop = __pyx_t_10;
+
+ /* "View.MemoryView":757
+ * start = index.start or 0
+ * stop = index.stop or 0
+ * step = index.step or 0 # <<<<<<<<<<<<<<
+ *
+ * have_start = index.start is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 757, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(4, 757, __pyx_L1_error)
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 757, __pyx_L1_error)
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_step = __pyx_t_10;
+
+ /* "View.MemoryView":759
+ * step = index.step or 0
+ *
+ * have_start = index.start is not None # <<<<<<<<<<<<<<
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 759, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_start = __pyx_t_1;
+
+ /* "View.MemoryView":760
+ *
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None # <<<<<<<<<<<<<<
+ * have_step = index.step is not None
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 760, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_stop = __pyx_t_1;
+
+ /* "View.MemoryView":761
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None # <<<<<<<<<<<<<<
+ *
+ * slice_memviewslice(
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 761, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_step = __pyx_t_1;
+
+ /* "View.MemoryView":763
+ * have_step = index.step is not None
+ *
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __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(4, 763, __pyx_L1_error)
+
+ /* "View.MemoryView":769
+ * have_start, have_stop, have_step,
+ * True)
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":741
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":771
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":772
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":773
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 773, __pyx_L1_error) }
+
+ /* "View.MemoryView":774
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ * else:
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(4, 774, __pyx_L1_error) }
+
+ /* "View.MemoryView":772
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __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(4, 772, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 772, __pyx_L1_error)
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":771
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
+ }
+
+ /* "View.MemoryView":777
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ /*else*/ {
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":778
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __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(4, 777, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":777
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(4, 777, __pyx_L1_error)
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":705
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":802
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+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) {
+ Py_ssize_t __pyx_v_new_shape;
+ int __pyx_v_negative_step;
+ int __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":822
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
+ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":824
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
+ __pyx_t_1 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":825
+ *
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+
+ /* "View.MemoryView":824
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
+ }
+
+ /* "View.MemoryView":826
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
+ __pyx_t_1 = (0 <= __pyx_v_start);
+ if (__pyx_t_1) {
+ __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
+ }
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":827
+ * start += shape
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
+ * else:
+ *
+ */
+ __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(4, 827, __pyx_L1_error)
+
+ /* "View.MemoryView":826
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":822
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":830
+ * else:
+ *
+ * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
+ *
+ * if have_step and step == 0:
+ */
+ /*else*/ {
+ __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step < 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L6_bool_binop_done:;
+ __pyx_v_negative_step = __pyx_t_2;
+
+ /* "View.MemoryView":832
+ * negative_step = have_step != 0 and step < 0
+ *
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_have_step != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step == 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":833
+ *
+ * if have_step and step == 0:
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __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(4, 833, __pyx_L1_error)
+
+ /* "View.MemoryView":832
+ * negative_step = have_step != 0 and step < 0
+ *
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":836
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_start != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":837
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":838
+ * if have_start:
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+
+ /* "View.MemoryView":839
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":840
+ * start += shape
+ * if start < 0:
+ * start = 0 # <<<<<<<<<<<<<<
+ * elif start >= shape:
+ * if negative_step:
+ */
+ __pyx_v_start = 0;
+
+ /* "View.MemoryView":839
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
+ }
+
+ /* "View.MemoryView":837
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":841
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
+ __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":842
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":843
+ * elif start >= shape:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = shape
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":842
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ goto __pyx_L14;
+ }
+
+ /* "View.MemoryView":845
+ * start = shape - 1
+ * else:
+ * start = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ /*else*/ {
+ __pyx_v_start = __pyx_v_shape;
+ }
+ __pyx_L14:;
+
+ /* "View.MemoryView":841
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
+ }
+ __pyx_L12:;
+
+ /* "View.MemoryView":836
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
+ goto __pyx_L11;
+ }
+
+ /* "View.MemoryView":847
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":848
+ * else:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":847
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ goto __pyx_L15;
+ }
+
+ /* "View.MemoryView":850
+ * start = shape - 1
+ * else:
+ * start = 0 # <<<<<<<<<<<<<<
+ *
+ * if have_stop:
+ */
+ /*else*/ {
+ __pyx_v_start = 0;
+ }
+ __pyx_L15:;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":852
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_stop != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":853
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":854
+ * if have_stop:
+ * if stop < 0:
+ * stop += shape # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop = 0
+ */
+ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
+
+ /* "View.MemoryView":855
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":856
+ * stop += shape
+ * if stop < 0:
+ * stop = 0 # <<<<<<<<<<<<<<
+ * elif stop > shape:
+ * stop = shape
+ */
+ __pyx_v_stop = 0;
+
+ /* "View.MemoryView":855
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
+ }
+
+ /* "View.MemoryView":853
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
+ goto __pyx_L17;
+ }
+
+ /* "View.MemoryView":857
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":858
+ * stop = 0
+ * elif stop > shape:
+ * stop = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+
+ /* "View.MemoryView":857
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
+ }
+ __pyx_L17:;
+
+ /* "View.MemoryView":852
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
+ goto __pyx_L16;
+ }
+
+ /* "View.MemoryView":860
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":861
+ * else:
+ * if negative_step:
+ * stop = -1 # <<<<<<<<<<<<<<
+ * else:
+ * stop = shape
+ */
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":860
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
+ goto __pyx_L19;
+ }
+
+ /* "View.MemoryView":863
+ * stop = -1
+ * else:
+ * stop = shape # <<<<<<<<<<<<<<
+ *
+ * if not have_step:
+ */
+ /*else*/ {
+ __pyx_v_stop = __pyx_v_shape;
+ }
+ __pyx_L19:;
+ }
+ __pyx_L16:;
+
+ /* "View.MemoryView":865
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":866
+ *
+ * if not have_step:
+ * step = 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_step = 1;
+
+ /* "View.MemoryView":865
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
+ }
+
+ /* "View.MemoryView":870
+ *
+ * with cython.cdivision(True):
+ * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
+ *
+ * if (stop - start) - step * new_shape:
+ */
+ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
+
+ /* "View.MemoryView":872
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":873
+ *
+ * if (stop - start) - step * new_shape:
+ * new_shape += 1 # <<<<<<<<<<<<<<
+ *
+ * if new_shape < 0:
+ */
+ __pyx_v_new_shape = (__pyx_v_new_shape + 1);
+
+ /* "View.MemoryView":872
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
+ }
+
+ /* "View.MemoryView":875
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":876
+ *
+ * if new_shape < 0:
+ * new_shape = 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_new_shape = 0;
+
+ /* "View.MemoryView":875
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
+ }
+
+ /* "View.MemoryView":879
+ *
+ *
+ * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset
+ */
+ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
+
+ /* "View.MemoryView":880
+ *
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
+ * dst.suboffsets[new_ndim] = suboffset
+ *
+ */
+ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
+
+ /* "View.MemoryView":881
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":884
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
+ __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":885
+ *
+ * if suboffset_dim[0] < 0:
+ * dst.data += start * stride # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ */
+ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":884
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
+ goto __pyx_L23;
+ }
+
+ /* "View.MemoryView":887
+ * dst.data += start * stride
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
+ *
+ * if suboffset >= 0:
+ */
+ /*else*/ {
+ __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
+ (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
+ }
+ __pyx_L23:;
+
+ /* "View.MemoryView":889
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":890
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
+ __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":891
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":892
+ * if not is_slice:
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ */
+ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":891
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
+ goto __pyx_L26;
+ }
+
+ /* "View.MemoryView":894
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
+ * "must be indexed and not sliced", dim)
+ * else:
+ */
+ /*else*/ {
+
+ /* "View.MemoryView":895
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __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(4, 894, __pyx_L1_error)
+ }
+ __pyx_L26:;
+
+ /* "View.MemoryView":890
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
+ goto __pyx_L25;
+ }
+
+ /* "View.MemoryView":897
+ * "must be indexed and not sliced", dim)
+ * else:
+ * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ /*else*/ {
+ (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
+ }
+ __pyx_L25:;
+
+ /* "View.MemoryView":889
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
+ }
+
+ /* "View.MemoryView":899
+ * suboffset_dim[0] = new_ndim
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":802
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":905
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+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) {
+ Py_ssize_t __pyx_v_shape;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_suboffset;
+ Py_ssize_t __pyx_v_itemsize;
+ char *__pyx_v_resultp;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_RefNannySetupContext("pybuffer_index", 0);
+
+ /* "View.MemoryView":907
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t itemsize = view.itemsize
+ * cdef char *resultp
+ */
+ __pyx_v_suboffset = -1L;
+
+ /* "View.MemoryView":908
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
+ * cdef char *resultp
+ *
+ */
+ __pyx_t_1 = __pyx_v_view->itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":911
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
+ __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":912
+ *
+ * if view.ndim == 0:
+ * shape = view.len / itemsize # <<<<<<<<<<<<<<
+ * stride = itemsize
+ * else:
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+ __PYX_ERR(4, 912, __pyx_L1_error)
+ }
+ 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))) {
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ __PYX_ERR(4, 912, __pyx_L1_error)
+ }
+ __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
+
+ /* "View.MemoryView":913
+ * if view.ndim == 0:
+ * shape = view.len / itemsize
+ * stride = itemsize # <<<<<<<<<<<<<<
+ * else:
+ * shape = view.shape[dim]
+ */
+ __pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":911
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":915
+ * stride = itemsize
+ * else:
+ * shape = view.shape[dim] # <<<<<<<<<<<<<<
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ */
+ /*else*/ {
+ __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":916
+ * else:
+ * shape = view.shape[dim]
+ * stride = view.strides[dim] # <<<<<<<<<<<<<<
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim]
+ */
+ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":917
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":918
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * if index < 0:
+ */
+ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
+
+ /* "View.MemoryView":917
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":920
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":921
+ *
+ * if index < 0:
+ * index += view.shape[dim] # <<<<<<<<<<<<<<
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ */
+ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
+
+ /* "View.MemoryView":922
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":923
+ * index += view.shape[dim]
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * if index >= shape:
+ */
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 923, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(4, 923, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 923, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(4, 923, __pyx_L1_error)
+
+ /* "View.MemoryView":922
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":920
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
+ }
+
+ /* "View.MemoryView":925
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * if index >= shape: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":926
+ *
+ * if index >= shape:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * resultp = bufp + index * stride
+ */
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 926, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(4, 926, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 926, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(4, 926, __pyx_L1_error)
+
+ /* "View.MemoryView":925
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * if index >= shape: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":928
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * resultp = bufp + index * stride # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset
+ */
+ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
+
+ /* "View.MemoryView":929
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":930
+ * resultp = bufp + index * stride
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
+ *
+ * return resultp
+ */
+ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":929
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
+ }
+
+ /* "View.MemoryView":932
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ * return resultp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_resultp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":905
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":938
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
+ int __pyx_v_ndim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ int __pyx_v_i;
+ int __pyx_v_j;
+ int __pyx_r;
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ long __pyx_t_3;
+ long __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_t_9;
+
+ /* "View.MemoryView":939
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
+ * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ */
+ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
+ __pyx_v_ndim = __pyx_t_1;
+
+ /* "View.MemoryView":941
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t *strides = memslice.strides
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->shape;
+ __pyx_v_shape = __pyx_t_2;
+
+ /* "View.MemoryView":942
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->strides;
+ __pyx_v_strides = __pyx_t_2;
+
+ /* "View.MemoryView":946
+ *
+ * cdef int i, j
+ * for i in range(ndim / 2): # <<<<<<<<<<<<<<
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ */
+ __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
+ __pyx_t_4 = __pyx_t_3;
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":947
+ * cdef int i, j
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i # <<<<<<<<<<<<<<
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i]
+ */
+ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
+
+ /* "View.MemoryView":948
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ */
+ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
+ __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
+ (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
+
+ /* "View.MemoryView":949
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ */
+ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
+ __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
+ (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
+ (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
+
+ /* "View.MemoryView":951
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ */
+ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (!__pyx_t_8) {
+ } else {
+ __pyx_t_7 = __pyx_t_8;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
+ __pyx_t_7 = __pyx_t_8;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_7) {
+
+ /* "View.MemoryView":952
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
+ *
+ * return 1
+ */
+ __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(4, 952, __pyx_L1_error)
+
+ /* "View.MemoryView":951
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":954
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ * return 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":938
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":971
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":972
+ *
+ * def __dealloc__(self):
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
+
+ /* "View.MemoryView":971
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":974
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":975
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":976
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 976, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":975
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":978
+ * return self.to_object_func(itemp)
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __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(4, 978, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":974
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":980
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":981
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":982
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value)
+ */
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(4, 982, __pyx_L1_error)
+
+ /* "View.MemoryView":981
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":984
+ * self.to_dtype_func(itemp, value)
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ /*else*/ {
+ __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(4, 984, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":980
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":987
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":988
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->from_object);
+ __pyx_r = __pyx_v_self->from_object;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":987
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(4, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(4, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":994
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+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) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_TypeInfo *__pyx_t_4;
+ Py_buffer __pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
+
+ /* "View.MemoryView":1002
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1003
+ *
+ * if <PyObject *> memviewslice.memview == Py_None:
+ * return None # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1002
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ }
+
+ /* "View.MemoryView":1008
+ *
+ *
+ * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * result.from_slice = memviewslice
+ */
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1008, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1008, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
+ __Pyx_INCREF(__pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1008, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":1010
+ * result = _memoryviewslice(None, 0, dtype_is_object)
+ *
+ * result.from_slice = memviewslice # <<<<<<<<<<<<<<
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ */
+ __pyx_v_result->from_slice = __pyx_v_memviewslice;
+
+ /* "View.MemoryView":1011
+ *
+ * result.from_slice = memviewslice
+ * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ */
+ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
+
+ /* "View.MemoryView":1013
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1013, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_result->from_object);
+ __Pyx_DECREF(__pyx_v_result->from_object);
+ __pyx_v_result->from_object = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":1014
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
+ *
+ * result.view = memviewslice.memview.view
+ */
+ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
+ __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
+
+ /* "View.MemoryView":1016
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ */
+ __pyx_t_5 = __pyx_v_memviewslice.memview->view;
+ __pyx_v_result->__pyx_base.view = __pyx_t_5;
+
+ /* "View.MemoryView":1017
+ *
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ */
+ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
+
+ /* "View.MemoryView":1018
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
+
+ /* "View.MemoryView":1019
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
+
+ /* "View.MemoryView":1020
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
+ */
+ Py_INCREF(Py_None);
+
+ /* "View.MemoryView":1022
+ * Py_INCREF(Py_None)
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
+ * result.flags = PyBUF_RECORDS
+ * else:
+ */
+ __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1023
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
+ * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
+ * else:
+ * result.flags = PyBUF_RECORDS_RO
+ */
+ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
+
+ /* "View.MemoryView":1022
+ * Py_INCREF(Py_None)
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
+ * result.flags = PyBUF_RECORDS
+ * else:
+ */
+ goto __pyx_L4;
+ }
+
+ /* "View.MemoryView":1025
+ * result.flags = PyBUF_RECORDS
+ * else:
+ * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ */
+ /*else*/ {
+ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":1027
+ * result.flags = PyBUF_RECORDS_RO
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ *
+ */
+ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
+
+ /* "View.MemoryView":1028
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
+
+ /* "View.MemoryView":1031
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1032
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1033
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1034
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1035
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
+ *
+ * result.view.len = result.view.itemsize
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":1033
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":1037
+ * break
+ *
+ * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
+ */
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
+
+ /* "View.MemoryView":1038
+ *
+ * result.view.len = result.view.itemsize
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
+ *
+ */
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1038, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":1039
+ * result.view.len = result.view.itemsize
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
+ *
+ * result.to_object_func = to_object_func
+ */
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1039, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1039, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(4, 1039, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
+ }
+
+ /* "View.MemoryView":1041
+ * result.view.len *= length
+ *
+ * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
+ * result.to_dtype_func = to_dtype_func
+ *
+ */
+ __pyx_v_result->to_object_func = __pyx_v_to_object_func;
+
+ /* "View.MemoryView":1042
+ *
+ * result.to_object_func = to_object_func
+ * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
+
+ /* "View.MemoryView":1044
+ * result.to_dtype_func = to_dtype_func
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":994
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1047
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
+ __Pyx_memviewslice *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
+
+ /* "View.MemoryView":1050
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1051
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview # <<<<<<<<<<<<<<
+ * return &obj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(4, 1051, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1052
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview
+ * return &obj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, mslice)
+ */
+ __pyx_r = (&__pyx_v_obj->from_slice);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1050
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
+ }
+
+ /* "View.MemoryView":1054
+ * return &obj.from_slice
+ * else:
+ * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
+ * return mslice
+ *
+ */
+ /*else*/ {
+ __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
+
+ /* "View.MemoryView":1055
+ * else:
+ * slice_copy(memview, mslice)
+ * return mslice # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ */
+ __pyx_r = __pyx_v_mslice;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1047
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_obj);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1058
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
+ int __pyx_v_dim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ Py_ssize_t *__pyx_v_suboffsets;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t *__pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ __Pyx_RefNannySetupContext("slice_copy", 0);
+
+ /* "View.MemoryView":1062
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ *
+ * shape = memview.view.shape # <<<<<<<<<<<<<<
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets
+ */
+ __pyx_t_1 = __pyx_v_memview->view.shape;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "View.MemoryView":1063
+ *
+ * shape = memview.view.shape
+ * strides = memview.view.strides # <<<<<<<<<<<<<<
+ * suboffsets = memview.view.suboffsets
+ *
+ */
+ __pyx_t_1 = __pyx_v_memview->view.strides;
+ __pyx_v_strides = __pyx_t_1;
+
+ /* "View.MemoryView":1064
+ * shape = memview.view.shape
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ */
+ __pyx_t_1 = __pyx_v_memview->view.suboffsets;
+ __pyx_v_suboffsets = __pyx_t_1;
+
+ /* "View.MemoryView":1066
+ * suboffsets = memview.view.suboffsets
+ *
+ * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
+ * dst.data = <char *> memview.view.buf
+ *
+ */
+ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
+
+ /* "View.MemoryView":1067
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim in range(memview.view.ndim):
+ */
+ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
+
+ /* "View.MemoryView":1069
+ * dst.data = <char *> memview.view.buf
+ *
+ * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ */
+ __pyx_t_2 = __pyx_v_memview->view.ndim;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_dim = __pyx_t_4;
+
+ /* "View.MemoryView":1070
+ *
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
+ * dst.strides[dim] = strides[dim]
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ */
+ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":1071
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
+ */
+ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":1072
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ */
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_5 = -1L;
+ }
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
+ }
+
+ /* "View.MemoryView":1058
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1075
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
+ __Pyx_memviewslice __pyx_v_memviewslice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("memoryview_copy", 0);
+
+ /* "View.MemoryView":1078
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
+ * return memoryview_copy_from_slice(memview, &memviewslice)
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
+
+ /* "View.MemoryView":1079
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice)
+ * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1079, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1075
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1082
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
+ PyObject *(*__pyx_v_to_object_func)(char *);
+ int (*__pyx_v_to_dtype_func)(char *, PyObject *);
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *(*__pyx_t_3)(char *);
+ int (*__pyx_t_4)(char *, PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
+
+ /* "View.MemoryView":1089
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1090
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ */
+ __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
+ __pyx_v_to_object_func = __pyx_t_3;
+
+ /* "View.MemoryView":1091
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
+ * else:
+ * to_object_func = NULL
+ */
+ __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
+ __pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1089
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1093
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ * to_object_func = NULL # <<<<<<<<<<<<<<
+ * to_dtype_func = NULL
+ *
+ */
+ /*else*/ {
+ __pyx_v_to_object_func = NULL;
+
+ /* "View.MemoryView":1094
+ * else:
+ * to_object_func = NULL
+ * to_dtype_func = NULL # <<<<<<<<<<<<<<
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ */
+ __pyx_v_to_dtype_func = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1096
+ * to_dtype_func = NULL
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ __Pyx_XDECREF(__pyx_r);
+
+ /* "View.MemoryView":1098
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __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(4, 1096, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1082
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1104
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1105
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1106
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0:
+ * return -arg # <<<<<<<<<<<<<<
+ * else:
+ * return arg
+ */
+ __pyx_r = (-__pyx_v_arg);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1105
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":1108
+ * return -arg
+ * else:
+ * return arg # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_get_best_slice_order')
+ */
+ /*else*/ {
+ __pyx_r = __pyx_v_arg;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1104
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1111
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_c_stride;
+ Py_ssize_t __pyx_v_f_stride;
+ char __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "View.MemoryView":1116
+ * """
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t f_stride = 0
+ *
+ */
+ __pyx_v_c_stride = 0;
+
+ /* "View.MemoryView":1117
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0
+ * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_f_stride = 0;
+
+ /* "View.MemoryView":1119
+ * cdef Py_ssize_t f_stride = 0
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1120
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1121
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1122
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ goto __pyx_L4_break;
+
+ /* "View.MemoryView":1120
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
+ }
+ }
+ __pyx_L4_break:;
+
+ /* "View.MemoryView":1124
+ * break
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_1;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1125
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1126
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1127
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ */
+ goto __pyx_L7_break;
+
+ /* "View.MemoryView":1125
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
+ }
+ }
+ __pyx_L7_break:;
+
+ /* "View.MemoryView":1129
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
+ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1130
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ * return 'C' # <<<<<<<<<<<<<<
+ * else:
+ * return 'F'
+ */
+ __pyx_r = 'C';
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1129
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":1132
+ * return 'C'
+ * else:
+ * return 'F' # <<<<<<<<<<<<<<
+ *
+ * @cython.cdivision(True)
+ */
+ /*else*/ {
+ __pyx_r = 'F';
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1111
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1135
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+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) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
+ Py_ssize_t __pyx_v_dst_extent;
+ Py_ssize_t __pyx_v_src_stride;
+ Py_ssize_t __pyx_v_dst_stride;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+
+ /* "View.MemoryView":1142
+ *
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ */
+ __pyx_v_src_extent = (__pyx_v_src_shape[0]);
+
+ /* "View.MemoryView":1143
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ */
+ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
+
+ /* "View.MemoryView":1144
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ */
+ __pyx_v_src_stride = (__pyx_v_src_strides[0]);
+
+ /* "View.MemoryView":1145
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
+
+ /* "View.MemoryView":1147
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1148
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "View.MemoryView":1149
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ */
+ __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
+ if (__pyx_t_2) {
+ __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
+ }
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1148
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1150
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
+
+ /* "View.MemoryView":1148
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ goto __pyx_L4;
+ }
+
+ /* "View.MemoryView":1152
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ */
+ /*else*/ {
+ __pyx_t_4 = __pyx_v_dst_extent;
+ __pyx_t_5 = __pyx_t_4;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1153
+ * else:
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
+ * src_data += src_stride
+ * dst_data += dst_stride
+ */
+ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
+
+ /* "View.MemoryView":1154
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ * else:
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1155
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":1147
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1157
+ * dst_data += dst_stride
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * _copy_strided_to_strided(src_data, src_strides + 1,
+ * dst_data, dst_strides + 1,
+ */
+ /*else*/ {
+ __pyx_t_4 = __pyx_v_dst_extent;
+ __pyx_t_5 = __pyx_t_4;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1158
+ * else:
+ * for i in range(dst_extent):
+ * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
+ * dst_data, dst_strides + 1,
+ * src_shape + 1, dst_shape + 1,
+ */
+ _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);
+
+ /* "View.MemoryView":1162
+ * src_shape + 1, dst_shape + 1,
+ * ndim - 1, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ *
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1163
+ * ndim - 1, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1135
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1165
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+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) {
+
+ /* "View.MemoryView":1168
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
+ * src.shape, dst.shape, ndim, itemsize)
+ *
+ */
+ _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);
+
+ /* "View.MemoryView":1165
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1172
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_size;
+ Py_ssize_t __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "View.MemoryView":1175
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_size = __pyx_t_1;
+
+ /* "View.MemoryView":1177
+ * cdef Py_ssize_t size = src.memview.view.itemsize
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * size *= src.shape[i]
+ *
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1178
+ *
+ * for i in range(ndim):
+ * size *= src.shape[i] # <<<<<<<<<<<<<<
+ *
+ * return size
+ */
+ __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":1180
+ * size *= src.shape[i]
+ *
+ * return size # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ */
+ __pyx_r = __pyx_v_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1172
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1183
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+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) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "View.MemoryView":1192
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
+ __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1193
+ *
+ * if order == 'F':
+ * for idx in range(ndim): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_idx = __pyx_t_4;
+
+ /* "View.MemoryView":1194
+ * if order == 'F':
+ * for idx in range(ndim):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ * else:
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1195
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+
+ /* "View.MemoryView":1192
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1197
+ * stride = stride * shape[idx]
+ * else:
+ * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "View.MemoryView":1198
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ *
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1199
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ *
+ * return stride
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1201
+ * stride = stride * shape[idx]
+ *
+ * return stride # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ */
+ __pyx_r = __pyx_v_stride;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1183
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1204
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+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) {
+ int __pyx_v_i;
+ void *__pyx_v_result;
+ size_t __pyx_v_itemsize;
+ size_t __pyx_v_size;
+ void *__pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+
+ /* "View.MemoryView":1215
+ * cdef void *result
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1216
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
+ *
+ * result = malloc(size)
+ */
+ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
+
+ /* "View.MemoryView":1218
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ * result = malloc(size) # <<<<<<<<<<<<<<
+ * if not result:
+ * _err(MemoryError, NULL)
+ */
+ __pyx_v_result = malloc(__pyx_v_size);
+
+ /* "View.MemoryView":1219
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1220
+ * result = malloc(size)
+ * if not result:
+ * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(4, 1220, __pyx_L1_error)
+
+ /* "View.MemoryView":1219
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
+ }
+
+ /* "View.MemoryView":1223
+ *
+ *
+ * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ */
+ __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
+
+ /* "View.MemoryView":1224
+ *
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ */
+ __pyx_t_4 = __pyx_v_src->memview;
+ __pyx_v_tmpslice->memview = __pyx_t_4;
+
+ /* "View.MemoryView":1225
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ __pyx_t_5 = __pyx_t_3;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1226
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
+ * tmpslice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1227
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
+ */
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
+ }
+
+ /* "View.MemoryView":1229
+ * tmpslice.suboffsets[i] = -1
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
+ * ndim, order)
+ *
+ */
+ (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));
+
+ /* "View.MemoryView":1233
+ *
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ __pyx_t_5 = __pyx_t_3;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1234
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1235
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
+ *
+ * if slice_is_contig(src[0], order, ndim):
+ */
+ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1234
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":1237
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1238
+ *
+ * if slice_is_contig(src[0], order, ndim):
+ * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ */
+ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
+
+ /* "View.MemoryView":1237
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
+ goto __pyx_L9;
+ }
+
+ /* "View.MemoryView":1240
+ * memcpy(result, src.data, size)
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ /*else*/ {
+ copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1242
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1204
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = NULL;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1247
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_extents", 0);
+
+ /* "View.MemoryView":1250
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ * (i, extent1, extent2)) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1249
+ * cdef int _err_extents(int i, Py_ssize_t extent1,
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
+ * (i, extent1, extent2))
+ *
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(4, 1249, __pyx_L1_error)
+
+ /* "View.MemoryView":1247
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1253
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_dim", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1254
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
+ * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err')
+ */
+ __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(4, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1254, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1254, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1254, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(4, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(4, 1254, __pyx_L1_error)
+
+ /* "View.MemoryView":1253
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1257
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1258
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":1259
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL:
+ * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
+ * else:
+ * raise error
+ */
+ __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(4, 1259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1259, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 1259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 1259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(4, 1259, __pyx_L1_error)
+
+ /* "View.MemoryView":1258
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":1261
+ * raise error(msg.decode('ascii'))
+ * else:
+ * raise error # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ */
+ /*else*/ {
+ __Pyx_Raise(__pyx_v_error, 0, 0, 0);
+ __PYX_ERR(4, 1261, __pyx_L1_error)
+ }
+
+ /* "View.MemoryView":1257
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1264
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+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) {
+ void *__pyx_v_tmpdata;
+ size_t __pyx_v_itemsize;
+ int __pyx_v_i;
+ char __pyx_v_order;
+ int __pyx_v_broadcasting;
+ int __pyx_v_direct_copy;
+ __Pyx_memviewslice __pyx_v_tmp;
+ int __pyx_v_ndim;
+ int __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ void *__pyx_t_7;
+ int __pyx_t_8;
+
+ /* "View.MemoryView":1272
+ * Check for overlapping memory and verify the shapes.
+ * """
+ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ */
+ __pyx_v_tmpdata = NULL;
+
+ /* "View.MemoryView":1273
+ * """
+ * cdef void *tmpdata = NULL
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ */
+ __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1275
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
+
+ /* "View.MemoryView":1276
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False # <<<<<<<<<<<<<<
+ * cdef bint direct_copy = False
+ * cdef __Pyx_memviewslice tmp
+ */
+ __pyx_v_broadcasting = 0;
+
+ /* "View.MemoryView":1277
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice tmp
+ *
+ */
+ __pyx_v_direct_copy = 0;
+
+ /* "View.MemoryView":1280
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
+ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1281
+ *
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1280
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1282
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1283
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
+
+ /* "View.MemoryView":1282
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ */
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1285
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_3 = __pyx_v_dst_ndim;
+ __pyx_t_4 = __pyx_v_src_ndim;
+ if (((__pyx_t_3 > __pyx_t_4) != 0)) {
+ __pyx_t_5 = __pyx_t_3;
+ } else {
+ __pyx_t_5 = __pyx_t_4;
+ }
+ __pyx_v_ndim = __pyx_t_5;
+
+ /* "View.MemoryView":1287
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ */
+ __pyx_t_5 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_5;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1288
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1289
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1290
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ * broadcasting = True # <<<<<<<<<<<<<<
+ * src.strides[i] = 0
+ * else:
+ */
+ __pyx_v_broadcasting = 1;
+
+ /* "View.MemoryView":1291
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ * src.strides[i] = 0 # <<<<<<<<<<<<<<
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ */
+ (__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1289
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
+ goto __pyx_L7;
+ }
+
+ /* "View.MemoryView":1293
+ * src.strides[i] = 0
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
+ *
+ * if src.suboffsets[i] >= 0:
+ */
+ /*else*/ {
+ __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(4, 1293, __pyx_L1_error)
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":1288
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
+ }
+
+ /* "View.MemoryView":1295
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1296
+ *
+ * if src.suboffsets[i] >= 0:
+ * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ */
+ __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(4, 1296, __pyx_L1_error)
+
+ /* "View.MemoryView":1295
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":1298
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
+ *
+ * if not slice_is_contig(src, order, ndim):
+ */
+ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1300
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1301
+ *
+ * if not slice_is_contig(src, order, ndim):
+ * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
+
+ /* "View.MemoryView":1300
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":1303
+ * order = get_best_order(&dst, ndim)
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
+ * src = tmp
+ *
+ */
+ __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(4, 1303, __pyx_L1_error)
+ __pyx_v_tmpdata = __pyx_t_7;
+
+ /* "View.MemoryView":1304
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ * src = tmp # <<<<<<<<<<<<<<
+ *
+ * if not broadcasting:
+ */
+ __pyx_v_src = __pyx_v_tmp;
+
+ /* "View.MemoryView":1298
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
+ *
+ * if not slice_is_contig(src, order, ndim):
+ */
+ }
+
+ /* "View.MemoryView":1306
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1309
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim):
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1310
+ *
+ * if slice_is_contig(src, 'C', ndim):
+ * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
+ * elif slice_is_contig(src, 'F', ndim):
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
+
+ /* "View.MemoryView":1309
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim):
+ */
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":1311
+ * if slice_is_contig(src, 'C', ndim):
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1312
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim):
+ * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
+ *
+ * if direct_copy:
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1311
+ * if slice_is_contig(src, 'C', ndim):
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ */
+ }
+ __pyx_L12:;
+
+ /* "View.MemoryView":1314
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_2 = (__pyx_v_direct_copy != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1316
+ * if direct_copy:
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1317
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ */
+ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
+
+ /* "View.MemoryView":1318
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ * free(tmpdata)
+ * return 0
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1319
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1320
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * if order == 'F' == get_best_order(&dst, ndim):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1314
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ }
+
+ /* "View.MemoryView":1306
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ }
+
+ /* "View.MemoryView":1322
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = (__pyx_v_order == 'F');
+ if (__pyx_t_2) {
+ __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
+ }
+ __pyx_t_8 = (__pyx_t_2 != 0);
+ if (__pyx_t_8) {
+
+ /* "View.MemoryView":1325
+ *
+ *
+ * transpose_memslice(&src) # <<<<<<<<<<<<<<
+ * transpose_memslice(&dst)
+ *
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(4, 1325, __pyx_L1_error)
+
+ /* "View.MemoryView":1326
+ *
+ * transpose_memslice(&src)
+ * transpose_memslice(&dst) # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(4, 1326, __pyx_L1_error)
+
+ /* "View.MemoryView":1322
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ }
+
+ /* "View.MemoryView":1328
+ * transpose_memslice(&dst)
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1329
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ */
+ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1330
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ * free(tmpdata)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1332
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1333
+ *
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1264
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1336
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
+ int __pyx_v_i;
+ int __pyx_v_offset;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1340
+ * int ndim_other) nogil:
+ * cdef int i
+ * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
+
+ /* "View.MemoryView":1342
+ * cdef int offset = ndim_other - ndim
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1343
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
+ */
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1344
+ * for i in range(ndim - 1, -1, -1):
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
+ *
+ */
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1345
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
+ *
+ * for i in range(offset):
+ */
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
+ }
+
+ /* "View.MemoryView":1347
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
+ *
+ * for i in range(offset): # <<<<<<<<<<<<<<
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ */
+ __pyx_t_1 = __pyx_v_offset;
+ __pyx_t_2 = __pyx_t_1;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1348
+ *
+ * for i in range(offset):
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
+ */
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
+
+ /* "View.MemoryView":1349
+ * for i in range(offset):
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
+
+ /* "View.MemoryView":1350
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
+ }
+
+ /* "View.MemoryView":1336
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1358
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+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) {
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1362
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
+ __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1363
+ *
+ * if dtype_is_object:
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
+ * dst.strides, ndim, inc)
+ *
+ */
+ __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);
+
+ /* "View.MemoryView":1362
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
+ }
+
+ /* "View.MemoryView":1358
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1367
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+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) {
+ __Pyx_RefNannyDeclarations
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
+
+ /* "View.MemoryView":1370
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
+
+ /* "View.MemoryView":1367
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+}
+
+/* "View.MemoryView":1373
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+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) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
+
+ /* "View.MemoryView":1377
+ * cdef Py_ssize_t i
+ *
+ * for i in range(shape[0]): # <<<<<<<<<<<<<<
+ * if ndim == 1:
+ * if inc:
+ */
+ __pyx_t_1 = (__pyx_v_shape[0]);
+ __pyx_t_2 = __pyx_t_1;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1378
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
+ __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":1379
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
+ __pyx_t_4 = (__pyx_v_inc != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":1380
+ * if ndim == 1:
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * Py_DECREF((<PyObject **> data)[0])
+ */
+ Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1379
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":1382
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ */
+ /*else*/ {
+ Py_DECREF((((PyObject **)__pyx_v_data)[0]));
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":1378
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
+ goto __pyx_L5;
+ }
+
+ /* "View.MemoryView":1384
+ * Py_DECREF((<PyObject **> data)[0])
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, inc)
+ *
+ */
+ /*else*/ {
+
+ /* "View.MemoryView":1385
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":1387
+ * ndim - 1, inc)
+ *
+ * data += strides[0] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
+ }
+
+ /* "View.MemoryView":1373
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1393
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+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) {
+
+ /* "View.MemoryView":1396
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1397
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False)
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True)
+ */
+ __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);
+
+ /* "View.MemoryView":1399
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1393
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1403
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+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) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_extent;
+ int __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+
+ /* "View.MemoryView":1407
+ * size_t itemsize, void *item) nogil:
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ */
+ __pyx_v_stride = (__pyx_v_strides[0]);
+
+ /* "View.MemoryView":1408
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0]
+ * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_extent = (__pyx_v_shape[0]);
+
+ /* "View.MemoryView":1410
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1411
+ *
+ * if ndim == 1:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * memcpy(data, item, itemsize)
+ * data += stride
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1412
+ * if ndim == 1:
+ * for i in range(extent):
+ * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
+ * data += stride
+ * else:
+ */
+ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
+
+ /* "View.MemoryView":1413
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ * data += stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(extent):
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+
+ /* "View.MemoryView":1410
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1415
+ * data += stride
+ * else:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ */
+ /*else*/ {
+ __pyx_t_2 = __pyx_v_extent;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1416
+ * else:
+ * for i in range(extent):
+ * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, itemsize, item)
+ * data += stride
+ */
+ __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);
+
+ /* "View.MemoryView":1418
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ * data += stride # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1403
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v___pyx_type = 0;
+ long __pyx_v___pyx_checksum;
+ PyObject *__pyx_v___pyx_state = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(4, 1, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(4, 1, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(4, 1, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v___pyx_type = values[0];
+ __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(4, 1, __pyx_L3_error)
+ __pyx_v___pyx_state = values[2];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(4, 1, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_v___pyx_PickleError = NULL;
+ PyObject *__pyx_v___pyx_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
+
+ /* "(tree fragment)":2
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
+ * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ */
+ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
+ if (__pyx_t_1) {
+
+ /* "(tree fragment)":3
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type)
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_PickleError);
+ __Pyx_GIVEREF(__pyx_n_s_PickleError);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
+ __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_v___pyx_PickleError = __pyx_t_2;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "(tree fragment)":4
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ */
+ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_INCREF(__pyx_v___pyx_PickleError);
+ __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(4, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":2
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
+ * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ */
+ }
+
+ /* "(tree fragment)":5
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
+ * if __pyx_state is not None:
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(4, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(4, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_INCREF(__pyx_v___pyx_type);
+ __Pyx_GIVEREF(__pyx_v___pyx_type);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(4, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v___pyx_result = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "(tree fragment)":6
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
+ __pyx_t_7 = (__pyx_t_1 != 0);
+ if (__pyx_t_7) {
+
+ /* "(tree fragment)":7
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ */
+ 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(4, 7, __pyx_L1_error)
+ __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(4, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "(tree fragment)":6
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ }
+
+ /* "(tree fragment)":8
+ * if __pyx_state is not None:
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result # <<<<<<<<<<<<<<
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v___pyx_result);
+ __pyx_r = __pyx_v___pyx_result;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v___pyx_PickleError);
+ __Pyx_XDECREF(__pyx_v___pyx_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":9
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ */
+
+static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
+
+ /* "(tree fragment)":10
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[1])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(4, 10, __pyx_L1_error)
+ }
+ __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(4, 10, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->name);
+ __Pyx_DECREF(__pyx_v___pyx_result->name);
+ __pyx_v___pyx_result->name = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":11
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[1])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(4, 11, __pyx_L1_error)
+ }
+ __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(4, 11, __pyx_L1_error)
+ __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
+ if (__pyx_t_4) {
+ } else {
+ __pyx_t_2 = __pyx_t_4;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(4, 11, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_4 != 0);
+ __pyx_t_2 = __pyx_t_5;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "(tree fragment)":12
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(4, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(4, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(4, 12, __pyx_L1_error)
+ }
+ __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(4, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_8) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(4, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":11
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[1])
+ */
+ }
+
+ /* "(tree fragment)":9
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
+
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_array_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
+ p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
+ return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
+}
+
+static void __pyx_tp_dealloc_array(PyObject *o) {
+ struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ 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))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_array___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->mode);
+ Py_CLEAR(p->_format);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_array___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
+ PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
+ if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ v = __pyx_array___getattr__(o, n);
+ }
+ return v;
+}
+
+static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_array[] = {
+ {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_array[] = {
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_array = {
+ __pyx_array___len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_array, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_array = {
+ __pyx_array___len__, /*mp_length*/
+ __pyx_array___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_array = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_array_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_array = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaGraph.ctools._ctools.array", /*tp_name*/
+ sizeof(struct __pyx_array_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_array, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ __pyx_tp_getattro_array, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_array, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_array, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_array, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_MemviewEnum_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_MemviewEnum_obj *)o);
+ p->name = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_Enum(PyObject *o) {
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->name);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ if (p->name) {
+ e = (*v)(p->name, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_Enum(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ tmp = ((PyObject*)p->name);
+ p->name = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_Enum[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_MemviewEnum = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaGraph.ctools._ctools.Enum", /*tp_name*/
+ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_Enum, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ __pyx_MemviewEnum___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_Enum, /*tp_traverse*/
+ __pyx_tp_clear_Enum, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_Enum, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_MemviewEnum___init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_Enum, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
+
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryview_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryview_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_memoryview;
+ p->obj = Py_None; Py_INCREF(Py_None);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ p->view.obj = NULL;
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
+ return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
+}
+
+static void __pyx_tp_dealloc_memoryview(PyObject *o) {
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryview___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->obj);
+ Py_CLEAR(p->_size);
+ Py_CLEAR(p->_array_interface);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ if (p->obj) {
+ e = (*v)(p->obj, a); if (e) return e;
+ }
+ if (p->_size) {
+ e = (*v)(p->_size, a); if (e) return e;
+ }
+ if (p->_array_interface) {
+ e = (*v)(p->_array_interface, a); if (e) return e;
+ }
+ if (p->view.obj) {
+ e = (*v)(p->view.obj, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_memoryview(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ tmp = ((PyObject*)p->obj);
+ p->obj = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_size);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_array_interface);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ Py_CLEAR(p->view.obj);
+ return 0;
+}
+static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_memoryview___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_memoryview[] = {
+ {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
+ {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
+ {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
+ {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_memoryview[] = {
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
+ __pyx_memoryview___len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_memoryview, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
+ __pyx_memoryview___len__, /*mp_length*/
+ __pyx_memoryview___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_memoryview_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_memoryview = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaGraph.ctools._ctools.memoryview", /*tp_name*/
+ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ __pyx_memoryview___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ __pyx_memoryview___str__, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_memoryview, /*tp_traverse*/
+ __pyx_tp_clear_memoryview, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_memoryview, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_memoryview, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_memoryview, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
+
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryviewslice_obj *p;
+ PyObject *o = __pyx_tp_new_memoryview(t, a, k);
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryviewslice_obj *)o);
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ p->from_slice.memview = NULL;
+ return o;
+}
+
+static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryviewslice___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->from_object);
+ PyObject_GC_Track(o);
+ __pyx_tp_dealloc_memoryview(o);
+}
+
+static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
+ if (p->from_object) {
+ e = (*v)(p->from_object, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ __pyx_tp_clear_memoryview(o);
+ tmp = ((PyObject*)p->from_object);
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
+ return 0;
+}
+
+static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods__memoryviewslice[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_memoryviewslice = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaGraph.ctools._ctools._memoryviewslice", /*tp_name*/
+ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___repr__, /*tp_repr*/
+ #else
+ 0, /*tp_repr*/
+ #endif
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___str__, /*tp_str*/
+ #else
+ 0, /*tp_str*/
+ #endif
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Internal class for passing memoryview slices to Python", /*tp_doc*/
+ __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
+ __pyx_tp_clear__memoryviewslice, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods__memoryviewslice, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets__memoryviewslice, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new__memoryviewslice, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec__ctools(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+ {Py_mod_create, (void*)__pyx_pymod_create},
+ {Py_mod_exec, (void*)__pyx_pymod_exec__ctools},
+ {0, NULL}
+};
+#endif
+
+static struct PyModuleDef __pyx_moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "_ctools",
+ 0, /* m_doc */
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ 0, /* m_size */
+ #else
+ -1, /* m_size */
+ #endif
+ __pyx_methods /* m_methods */,
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_moduledef_slots, /* m_slots */
+ #else
+ NULL, /* m_reload */
+ #endif
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_C, __pyx_k_C, sizeof(__pyx_k_C), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
+ {&__pyx_n_s_NUMPY_TO_TYPE_DESC, __pyx_k_NUMPY_TO_TYPE_DESC, sizeof(__pyx_k_NUMPY_TO_TYPE_DESC), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
+ {&__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},
+ {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
+ {&__pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools, __pyx_k_PyMca5_PyMcaGraph_ctools__ctools, sizeof(__pyx_k_PyMca5_PyMcaGraph_ctools__ctools), 0, 0, 1, 0},
+ {&__pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2, __pyx_k_PyMca5_PyMcaGraph_ctools__ctools_2, sizeof(__pyx_k_PyMca5_PyMcaGraph_ctools__ctools_2), 0, 0, 1, 1},
+ {&__pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_3, __pyx_k_PyMca5_PyMcaGraph_ctools__ctools_3, sizeof(__pyx_k_PyMca5_PyMcaGraph_ctools__ctools_3), 0, 0, 1, 0},
+ {&__pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_4, __pyx_k_PyMca5_PyMcaGraph_ctools__ctools_4, sizeof(__pyx_k_PyMca5_PyMcaGraph_ctools__ctools_4), 0, 0, 1, 0},
+ {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
+ {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
+ {&__pyx_n_s_asarray, __pyx_k_asarray, sizeof(__pyx_k_asarray), 0, 0, 1, 1},
+ {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
+ {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
+ {&__pyx_n_s_border, __pyx_k_border, sizeof(__pyx_k_border), 0, 0, 1, 1},
+ {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
+ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
+ {&__pyx_n_s_c_colormap, __pyx_k_c_colormap, sizeof(__pyx_k_c_colormap), 0, 0, 1, 1},
+ {&__pyx_n_s_c_colormapLength, __pyx_k_c_colormapLength, sizeof(__pyx_k_c_colormapLength), 0, 0, 1, 1},
+ {&__pyx_n_s_c_data, __pyx_k_c_data, sizeof(__pyx_k_c_data), 0, 0, 1, 1},
+ {&__pyx_n_s_c_dataItemSize, __pyx_k_c_dataItemSize, sizeof(__pyx_k_c_dataItemSize), 0, 0, 1, 1},
+ {&__pyx_n_s_c_dataMax, __pyx_k_c_dataMax, sizeof(__pyx_k_c_dataMax), 0, 0, 1, 1},
+ {&__pyx_n_s_c_dataMin, __pyx_k_c_dataMin, sizeof(__pyx_k_c_dataMin), 0, 0, 1, 1},
+ {&__pyx_n_s_c_dataMinPos, __pyx_k_c_dataMinPos, sizeof(__pyx_k_c_dataMinPos), 0, 0, 1, 1},
+ {&__pyx_n_s_c_dataPtr, __pyx_k_c_dataPtr, sizeof(__pyx_k_c_dataPtr), 0, 0, 1, 1},
+ {&__pyx_n_s_c_dataSize, __pyx_k_c_dataSize, sizeof(__pyx_k_c_dataSize), 0, 0, 1, 1},
+ {&__pyx_n_s_c_end, __pyx_k_c_end, sizeof(__pyx_k_c_end), 0, 0, 1, 1},
+ {&__pyx_n_s_c_nanColor, __pyx_k_c_nanColor, sizeof(__pyx_k_c_nanColor), 0, 0, 1, 1},
+ {&__pyx_n_s_c_nanColorPtr, __pyx_k_c_nanColorPtr, sizeof(__pyx_k_c_nanColorPtr), 0, 0, 1, 1},
+ {&__pyx_n_s_c_pixmap, __pyx_k_c_pixmap, sizeof(__pyx_k_c_pixmap), 0, 0, 1, 1},
+ {&__pyx_n_s_c_points, __pyx_k_c_points, sizeof(__pyx_k_c_points), 0, 0, 1, 1},
+ {&__pyx_n_s_c_start, __pyx_k_c_start, sizeof(__pyx_k_c_start), 0, 0, 1, 1},
+ {&__pyx_n_s_c_startExtra, __pyx_k_c_startExtra, sizeof(__pyx_k_c_startExtra), 0, 0, 1, 1},
+ {&__pyx_n_s_c_type, __pyx_k_c_type, sizeof(__pyx_k_c_type), 0, 0, 1, 1},
+ {&__pyx_n_s_c_vertices, __pyx_k_c_vertices, sizeof(__pyx_k_c_vertices), 0, 0, 1, 1},
+ {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
+ {&__pyx_n_s_colormap, __pyx_k_colormap, sizeof(__pyx_k_colormap), 0, 0, 1, 1},
+ {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_data, __pyx_k_data, sizeof(__pyx_k_data), 0, 0, 1, 1},
+ {&__pyx_n_s_dataToRGBAColormap, __pyx_k_dataToRGBAColormap, sizeof(__pyx_k_dataToRGBAColormap), 0, 0, 1, 1},
+ {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
+ {&__pyx_n_s_empty, __pyx_k_empty, sizeof(__pyx_k_empty), 0, 0, 1, 1},
+ {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
+ {&__pyx_n_s_endValue, __pyx_k_endValue, sizeof(__pyx_k_endValue), 0, 0, 1, 1},
+ {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
+ {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
+ {&__pyx_n_s_f2, __pyx_k_f2, sizeof(__pyx_k_f2), 0, 0, 1, 1},
+ {&__pyx_n_s_f4, __pyx_k_f4, sizeof(__pyx_k_f4), 0, 0, 1, 1},
+ {&__pyx_n_s_f8, __pyx_k_f8, sizeof(__pyx_k_f8), 0, 0, 1, 1},
+ {&__pyx_n_s_fastLog10, __pyx_k_fastLog10, sizeof(__pyx_k_fastLog10), 0, 0, 1, 1},
+ {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
+ {&__pyx_n_s_float32, __pyx_k_float32, sizeof(__pyx_k_float32), 0, 0, 1, 1},
+ {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
+ {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
+ {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1},
+ {&__pyx_n_s_i2, __pyx_k_i2, sizeof(__pyx_k_i2), 0, 0, 1, 1},
+ {&__pyx_n_s_i4, __pyx_k_i4, sizeof(__pyx_k_i4), 0, 0, 1, 1},
+ {&__pyx_n_s_i8, __pyx_k_i8, sizeof(__pyx_k_i8), 0, 0, 1, 1},
+ {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_int16, __pyx_k_int16, sizeof(__pyx_k_int16), 0, 0, 1, 1},
+ {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
+ {&__pyx_n_s_int8, __pyx_k_int8, sizeof(__pyx_k_int8), 0, 0, 1, 1},
+ {&__pyx_n_s_isLog10Mapping, __pyx_k_isLog10Mapping, sizeof(__pyx_k_isLog10Mapping), 0, 0, 1, 1},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_mask, __pyx_k_mask, sizeof(__pyx_k_mask), 0, 0, 1, 1},
+ {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
+ {&__pyx_n_s_minMax, __pyx_k_minMax, sizeof(__pyx_k_minMax), 0, 0, 1, 1},
+ {&__pyx_n_s_minPositive, __pyx_k_minPositive, sizeof(__pyx_k_minPositive), 0, 0, 1, 1},
+ {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
+ {&__pyx_n_s_n_points, __pyx_k_n_points, sizeof(__pyx_k_n_points), 0, 0, 1, 1},
+ {&__pyx_n_s_n_vertices, __pyx_k_n_vertices, sizeof(__pyx_k_n_vertices), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
+ {&__pyx_n_s_nanColor, __pyx_k_nanColor, sizeof(__pyx_k_nanColor), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
+ {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
+ {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
+ {&__pyx_n_s_order, __pyx_k_order, sizeof(__pyx_k_order), 0, 0, 1, 1},
+ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
+ {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
+ {&__pyx_n_s_pixmap, __pyx_k_pixmap, sizeof(__pyx_k_pixmap), 0, 0, 1, 1},
+ {&__pyx_n_s_pnpoly, __pyx_k_pnpoly, sizeof(__pyx_k_pnpoly), 0, 0, 1, 1},
+ {&__pyx_n_s_pnpolyFloat, __pyx_k_pnpolyFloat, sizeof(__pyx_k_pnpolyFloat), 0, 0, 1, 1},
+ {&__pyx_n_s_pnpolyInt, __pyx_k_pnpolyInt, sizeof(__pyx_k_pnpolyInt), 0, 0, 1, 1},
+ {&__pyx_n_s_pnpolyd, __pyx_k_pnpolyd, sizeof(__pyx_k_pnpolyd), 0, 0, 1, 1},
+ {&__pyx_n_s_points, __pyx_k_points, sizeof(__pyx_k_points), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
+ {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
+ {&__pyx_n_s_startValue, __pyx_k_startValue, sizeof(__pyx_k_startValue), 0, 0, 1, 1},
+ {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
+ {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
+ {&__pyx_n_s_str, __pyx_k_str, sizeof(__pyx_k_str), 0, 0, 1, 1},
+ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
+ {&__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},
+ {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
+ {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
+ {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__pyx_n_s_u1, __pyx_k_u1, sizeof(__pyx_k_u1), 0, 0, 1, 1},
+ {&__pyx_n_s_u2, __pyx_k_u2, sizeof(__pyx_k_u2), 0, 0, 1, 1},
+ {&__pyx_n_s_u4, __pyx_k_u4, sizeof(__pyx_k_u4), 0, 0, 1, 1},
+ {&__pyx_n_s_u8, __pyx_k_u8, sizeof(__pyx_k_u8), 0, 0, 1, 1},
+ {&__pyx_n_s_uint16, __pyx_k_uint16, sizeof(__pyx_k_uint16), 0, 0, 1, 1},
+ {&__pyx_n_s_uint32, __pyx_k_uint32, sizeof(__pyx_k_uint32), 0, 0, 1, 1},
+ {&__pyx_n_s_uint8, __pyx_k_uint8, sizeof(__pyx_k_uint8), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
+ {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
+ {&__pyx_n_s_vertices, __pyx_k_vertices, sizeof(__pyx_k_vertices), 0, 0, 1, 1},
+ {&__pyx_kp_s_zero_size_array, __pyx_k_zero_size_array, sizeof(__pyx_k_zero_size_array), 0, 0, 1, 0},
+ {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 78, __pyx_L1_error)
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 242, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 810, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1000, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(4, 147, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(4, 150, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(4, 2, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(4, 399, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(4, 608, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(4, 827, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":70
+ * """
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ */
+ __pyx_slice_ = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice_)) __PYX_ERR(0, 70, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice_);
+ __Pyx_GIVEREF(__pyx_slice_);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":78
+ *
+ * if c_dataSize == 0:
+ * raise ValueError("zero-size array") # <<<<<<<<<<<<<<
+ *
+ * cdef double c_dataMin, c_dataMinPos, c_dataMax
+ */
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_zero_size_array); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 78, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":82
+ * cdef double c_dataMin, c_dataMinPos, c_dataMax
+ *
+ * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
+ *
+ * if minPositive:
+ */
+ __pyx_slice__3 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) __PYX_ERR(0, 82, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__3);
+ __Pyx_GIVEREF(__pyx_slice__3);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":83
+ * """
+ * #Convert float16 to float32
+ * if data.dtype.str[1:] == 'f2': # <<<<<<<<<<<<<<
+ * data = np.asarray(data, dtype=np.float32)
+ *
+ */
+ __pyx_slice__4 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__4)) __PYX_ERR(1, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__4);
+ __Pyx_GIVEREF(__pyx_slice__4);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":105
+ * cdef unsigned char[:, :] c_pixmap = pixmap
+ *
+ * cdef unsigned int c_type = _NUMPY_TO_TYPE_DESC[data.dtype.str[1:]] # <<<<<<<<<<<<<<
+ *
+ * cdef double c_start, c_startExtra, c_end
+ */
+ __pyx_slice__5 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__5)) __PYX_ERR(1, 105, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__5);
+ __Pyx_GIVEREF(__pyx_slice__5);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":138
+ * &c_pixmap[0, 0])
+ *
+ * pixmap.shape = data.shape + (4,) # <<<<<<<<<<<<<<
+ * return pixmap, (c_start, c_end)
+ *
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_4); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(1, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":229
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 229, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":233
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
+ *
+ * info.buf = PyArray_DATA(self)
+ */
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":263
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ */
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":810
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
+ *
+ * if ((child.byteorder == c'>' and little_endian) or
+ */
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 810, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":814
+ * if ((child.byteorder == c'>' and little_endian) or
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * # One could encode it in the format string and have Cython
+ * # complain instead, BUT: < and > in format strings also imply
+ */
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 814, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":834
+ * t = child.type_num
+ * if end - f < 5:
+ * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ */
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(3, 834, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(3, 1000, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1006
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(3, 1006, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1012
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(3, 1012, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
+
+ /* "View.MemoryView":132
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(4, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
+
+ /* "View.MemoryView":135
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(format, bytes):
+ */
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(4, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+
+ /* "View.MemoryView":138
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(4, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+
+ /* "View.MemoryView":147
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(4, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+
+ /* "View.MemoryView":175
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(4, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+
+ /* "View.MemoryView":191
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(4, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(4, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+
+ /* "View.MemoryView":413
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ */
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(4, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
+
+ /* "View.MemoryView":490
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(4, 490, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
+
+ /* "View.MemoryView":515
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(4, 515, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
+
+ /* "View.MemoryView":565
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
+ */
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(4, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
+
+ /* "View.MemoryView":572
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__28 = PyTuple_New(1); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(4, 572, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__28, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__28);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(4, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_GIVEREF(__pyx_tuple__30);
+
+ /* "View.MemoryView":677
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_slice__31 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__31)) __PYX_ERR(4, 677, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__31);
+ __Pyx_GIVEREF(__pyx_slice__31);
+
+ /* "View.MemoryView":680
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_slice__32 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__32)) __PYX_ERR(4, 680, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__32);
+ __Pyx_GIVEREF(__pyx_slice__32);
+
+ /* "View.MemoryView":691
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(4, 691, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__33);
+ __Pyx_GIVEREF(__pyx_slice__33);
+
+ /* "View.MemoryView":698
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(4, 698, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__34);
+ __Pyx_GIVEREF(__pyx_tuple__34);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(4, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__35);
+ __Pyx_GIVEREF(__pyx_tuple__35);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(4, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":55
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def minMax(np.ndarray data, bint minPositive=False): # <<<<<<<<<<<<<<
+ * """Get min, max and optionally min positive of data.
+ *
+ */
+ __pyx_tuple__37 = PyTuple_Pack(9, __pyx_n_s_data, __pyx_n_s_minPositive, __pyx_n_s_c_data, __pyx_n_s_c_dataPtr, __pyx_n_s_c_dataSize, __pyx_n_s_c_dataMin, __pyx_n_s_c_dataMinPos, __pyx_n_s_c_dataMax, __pyx_n_s_c_type); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+ __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools, __pyx_n_s_minMax, 55, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 55, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":61
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
+ * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
+ * startValue=None, endValue=None,
+ */
+ __pyx_tuple__39 = PyTuple_Pack(20, __pyx_n_s_data, __pyx_n_s_colormap, __pyx_n_s_startValue, __pyx_n_s_endValue, __pyx_n_s_isLog10Mapping, __pyx_n_s_nanColor, __pyx_n_s_c_data, __pyx_n_s_c_dataPtr, __pyx_n_s_c_dataSize, __pyx_n_s_c_dataItemSize, __pyx_n_s_c_colormap, __pyx_n_s_c_colormapLength, __pyx_n_s_c_nanColorPtr, __pyx_n_s_c_nanColor, __pyx_n_s_pixmap, __pyx_n_s_c_pixmap, __pyx_n_s_c_type, __pyx_n_s_c_start, __pyx_n_s_c_startExtra, __pyx_n_s_c_end); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__39);
+ __Pyx_GIVEREF(__pyx_tuple__39);
+ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(6, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_3, __pyx_n_s_dataToRGBAColormap, 61, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 61, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":141
+ * return pixmap, (c_start, c_end)
+ *
+ * def fastLog10(double value): # <<<<<<<<<<<<<<
+ * return _fastLog10(value)
+ */
+ __pyx_tuple__41 = PyTuple_Pack(2, __pyx_n_s_value, __pyx_n_s_value); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__41);
+ __Pyx_GIVEREF(__pyx_tuple__41);
+ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_3, __pyx_n_s_fastLog10, 141, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 141, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":54
+ *
+ * @cython.boundscheck(False)
+ * def pnpoly(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * """
+ * :param vertices: Array Nx2 with the coordenates of the polygon vertices
+ */
+ __pyx_tuple__43 = PyTuple_Pack(3, __pyx_n_s_vertices, __pyx_n_s_points, __pyx_n_s_border); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(2, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__43);
+ __Pyx_GIVEREF(__pyx_tuple__43);
+ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_4, __pyx_n_s_pnpoly, 54, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(2, 54, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":72
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyd(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+ __pyx_tuple__45 = PyTuple_Pack(8, __pyx_n_s_vertices, __pyx_n_s_points, __pyx_n_s_border, __pyx_n_s_c_vertices, __pyx_n_s_n_vertices, __pyx_n_s_c_points, __pyx_n_s_n_points, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(2, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__45);
+ __Pyx_GIVEREF(__pyx_tuple__45);
+ __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_4, __pyx_n_s_pnpolyd, 72, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(2, 72, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":90
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyFloat(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+ __pyx_tuple__47 = PyTuple_Pack(8, __pyx_n_s_vertices, __pyx_n_s_points, __pyx_n_s_border, __pyx_n_s_c_vertices, __pyx_n_s_n_vertices, __pyx_n_s_c_points, __pyx_n_s_n_points, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(2, 90, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__47);
+ __Pyx_GIVEREF(__pyx_tuple__47);
+ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaGraph_ctools__ctools_4, __pyx_n_s_pnpolyFloat, 90, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(2, 90, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":108
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyInt(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+ __pyx_tuple__49 = PyTuple_Pack(8, __pyx_n_s_vertices, __pyx_n_s_points, __pyx_n_s_border, __pyx_n_s_c_vertices, __pyx_n_s_n_vertices, __pyx_n_s_c_points, __pyx_n_s_n_points, __pyx_n_s_mask); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 108, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__49);
+ __Pyx_GIVEREF(__pyx_tuple__49);
+ __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(3, 0, 8, 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_PyMca5_PyMcaGraph_ctools__ctools_4, __pyx_n_s_pnpolyInt, 108, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(2, 108, __pyx_L1_error)
+
+ /* "View.MemoryView":285
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(4, 285, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__51);
+ __Pyx_GIVEREF(__pyx_tuple__51);
+
+ /* "View.MemoryView":286
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(4, 286, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__52);
+ __Pyx_GIVEREF(__pyx_tuple__52);
+
+ /* "View.MemoryView":287
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(4, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__53);
+ __Pyx_GIVEREF(__pyx_tuple__53);
+
+ /* "View.MemoryView":290
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(4, 290, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__54);
+ __Pyx_GIVEREF(__pyx_tuple__54);
+
+ /* "View.MemoryView":291
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(4, 291, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__55);
+ __Pyx_GIVEREF(__pyx_tuple__55);
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+ __pyx_tuple__56 = 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__56)) __PYX_ERR(4, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__56);
+ __Pyx_GIVEREF(__pyx_tuple__56);
+ __pyx_codeobj__57 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__56, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__57)) __PYX_ERR(4, 1, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_6 = PyInt_FromLong(6); if (unlikely(!__pyx_int_6)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_7 = PyInt_FromLong(7); if (unlikely(!__pyx_int_7)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(2, 1, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_modinit_global_init_code(void); /*proto*/
+static int __Pyx_modinit_variable_export_code(void); /*proto*/
+static int __Pyx_modinit_function_export_code(void); /*proto*/
+static int __Pyx_modinit_type_init_code(void); /*proto*/
+static int __Pyx_modinit_type_import_code(void); /*proto*/
+static int __Pyx_modinit_variable_import_code(void); /*proto*/
+static int __Pyx_modinit_function_import_code(void); /*proto*/
+
+static int __Pyx_modinit_global_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
+ /*--- Global init code ---*/
+ generic = Py_None; Py_INCREF(Py_None);
+ strided = Py_None; Py_INCREF(Py_None);
+ indirect = Py_None; Py_INCREF(Py_None);
+ contiguous = Py_None; Py_INCREF(Py_None);
+ indirect_contiguous = Py_None; Py_INCREF(Py_None);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_variable_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
+ /*--- Variable export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
+ /*--- Function export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
+ /*--- Type init code ---*/
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(4, 104, __pyx_L1_error)
+ __pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(4, 104, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(4, 104, __pyx_L1_error)
+ __pyx_array_type = &__pyx_type___pyx_array;
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 278, __pyx_L1_error)
+ __pyx_type___pyx_MemviewEnum.tp_print = 0;
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(4, 278, __pyx_L1_error)
+ __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
+ __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
+ __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
+ __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
+ __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
+ __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
+ __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
+ __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
+ __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(4, 329, __pyx_L1_error)
+ __pyx_type___pyx_memoryview.tp_print = 0;
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(4, 329, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(4, 329, __pyx_L1_error)
+ __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
+ __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
+ __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
+ __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
+ __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
+ __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 960, __pyx_L1_error)
+ __pyx_type___pyx_memoryviewslice.tp_print = 0;
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(4, 960, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(4, 960, __pyx_L1_error)
+ __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_type_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(5, 9, __pyx_L1_error)
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 164, __pyx_L1_error)
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 186, __pyx_L1_error)
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 190, __pyx_L1_error)
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 199, __pyx_L1_error)
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 872, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_variable_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
+ /*--- Variable import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
+ /*--- Function import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+
+#if PY_MAJOR_VERSION < 3
+#ifdef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC void
+#else
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#endif
+#else
+#ifdef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC PyObject *
+#else
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#endif
+#endif
+#ifndef CYTHON_SMALL_CODE
+#if defined(__clang__)
+ #define CYTHON_SMALL_CODE
+#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
+ #define CYTHON_SMALL_CODE __attribute__((optimize("Os")))
+#else
+ #define CYTHON_SMALL_CODE
+#endif
+#endif
+
+
+#if PY_MAJOR_VERSION < 3
+__Pyx_PyMODINIT_FUNC init_ctools(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC init_ctools(void)
+#else
+__Pyx_PyMODINIT_FUNC PyInit__ctools(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC PyInit__ctools(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+ return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
+ int result = 0;
+ if (likely(value)) {
+ result = PyDict_SetItemString(moddict, to_name, value);
+ Py_DECREF(value);
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ } else {
+ result = -1;
+ }
+ return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+ PyObject *module = NULL, *moddict, *modname;
+ if (__pyx_m)
+ return __Pyx_NewRef(__pyx_m);
+ modname = PyObject_GetAttrString(spec, "name");
+ if (unlikely(!modname)) goto bad;
+ module = PyModule_NewObject(modname);
+ Py_DECREF(modname);
+ if (unlikely(!module)) goto bad;
+ moddict = PyModule_GetDict(module);
+ if (unlikely(!moddict)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+ return module;
+bad:
+ Py_XDECREF(module);
+ return NULL;
+}
+
+
+static int __pyx_pymod_exec__ctools(PyObject *__pyx_pyinit_module)
+#endif
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ static PyThread_type_lock __pyx_t_3[8];
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+ #elif PY_MAJOR_VERSION >= 3
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
+ #endif
+ #if CYTHON_REFNANNY
+__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+}
+#endif
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__ctools(void)", 0);
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(2, 1, __pyx_L1_error)
+ #ifdef __Pyx_CyFunction_USED
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_m = __pyx_pyinit_module;
+ Py_INCREF(__pyx_m);
+ #else
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_ctools", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(2, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(2, 1, __pyx_L1_error)
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(2, 1, __pyx_L1_error);
+ /*--- Initialize various global constants etc. ---*/
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+ if (__pyx_module_is_main_PyMca5__PyMcaGraph__ctools___ctools) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(2, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "PyMca5.PyMcaGraph.ctools._ctools")) {
+ if (unlikely(PyDict_SetItemString(modules, "PyMca5.PyMcaGraph.ctools._ctools", __pyx_m) < 0)) __PYX_ERR(2, 1, __pyx_L1_error)
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ /*--- Constants init code ---*/
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ /*--- Global type/function init code ---*/
+ (void)__Pyx_modinit_global_init_code();
+ (void)__Pyx_modinit_variable_export_code();
+ (void)__Pyx_modinit_function_export_code();
+ if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
+ if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
+ (void)__Pyx_modinit_variable_import_code();
+ (void)__Pyx_modinit_function_import_code();
+ /*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ #endif
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":34
+ * from InsidePolygonWithBounds cimport PointsInsidePolygonInt as _pnpolyInt32
+ * cimport numpy
+ * import numpy # <<<<<<<<<<<<<<
+ *
+ * # From numpy_common.pxi to avoid warnings while compiling C code
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 34, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(2, 34, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":44
+ * void import_umath()
+ *
+ * if FALSE: # <<<<<<<<<<<<<<
+ * import_array()
+ * import_umath()
+ */
+ __pyx_t_2 = (0 != 0);
+ if (__pyx_t_2) {
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":45
+ *
+ * if FALSE:
+ * import_array() # <<<<<<<<<<<<<<
+ * import_umath()
+ *
+ */
+ import_array();
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":46
+ * if FALSE:
+ * import_array()
+ * import_umath() # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ import_umath();
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":44
+ * void import_umath()
+ *
+ * if FALSE: # <<<<<<<<<<<<<<
+ * import_array()
+ * import_umath()
+ */
+ }
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":31
+ * cimport cython
+ * cimport numpy as np
+ * import numpy as np # <<<<<<<<<<<<<<
+ *
+ * from MinMax cimport getMinMax
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 31, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(0, 31, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":41
+ * # 1st and 2nd bits for size: 00: 8 bits, 01: 16 bits, 10: 32 bits, 11: 64 bits.
+ * _NUMPY_TO_TYPE_DESC = {
+ * 'f8': 0b1011, # <<<<<<<<<<<<<<
+ * 'f4': 0b1010,
+ * 'i1': 0b0000,
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_f8, __pyx_int_11) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_f4, __pyx_int_10) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i1, __pyx_int_0) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u1, __pyx_int_4) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i2, __pyx_int_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u2, __pyx_int_5) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i4, __pyx_int_2) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u4, __pyx_int_6) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i8, __pyx_int_3) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u8, __pyx_int_7) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NUMPY_TO_TYPE_DESC, __pyx_t_1) < 0) __PYX_ERR(0, 40, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/MinMax.pyx":55
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def minMax(np.ndarray data, bint minPositive=False): # <<<<<<<<<<<<<<
+ * """Get min, max and optionally min positive of data.
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_1minMax, NULL, __pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_minMax, __pyx_t_1) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":31
+ * cimport cython
+ * cimport numpy as np
+ * import numpy as np # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 31, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) __PYX_ERR(1, 31, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":40
+ *
+ * # Init fastLog10 look-up table
+ * initFastLog10() # <<<<<<<<<<<<<<
+ *
+ * # Convert numpy dtype array-protocol string to bit field to pass to C function
+ */
+ initFastLog10();
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":47
+ * # 1st and 2nd bits for size: 00: 8 bits, 01: 16 bits, 10: 32 bits, 11: 64 bits.
+ * _NUMPY_TO_TYPE_DESC = {
+ * 'f8': 0b1011, # <<<<<<<<<<<<<<
+ * 'f4': 0b1010,
+ * 'i1': 0b0000,
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 47, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_f8, __pyx_int_11) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_f4, __pyx_int_10) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i1, __pyx_int_0) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u1, __pyx_int_4) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i2, __pyx_int_1) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u2, __pyx_int_5) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i4, __pyx_int_2) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u4, __pyx_int_6) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_i8, __pyx_int_3) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_u8, __pyx_int_7) < 0) __PYX_ERR(1, 47, __pyx_L1_error)
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_NUMPY_TO_TYPE_DESC, __pyx_t_1) < 0) __PYX_ERR(1, 46, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":61
+ * @cython.boundscheck(False)
+ * @cython.wraparound(False)
+ * def dataToRGBAColormap(data, # <<<<<<<<<<<<<<
+ * np.ndarray[np.uint8_t, ndim=2, mode="c"] colormap,
+ * startValue=None, endValue=None,
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_3dataToRGBAColormap, NULL, __pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_dataToRGBAColormap, __pyx_t_1) < 0) __PYX_ERR(1, 61, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/Colormap.pyx":141
+ * return pixmap, (c_start, c_end)
+ *
+ * def fastLog10(double value): # <<<<<<<<<<<<<<
+ * return _fastLog10(value)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_5fastLog10, NULL, __pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 141, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_fastLog10, __pyx_t_1) < 0) __PYX_ERR(1, 141, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":54
+ *
+ * @cython.boundscheck(False)
+ * def pnpoly(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * """
+ * :param vertices: Array Nx2 with the coordenates of the polygon vertices
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_7pnpoly, NULL, __pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pnpoly, __pyx_t_1) < 0) __PYX_ERR(2, 54, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":72
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyd(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_9_pnpolyd, NULL, __pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 72, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pnpolyd, __pyx_t_1) < 0) __PYX_ERR(2, 72, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":90
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyFloat(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_11_pnpolyFloat, NULL, __pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 90, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pnpolyFloat, __pyx_t_1) < 0) __PYX_ERR(2, 90, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":108
+ *
+ * @cython.boundscheck(False)
+ * def _pnpolyInt(vertices, points, bint border=True): # <<<<<<<<<<<<<<
+ * cdef double[:,:] c_vertices = numpy.ascontiguousarray(vertices,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_10PyMcaGraph_6ctools_7_ctools_13_pnpolyInt, NULL, __pyx_n_s_PyMca5_PyMcaGraph_ctools__ctools_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 108, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pnpolyInt, __pyx_t_1) < 0) __PYX_ERR(2, 108, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaGraph/ctools/_ctools/cython/_ctools.pyx":1
+ * #/[inserted by cython to avoid comment start]*########################################################################## # <<<<<<<<<<<<<<
+ * #
+ * # The PyMca X-Ray Fluorescence Toolkit
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":208
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(array self):
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(4, 208, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_array_type);
+
+ /* "View.MemoryView":285
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 285, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(generic);
+ __Pyx_DECREF_SET(generic, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":286
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 286, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(strided);
+ __Pyx_DECREF_SET(strided, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":287
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect);
+ __Pyx_DECREF_SET(indirect, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":290
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 290, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(contiguous);
+ __Pyx_DECREF_SET(contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":291
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 291, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect_contiguous);
+ __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":315
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":316
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_3[0] = PyThread_allocate_lock();
+ __pyx_t_3[1] = PyThread_allocate_lock();
+ __pyx_t_3[2] = PyThread_allocate_lock();
+ __pyx_t_3[3] = PyThread_allocate_lock();
+ __pyx_t_3[4] = PyThread_allocate_lock();
+ __pyx_t_3[5] = PyThread_allocate_lock();
+ __pyx_t_3[6] = PyThread_allocate_lock();
+ __pyx_t_3[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_3, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":544
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 544, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(4, 544, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryview_type);
+
+ /* "View.MemoryView":990
+ * return self.from_object
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 990, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(4, 990, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryviewslice_type);
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+ __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(4, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(4, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":9
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init PyMca5.PyMcaGraph.ctools._ctools", 0, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init PyMca5.PyMcaGraph.ctools._ctools");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ return (__pyx_m != NULL) ? 0 : -1;
+ #elif PY_MAJOR_VERSION >= 3
+ return __pyx_m;
+ #else
+ return;
+ #endif
+}
+
+/* --- Runtime support code --- */
+/* Refnanny */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+/* PyObjectGetAttrStr */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#endif
+
+/* GetBuiltinName */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+/* RaiseDoubleKeywords */
+static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+/* ParseKeywords */
+static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+/* RaiseArgTupleInvalid */
+static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+/* ArgTypeTest */
+static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ else if (exact) {
+ #if PY_MAJOR_VERSION == 2
+ if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(__Pyx_TypeCheck(obj, type))) return 1;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+ return 0;
+}
+
+/* SliceObject */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetSlice(PyObject* obj,
+ Py_ssize_t cstart, Py_ssize_t cstop,
+ PyObject** _py_start, PyObject** _py_stop, PyObject** _py_slice,
+ int has_cstart, int has_cstop, CYTHON_UNUSED int wraparound) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyMappingMethods* mp;
+#if PY_MAJOR_VERSION < 3
+ PySequenceMethods* ms = Py_TYPE(obj)->tp_as_sequence;
+ if (likely(ms && ms->sq_slice)) {
+ if (!has_cstart) {
+ if (_py_start && (*_py_start != Py_None)) {
+ cstart = __Pyx_PyIndex_AsSsize_t(*_py_start);
+ if ((cstart == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstart = 0;
+ }
+ if (!has_cstop) {
+ if (_py_stop && (*_py_stop != Py_None)) {
+ cstop = __Pyx_PyIndex_AsSsize_t(*_py_stop);
+ if ((cstop == (Py_ssize_t)-1) && PyErr_Occurred()) goto bad;
+ } else
+ cstop = PY_SSIZE_T_MAX;
+ }
+ if (wraparound && unlikely((cstart < 0) | (cstop < 0)) && likely(ms->sq_length)) {
+ Py_ssize_t l = ms->sq_length(obj);
+ if (likely(l >= 0)) {
+ if (cstop < 0) {
+ cstop += l;
+ if (cstop < 0) cstop = 0;
+ }
+ if (cstart < 0) {
+ cstart += l;
+ if (cstart < 0) cstart = 0;
+ }
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ return ms->sq_slice(obj, cstart, cstop);
+ }
+#endif
+ mp = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(mp && mp->mp_subscript))
+#endif
+ {
+ PyObject* result;
+ PyObject *py_slice, *py_start, *py_stop;
+ if (_py_slice) {
+ py_slice = *_py_slice;
+ } else {
+ PyObject* owned_start = NULL;
+ PyObject* owned_stop = NULL;
+ if (_py_start) {
+ py_start = *_py_start;
+ } else {
+ if (has_cstart) {
+ owned_start = py_start = PyInt_FromSsize_t(cstart);
+ if (unlikely(!py_start)) goto bad;
+ } else
+ py_start = Py_None;
+ }
+ if (_py_stop) {
+ py_stop = *_py_stop;
+ } else {
+ if (has_cstop) {
+ owned_stop = py_stop = PyInt_FromSsize_t(cstop);
+ if (unlikely(!py_stop)) {
+ Py_XDECREF(owned_start);
+ goto bad;
+ }
+ } else
+ py_stop = Py_None;
+ }
+ py_slice = PySlice_New(py_start, py_stop, Py_None);
+ Py_XDECREF(owned_start);
+ Py_XDECREF(owned_stop);
+ if (unlikely(!py_slice)) goto bad;
+ }
+#if CYTHON_USE_TYPE_SLOTS
+ result = mp->mp_subscript(obj, py_slice);
+#else
+ result = PyObject_GetItem(obj, py_slice);
+#endif
+ if (!_py_slice) {
+ Py_DECREF(py_slice);
+ }
+ return result;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "'%.200s' object is unsliceable", Py_TYPE(obj)->tp_name);
+bad:
+ return NULL;
+}
+
+/* BytesEquals */
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+ if (s1 == s2) {
+ return (equals == Py_EQ);
+ } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+ const char *ps1, *ps2;
+ Py_ssize_t length = PyBytes_GET_SIZE(s1);
+ if (length != PyBytes_GET_SIZE(s2))
+ return (equals == Py_NE);
+ ps1 = PyBytes_AS_STRING(s1);
+ ps2 = PyBytes_AS_STRING(s2);
+ if (ps1[0] != ps2[0]) {
+ return (equals == Py_NE);
+ } else if (length == 1) {
+ return (equals == Py_EQ);
+ } else {
+ int result;
+#if CYTHON_USE_UNICODE_INTERNALS
+ Py_hash_t hash1, hash2;
+ hash1 = ((PyBytesObject*)s1)->ob_shash;
+ hash2 = ((PyBytesObject*)s2)->ob_shash;
+ if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
+ return (equals == Py_NE);
+ }
+#endif
+ result = memcmp(ps1, ps2, (size_t)length);
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+ return (equals == Py_NE);
+ } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+ return (equals == Py_NE);
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+#endif
+}
+
+/* UnicodeEquals */
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+ PyObject* owned_ref = NULL;
+#endif
+ int s1_is_unicode, s2_is_unicode;
+ if (s1 == s2) {
+ goto return_eq;
+ }
+ s1_is_unicode = PyUnicode_CheckExact(s1);
+ s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+ if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+ owned_ref = PyUnicode_FromObject(s2);
+ if (unlikely(!owned_ref))
+ return -1;
+ s2 = owned_ref;
+ s2_is_unicode = 1;
+ } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+ owned_ref = PyUnicode_FromObject(s1);
+ if (unlikely(!owned_ref))
+ return -1;
+ s1 = owned_ref;
+ s1_is_unicode = 1;
+ } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+ return __Pyx_PyBytes_Equals(s1, s2, equals);
+ }
+#endif
+ if (s1_is_unicode & s2_is_unicode) {
+ Py_ssize_t length;
+ int kind;
+ void *data1, *data2;
+ if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+ return -1;
+ length = __Pyx_PyUnicode_GET_LENGTH(s1);
+ if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+ goto return_ne;
+ }
+#if CYTHON_USE_UNICODE_INTERNALS
+ {
+ Py_hash_t hash1, hash2;
+ #if CYTHON_PEP393_ENABLED
+ hash1 = ((PyASCIIObject*)s1)->hash;
+ hash2 = ((PyASCIIObject*)s2)->hash;
+ #else
+ hash1 = ((PyUnicodeObject*)s1)->hash;
+ hash2 = ((PyUnicodeObject*)s2)->hash;
+ #endif
+ if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
+ goto return_ne;
+ }
+ }
+#endif
+ kind = __Pyx_PyUnicode_KIND(s1);
+ if (kind != __Pyx_PyUnicode_KIND(s2)) {
+ goto return_ne;
+ }
+ data1 = __Pyx_PyUnicode_DATA(s1);
+ data2 = __Pyx_PyUnicode_DATA(s2);
+ if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+ goto return_ne;
+ } else if (length == 1) {
+ goto return_eq;
+ } else {
+ int result = memcmp(data1, data2, (size_t)(length * kind));
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & s2_is_unicode) {
+ goto return_ne;
+ } else if ((s2 == Py_None) & s1_is_unicode) {
+ goto return_ne;
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+return_eq:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ);
+return_ne:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_NE);
+#endif
+}
+
+/* GetModuleGlobalName */
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if !CYTHON_AVOID_BORROWED_REFS
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
+ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else if (unlikely(PyErr_Occurred())) {
+ result = NULL;
+ } else {
+#else
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#endif
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(__Pyx_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ int flags = PyCFunction_GET_FLAGS(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
+ return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
+ } else {
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
+ }
+}
+#endif
+
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif
+#endif
+
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
+ if (likely(PyCFunction_Check(func))) {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+#endif
+
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+}
+#endif
+
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
+ instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+ if (cause) {
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+/* GetItemInt */
+ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+ PyObject *r;
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyList_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyTuple_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+ if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
+ PyObject *r = PyList_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ else if (PyTuple_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return NULL;
+ PyErr_Clear();
+ }
+ }
+ return m->sq_item(o, i);
+ }
+ }
+#else
+ if (is_list || PySequence_Check(o)) {
+ return PySequence_GetItem(o, i);
+ }
+#endif
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+/* ObjectGetItem */
+ #if CYTHON_USE_TYPE_SLOTS
+static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
+ PyObject *runerr;
+ Py_ssize_t key_value;
+ PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
+ if (unlikely(!(m && m->sq_item))) {
+ PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
+ return NULL;
+ }
+ key_value = __Pyx_PyIndex_AsSsize_t(index);
+ if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
+ return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
+ }
+ if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
+ PyErr_Clear();
+ PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
+ }
+ return NULL;
+}
+static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
+ PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(m && m->mp_subscript)) {
+ return m->mp_subscript(obj, key);
+ }
+ return __Pyx_PyObject_GetIndex(obj, key);
+}
+#endif
+
+/* IsLittleEndian */
+ static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
+{
+ union {
+ uint32_t u32;
+ uint8_t u8[4];
+ } S;
+ S.u32 = 0x01020304;
+ return S.u8[0] == 4;
+}
+
+/* BufferFormatCheck */
+ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type) {
+ stack[0].field = &ctx->root;
+ stack[0].parent_offset = 0;
+ ctx->root.type = type;
+ ctx->root.name = "buffer dtype";
+ ctx->root.offset = 0;
+ ctx->head = stack;
+ ctx->head->field = &ctx->root;
+ ctx->fmt_offset = 0;
+ ctx->head->parent_offset = 0;
+ ctx->new_packmode = '@';
+ ctx->enc_packmode = '@';
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ ctx->is_valid_array = 0;
+ ctx->struct_alignment = 0;
+ while (type->typegroup == 'S') {
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = 0;
+ type = type->fields->type;
+ }
+}
+static int __Pyx_BufFmt_ParseNumber(const char** ts) {
+ int count;
+ const char* t = *ts;
+ if (*t < '0' || *t > '9') {
+ return -1;
+ } else {
+ count = *t++ - '0';
+ while (*t >= '0' && *t < '9') {
+ count *= 10;
+ count += *t++ - '0';
+ }
+ }
+ *ts = t;
+ return count;
+}
+static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
+ int number = __Pyx_BufFmt_ParseNumber(ts);
+ if (number == -1)
+ PyErr_Format(PyExc_ValueError,\
+ "Does not understand character buffer dtype format string ('%c')", **ts);
+ return number;
+}
+static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
+ PyErr_Format(PyExc_ValueError,
+ "Unexpected format string character: '%c'", ch);
+}
+static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': return "'char'";
+ case 'b': return "'signed char'";
+ case 'B': return "'unsigned char'";
+ case 'h': return "'short'";
+ case 'H': return "'unsigned short'";
+ case 'i': return "'int'";
+ case 'I': return "'unsigned int'";
+ case 'l': return "'long'";
+ case 'L': return "'unsigned long'";
+ case 'q': return "'long long'";
+ case 'Q': return "'unsigned long long'";
+ case 'f': return (is_complex ? "'complex float'" : "'float'");
+ case 'd': return (is_complex ? "'complex double'" : "'double'");
+ case 'g': return (is_complex ? "'complex long double'" : "'long double'");
+ case 'T': return "a struct";
+ case 'O': return "Python object";
+ case 'P': return "a pointer";
+ case 's': case 'p': return "a string";
+ case 0: return "end";
+ default: return "unparseable format string";
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return 2;
+ case 'i': case 'I': case 'l': case 'L': return 4;
+ case 'q': case 'Q': return 8;
+ case 'f': return (is_complex ? 8 : 4);
+ case 'd': return (is_complex ? 16 : 8);
+ case 'g': {
+ PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
+ return 0;
+ }
+ case 'O': case 'P': return sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(short);
+ case 'i': case 'I': return sizeof(int);
+ case 'l': case 'L': return sizeof(long);
+ #ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(PY_LONG_LONG);
+ #endif
+ case 'f': return sizeof(float) * (is_complex ? 2 : 1);
+ case 'd': return sizeof(double) * (is_complex ? 2 : 1);
+ case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
+ case 'O': case 'P': return sizeof(void*);
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+typedef struct { char c; short x; } __Pyx_st_short;
+typedef struct { char c; int x; } __Pyx_st_int;
+typedef struct { char c; long x; } __Pyx_st_long;
+typedef struct { char c; float x; } __Pyx_st_float;
+typedef struct { char c; double x; } __Pyx_st_double;
+typedef struct { char c; long double x; } __Pyx_st_longdouble;
+typedef struct { char c; void *x; } __Pyx_st_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+/* These are for computing the padding at the end of the struct to align
+ on the first member of the struct. This will probably the same as above,
+ but we don't have any guarantees.
+ */
+typedef struct { short x; char c; } __Pyx_pad_short;
+typedef struct { int x; char c; } __Pyx_pad_int;
+typedef struct { long x; char c; } __Pyx_pad_long;
+typedef struct { float x; char c; } __Pyx_pad_float;
+typedef struct { double x; char c; } __Pyx_pad_double;
+typedef struct { long double x; char c; } __Pyx_pad_longdouble;
+typedef struct { void *x; char c; } __Pyx_pad_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
+ switch (ch) {
+ case 'c':
+ return 'H';
+ case 'b': case 'h': case 'i':
+ case 'l': case 'q': case 's': case 'p':
+ return 'I';
+ case 'B': case 'H': case 'I': case 'L': case 'Q':
+ return 'U';
+ case 'f': case 'd': case 'g':
+ return (is_complex ? 'C' : 'R');
+ case 'O':
+ return 'O';
+ case 'P':
+ return 'P';
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
+ if (ctx->head == NULL || ctx->head->field == &ctx->root) {
+ const char* expected;
+ const char* quote;
+ if (ctx->head == NULL) {
+ expected = "end";
+ quote = "";
+ } else {
+ expected = ctx->head->field->type->name;
+ quote = "'";
+ }
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected %s%s%s but got %s",
+ quote, expected, quote,
+ __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
+ } else {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_StructField* parent = (ctx->head - 1)->field;
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
+ field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
+ parent->type->name, field->name);
+ }
+}
+static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
+ char group;
+ size_t size, offset, arraysize = 1;
+ if (ctx->enc_type == 0) return 0;
+ if (ctx->head->field->type->arraysize[0]) {
+ int i, ndim = 0;
+ if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
+ ctx->is_valid_array = ctx->head->field->type->ndim == 1;
+ ndim = 1;
+ if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
+ PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %zu",
+ ctx->head->field->type->arraysize[0], ctx->enc_count);
+ return -1;
+ }
+ }
+ if (!ctx->is_valid_array) {
+ PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
+ ctx->head->field->type->ndim, ndim);
+ return -1;
+ }
+ for (i = 0; i < ctx->head->field->type->ndim; i++) {
+ arraysize *= ctx->head->field->type->arraysize[i];
+ }
+ ctx->is_valid_array = 0;
+ ctx->enc_count = 1;
+ }
+ group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
+ do {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_TypeInfo* type = field->type;
+ if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
+ size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
+ } else {
+ size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
+ }
+ if (ctx->enc_packmode == '@') {
+ size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
+ size_t align_mod_offset;
+ if (align_at == 0) return -1;
+ align_mod_offset = ctx->fmt_offset % align_at;
+ if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
+ if (ctx->struct_alignment == 0)
+ ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
+ ctx->is_complex);
+ }
+ if (type->size != size || type->typegroup != group) {
+ if (type->typegroup == 'C' && type->fields != NULL) {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = parent_offset;
+ continue;
+ }
+ if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
+ } else {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ }
+ offset = ctx->head->parent_offset + field->offset;
+ if (ctx->fmt_offset != offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
+ (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
+ return -1;
+ }
+ ctx->fmt_offset += size;
+ if (arraysize)
+ ctx->fmt_offset += (arraysize - 1) * size;
+ --ctx->enc_count;
+ while (1) {
+ if (field == &ctx->root) {
+ ctx->head = NULL;
+ if (ctx->enc_count != 0) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ break;
+ }
+ ctx->head->field = ++field;
+ if (field->type == NULL) {
+ --ctx->head;
+ field = ctx->head->field;
+ continue;
+ } else if (field->type->typegroup == 'S') {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ if (field->type->fields->type == NULL) continue;
+ field = field->type->fields;
+ ++ctx->head;
+ ctx->head->field = field;
+ ctx->head->parent_offset = parent_offset;
+ break;
+ } else {
+ break;
+ }
+ }
+ } while (ctx->enc_count);
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ return 0;
+}
+static PyObject *
+__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
+{
+ const char *ts = *tsp;
+ int i = 0, number;
+ int ndim = ctx->head->field->type->ndim;
+;
+ ++ts;
+ if (ctx->new_count != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot handle repeated arrays in format string");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ while (*ts && *ts != ')') {
+ switch (*ts) {
+ case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
+ default: break;
+ }
+ number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %d",
+ ctx->head->field->type->arraysize[i], number);
+ if (*ts != ',' && *ts != ')')
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a comma in format string, got '%c'", *ts);
+ if (*ts == ',') ts++;
+ i++;
+ }
+ if (i != ndim)
+ return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
+ ctx->head->field->type->ndim, i);
+ if (!*ts) {
+ PyErr_SetString(PyExc_ValueError,
+ "Unexpected end of format string, expected ')'");
+ return NULL;
+ }
+ ctx->is_valid_array = 1;
+ ctx->new_count = 1;
+ *tsp = ++ts;
+ return Py_None;
+}
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
+ int got_Z = 0;
+ while (1) {
+ switch(*ts) {
+ case 0:
+ if (ctx->enc_type != 0 && ctx->head == NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ if (ctx->head != NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ return ts;
+ case ' ':
+ case '\r':
+ case '\n':
+ ++ts;
+ break;
+ case '<':
+ if (!__Pyx_Is_Little_Endian()) {
+ PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '>':
+ case '!':
+ if (__Pyx_Is_Little_Endian()) {
+ PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '=':
+ case '@':
+ case '^':
+ ctx->new_packmode = *ts++;
+ break;
+ case 'T':
+ {
+ const char* ts_after_sub;
+ size_t i, struct_count = ctx->new_count;
+ size_t struct_alignment = ctx->struct_alignment;
+ ctx->new_count = 1;
+ ++ts;
+ if (*ts != '{') {
+ PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ ctx->enc_count = 0;
+ ctx->struct_alignment = 0;
+ ++ts;
+ ts_after_sub = ts;
+ for (i = 0; i != struct_count; ++i) {
+ ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
+ if (!ts_after_sub) return NULL;
+ }
+ ts = ts_after_sub;
+ if (struct_alignment) ctx->struct_alignment = struct_alignment;
+ }
+ break;
+ case '}':
+ {
+ size_t alignment = ctx->struct_alignment;
+ ++ts;
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ if (alignment && ctx->fmt_offset % alignment) {
+ ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
+ }
+ }
+ return ts;
+ case 'x':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->fmt_offset += ctx->new_count;
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->enc_packmode = ctx->new_packmode;
+ ++ts;
+ break;
+ case 'Z':
+ got_Z = 1;
+ ++ts;
+ if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
+ __Pyx_BufFmt_RaiseUnexpectedChar('Z');
+ return NULL;
+ }
+ CYTHON_FALLTHROUGH;
+ case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
+ case 'l': case 'L': case 'q': case 'Q':
+ case 'f': case 'd': case 'g':
+ case 'O': case 'p':
+ if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
+ ctx->enc_packmode == ctx->new_packmode) {
+ ctx->enc_count += ctx->new_count;
+ ctx->new_count = 1;
+ got_Z = 0;
+ ++ts;
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ case 's':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_count = ctx->new_count;
+ ctx->enc_packmode = ctx->new_packmode;
+ ctx->enc_type = *ts;
+ ctx->is_complex = got_Z;
+ ++ts;
+ ctx->new_count = 1;
+ got_Z = 0;
+ break;
+ case ':':
+ ++ts;
+ while(*ts != ':') ++ts;
+ ++ts;
+ break;
+ case '(':
+ if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
+ break;
+ default:
+ {
+ int number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ ctx->new_count = (size_t)number;
+ }
+ }
+ }
+}
+
+/* BufferGetAndValidate */
+ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
+ if (unlikely(info->buf == NULL)) return;
+ if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
+ __Pyx_ReleaseBuffer(info);
+}
+static void __Pyx_ZeroBuffer(Py_buffer* buf) {
+ buf->buf = NULL;
+ buf->obj = NULL;
+ buf->strides = __Pyx_zeros;
+ buf->shape = __Pyx_zeros;
+ buf->suboffsets = __Pyx_minusones;
+}
+static int __Pyx__GetBufferAndValidate(
+ Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
+ int nd, int cast, __Pyx_BufFmt_StackElem* stack)
+{
+ buf->buf = NULL;
+ if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
+ __Pyx_ZeroBuffer(buf);
+ return -1;
+ }
+ if (unlikely(buf->ndim != nd)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ nd, buf->ndim);
+ goto fail;
+ }
+ if (!cast) {
+ __Pyx_BufFmt_Context ctx;
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if (unlikely((unsigned)buf->itemsize != dtype->size)) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
+ buf->itemsize, (buf->itemsize > 1) ? "s" : "",
+ dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+ return 0;
+fail:;
+ __Pyx_SafeReleaseBuffer(buf);
+ return -1;
+}
+
+/* PyObjectSetAttrStr */
+ #if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_setattro))
+ return tp->tp_setattro(obj, attr_name, value);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_setattr))
+ return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
+#endif
+ return PyObject_SetAttr(obj, attr_name, value);
+}
+#endif
+
+/* MemviewSliceInit */
+ static int
+__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference)
+{
+ __Pyx_RefNannyDeclarations
+ int i, retval=-1;
+ Py_buffer *buf = &memview->view;
+ __Pyx_RefNannySetupContext("init_memviewslice", 0);
+ if (!buf) {
+ PyErr_SetString(PyExc_ValueError,
+ "buf is NULL.");
+ goto fail;
+ } else if (memviewslice->memview || memviewslice->data) {
+ PyErr_SetString(PyExc_ValueError,
+ "memviewslice is already initialized!");
+ goto fail;
+ }
+ if (buf->strides) {
+ for (i = 0; i < ndim; i++) {
+ memviewslice->strides[i] = buf->strides[i];
+ }
+ } else {
+ Py_ssize_t stride = buf->itemsize;
+ for (i = ndim - 1; i >= 0; i--) {
+ memviewslice->strides[i] = stride;
+ stride *= buf->shape[i];
+ }
+ }
+ for (i = 0; i < ndim; i++) {
+ memviewslice->shape[i] = buf->shape[i];
+ if (buf->suboffsets) {
+ memviewslice->suboffsets[i] = buf->suboffsets[i];
+ } else {
+ memviewslice->suboffsets[i] = -1;
+ }
+ }
+ memviewslice->memview = memview;
+ memviewslice->data = (char *)buf->buf;
+ if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
+ Py_INCREF(memview);
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ memviewslice->memview = 0;
+ memviewslice->data = 0;
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+#ifndef Py_NO_RETURN
+#define Py_NO_RETURN
+#endif
+static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
+ va_list vargs;
+ char msg[200];
+#ifdef HAVE_STDARG_PROTOTYPES
+ va_start(vargs, fmt);
+#else
+ va_start(vargs);
+#endif
+ vsnprintf(msg, 200, fmt, vargs);
+ va_end(vargs);
+ Py_FatalError(msg);
+}
+static CYTHON_INLINE int
+__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)++;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE int
+__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)--;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE void
+__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
+{
+ int first_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview || (PyObject *) memview == Py_None)
+ return;
+ if (__pyx_get_slice_count(memview) < 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ first_time = __pyx_add_acquisition_count(memview) == 0;
+ if (first_time) {
+ if (have_gil) {
+ Py_INCREF((PyObject *) memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_INCREF((PyObject *) memview);
+ PyGILState_Release(_gilstate);
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
+ int have_gil, int lineno) {
+ int last_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview ) {
+ return;
+ } else if ((PyObject *) memview == Py_None) {
+ memslice->memview = NULL;
+ return;
+ }
+ if (__pyx_get_slice_count(memview) <= 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ last_time = __pyx_sub_acquisition_count(memview) == 1;
+ memslice->data = NULL;
+ if (last_time) {
+ if (have_gil) {
+ Py_CLEAR(memslice->memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_CLEAR(memslice->memview);
+ PyGILState_Release(_gilstate);
+ }
+ } else {
+ memslice->memview = NULL;
+ }
+}
+
+/* DictGetItem */
+ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
+ PyObject *value;
+ value = PyDict_GetItemWithError(d, key);
+ if (unlikely(!value)) {
+ if (!PyErr_Occurred()) {
+ PyObject* args = PyTuple_Pack(1, key);
+ if (likely(args))
+ PyErr_SetObject(PyExc_KeyError, args);
+ Py_XDECREF(args);
+ }
+ return NULL;
+ }
+ Py_INCREF(value);
+ return value;
+}
+#endif
+
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+ PyErr_Format(PyExc_ValueError,
+ "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
+}
+
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+ PyErr_Format(PyExc_ValueError,
+ "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
+ index, (index == 1) ? "" : "s");
+}
+
+/* RaiseNoneIterError */
+ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ #if PY_VERSION_HEX >= 0x030700A2
+ *type = tstate->exc_state.exc_type;
+ *value = tstate->exc_state.exc_value;
+ *tb = tstate->exc_state.exc_traceback;
+ #else
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ #endif
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if PY_VERSION_HEX >= 0x030700A2
+ tmp_type = tstate->exc_state.exc_type;
+ tmp_value = tstate->exc_state.exc_value;
+ tmp_tb = tstate->exc_state.exc_traceback;
+ tstate->exc_state.exc_type = type;
+ tstate->exc_state.exc_value = value;
+ tstate->exc_state.exc_traceback = tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ if (unlikely(PyTuple_Check(err)))
+ return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+ return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
+}
+#endif
+
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ #if PY_VERSION_HEX >= 0x030700A2
+ tmp_type = tstate->exc_state.exc_type;
+ tmp_value = tstate->exc_state.exc_value;
+ tmp_tb = tstate->exc_state.exc_traceback;
+ tstate->exc_state.exc_type = local_type;
+ tstate->exc_state.exc_value = local_value;
+ tstate->exc_state.exc_traceback = local_tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* None */
+ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+ Py_ssize_t q = a / b;
+ Py_ssize_t r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+/* GetAttr */
+ static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __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)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ length = stop - start;
+ if (unlikely(length <= 0))
+ return PyUnicode_FromUnicode(NULL, 0);
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+/* GetAttr3 */
+ static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+ return NULL;
+ __Pyx_PyErr_Clear();
+ Py_INCREF(d);
+ return d;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
+ PyObject *r = __Pyx_GetAttr(o, n);
+ return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
+}
+
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if PY_VERSION_HEX >= 0x030700A2
+ tmp_type = tstate->exc_state.exc_type;
+ tmp_value = tstate->exc_state.exc_value;
+ tmp_tb = tstate->exc_state.exc_traceback;
+ tstate->exc_state.exc_type = *type;
+ tstate->exc_state.exc_value = *value;
+ tstate->exc_state.exc_traceback = *tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+ #endif
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#endif
+
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* FastTypeChecks */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+ while (a) {
+ a = a->tp_base;
+ if (a == b)
+ return 1;
+ }
+ return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+ PyObject *mro;
+ if (a == b) return 1;
+ mro = a->tp_mro;
+ if (likely(mro)) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(mro);
+ for (i = 0; i < n; i++) {
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+ return 1;
+ }
+ return 0;
+ }
+ return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+ PyObject *exception, *value, *tb;
+ int res;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&exception, &value, &tb);
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ if (!res) {
+ res = PyObject_IsSubclass(err, exc_type2);
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ }
+ __Pyx_ErrRestore(exception, value, tb);
+ return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+ if (!res) {
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+ }
+ return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+ if (likely(err == exc_type)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+ }
+ return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+ }
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* None */
+ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+ PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
+}
+
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
+ long q = a / b;
+ long r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+/* WriteUnraisableException */
+ static void __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) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
+}
+
+/* ImportFrom */
+ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+/* HasAttr */
+ static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
+ PyObject *r;
+ if (unlikely(!__Pyx_PyBaseString_Check(n))) {
+ PyErr_SetString(PyExc_TypeError,
+ "hasattr(): attribute name must be string");
+ return -1;
+ }
+ r = __Pyx_GetAttr(o, n);
+ if (unlikely(!r)) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ Py_DECREF(r);
+ return 1;
+ }
+}
+
+/* PyObject_GenericGetAttrNoDict */
+ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
+ PyErr_Format(PyExc_AttributeError,
+#if PY_MAJOR_VERSION >= 3
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, attr_name);
+#else
+ "'%.50s' object has no attribute '%.400s'",
+ tp->tp_name, PyString_AS_STRING(attr_name));
+#endif
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
+ PyObject *descr;
+ PyTypeObject *tp = Py_TYPE(obj);
+ if (unlikely(!PyString_Check(attr_name))) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ assert(!tp->tp_dictoffset);
+ descr = _PyType_Lookup(tp, attr_name);
+ if (unlikely(!descr)) {
+ return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
+ }
+ Py_INCREF(descr);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
+ #endif
+ {
+ descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
+ if (unlikely(f)) {
+ PyObject *res = f(descr, obj, (PyObject *)tp);
+ Py_DECREF(descr);
+ return res;
+ }
+ }
+ return descr;
+}
+#endif
+
+/* PyObject_GenericGetAttr */
+ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
+ if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
+}
+#endif
+
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+/* SetupReduce */
+ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
+ int ret;
+ PyObject *name_attr;
+ name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
+ if (likely(name_attr)) {
+ ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
+ } else {
+ ret = -1;
+ }
+ if (unlikely(ret < 0)) {
+ PyErr_Clear();
+ ret = 0;
+ }
+ Py_XDECREF(name_attr);
+ return ret;
+}
+static int __Pyx_setup_reduce(PyObject* type_obj) {
+ int ret = 0;
+ PyObject *object_reduce = NULL;
+ PyObject *object_reduce_ex = NULL;
+ PyObject *reduce = NULL;
+ PyObject *reduce_ex = NULL;
+ PyObject *reduce_cython = NULL;
+ PyObject *setstate = NULL;
+ PyObject *setstate_cython = NULL;
+#if CYTHON_USE_PYTYPE_LOOKUP
+ if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
+#else
+ if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
+#endif
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
+#else
+ object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
+#endif
+ reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
+ if (reduce_ex == object_reduce_ex) {
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
+#else
+ object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
+#endif
+ reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
+ if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
+ reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
+ setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
+ if (!setstate) PyErr_Clear();
+ if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
+ setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
+ }
+ PyType_Modified((PyTypeObject*)type_obj);
+ }
+ }
+ goto GOOD;
+BAD:
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
+ ret = -1;
+GOOD:
+#if !CYTHON_USE_PYTYPE_LOOKUP
+ Py_XDECREF(object_reduce);
+ Py_XDECREF(object_reduce_ex);
+#endif
+ Py_XDECREF(reduce);
+ Py_XDECREF(reduce_ex);
+ Py_XDECREF(reduce_cython);
+ Py_XDECREF(setstate);
+ Py_XDECREF(setstate_cython);
+ return ret;
+}
+
+/* CLineInTraceback */
+ #ifndef CYTHON_CLINE_IN_TRACEBACK
+static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
+ PyObject *use_cline;
+ PyObject *ptype, *pvalue, *ptraceback;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject **cython_runtime_dict;
+#endif
+ if (unlikely(!__pyx_cython_runtime)) {
+ return c_line;
+ }
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+#if CYTHON_COMPILING_IN_CPYTHON
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
+ if (likely(cython_runtime_dict)) {
+ use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
+ } else
+#endif
+ {
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
+ if (use_cline_obj) {
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
+ Py_DECREF(use_cline_obj);
+ } else {
+ PyErr_Clear();
+ use_cline = NULL;
+ }
+ }
+ if (!use_cline) {
+ c_line = 0;
+ PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
+ }
+ else if (PyObject_Not(use_cline) != 0) {
+ c_line = 0;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ return c_line;
+}
+#endif
+
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = start + (end - start) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+/* AddTraceback */
+ #include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ if (c_line) {
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
+ }
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ tstate, /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+#if PY_MAJOR_VERSION < 3
+static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
+ if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
+ if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
+ if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
+ if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
+ PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
+ return -1;
+}
+static void __Pyx_ReleaseBuffer(Py_buffer *view) {
+ PyObject *obj = view->obj;
+ if (!obj) return;
+ if (PyObject_CheckBuffer(obj)) {
+ PyBuffer_Release(view);
+ return;
+ }
+ if ((0)) {}
+ else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
+ view->obj = NULL;
+ Py_DECREF(obj);
+}
+#endif
+
+
+ /* MemviewSliceIsContig */
+ static int
+__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
+{
+ int i, index, step, start;
+ Py_ssize_t itemsize = mvs.memview->view.itemsize;
+ if (order == 'F') {
+ step = 1;
+ start = 0;
+ } else {
+ step = -1;
+ start = ndim - 1;
+ }
+ for (i = 0; i < ndim; i++) {
+ index = start + step * i;
+ if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
+ return 0;
+ itemsize *= mvs.shape[index];
+ }
+ return 1;
+}
+
+/* OverlappingSlices */
+ static void
+__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
+ void **out_start, void **out_end,
+ int ndim, size_t itemsize)
+{
+ char *start, *end;
+ int i;
+ start = end = slice->data;
+ for (i = 0; i < ndim; i++) {
+ Py_ssize_t stride = slice->strides[i];
+ Py_ssize_t extent = slice->shape[i];
+ if (extent == 0) {
+ *out_start = *out_end = start;
+ return;
+ } else {
+ if (stride > 0)
+ end += stride * (extent - 1);
+ else
+ start += stride * (extent - 1);
+ }
+ }
+ *out_start = start;
+ *out_end = end + itemsize;
+}
+static int
+__pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize)
+{
+ void *start1, *end1, *start2, *end2;
+ __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
+ __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
+ return (start1 < end2) && (start2 < end1);
+}
+
+/* Capsule */
+ static CYTHON_INLINE PyObject *
+__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
+{
+ PyObject *cobj;
+#if PY_VERSION_HEX >= 0x02070000
+ cobj = PyCapsule_New(p, sig, NULL);
+#else
+ cobj = PyCObject_FromVoidPtr(p, NULL);
+#endif
+ return cobj;
+}
+
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+/* Declarations */
+ #if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+ return ::std::complex< float >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+ return x + y*(__pyx_t_float_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+ __pyx_t_float_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabsf(b.real) >= fabsf(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ float r = b.imag / b.real;
+ float s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ float r = b.real / b.imag;
+ float s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ float denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_float_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrtf(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypotf(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ float denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(a, a);
+ case 3:
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, a);
+ case 4:
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ } else if (b.imag == 0) {
+ z.real = powf(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2f(0, -1);
+ }
+ } else {
+ r = __Pyx_c_abs_float(a);
+ theta = atan2f(a.imag, a.real);
+ }
+ lnr = logf(r);
+ z_r = expf(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cosf(z_theta);
+ z.imag = z_r * sinf(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+/* Declarations */
+ #if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return ::std::complex< double >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return x + y*(__pyx_t_double_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ __pyx_t_double_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabs(b.real) >= fabs(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ double r = b.imag / b.real;
+ double s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ double r = b.real / b.imag;
+ double s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ double denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_double_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrt(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypot(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ double denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(a, a);
+ case 3:
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, a);
+ case 4:
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ } else if (b.imag == 0) {
+ z.real = pow(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2(0, -1);
+ }
+ } else {
+ r = __Pyx_c_abs_double(a);
+ theta = atan2(a.imag, a.real);
+ }
+ lnr = log(r);
+ z_r = exp(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cos(z_theta);
+ z.imag = z_r * sin(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
+ const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(enum NPY_TYPES) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewSliceCopyTemplate */
+ 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)
+{
+ __Pyx_RefNannyDeclarations
+ int i;
+ __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
+ struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
+ Py_buffer *buf = &from_memview->view;
+ PyObject *shape_tuple = NULL;
+ PyObject *temp_int = NULL;
+ struct __pyx_array_obj *array_obj = NULL;
+ struct __pyx_memoryview_obj *memview_obj = NULL;
+ __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
+ for (i = 0; i < ndim; i++) {
+ if (from_mvs->suboffsets[i] >= 0) {
+ PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
+ "indirect dimensions (axis %d)", i);
+ goto fail;
+ }
+ }
+ shape_tuple = PyTuple_New(ndim);
+ if (unlikely(!shape_tuple)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(shape_tuple);
+ for(i = 0; i < ndim; i++) {
+ temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
+ if(unlikely(!temp_int)) {
+ goto fail;
+ } else {
+ PyTuple_SET_ITEM(shape_tuple, i, temp_int);
+ temp_int = NULL;
+ }
+ }
+ array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
+ if (unlikely(!array_obj)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(array_obj);
+ memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ (PyObject *) array_obj, contig_flag,
+ dtype_is_object,
+ from_mvs->memview->typeinfo);
+ if (unlikely(!memview_obj))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
+ goto fail;
+ if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
+ dtype_is_object) < 0))
+ goto fail;
+ goto no_fail;
+fail:
+ __Pyx_XDECREF(new_mvs.memview);
+ new_mvs.memview = NULL;
+ new_mvs.data = NULL;
+no_fail:
+ __Pyx_XDECREF(shape_tuple);
+ __Pyx_XDECREF(temp_int);
+ __Pyx_XDECREF(array_obj);
+ __Pyx_RefNannyFinishContext();
+ return new_mvs;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned long __Pyx_PyInt_As_unsigned_long(PyObject *x) {
+ const unsigned long neg_one = (unsigned long) -1, const_zero = (unsigned long) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(unsigned long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (unsigned long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) >= 2 * PyLong_SHIFT) {
+ return (unsigned long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) >= 3 * PyLong_SHIFT) {
+ return (unsigned long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned 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])))
+ } else if (8 * sizeof(unsigned long) >= 4 * PyLong_SHIFT) {
+ return (unsigned long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(unsigned long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned long) (((unsigned long)-1)*(((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned long) ((((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned long) (((unsigned long)-1)*(((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned long) ((((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned 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])))
+ } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned long) (((unsigned long)-1)*(((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned 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])))
+ } else if (8 * sizeof(unsigned long) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned long) ((((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(unsigned long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ unsigned long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (unsigned long) -1;
+ }
+ } else {
+ unsigned long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (unsigned long) -1;
+ val = __Pyx_PyInt_As_unsigned_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to unsigned long");
+ return (unsigned long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to unsigned long");
+ return (unsigned long) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
+ const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(unsigned int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (unsigned int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT) {
+ return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT) {
+ return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned 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])))
+ } else if (8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT) {
+ return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (unsigned int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(unsigned int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (unsigned int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(unsigned int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(unsigned int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned 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])))
+ } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(unsigned int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(unsigned 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])))
+ } else if (8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT) {
+ return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(unsigned int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ unsigned int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (unsigned int) -1;
+ }
+ } else {
+ unsigned int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (unsigned int) -1;
+ val = __Pyx_PyInt_As_unsigned_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to unsigned int");
+ return (unsigned int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to unsigned int");
+ return (unsigned int) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(char) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (char) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(char) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(char) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ char val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (char) -1;
+ }
+ } else {
+ char val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (char) -1;
+ val = __Pyx_PyInt_As_char(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to char");
+ return (char) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to char");
+ return (char) -1;
+}
+
+/* TypeInfoCompare */
+ static int
+__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
+{
+ int i;
+ if (!a || !b)
+ return 0;
+ if (a == b)
+ return 1;
+ if (a->size != b->size || a->typegroup != b->typegroup ||
+ a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
+ if (a->typegroup == 'H' || b->typegroup == 'H') {
+ return a->size == b->size;
+ } else {
+ return 0;
+ }
+ }
+ if (a->ndim) {
+ for (i = 0; i < a->ndim; i++)
+ if (a->arraysize[i] != b->arraysize[i])
+ return 0;
+ }
+ if (a->typegroup == 'S') {
+ if (a->flags != b->flags)
+ return 0;
+ if (a->fields || b->fields) {
+ if (!(a->fields && b->fields))
+ return 0;
+ for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
+ __Pyx_StructField *field_a = a->fields + i;
+ __Pyx_StructField *field_b = b->fields + i;
+ if (field_a->offset != field_b->offset ||
+ !__pyx_typeinfo_cmp(field_a->type, field_b->type))
+ return 0;
+ }
+ return !a->fields[i].type && !b->fields[i].type;
+ }
+ }
+ return 1;
+}
+
+/* MemviewSliceValidateAndInit */
+ static int
+__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
+{
+ if (buf->shape[dim] <= 1)
+ return 1;
+ if (buf->strides) {
+ if (spec & __Pyx_MEMVIEW_CONTIG) {
+ if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
+ if (buf->strides[dim] != sizeof(void *)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly contiguous "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ } else if (buf->strides[dim] != buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_FOLLOW) {
+ Py_ssize_t stride = buf->strides[dim];
+ if (stride < 0)
+ stride = -stride;
+ if (stride < buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ } else {
+ if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not contiguous in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (spec & (__Pyx_MEMVIEW_PTR)) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not indirect in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (buf->suboffsets) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer exposes suboffsets but no strides");
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
+{
+ if (spec & __Pyx_MEMVIEW_DIRECT) {
+ if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer not compatible with direct access "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_PTR) {
+ if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly accessible "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
+{
+ int i;
+ if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = 0; i < ndim; i++) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not fortran contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = ndim - 1; i >- 1; i--) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not C contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int __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)
+{
+ struct __pyx_memoryview_obj *memview, *new_memview;
+ __Pyx_RefNannyDeclarations
+ Py_buffer *buf;
+ int i, spec = 0, retval = -1;
+ __Pyx_BufFmt_Context ctx;
+ int from_memoryview = __pyx_memoryview_check(original_obj);
+ __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
+ if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
+ original_obj)->typeinfo)) {
+ memview = (struct __pyx_memoryview_obj *) original_obj;
+ new_memview = NULL;
+ } else {
+ memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ original_obj, buf_flags, 0, dtype);
+ new_memview = memview;
+ if (unlikely(!memview))
+ goto fail;
+ }
+ buf = &memview->view;
+ if (buf->ndim != ndim) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ ndim, buf->ndim);
+ goto fail;
+ }
+ if (new_memview) {
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned) buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
+ "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
+ buf->itemsize,
+ (buf->itemsize > 1) ? "s" : "",
+ dtype->name,
+ dtype->size,
+ (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ for (i = 0; i < ndim; i++) {
+ spec = axes_specs[i];
+ if (!__pyx_check_strides(buf, i, ndim, spec))
+ goto fail;
+ if (!__pyx_check_suboffsets(buf, i, ndim, spec))
+ goto fail;
+ }
+ if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
+ new_memview != NULL) == -1)) {
+ goto fail;
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ Py_XDECREF(new_memview);
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_unsigned_char(PyObject *obj, int writable_flag) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS_RO | writable_flag, 2,
+ &__Pyx_TypeInfo_unsigned_char, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_double(PyObject *obj, int writable_flag) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS_RO | writable_flag, 2,
+ &__Pyx_TypeInfo_double, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_float(PyObject *obj, int writable_flag) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS_RO | writable_flag, 2,
+ &__Pyx_TypeInfo_float, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_dsds_int(PyObject *obj, int writable_flag) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED), (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS_RO | writable_flag, 2,
+ &__Pyx_TypeInfo_int, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+/* ModuleImport */
+ #ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+/* TypeImport */
+ #ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ if (PyObject_Hash(*t->p) == -1)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+}
+#else
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (likely(PyUnicode_IS_ASCII(o))) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
+ } else
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+ if (PyLong_Check(result)) {
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "__int__ returned non-int (type %.200s). "
+ "The ability to return an instance of a strict subclass of int "
+ "is deprecated, and may be removed in a future version of Python.",
+ Py_TYPE(result)->tp_name)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+ }
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ type_name, type_name, Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyNumberMethods *m;
+#endif
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
+#else
+ if (likely(PyLong_Check(x)))
+#endif
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
+ m = Py_TYPE(x)->tp_as_number;
+ #if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = m->nb_long(x);
+ }
+ #else
+ if (likely(m && m->nb_int)) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ #endif
+#else
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+ res = PyNumber_Int(x);
+ }
+#endif
+ if (likely(res)) {
+#if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
+#else
+ if (unlikely(!PyLong_CheckExact(res))) {
+#endif
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ 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]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ 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]));
+ }
+ break;
+ }
+ }
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/PyMca5/PyMcaGui/PyMcaPrintPreview.py b/PyMca5/PyMcaGui/PyMcaPrintPreview.py
new file mode 100644
index 0000000..f9e59f6
--- /dev/null
+++ b/PyMca5/PyMcaGui/PyMcaPrintPreview.py
@@ -0,0 +1,31 @@
+#/*##########################################################################
+# Copyright (C) 2018 V.A. Sole, European Synchrotron Radiation Facility
+#
+# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
+# the ESRF by the Software group.
+#
+# Permission is hereby granted, free of charge, to any person obtaining a copy
+# of this software and associated documentation files (the "Software"), to deal
+# in the Software without restriction, including without limitation the rights
+# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+# copies of the Software, and to permit persons to whom the Software is
+# furnished to do so, subject to the following conditions:
+#
+# The above copyright notice and this permission notice shall be included in
+# all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+# THE SOFTWARE.
+#
+#############################################################################*/
+__author__ = "V.A. Sole - ESRF Data Analysis"
+__contact__ = "sole@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
+from .plotting.PyMcaPrintPreview import *
diff --git a/PyMca5/PyMcaGui/PyMcaQt.py b/PyMca5/PyMcaGui/PyMcaQt.py
index 467ac81..3adbf8e 100644
--- a/PyMca5/PyMcaGui/PyMcaQt.py
+++ b/PyMca5/PyMcaGui/PyMcaQt.py
@@ -34,11 +34,56 @@ import traceback
This module simplifies writing code that has to deal with with PySide and PyQt4.
"""
+BINDING = None
# force cx_freeze to consider sip among the modules to add
# to the binary packages
-if (('PySide.QtCore' in sys.modules) or
- (hasattr(sys, 'argv') and 'PySide' in sys.argv)):
- # argv might not be defined for embedded python (e.g., in Qt designer)
+if 'PySide2.QtCore' in sys.modules:
+ BINDING = 'PySide2'
+
+elif 'PySide.QtCore' in sys.modules:
+ BINDING = 'PySide'
+
+elif 'PyQt5.QtCore' in sys.modules:
+ BINDING = 'PyQt5'
+
+elif 'PyQt4.QtCore' in sys.modules:
+ BINDING = 'PyQt4'
+
+elif hasattr(sys, 'argv') and ('PySide2' in sys.argv):
+ BINDING = 'PySide2'
+
+elif hasattr(sys, 'argv') and ('PySide' in sys.argv):
+ # argv might not be defined for embedded python (e.g., in Qt designer)
+ BINDING = 'PySide'
+
+else: # Try the different bindings
+ try:
+ import PyQt5
+ BINDING = "PyQt5"
+ except ImportError:
+ try:
+ if sys.version_info < (3,):
+ try:
+ import sip
+ sip.setapi("QString", 2)
+ sip.setapi("QVariant", 2)
+ except:
+ print("Cannot set sip API") # Console widget not available
+ import PyQt4
+ BINDING = "PyQt4"
+ except ImportError:
+ try:
+ import PySide
+ BINDING = "PySide"
+ except ImportError:
+ try:
+ import PySide2
+ BINDING = "PySide2"
+ except ImportError:
+ raise ImportError(
+ 'No Qt wrapper found. Install PyQt5, PyQt4, PySide or PySide2.')
+
+if BINDING == "PySide":
from PySide.QtCore import *
from PySide.QtGui import *
try:
@@ -50,6 +95,7 @@ if (('PySide.QtCore' in sys.modules) or
except:
pass
pyqtSignal = Signal
+ pyqtSlot = Slot
#matplotlib has difficulties to identify PySide
try:
@@ -57,12 +103,29 @@ if (('PySide.QtCore' in sys.modules) or
matplotlib.rcParams['backend.qt4']='PySide'
except:
pass
-elif "PyQt5.QtCore" in sys.modules:
+
+elif BINDING == "PyQt4":
+ if sys.version_info < (3,):
+ try:
+ import sip
+ sip.setapi("QString", 2)
+ sip.setapi("QVariant", 2)
+ except:
+ print("Cannot set sip API") # Console widget not available
+ from PyQt4.QtCore import *
+ from PyQt4.QtGui import *
+ try:
+ from PyQt4.QtOpenGL import *
+ except:
+ pass
try:
- import sip
+ from PyQt4.QtSvg import *
except:
- # PyQt5 always uses API 2
pass
+ Signal = pyqtSignal
+ Slot = pyqtSlot
+
+elif BINDING == "PyQt5":
from PyQt5.QtCore import *
from PyQt5.QtGui import *
from PyQt5.QtWidgets import *
@@ -75,59 +138,28 @@ elif "PyQt5.QtCore" in sys.modules:
from PyQt5.QtSvg import *
except:
pass
-else:
- if sys.version_info < (3,):
- try:
- import sip
- sip.setapi("QString", 2)
- sip.setapi("QVariant", 2)
- except:
- print("Cannot set sip API") # Console widget not available
+ Signal = pyqtSignal
+ Slot = pyqtSlot
+
+elif BINDING == "PySide2":
+ # try PySide2 (experimental)
+ from PySide2.QtCore import *
+ from PySide2.QtGui import *
+ from PySide2.QtWidgets import *
+ from PySide2.QtPrintSupport import *
try:
- from PyQt4.QtCore import *
- from PyQt4.QtGui import *
- try:
- from PyQt4.QtOpenGL import *
- except:
- pass
- try:
- from PyQt4.QtSvg import *
- except:
- pass
- except ImportError:
- try:
- # try PySide
- from PySide.QtCore import *
- from PySide.QtGui import *
- try:
- from PySide.QtSvg import *
- except:
- pass
- try:
- from PySide.QtOpenGL import *
- except:
- pass
- pyqtSignal = Signal
+ from PySide2.QtOpenGL import *
+ except:
+ pass
+ try:
+ from PySide2.QtSvg import *
+ except:
+ pass
+ pyqtSignal = Signal
+ pyqtSlot = Slot
- # matplotlib has difficulties to identify PySide
- try:
- import matplotlib
- matplotlib.rcParams['backend.qt4']='PySide'
- except:
- pass
- except ImportError:
- from PyQt5.QtCore import *
- from PyQt5.QtGui import *
- from PyQt5.QtWidgets import *
- from PyQt5.QtPrintSupport import *
- try:
- from PyQt5.QtOpenGL import *
- except:
- pass
- try:
- from PyQt5.QtSvg import *
- except:
- pass
+else:
+ raise ImportError('No Qt wrapper found. Install one of PyQt5, PyQt4, PySide or PySide2 (untested)')
# provide a exception handler but not implement it by default
def exceptionHandler(type_, value, trace):
@@ -140,7 +172,7 @@ def exceptionHandler(type_, value, trace):
msg.raise_()
msg.exec_()
-# Overwrite the QFileDialog to make sure that by default it
+# Overwrite the QFileDialog to make sure that by default it
# returns non-native dialogs as it was the traditional behavior of Qt
_QFileDialog = QFileDialog
class QFileDialog(_QFileDialog):
diff --git a/PyMca5/PyMcaGui/__init__.py b/PyMca5/PyMcaGui/__init__.py
index ca54bf2..396fb96 100644
--- a/PyMca5/PyMcaGui/__init__.py
+++ b/PyMca5/PyMcaGui/__init__.py
@@ -1,5 +1,5 @@
#/*##########################################################################
-# Copyright (C) 2004-2014 V.A. Sole, European Synchrotron Radiation Facility
+# Copyright (C) 2004-2018 V.A. Sole, European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -39,7 +39,7 @@ def getPackages(directory):
packages += getPackages(dirName)
return packages
-from .plotting import PyMca_Icons, PyMcaPrintPreview
+from .plotting import PyMca_Icons
from .plotting.PyMca_Icons import IconDict
# this is the package level directory PyMcaGui
diff --git a/PyMca5/PyMcaGui/math/fitting/SimpleFitAllGui.py b/PyMca5/PyMcaGui/math/fitting/SimpleFitAllGui.py
index ee7e657..a6fd6f0 100644
--- a/PyMca5/PyMcaGui/math/fitting/SimpleFitAllGui.py
+++ b/PyMca5/PyMcaGui/math/fitting/SimpleFitAllGui.py
@@ -113,6 +113,7 @@ class SimpleFitAllGui(SimpleFitGui):
w = SpecfitConfigGui.SpecfitConfigGui
SpecfitFunctions.WIDGET = [w for _t in SpecfitFunctions.THEORY]
fit.importFunctions(SpecfitFunctions)
+ fit.loadUserFunctions()
SimpleFitGui.__init__(self, parent, fit, graph, actions)
self.fitAllInstance = SimpleFitAll.SimpleFitAll(fit=self.fitModule)
diff --git a/PyMca5/PyMcaGui/math/fitting/SimpleFitGui.py b/PyMca5/PyMcaGui/math/fitting/SimpleFitGui.py
index 76753c4..19d73b2 100644
--- a/PyMca5/PyMcaGui/math/fitting/SimpleFitGui.py
+++ b/PyMca5/PyMcaGui/math/fitting/SimpleFitGui.py
@@ -136,6 +136,7 @@ class SimpleFitGui(qt.QWidget):
if fit is None:
self.fitModule = SimpleFitModule.SimpleFit()
self.fitModule.importFunctions(SimpleFitUserEstimatedFunctions)
+ self.fitModule.loadUserFunctions()
else:
self.fitModule = fit
if graph is None:
diff --git a/PyMca5/PyMcaGui/physics/xrf/XRFMCPyMca.py b/PyMca5/PyMcaGui/physics/xrf/XRFMCPyMca.py
index fd829bd..d19a8eb 100644
--- a/PyMca5/PyMcaGui/physics/xrf/XRFMCPyMca.py
+++ b/PyMca5/PyMcaGui/physics/xrf/XRFMCPyMca.py
@@ -2,7 +2,7 @@
#
# The PyMca X-Ray Fluorescence Toolkit
#
-# Copyright (c) 2004-2016 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2018 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -178,8 +178,9 @@ class XRFMCProgramFile(GetFileList):
filedialog.setWindowTitle("Select xmimsim-pymca executable")
filedialog.setDirectory(wdir)
filedialog.setModal(1)
- filedialog.setFileMode(filedialog.ExistingFiles)
if sys.platform == 'darwin':
+ filedialog.setFileMode(qt.QFileDialog.Directory)
+ filedialog.setOption(qt.QFileDialog.ShowDirsOnly)
filelist = filedialog.exec_()
if filelist:
filelist = filedialog.selectedFiles()
@@ -190,6 +191,7 @@ class XRFMCProgramFile(GetFileList):
"xmimsim-pymca")
filelist = [xmimsim]
else:
+ filedialog.setFileMode(qt.QFileDialog.ExistingFiles)
filelist = qt.QFileDialog.getOpenFileName(self,
"Selec xmimsim-pymca executable",
wdir,
diff --git a/PyMca5/PyMcaGui/plotting/MaskImageWidget.py b/PyMca5/PyMcaGui/plotting/MaskImageWidget.py
index f37405e..5116c8b 100644
--- a/PyMca5/PyMcaGui/plotting/MaskImageWidget.py
+++ b/PyMca5/PyMcaGui/plotting/MaskImageWidget.py
@@ -1123,7 +1123,7 @@ class MaskImageWidget(qt.QWidget):
numpy.uint8)
minValue, maxValue = self._getSelectionMinMax()
tmpData = numpy.array(self.__imageData, copy=True)
- tmpData[True - numpy.isfinite(self.__imageData)] = minValue
+ tmpData[~numpy.isfinite(self.__imageData)] = minValue
selectionMask[tmpData >= maxValue] = 1
self.setSelectionMask(selectionMask, plot=False)
self.plotImage(update=False)
@@ -1134,7 +1134,7 @@ class MaskImageWidget(qt.QWidget):
numpy.uint8)
minValue, maxValue = self._getSelectionMinMax()
tmpData = numpy.array(self.__imageData, copy=True)
- tmpData[True - numpy.isfinite(self.__imageData)] = maxValue
+ tmpData[~numpy.isfinite(self.__imageData)] = maxValue
selectionMask[tmpData >= maxValue] = 0
selectionMask[tmpData <= minValue] = 0
self.setSelectionMask(selectionMask, plot=False)
@@ -1146,7 +1146,7 @@ class MaskImageWidget(qt.QWidget):
numpy.uint8)
minValue, maxValue = self._getSelectionMinMax()
tmpData = numpy.array(self.__imageData, copy=True)
- tmpData[True - numpy.isfinite(self.__imageData)] = maxValue
+ tmpData[~numpy.isfinite(self.__imageData)] = maxValue
selectionMask[tmpData <= minValue] = 1
self.setSelectionMask(selectionMask, plot=False)
self.plotImage(update=False)
@@ -1249,23 +1249,25 @@ class MaskImageWidget(qt.QWidget):
self.__image = qimage
if self.__image.format() == qt.QImage.Format_Indexed8:
- pixmap0 = numpy.fromstring(qimage.bits().asstring(width * height),
- dtype = numpy.uint8)
+ pixmap0 = numpy.frombuffer(qimage.bits().asstring(width * height),
+ dtype=numpy.uint8)
pixmap = numpy.zeros((height * width, 4), numpy.uint8)
- pixmap[:,0] = pixmap0[:]
- pixmap[:,1] = pixmap0[:]
- pixmap[:,2] = pixmap0[:]
- pixmap[:,3] = 255
+ pixmap[:, 0] = pixmap0[:]
+ pixmap[:, 1] = pixmap0[:]
+ pixmap[:, 2] = pixmap0[:]
+ pixmap[:, 3] = 255
pixmap.shape = height, width, 4
else:
self.__image = self.__image.convertToFormat(qt.QImage.Format_ARGB32)
- pixmap = numpy.fromstring(self.__image.bits().asstring(width * height * 4),
- dtype = numpy.uint8)
- pixmap.shape = height, width,-1
+ pixmap0 = numpy.frombuffer(self.__image.bits().asstring(width * height * 4),
+ dtype=numpy.uint8)
+ pixmap = numpy.array(pixmap0, copy=True)
+ pixmap.shape = height, width, -1
# Qt uses BGRA, convert to RGBA
- tmpBuffer = numpy.array(pixmap[:,:,0], copy=True, dtype=pixmap.dtype)
- pixmap[:,:,0] = pixmap[:,:,2]
- pixmap[:,:,2] = tmpBuffer
+ tmpBuffer = numpy.array(pixmap[:, :, 0],
+ copy=True, dtype=pixmap.dtype)
+ pixmap[:, :, 0] = pixmap[:, :, 2]
+ pixmap[:, :, 2] = tmpBuffer
if data is None:
self.__imageData = numpy.zeros((height, width), numpy.float)
@@ -2230,8 +2232,8 @@ def test(filename=None, backend=None):
container.setImageData(data, xScale=(1000.0, 1.0), yScale=(1000., 1.))
mask = (data*0).astype(numpy.uint8)
n, m = data.shape
- mask[ n/4:n/4+n/8, m/4:m/4+m/8] = 1
- mask[ 3*n/4:3*n/4+n/8, m/4:m/4+m/8] = 2
+ mask[ n//4 : n//4 + n//8, m//4 : m//4 + m//8] = 1
+ mask[ 3*n//4 : 3*n//4 + n//8, m//4 : m//4 + m//8] = 2
container.setSelectionMask(mask, plot=True)
#data.shape = 100, 400
#container.setImageData(None)
diff --git a/PyMca5/PyMcaGui/plotting/PlotWidget.py b/PyMca5/PyMcaGui/plotting/PlotWidget.py
index 93c77f9..d6282a8 100644
--- a/PyMca5/PyMcaGui/plotting/PlotWidget.py
+++ b/PyMca5/PyMcaGui/plotting/PlotWidget.py
@@ -32,35 +32,53 @@ import os
from PyMca5.PyMcaGraph import Plot
SVG = True
-if "PySide" in sys.modules:
+if "PySide.QtCore" in sys.modules:
from PySide import QtCore, QtGui
try:
from PySide import QtSvg
except ImportError:
SVG = False
-elif ("PyQt5" in sys.modules) or ("PyQt5" in sys.argv):
- from PyQt5 import QtCore, QtGui, QtWidgets
+elif "PySide2.QtCore" in sys.modules:
+ from PySide2 import QtCore, QtGui, QtWidgets
QtGui.QApplication = QtWidgets.QApplication
QtGui.QMainWindow = QtWidgets.QMainWindow
QtGui.QWidget = QtWidgets.QWidget
QtGui.QVBoxLayout = QtWidgets.QVBoxLayout
QtGui.qApp = QtWidgets.qApp
try:
- from PyQt5.QtPrintSupport import QPrinter, QPrintDialog
+ from PySide2.QtPrintSupport import QPrinter, QPrintDialog
QtGui.QPrinter = QPrinter
QtGui.QPrintDialog = QPrintDialog
except ImportError:
print("PyQt5 No print support available")
try:
- from PyQt5 import QtSvg
+ from PySide2 import QtSvg
except ImportError:
SVG = False
-else:
+elif ("PyQt4.QtCore" in sys.modules) or ("PyQt4" in sys.argv):
from PyQt4 import QtCore, QtGui
try:
from PyQt4 import QtSvg
except ImportError:
SVG = False
+else:
+ from PyQt5 import QtCore, QtGui, QtWidgets
+ QtGui.QApplication = QtWidgets.QApplication
+ QtGui.QMainWindow = QtWidgets.QMainWindow
+ QtGui.QWidget = QtWidgets.QWidget
+ QtGui.QVBoxLayout = QtWidgets.QVBoxLayout
+ QtGui.qApp = QtWidgets.qApp
+ try:
+ from PyQt5.QtPrintSupport import QPrinter, QPrintDialog
+ QtGui.QPrinter = QPrinter
+ QtGui.QPrintDialog = QPrintDialog
+ except ImportError:
+ print("PyQt5 No print support available")
+ try:
+ from PyQt5 import QtSvg
+ except ImportError:
+ SVG = False
+
if not hasattr(QtCore, "Signal"):
QtCore.Signal = QtCore.pyqtSignal
diff --git a/PyMca5/PyMcaGui/plotting/PyMca_Icons.py b/PyMca5/PyMcaGui/plotting/PyMca_Icons.py
index 17854e7..56fdc97 100644
--- a/PyMca5/PyMcaGui/plotting/PyMca_Icons.py
+++ b/PyMca5/PyMcaGui/plotting/PyMca_Icons.py
@@ -30,7 +30,6 @@ __copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
import logging
import sys
-from PyMca5.PyMcaGui import PyMcaQt as qt
if sys.version_info < (3, ):
from collections import MutableMapping
@@ -4056,7 +4055,7 @@ TRANSLATION_TABLE = {
"peak": "math-peak",
"peakreset": "math-peak-reset",
"peaksearch": "math-peak-search",
- "roi": "plot-roi",
+ #"roi": "plot-roi",
"roireset": "plot-roi-reset",
"selected": "selected",
#"unselected": unselected,
@@ -4117,15 +4116,7 @@ class _PatchedIconDict(MutableMapping):
"""
def __init__(self, *args, **kw):
self._unpatched_icons = dict(*args, **kw)
- try:
- from silx.gui import icons as silx_icons
- except ImportError:
- _logger.debug("Could not import silx. Legacy icons will be used.")
- silx_icons = None
-
- self._silx_icons = silx_icons
- # keep an internal copy:
- self._translation_table = TRANSLATION_TABLE.copy()
+ self.__initialized = False
def __iter__(self):
for key in self._unpatched_icons:
@@ -4136,6 +4127,19 @@ class _PatchedIconDict(MutableMapping):
return len(self._unpatched_icons)
def __getitem__(self, key):
+ if not self.__initialized:
+ from PyMca5.PyMcaGui import PyMcaQt as qt
+ self._qt = qt
+ try:
+ from silx.gui import icons as silx_icons
+ except ImportError:
+ _logger.debug("Could not import silx. Legacy icons will be used.")
+ silx_icons = None
+
+ self._silx_icons = silx_icons
+ # keep an internal copy:
+ self._translation_table = TRANSLATION_TABLE.copy()
+ self.__initialized = True
if key not in self._unpatched_icons:
raise KeyError("Unknown icon '%s'" % key)
@@ -4145,7 +4149,7 @@ class _PatchedIconDict(MutableMapping):
key)
return self._unpatched_icons[key]
- if qt.QApplication.instance() is None:
+ if self._qt.QApplication.instance() is None:
_logger.warning("Cannot fetch QPixmap without a QApplication."
" Using legacy PyMca icon as fallback.")
return self._unpatched_icons[key]
@@ -4173,7 +4177,6 @@ class _PatchedIconDict(MutableMapping):
# we also need to remove the key from internal translation table
del self._translation_table[key]
-
IconDict = _PatchedIconDict(IconDict0)
@@ -4199,6 +4202,7 @@ def showIcons():
return w
if __name__ == '__main__':
+ from PyMca5.PyMcaGui import PyMcaQt as qt
app = qt.QApplication(sys.argv)
app.lastWindowClosed.connect(app.quit)
logging.basicConfig()
diff --git a/PyMca5/PyMcaGui/pymca/ExternalImagesWindow.py b/PyMca5/PyMcaGui/pymca/ExternalImagesWindow.py
index 4791ce5..ab104d7 100644
--- a/PyMca5/PyMcaGui/pymca/ExternalImagesWindow.py
+++ b/PyMca5/PyMcaGui/pymca/ExternalImagesWindow.py
@@ -1,5 +1,5 @@
#/*##########################################################################
-# Copyright (C) 2004-2015 V.A. Sole, European Synchrotron Radiation Facility
+# Copyright (C) 2004-2018 V.A. Sole, European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -222,19 +222,23 @@ class ExternalImagesWindow(MaskImageWidget.MaskImageWidget):
if self._dynamic:
self._dynamicAction(index)
elif self._stack:
- self.setImageData(self.imageList[index])
+ # with matplotlib 2.2.2 the graph title is not updated
+ # if set after the image data
if self.imageNames is None:
self.graphWidget.graph.setGraphTitle("Image %d" % index)
else:
self.graphWidget.graph.setGraphTitle(self.imageNames[index])
+ self.setImageData(self.imageList[index])
else:
qimage = self._imageDict[self.imageNames[index]]
+ # with matplotlib 2.2.2 the graph title is not updated
+ # if set after the image data
+ self.graphWidget.graph.setGraphTitle(self.imageNames[index])
self.setQImage(qimage,
qimage.width(),
qimage.height(),
clearmask=False,
data=self.imageList[index])
- self.graphWidget.graph.setGraphTitle(self.imageNames[index])
if moveslider:
self.slider.setValue(index)
diff --git a/PyMca5/PyMcaGui/pymca/PyMcaMain.py b/PyMca5/PyMcaGui/pymca/PyMcaMain.py
index ab963c9..991a8b1 100644
--- a/PyMca5/PyMcaGui/pymca/PyMcaMain.py
+++ b/PyMca5/PyMcaGui/pymca/PyMcaMain.py
@@ -44,7 +44,8 @@ if __name__ == '__main__':
'qt=',
'backend=',
'nativefiledialogs=',
- 'PySide=']
+ 'PySide=',
+ 'binding=']
try:
opts, args = getopt.getopt(
sys.argv[1:],
@@ -57,6 +58,7 @@ if __name__ == '__main__':
keywords={}
debugreport = 0
qtversion = None
+ binding = None
for opt, arg in opts:
if opt in ('--spec'):
keywords['spec'] = arg
@@ -77,25 +79,49 @@ if __name__ == '__main__':
else:
nativeFileDialogs = False
elif opt in ('--PySide'):
+ print("Please use --binding=PySide")
import PySide.QtCore
- if qtversion == '3':
- raise NotImplementedError("Qt3 is no longer supported")
- elif qtversion == '4':
- try:
- import sip
- sip.setapi("QString", 2)
- sip.setapi("QVariant", 2)
- except:
- print("Cannot set sip API") # Console widget not available
- import PyQt4.QtCore
- elif qtversion == '5':
- try:
- import sip
- except:
- pass
- import PyQt5.QtCore
+ elif opt in ('--binding'):
+ binding = arg.lower()
+ if binding == "pyqt5":
+ import PyQt5.QtCore
+ elif binding == "pyqt4":
+ if sys.version_info < (3,):
+ try:
+ import sip
+ sip.setapi("QString", 2)
+ sip.setapi("QVariant", 2)
+ except:
+ print("Cannot set sip API")
+ import PyQt4.QtCore
+ elif binding == "pyside2":
+ import PySide2.QtCore
+ elif binding == "pyside":
+ import PySide.QtCore
+ else:
+ raise ValueError("Unknown Qt binding <%s>" % binding)
+ if binding is None:
+ if qtversion == '3':
+ raise NotImplementedError("Qt3 is no longer supported")
+ elif qtversion == '4':
+ if sys.version_info < (3,):
+ try:
+ import sip
+ sip.setapi("QString", 2)
+ sip.setapi("QVariant", 2)
+ except:
+ print("Cannot set sip API")
+ import PyQt4.QtCore
+ elif qtversion == '5':
+ import PyQt5.QtCore
from PyMca5.PyMcaGui import PyMcaQt as qt
+QTVERSION = qt.qVersion()
+if sys.platform == 'darwin':
+ if backend is not None:
+ if backend.lower() in ["gl", "opengl"]:
+ if hasattr(qt, 'QOpenGLWidget'):
+ print("Warning: OpenGL backend not fully supported")
try:
# try to import silx prior to import matplotlib
import silx.gui.plot
@@ -109,8 +135,6 @@ if hasattr(qt, "QString"):
else:
QString = qt.safe_str
-QTVERSION = qt.qVersion()
-
try:
from PyMca5.PyMcaGui.physics.xrf import XRFMCPyMca
XRFMC_FLAG = True
@@ -332,7 +356,7 @@ class PyMcaMain(PyMcaMdi.PyMcaMdi):
self.mcaWindow.showMaximized()
currentConfigDict = ConfigDict.ConfigDict()
try:
- defaultFileName = self.__getDefaultSettingsFile()
+ defaultFileName = PyMca5.getDefaultSettingsFile()
self.configDir = os.path.dirname(defaultFileName)
except:
if not ('fresh' in kw):
@@ -542,7 +566,7 @@ class PyMcaMain(PyMcaMdi.PyMcaMdi):
def _dispatcherRemoveSelectionSlot(self, dictOrList):
if DEBUG:
- print("self.dispatcherRemoveSelectionSlot(ddict), ddict = ",ddict)
+ print("self.dispatcherRemoveSelectionSlot(ddict), ddict = ", dictOrList)
if type(dictOrList) == type([]):
ddict = dictOrList[0]
else:
@@ -754,7 +778,7 @@ class PyMcaMain(PyMcaMdi.PyMcaMdi):
d = ConfigDict.ConfigDict()
d.update(config)
if filename is None:
- filename = self.__getDefaultSettingsFile()
+ filename = PyMca5.getDefaultSettingsFile()
d.write(filename)
def __configurePyMca(self, ddict):
@@ -1477,47 +1501,9 @@ class PyMcaMain(PyMcaMdi.PyMcaMdi):
def _saveAs(self, filename=None):
if filename is None:
- filename = self.__getDefaultSettingsFile()
+ filename = PyMca5.getDefaultSettingsFile()
self.saveConfig(self.getConfig(), filename)
- def __getDefaultSettingsFile(self):
- filename = "PyMca.ini"
- if sys.platform == 'win32':
- # recipe based on: http://bugs.python.org/issue1763#msg62242
- dll = ctypes.windll.shell32
- buf = ctypes.create_unicode_buffer(MAX_PATH + 1)
- if dll.SHGetSpecialFolderPathW(None, buf, 0x0005, False):
- directory = buf.value
- else:
- # the above should have worked
- home = os.getenv('USERPROFILE')
- try:
- l = len(home)
- directory = os.path.join(home, "My Documents")
- except:
- home = '\\'
- directory = '\\'
- #print home
- #print directory
- if os.path.isdir('%s' % directory):
- directory = os.path.join(directory, "PyMca")
- else:
- #print "My Documents is not there"
- directory = os.path.join(home, "PyMca")
- if not os.path.exists('%s' % directory):
- #print "PyMca directory not present"
- os.mkdir('%s' % directory)
- #print filename
- finalfile = os.path.join(directory, filename)
- #print finalfile
- else:
- home = os.getenv('HOME')
- directory = os.path.join(home, "PyMca")
- if not os.path.exists('%s' % directory):
- os.mkdir('%s' % directory)
- finalfile = os.path.join(directory, filename)
- return finalfile
-
def loadTrainingData(self):
try:
source = os.path.join(PyMcaDataDir.PYMCA_DATA_DIR,
diff --git a/PyMca5/PyMcaGui/pymca/QHDF5StackWizard.py b/PyMca5/PyMcaGui/pymca/QHDF5StackWizard.py
index dd27997..103c115 100644
--- a/PyMca5/PyMcaGui/pymca/QHDF5StackWizard.py
+++ b/PyMca5/PyMcaGui/pymca/QHDF5StackWizard.py
@@ -92,15 +92,17 @@ class FileListPage(qt.QWizardPage):
filedialog.setWindowTitle("Open a set of files")
filedialog.setDirectory(wdir)
if hasattr(filedialog, "setFilters"):
- filedialog.setFilters(["HDF5 Files (*.nxs *.h5 *.hdf)",
+ filedialog.setFilters(["HDF5 Files (*.nxs *.h5 *.hdf *.hdf5)",
"HDF5 Files (*.h5)",
"HDF5 Files (*.hdf)",
+ "HDF5 Files (*.hdf5)",
"HDF5 Files (*.nxs)",
"HDF5 Files (*)"])
else:
- filedialog.setNameFilters(["HDF5 Files (*.nxs *.h5 *.hdf)",
+ filedialog.setNameFilters(["HDF5 Files (*.nxs *.h5 *.hdf *.hdf5)",
"HDF5 Files (*.h5)",
"HDF5 Files (*.hdf)",
+ "HDF5 Files (*.hdf5)",
"HDF5 Files (*.nxs)",
"HDF5 Files (*)"])
filedialog.setModal(1)
diff --git a/PyMca5/PyMcaGui/pymca/QStackWidget.py b/PyMca5/PyMcaGui/pymca/QStackWidget.py
index a8a896c..36fe82a 100644
--- a/PyMca5/PyMcaGui/pymca/QStackWidget.py
+++ b/PyMca5/PyMcaGui/pymca/QStackWidget.py
@@ -34,6 +34,39 @@ import traceback
import numpy
import weakref
+if __name__ == "__main__":
+ # we have to get the Qt binding prior to import PyMcaQt
+ import getopt
+ options = ''
+ longoptions = ["fileindex=","old",
+ "filepattern=", "begin=", "end=", "increment=",
+ "nativefiledialogs=", "imagestack=", "image=",
+ "backend=", "binding="]
+ opts, args = getopt.getopt(
+ sys.argv[1:],
+ options,
+ longoptions)
+ binding = None
+ for opt, arg in opts:
+ if opt in ('--binding'):
+ binding = arg.lower()
+ if binding == "pyqt5":
+ import PyQt5.QtCore
+ elif binding == "pyqt4":
+ if sys.version_info < (3,):
+ try:
+ import sip
+ sip.setapi("QString", 2)
+ sip.setapi("QVariant", 2)
+ except:
+ print("Cannot set sip API")
+ import PyQt4.QtCore
+ elif binding == "pyside2":
+ import PySide2.QtCore
+ elif binding == "pyside":
+ import PySide.QtCore
+ else:
+ raise ValueError("Unknown Qt binding <%s>" % binding)
from PyMca5.PyMcaGui import PyMcaQt as qt
if hasattr(qt, "QString"):
QString = qt.QString
@@ -1224,12 +1257,6 @@ def test():
if __name__ == "__main__":
sys.excepthook = qt.exceptionHandler
- import getopt
- options = ''
- longoptions = ["fileindex=","old",
- "filepattern=", "begin=", "end=", "increment=",
- "nativefiledialogs=", "imagestack=", "image=",
- "backend="]
try:
opts, args = getopt.getopt(
sys.argv[1:],
diff --git a/PyMca5/PyMcaGui/pymca/RGBCorrelatorWidget.py b/PyMca5/PyMcaGui/pymca/RGBCorrelatorWidget.py
index c460114..5057b12 100644
--- a/PyMca5/PyMcaGui/pymca/RGBCorrelatorWidget.py
+++ b/PyMca5/PyMcaGui/pymca/RGBCorrelatorWidget.py
@@ -896,18 +896,20 @@ class RGBCorrelatorWidget(qt.QWidget):
height = qimage.height()
width = qimage.width()
if qimage.format() == qt.QImage.Format_Indexed8:
- pixmap0 = numpy.fromstring(qimage.bits().asstring(width * height),
- dtype = numpy.uint8)
+ pixmap0 = numpy.frombuffer(qimage.bits().asstring(width * height),
+ dtype=numpy.uint8)
pixmap = numpy.zeros((height * width, 4), numpy.uint8)
- pixmap[:,0] = pixmap0[:]
- pixmap[:,1] = pixmap0[:]
- pixmap[:,2] = pixmap0[:]
- pixmap[:,3] = 255
+ pixmap[:, 0] = pixmap0[:]
+ pixmap[:, 1] = pixmap0[:]
+ pixmap[:, 2] = pixmap0[:]
+ pixmap[:, 3] = 255
pixmap.shape = height, width, 4
else:
image = qimage.convertToFormat(qt.QImage.Format_ARGB32)
- pixmap = numpy.fromstring(qimage.bits().asstring(width * height * 4),
- dtype = numpy.uint8)
+ pixmap0 = numpy.frombuffer(image.bits().asstring(width * height * 4),
+ dtype=numpy.uint8)
+ pixmap = numpy.array(pixmap0, copy=True)
+
pixmap.shape = height, width, -1
data = pixmap[:,:,0] * 0.114 +\
pixmap[:,:,1] * 0.587 +\
diff --git a/PyMca5/PyMcaGui/pymca/StackSelector.py b/PyMca5/PyMcaGui/pymca/StackSelector.py
index 65a79ce..8cddcb1 100644
--- a/PyMca5/PyMcaGui/pymca/StackSelector.py
+++ b/PyMca5/PyMcaGui/pymca/StackSelector.py
@@ -1,6 +1,6 @@
#!/usr/bin/env python
#/*##########################################################################
-# Copyright (C) 2004-2017 V.A. Sole, European Synchrotron Radiation Facility
+# Copyright (C) 2004-2018 V.A. Sole, European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -279,7 +279,7 @@ class StackSelector(object):
stack = SupaVisioMap.SupaVisioMap(args[0])
elif args[0][-3:].upper() in ["RBS"]:
stack = SupaVisioMap.SupaVisioMap(args[0])
- elif args[0][-3:].lower() in [".h5", "nxs", "hdf"]:
+ elif args[0][-3:].lower() in [".h5", "nxs", "hdf", "hdf5"]:
if not HDF5:
raise IOError(\
"No HDF5 support while trying to read an HDF5 file")
@@ -357,7 +357,7 @@ class StackSelector(object):
"Image Files (*edf *ccd *raw *edf.gz *ccd.gz *raw.gz *cbf)",
"Image Files (*tif *tiff *TIF *TIFF)",
"TextImage Files (*txt)",
- "HDF5 Files (*.nxs *.hdf *.h5)",
+ "HDF5 Files (*.nxs *.hdf *.hdf5 *.h5)",
"EDF Files (*ccd)",
"Specfile Files (*mca)",
"Specfile Files (*dat)",
@@ -372,7 +372,7 @@ class StackSelector(object):
"MRC files (*.mrc *.st)",
"All Files (*)"]
if not HDF5:
- idx = fileTypeList.index("HDF5 Files (*.nxs *.hdf *.h5)")
+ idx = fileTypeList.index("HDF5 Files (*.nxs *.hdf *.hdf5 *.h5)")
del fileTypeList[idx]
message = "Open ONE indexed stack or SEVERAL files"
return self._getFileList(fileTypeList, message=message,
diff --git a/PyMca5/PyMcaIO/EdfFile.py b/PyMca5/PyMcaIO/EdfFile.py
index 418771f..481ca6e 100644
--- a/PyMca5/PyMcaIO/EdfFile.py
+++ b/PyMca5/PyMcaIO/EdfFile.py
@@ -2,7 +2,7 @@
#
# The PyMca X-Ray Fluorescence Toolkit
#
-# Copyright (c) 2004-2014 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2018 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -443,7 +443,7 @@ class EdfFile(object):
self.Images[Index].DataType = 'UnsignedShort'
try:
self.__data = numpy.reshape(
- numpy.fromstring(binary, numpy.uint16),
+ numpy.array(numpy.frombuffer(binary, numpy.uint16)),
(self.Images[Index].Dim2, self.Images[Index].Dim1))
except ValueError:
raise IOError('Size spec in ADSC-header does not match ' + \
@@ -636,14 +636,14 @@ class EdfFile(object):
sizeToRead = self.Images[Index].Dim1 * \
self.Images[Index].Dim2 * \
self.Images[Index].Dim3 * datasize
- Data = numpy.fromstring(self.File.read(sizeToRead),
- datatype)
+ Data = numpy.array(numpy.frombuffer(self.File.read(sizeToRead),
+ datatype))
Data = numpy.reshape(Data, (self.Images[Index].Dim3, self.Images[Index].Dim2, self.Images[Index].Dim1))
elif self.Images[Index].NumDim == 2:
sizeToRead = self.Images[Index].Dim1 * \
self.Images[Index].Dim2 * datasize
- Data = numpy.fromstring(self.File.read(sizeToRead),
- datatype)
+ Data = numpy.array(numpy.frombuffer(self.File.read(sizeToRead),
+ datatype))
#print "datatype = ",datatype
#print "Data.type = ", Data.dtype.char
#print "self.Images[Index].DataType ", self.Images[Index].DataType
@@ -654,8 +654,8 @@ class EdfFile(object):
Data = numpy.reshape(Data, (self.Images[Index].Dim2, self.Images[Index].Dim1))
elif self.Images[Index].NumDim == 1:
sizeToRead = self.Images[Index].Dim1 * datasize
- Data = numpy.fromstring(self.File.read(sizeToRead),
- datatype)
+ Data = numpy.array(numpy.frombuffer(self.File.read(sizeToRead),
+ datatype))
elif self.ADSC or self.MARCCD or self.PILATUS_CBF or self.SPE:
return self.__data[Pos[1]:(Pos[1] + Size[1]),
Pos[0]:(Pos[0] + Size[0])]
@@ -664,9 +664,9 @@ class EdfFile(object):
return data[Pos[1]:(Pos[1] + Size[1]),
Pos[0]:(Pos[0] + Size[0])]
elif fastedf and CAN_USE_FASTEDF:
- type = self.__GetDefaultNumpyType__(self.Images[Index].DataType, index=Index)
- size_pixel = self.__GetSizeNumpyType__(type)
- Data = numpy.array([], type)
+ type_ = self.__GetDefaultNumpyType__(self.Images[Index].DataType, index=Index)
+ size_pixel = self.__GetSizeNumpyType__(type_)
+ Data = numpy.array([], type_)
if self.Images[Index].NumDim == 1:
if Pos == None: Pos = (0,)
if Size == None: Size = (0,)
@@ -674,7 +674,7 @@ class EdfFile(object):
Size = list(Size)
if Size[0] == 0:Size[0] = sizex - Pos[0]
self.File.seek((Pos[0] * size_pixel) + self.Images[Index].DataPosition, 0)
- Data = numpy.fromstring(self.File.read(Size[0] * size_pixel), type)
+ Data = numpy.array(numpy.frombuffer(self.File.read(Size[0] * size_pixel), type_))
elif self.Images[Index].NumDim == 2:
if Pos == None: Pos = (0, 0)
if Size == None: Size = (0, 0)
@@ -682,7 +682,7 @@ class EdfFile(object):
sizex, sizey = self.Images[Index].Dim1, self.Images[Index].Dim2
if Size[0] == 0:Size[0] = sizex - Pos[0]
if Size[1] == 0:Size[1] = sizey - Pos[1]
- Data = numpy.zeros([Size[1], Size[0]], type)
+ Data = numpy.zeros([Size[1], Size[0]], type_)
self.File.seek((((Pos[1] * sizex) + Pos[0]) * size_pixel) + self.Images[Index].DataPosition, 0)
extended_fread(Data, Size[0] * size_pixel , numpy.array([Size[1]]),
numpy.array([sizex * size_pixel]) , self.File)
@@ -695,7 +695,7 @@ class EdfFile(object):
if Size[0] == 0:Size[0] = sizex - Pos[0]
if Size[1] == 0:Size[1] = sizey - Pos[1]
if Size[2] == 0:Size[2] = sizez - Pos[2]
- Data = numpy.zeros([Size[2], Size[1], Size[0]], type)
+ Data = numpy.zeros([Size[2], Size[1], Size[0]], type_)
self.File.seek(((((Pos[2] * sizey + Pos[1]) * sizex) + Pos[0]) * size_pixel) + self.Images[Index].DataPosition, 0)
extended_fread(Data, Size[0] * size_pixel , numpy.array([Size[2], Size[1]]),
numpy.array([ sizey * sizex * size_pixel , sizex * size_pixel]) , self.File)
@@ -703,9 +703,9 @@ class EdfFile(object):
else:
if fastedf:
print("I could not use fast routines")
- type = self.__GetDefaultNumpyType__(self.Images[Index].DataType, index=Index)
- size_pixel = self.__GetSizeNumpyType__(type)
- Data = numpy.array([], type)
+ type_ = self.__GetDefaultNumpyType__(self.Images[Index].DataType, index=Index)
+ size_pixel = self.__GetSizeNumpyType__(type_)
+ Data = numpy.array([], type_)
if self.Images[Index].NumDim == 1:
if Pos == None: Pos = (0,)
if Size == None: Size = (0,)
@@ -713,7 +713,7 @@ class EdfFile(object):
Size = list(Size)
if Size[0] == 0:Size[0] = sizex - Pos[0]
self.File.seek((Pos[0] * size_pixel) + self.Images[Index].DataPosition, 0)
- Data = numpy.fromstring(self.File.read(Size[0] * size_pixel), type)
+ Data = numpy.array(numpy.frombuffer(self.File.read(Size[0] * size_pixel), type_))
elif self.Images[Index].NumDim == 2:
if Pos == None: Pos = (0, 0)
if Size == None: Size = (0, 0)
@@ -723,11 +723,11 @@ class EdfFile(object):
if Size[1] == 0:Size[1] = sizey - Pos[1]
#print len(range(Pos[1],Pos[1]+Size[1])), "LECTURES OF ", Size[0], "POINTS"
#print "sizex = ", sizex, "sizey = ", sizey
- Data = numpy.zeros((Size[1], Size[0]), type)
+ Data = numpy.zeros((Size[1], Size[0]), type_)
dataindex = 0
for y in range(Pos[1], Pos[1] + Size[1]):
self.File.seek((((y * sizex) + Pos[0]) * size_pixel) + self.Images[Index].DataPosition, 0)
- line = numpy.fromstring(self.File.read(Size[0] * size_pixel), type)
+ line = numpy.array(numpy.frombuffer(self.File.read(Size[0] * size_pixel), type_))
Data[dataindex, :] = line[:]
#Data=numpy.concatenate((Data,line))
dataindex += 1
@@ -745,7 +745,7 @@ class EdfFile(object):
for z in range(Pos[2], Pos[2] + Size[2]):
for y in range(Pos[1], Pos[1] + Size[1]):
self.File.seek(((((z * sizey + y) * sizex) + Pos[0]) * size_pixel) + self.Images[Index].DataPosition, 0)
- line = numpy.fromstring(self.File.read(Size[0] * size_pixel), type)
+ line = numpy.array(numpy.frombuffer(self.File.read(Size[0] * size_pixel), type_))
Data = numpy.concatenate((Data, line))
Data = numpy.reshape(Data, (Size[2], Size[1], Size[0]))
@@ -776,9 +776,10 @@ class EdfFile(object):
size_img = size_row * self.Images[Index].Dim2
offset = offset + (Position[2] * size_img)
self.File.seek(self.Images[Index].DataPosition + offset, 0)
- Data = numpy.fromstring(self.File.read(size_pixel),
- self.__GetDefaultNumpyType__(self.Images[Index].DataType,
- index=Index))
+ Data = numpy.array(numpy.frombuffer(
+ self.File.read(size_pixel),
+ self.__GetDefaultNumpyType__(self.Images[Index].DataType,
+ index=Index)))
if self.SysByteOrder.upper() != self.Images[Index].ByteOrder.upper():
Data = Data.byteswap()
Data = self.__SetDataType__ (Data, "DoubleValue")
@@ -931,7 +932,7 @@ class EdfFile(object):
for i in Header.keys():
StrHeader = StrHeader + ("%s = %s ;\n" % (i, Header[i]))
self.Images[Index].Header[i] = Header[i]
- newsize = (((len(StrHeader) + 1) / HEADER_BLOCK_SIZE) + 1) * HEADER_BLOCK_SIZE - 2
+ newsize = (((len(StrHeader) + 1) // HEADER_BLOCK_SIZE) + 1) * HEADER_BLOCK_SIZE - 2
newsize = int(newsize)
StrHeader = StrHeader.ljust(newsize)
StrHeader = StrHeader + "}\n"
diff --git a/PyMca5/PyMcaIO/HDF5Stack1D.py b/PyMca5/PyMcaIO/HDF5Stack1D.py
index 2c41858..041bf1e 100644
--- a/PyMca5/PyMcaIO/HDF5Stack1D.py
+++ b/PyMca5/PyMcaIO/HDF5Stack1D.py
@@ -256,7 +256,10 @@ class HDF5Stack1D(DataObject.DataObject):
if self.__dtype in [numpy.int16, numpy.uint16]:
self.__dtype = numpy.float32
elif self.__dtype in [numpy.int32, numpy.uint32]:
- self.__dtype = numpy.float64
+ if mSelection:
+ self.__dtype = numpy.float32
+ else:
+ self.__dtype = numpy.float64
elif self.__dtype not in [numpy.float16, numpy.float32,
numpy.float64]:
# Some datasets form CLS (origin APS?) arrive as data format
@@ -266,7 +269,10 @@ class HDF5Stack1D(DataObject.DataObject):
if ("%s" % self.__dtype).endswith("2"):
self.__dtype = numpy.float32
else:
- self.__dtype = numpy.float64
+ if mSelection:
+ self.__dtype = numpy.float32
+ else:
+ self.__dtype = numpy.float64
# figure out the shape of the stack
shape = yDataset.shape
@@ -289,9 +295,14 @@ class HDF5Stack1D(DataObject.DataObject):
bytefactor = 8
neededMegaBytes = nFiles * dim0 * dim1 * (mcaDim * bytefactor/(1024*1024.))
- physicalMemory = PhysicalMemory.getPhysicalMemoryOrNone()
+ physicalMemory = None
+ if hasattr(PhysicalMemory, "getAvailablePhysicalMemoryOrNone"):
+ physicalMemory = PhysicalMemory.getAvailablePhysicalMemoryOrNone()
+ if not physicalMemory:
+ physicalMemory = PhysicalMemory.getPhysicalMemoryOrNone()
if physicalMemory is None:
- # 5 Gigabytes should be a good compromise
+ # 6 Gigabytes of available memory
+ # should be a good compromise in 2018
physicalMemory = 6000
else:
physicalMemory /= (1024*1024.)
@@ -300,6 +311,7 @@ class HDF5Stack1D(DataObject.DataObject):
if self.__dtype0 is None:
if (bytefactor == 8) and (neededMegaBytes < (2*physicalMemory)):
# try reading as float32
+ print("Forcing the use of float32 data")
self.__dtype = numpy.float32
else:
raise MemoryError("Force dynamic loading")
@@ -317,6 +329,8 @@ class HDF5Stack1D(DataObject.DataObject):
# some versions report ValueError instead of MemoryError
if (nFiles == 1) and (len(shape) == 3):
print("Attempting dynamic loading")
+ if mSelection is not None:
+ print("Ignoring monitor")
self.data = yDataset
if mSelection is not None:
mdtype = tmpHdf[mpath].dtype
diff --git a/PyMca5/PyMcaIO/MarCCD.py b/PyMca5/PyMcaIO/MarCCD.py
index fc37031..f2d0c8e 100644
--- a/PyMca5/PyMcaIO/MarCCD.py
+++ b/PyMca5/PyMcaIO/MarCCD.py
@@ -64,11 +64,11 @@ class MarCCD(object):
depth = info["depth"]
fd.seek(4096)
if depth == 1:
- data = numpy.fromstring(fd.read(nbytes), numpy.uint8)
+ data = numpy.array(numpy.frombuffer(fd.read(nbytes), numpy.uint8))
elif depth == 2:
- data = numpy.fromstring(fd.read(nbytes), numpy.uint16)
+ data = numpy.array(numpy.frombuffer(fd.read(nbytes), numpy.uint16))
elif depth == 4:
- data = numpy.fromstring(fd.read(nbytes), numpy.uint32)
+ data = numpy.array(numpy.frombuffer(fd.read(nbytes), numpy.uint32))
if swap:
data = data.byteswap()
data.shape = info["nfast"], info["nslow"]
@@ -155,7 +155,7 @@ class MccdHeader(object):
if 0:
self.__format = struct.unpack("256I", self.raw[0:256*4])
else:
- self.__format = numpy.fromstring(self.raw[0:256*4], numpy.uint32)
+ self.__format = numpy.array(numpy.frombuffer(self.raw[0:256*4], numpy.uint32))
def __unpack_gonio(self):
idx= 640
diff --git a/PyMca5/PyMcaIO/PilatusCBF.py b/PyMca5/PyMcaIO/PilatusCBF.py
index 5c5ebba..9c6f260 100644
--- a/PyMca5/PyMcaIO/PilatusCBF.py
+++ b/PyMca5/PyMcaIO/PilatusCBF.py
@@ -173,24 +173,27 @@ class PilatusCBF(object):
# lns = len(stream)
idx = stream.find(key16)
if idx == -1:
- listnpa.append(np.fromstring(stream, dtype="int8"))
+ listnpa.append(np.array(np.frombuffer(stream, dtype="int8")))
break
- listnpa.append(np.fromstring(stream[:idx], dtype="int8"))
+ listnpa.append(np.array(np.frombuffer(stream[:idx], dtype="int8")))
# position += listnpa[-1].size
if stream[idx + 1:idx + 3] == key32:
if stream[idx + 3:idx + 7] == key64:
- listnpa.append(np.fromstring(stream[idx + 7:idx + 15], dtype="int64"))
+ listnpa.append(np.array(np.frombuffer(stream[idx + 7:idx + 15],
+ dtype="int64")))
# position += 1
# print "loop64 x=%4i y=%4i in idx %4i lns %4i value=%s" % ((position % 2463), (position // 2463), idx, lns, listnpa[-1])
shift = 15
else: #32 bit int
- listnpa.append(np.fromstring(stream[idx + 3:idx + 7], dtype="int32"))
+ listnpa.append(np.array(np.frombuffer(stream[idx + 3:idx + 7],
+ dtype="int32")))
# position += 1
# print "loop32 x=%4i y=%4i in idx %4i lns %4i value=%s" % ((position % 2463), (position // 2463), idx, lns, listnpa[-1])
shift = 7
else: #int16
- listnpa.append(np.fromstring(stream[idx + 1:idx + 3], dtype="int16"))
+ listnpa.append(np.array(np.frombuffer(stream[idx + 1:idx + 3],
+ dtype="int16")))
# position += 1
# print "loop16 x=%4i y=%4i in idx %4i lns %4i value=%s" % ((position % 2463), (position // 2463), idx, lns, listnpa[-1])
shift = 3
diff --git a/PyMca5/PyMcaIO/SpecFileStack.py b/PyMca5/PyMcaIO/SpecFileStack.py
index 01e86bc..1b51b11 100644
--- a/PyMca5/PyMcaIO/SpecFileStack.py
+++ b/PyMca5/PyMcaIO/SpecFileStack.py
@@ -2,7 +2,7 @@
#
# The PyMca X-Ray Fluorescence Toolkit
#
-# Copyright (c) 2004-2017 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2018 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -110,10 +110,19 @@ class SpecFileStack(DataObject.DataObject):
iterlist = [1]
if SLOW_METHOD and shape is None:
self.data = numpy.zeros((self.nbFiles,
- nmca / numberofdetectors,
+ nmca // numberofdetectors,
arrRet.shape[0]),
arrRet.dtype.char)
filecounter = 0
+ if "McaLiveTime" in info:
+ nTimes = self.nbFiles * (nmca // numberofdetectors)
+ self.info["McaLiveTime"] = numpy.zeros((nTimes,),
+ numpy.float32)
+ if "McaElapsedTime" in info:
+ nTimes = self.nbFiles * (nmca // numberofdetectors)
+ self.info["McaElapsedTime"] = numpy.zeros((nTimes,),
+ numpy.float32)
+ nTimes = -1
for tempFileName in filelist:
tempInstance = SpecFileDataSource.SpecFileDataSource(tempFileName)
mca_number = -1
@@ -122,16 +131,22 @@ class SpecFileStack(DataObject.DataObject):
numberofmca = info['NbMca']
if numberofmca <= 0:
continue
+ # only the last mca is read
key = "%s.1.%s" % (keyindex, numberofmca)
dataObject = tempInstance._getMcaData(key)
arrRet = dataObject.data
mca_number += 1
+ nTimes += 1
for i in iterlist:
# mcadata = scan_obj.mca(i)
self.data[filecounter,
mca_number,
:] = arrRet[:]
self.incrProgressBar += 1
+ for timeKey in ["McaElapsedTime", "McaLiveTime"]:
+ if timeKey in dataObject.info:
+ self.info[timeKey][nTimes] = \
+ dataObject.info[timeKey]
self.onProgress(self.incrProgressBar)
filecounter += 1
elif shape is None and (self.nbFiles == 1) and (iterlist == [1]):
@@ -142,6 +157,9 @@ class SpecFileStack(DataObject.DataObject):
numberofmca,
arrRet.shape[0]),
arrRet.dtype.char)
+ # when reading fast we do not read the time information
+ # therefore we have to remove it from the info
+ self._cleanupTimeInfo()
for tempFileName in filelist:
tempInstance = specfile.Specfile(tempFileName)
# it can only be here if there is one scan per file
@@ -159,9 +177,12 @@ class SpecFileStack(DataObject.DataObject):
filecounter = 1
elif shape is None:
# it can only be here if there is one scan per file
+ # when reading fast we do not read the time information
+ # therefore we have to remove it from the info
+ self._cleanupTimeInfo()
try:
self.data = numpy.zeros((self.nbFiles,
- numberofmca / numberofdetectors,
+ numberofmca // numberofdetectors,
arrRet.shape[0]),
arrRet.dtype.char)
filecounter = 0
@@ -254,6 +275,8 @@ class SpecFileStack(DataObject.DataObject):
else:
raise
else:
+ # time information not read
+ self._cleanupTimeInfo()
sampling_order = 1
s0 = shape[0]
s1 = shape[1]
@@ -381,6 +404,11 @@ class SpecFileStack(DataObject.DataObject):
self.info["NumberOfFiles"] = self.__nFiles * 1
self.info["FileIndex"] = fileindex
+ def _cleanupTimeInfo(self):
+ for timeKey in ["McaElapsedTime", "McaLiveTime"]:
+ if timeKey in self.info:
+ del self.info[timeKey]
+
def onBegin(self, n):
pass
diff --git a/PyMca5/PyMcaIO/TiffIO.py b/PyMca5/PyMcaIO/TiffIO.py
index 0abf418..c564135 100644
--- a/PyMca5/PyMcaIO/TiffIO.py
+++ b/PyMca5/PyMcaIO/TiffIO.py
@@ -30,6 +30,7 @@ __author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+__date__ = "25/06/2018"
import sys
import os
@@ -45,6 +46,7 @@ TAG_ID = { 256:"NumberOfColumns", # S or L ImageWidth
259:"Compression", # SHORT (1 - NoCompression, ...
262:"PhotometricInterpretation", # SHORT (0 - WhiteIsZero, 1 -BlackIsZero, 2 - RGB, 3 - Palette color
270:"ImageDescription", # ASCII
+ 272:"Model", # ASCII
273:"StripOffsets", # S or L, for each strip, the byte offset of the strip
277:"SamplesPerPixel", # SHORT (>=3) only for RGB images
278:"RowsPerStrip", # S or L, number of rows in each back may be not for the last
@@ -62,6 +64,7 @@ TAG_BITS_PER_SAMPLE = 258
TAG_PHOTOMETRIC_INTERPRETATION = 262
TAG_COMPRESSION = 259
TAG_IMAGE_DESCRIPTION = 270
+TAG_MODEL = 272
TAG_STRIP_OFFSETS = 273
TAG_SAMPLES_PER_PIXEL = 277
TAG_ROWS_PER_STRIP = 278
@@ -151,7 +154,7 @@ class TiffIO(object):
else:
raise IOError("File is not a Mar CCD file, nor a TIFF file")
a = fd.read(2)
- fortyTwo = struct.unpack(self._structChar+"H",a)[0]
+ fortyTwo = struct.unpack(self._structChar + "H", a)[0]
if fortyTwo != 42:
raise IOError("Invalid TIFF version %d" % fortyTwo)
else:
@@ -184,7 +187,7 @@ class TiffIO(object):
if self._access is None:
# we do not own the file
# open in read mode
- newFile = open(fileName,'rb')
+ newFile = open(fileName, 'rb')
else:
newFile = open(fileName, self._access)
self.fd = newFile
@@ -272,7 +275,13 @@ class TiffIO(object):
ftype, vfmt = FIELD_TYPE[fieldType]
if ftype not in ['ASCII', 'RATIONAL', 'SRATIONAL']:
vfmt = st + vfmt
- actualValue = struct.unpack(vfmt, valueOffset[0: struct.calcsize(vfmt)])[0]
+ data = valueOffset[0: struct.calcsize(vfmt)]
+ if struct.calcsize(vfmt) > len(data):
+ # I do not see how I can enter here
+ # Add a 0 padding to have the expected size
+ print("WARNING: Data at tag id '%s' is smaller than expected", tagID)
+ data = data + b"\x00" * (struct.calcsize(vfmt) - len(data))
+ actualValue = struct.unpack(vfmt, data)[0]
valueOffsetList.append(actualValue)
else:
valueOffsetList.append(valueOffset)
@@ -294,8 +303,6 @@ class TiffIO(object):
# print("valueOffset = %s" % valueOffset)
return tagIDList, fieldTypeList, nValuesList, valueOffsetList
-
-
def _readIFDEntry(self, tag, tagIDList, fieldTypeList, nValuesList, valueOffsetList):
fd = self.fd
st = self._structChar
@@ -374,13 +381,15 @@ class TiffIO(object):
if nValuesList[idx] != 1:
# this happens with RGB and friends, nBits is not a single value
nBits = self._readIFDEntry(TAG_BITS_PER_SAMPLE,
- tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ tagIDList, fieldTypeList, nValuesList,
+ valueOffsetList)
if TAG_COLORMAP in tagIDList:
idx = tagIDList.index(TAG_COLORMAP)
tmpColormap = self._readIFDEntry(TAG_COLORMAP,
- tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ tagIDList, fieldTypeList, nValuesList,
+ valueOffsetList)
if max(tmpColormap) > 255:
tmpColormap = numpy.array(tmpColormap, dtype=numpy.uint16)
tmpColormap = (tmpColormap / 256.).astype(numpy.uint8)
@@ -423,9 +432,15 @@ class TiffIO(object):
imageDescription = self._readIFDEntry(TAG_IMAGE_DESCRIPTION,
tagIDList, fieldTypeList, nValuesList, valueOffsetList)
if type(imageDescription) in [type([1]), type((1,))]:
- imageDescription =helpString.join(imageDescription)
+ imageDescription = helpString.join(imageDescription)
else:
- imageDescription = "%d/%d" % (nImage+1, len(self._IFD))
+ imageDescription = "%d/%d" % (nImage + 1, len(self._IFD))
+
+ if TAG_MODEL in tagIDList:
+ model = self._readIFDEntry(TAG_MODEL,
+ tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ else:
+ model = None
defaultSoftware = "Unknown Software"
@@ -454,12 +469,15 @@ class TiffIO(object):
date = self._readIFDEntry(TAG_DATE,
tagIDList, fieldTypeList, nValuesList, valueOffsetList)
if type(date) in [type([1]), type((1,))]:
- date =helpString.join(date)
+ date = helpString.join(date)
else:
date = "Unknown Date"
stripOffsets = self._readIFDEntry(TAG_STRIP_OFFSETS,
- tagIDList, fieldTypeList, nValuesList, valueOffsetList)
+ tagIDList,
+ fieldTypeList,
+ nValuesList,
+ valueOffsetList)
if TAG_ROWS_PER_STRIP in tagIDList:
rowsPerStrip = self._readIFDEntry(TAG_ROWS_PER_STRIP,
tagIDList, fieldTypeList, nValuesList, valueOffsetList)[0]
@@ -511,6 +529,8 @@ class TiffIO(object):
info["colormap"] = colormap
info["sampleFormat"] = sampleFormat
info["photometricInterpretation"] = interpretation
+ if model is not None:
+ info["model"] = model
infoDict = {}
testString = 'PyMca'
@@ -663,22 +683,24 @@ class TiffIO(object):
rowStart = 0
if len(stripOffsets) == 1:
- bytesPerRow = int(stripByteCounts[0]/rowsPerStrip)
+ bytesPerRow = int(stripByteCounts[0] / rowsPerStrip)
+ nBytes = stripByteCounts[0]
if nRows == rowsPerStrip:
- actualBytesPerRow = int(image.nbytes/nRows)
+ actualBytesPerRow = int(image.nbytes / nRows)
if actualBytesPerRow != bytesPerRow:
print("Warning: Bogus StripByteCounts information")
bytesPerRow = actualBytesPerRow
+ nBytes = (rowMax-rowMin+1) * bytesPerRow
fd.seek(stripOffsets[0] + rowMin * bytesPerRow)
- nBytes = (rowMax-rowMin+1) * bytesPerRow
if self._swap:
- readout = numpy.fromstring(fd.read(nBytes), dtype).byteswap()
+ readout = numpy.array(numpy.frombuffer(fd.read(nBytes), dtype)).byteswap()
else:
- readout = numpy.fromstring(fd.read(nBytes), dtype)
+ readout = numpy.array(numpy.frombuffer(fd.read(nBytes), dtype))
if hasattr(nBits, 'index'):
readout.shape = -1, nColumns, len(nBits)
elif info['colormap'] is not None:
readout = colormap[readout]
+ readout.shape = -1, nColumns, 3
else:
readout.shape = -1, nColumns
image[rowMin:rowMax+1, :] = readout
@@ -686,7 +708,7 @@ class TiffIO(object):
for i in range(len(stripOffsets)):
# the amount of rows
nRowsToRead = rowsPerStrip
- rowEnd = int(min(rowStart+nRowsToRead, nRows))
+ rowEnd = int(min(rowStart + nRowsToRead, nRows))
if rowEnd < rowMin:
rowStart += nRowsToRead
continue
@@ -707,25 +729,27 @@ class TiffIO(object):
# intermediate buffer
tmpBuffer = fd.read(nBytes)
while readBytes < nBytes:
- n = struct.unpack('b', tmpBuffer[readBytes:(readBytes+1)])[0]
+ n = struct.unpack('b',
+ tmpBuffer[readBytes:(readBytes + 1)])[0]
readBytes += 1
if n >= 0:
# should I prevent reading more than the
# length of the chain? Let's python raise
# the exception...
bufferBytes += tmpBuffer[readBytes:\
- readBytes+(n+1)]
- readBytes += (n+1)
+ readBytes + (n + 1)]
+ readBytes += (n + 1)
elif n > -128:
- bufferBytes += (-n+1) * tmpBuffer[readBytes:(readBytes+1)]
+ bufferBytes += (-n + 1) * \
+ tmpBuffer[readBytes:(readBytes + 1)]
readBytes += 1
else:
# if read -128 ignore the byte
continue
if self._swap:
- readout = numpy.fromstring(bufferBytes, dtype).byteswap()
+ readout = numpy.array(numpy.frombuffer(bufferBytes, dtype)).byteswap()
else:
- readout = numpy.fromstring(bufferBytes, dtype)
+ readout = numpy.array(numpy.frombuffer(bufferBytes, dtype))
if hasattr(nBits, 'index'):
readout.shape = -1, nColumns, len(nBits)
elif info['colormap'] is not None:
@@ -738,9 +762,9 @@ class TiffIO(object):
if 1:
# use numpy
if self._swap:
- readout = numpy.fromstring(fd.read(nBytes), dtype).byteswap()
+ readout = numpy.array(numpy.frombuffer(fd.read(nBytes), dtype)).byteswap()
else:
- readout = numpy.fromstring(fd.read(nBytes), dtype)
+ readout = numpy.array(numpy.frombuffer(fd.read(nBytes), dtype))
if hasattr(nBits, 'index'):
readout.shape = -1, nColumns, len(nBits)
elif colormap is not None:
@@ -773,8 +797,8 @@ class TiffIO(object):
image[:, :, 1] * 0.587 + \
image[:, :, 2] * 0.299).astype(numpy.float32)
- if (rowMin == 0) and (rowMax == (nRows-1)):
- self._imageDataCacheIndex.insert(0,nImage)
+ if (rowMin == 0) and (rowMax == (nRows - 1)):
+ self._imageDataCacheIndex.insert(0, nImage)
self._imageDataCache.insert(0, image)
if len(self._imageDataCacheIndex) > self._maxImageCacheLength:
self._imageDataCacheIndex = self._imageDataCacheIndex[:self._maxImageCacheLength]
@@ -1034,7 +1058,7 @@ class TiffIO(object):
bitsPerSample * nChannels / 8)
if descriptionLength > 4:
- stripOffsets0 = endOfFile + dateLength + descriptionLength +\
+ stripOffsets0 = endOfFile + dateLength + descriptionLength + \
2 + 12 * nDirectoryEntries + 4
else:
stripOffsets0 = endOfFile + dateLength + \
@@ -1063,7 +1087,7 @@ class TiffIO(object):
value = stripOffsets0 + i * stripByteCounts
stripOffsets.append(value)
if i == 0:
- stripOffsetsString = struct.pack(fmt, value)
+ stripOffsetsString = struct.pack(fmt, value)
stripByteCountsString = struct.pack(fmt, stripByteCounts)
else:
stripOffsetsString += struct.pack(fmt, value)
@@ -1269,7 +1293,7 @@ if __name__ == "__main__":
tif = None
if os.path.exists(filename):
print("Testing image appending")
- tif = TiffIO(filename, mode = 'rb+')
+ tif = TiffIO(filename, mode='rb+')
tif.writeImage((data * 2).astype(dtype), info={'Title': '2nd'})
tif = None
tif = TiffIO(filename)
diff --git a/PyMca5/PyMcaMath/fitting/SimpleFitModule.py b/PyMca5/PyMcaMath/fitting/SimpleFitModule.py
index ceff61c..6cfde86 100644
--- a/PyMca5/PyMcaMath/fitting/SimpleFitModule.py
+++ b/PyMca5/PyMcaMath/fitting/SimpleFitModule.py
@@ -34,12 +34,18 @@ import sys
import os
import numpy
import copy
+import logging
+import glob
import types
from . import Gefit
from . import SpecfitFuns
+from PyMca5 import getDefaultUserFitFunctionsDirectory
+
+_logger = logging.getLogger(__name__)
DEBUG = 0
+
class SimpleFit(object):
def __init__(self):
#no data available by default
@@ -221,6 +227,11 @@ class SimpleFit(object):
except:
raise ValueError("Cannot interprete/find %s" % modname)
+ if isinstance(newfun.THEORY, dict):
+ # silx fit theories
+ self._importSilxFunctions(newfun)
+ return
+
theory = newfun.THEORY
function=newfun.FUNCTION
parameters = newfun.PARAMETERS
@@ -241,11 +252,10 @@ class SimpleFit(object):
except:
widget=None
- basename = os.path.basename(newfun.__file__)
-
for i in range(len(theory)):
ddict = {}
functionName = theory[i]
+ ddict['signature'] = 'pymca'
ddict['function'] = function[i]
ddict['parameters'] = parameters[i]
ddict['default_parameters'] = None
@@ -270,6 +280,80 @@ class SimpleFit(object):
self._fitConfiguration['functions'][functionName] = ddict
self._fitConfiguration['fit']['functions'].append(functionName)
+ def _importSilxFunctions(self, mod):
+ """
+ :param mod: Module defining silx fit theories
+ """
+ theoryDict = mod.THEORY
+
+ for name, theory in theoryDict.items():
+ assert not theory.pymca_legacy,\
+ "It makes no sense to wrap a PyMca fit theory " +\
+ "in a silx theory to load it back in PyMca"
+ ddict = {}
+ functionName = name
+ ddict['signature'] = 'silx'
+ ddict['function'] = self._wrapSilxFunction(theory.function)
+ ddict['parameters'] = theory.parameters
+ ddict['default_parameters'] = None
+ ddict['estimate'] = self._wrapSilxEstimate(theory.estimate)
+ ddict['derivative'] = self._wrapSilxDerivate(theory.derivative)
+ ddict['configure'] = theory.configure
+ ddict['widget'] = None
+ ddict['file'] = mod.__file__
+ ddict['configuration'] = {}
+ if theory.configure is not None:
+ ddict['configuration'] = theory.configure()
+ if ddict['estimate'] is None:
+ ddict['configuration']['estimation'] = None
+ self._fitConfiguration['functions'][functionName] = ddict
+ self._fitConfiguration['fit']['functions'].append(functionName)
+
+ def _wrapSilxEstimate(self, f):
+ if f is None:
+ return None
+
+ def wrapped(xx, yy, zzz, xscaling=1.0, yscaling=None):
+ estimated_param, constraints = f(xx, yy - zzz)
+ pymca_constraints = numpy.array(constraints).transpose()
+ return estimated_param, pymca_constraints
+ return wrapped
+
+ def _wrapSilxFunction(self, f):
+ if f is None:
+ return None
+
+ def wrapped(pars, x):
+ return f(x, *pars)
+ return wrapped
+
+ def _wrapSilxDerivate(self, f):
+ if f is None:
+ return None
+
+ def wrapped(parameters, index, x):
+ return f(x, parameters, index)
+ return wrapped
+
+ def loadUserFunctions(self):
+ userDirectory = getDefaultUserFitFunctionsDirectory()
+ fileList = glob.glob(os.path.join(userDirectory, "*.py"))
+ # simple filter to prevent unnecessary imports
+ filteredFileList = []
+ for fname in fileList:
+ # in Python 3, rb implies bytes and not strings
+ with open(fname, 'r') as f:
+ for line in f:
+ if line.strip().startswith("THEORY"):
+ filteredFileList.append(fname)
+ break
+ for fname in filteredFileList:
+ try:
+ self.importFunctions(fname)
+ except:
+ _logger.error("Could not import user fit functions %s",
+ fname)
+
def setFitFunction(self, name):
if name in [None, "None", "NONE"]:
self._fitConfiguration['fit']['fit_function'] = "None"
diff --git a/PyMca5/PyMcaMisc/PhysicalMemory.py b/PyMca5/PyMcaMisc/PhysicalMemory.py
index 375df81..32ba9dd 100644
--- a/PyMca5/PyMcaMisc/PhysicalMemory.py
+++ b/PyMca5/PyMcaMisc/PhysicalMemory.py
@@ -2,7 +2,7 @@
#
# The PyMca X-Ray Fluorescence Toolkit
#
-# Copyright (c) 2004-2017 European Synchrotron Radiation Facility
+# Copyright (c) 2004-2018 European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -81,14 +81,34 @@ if sys.platform == 'win32':
self.dwLength = ctypes.sizeof(self)
super(MEMORYSTATUSEX, self).__init__()
- #print("MemoryLoad: %d%%" % (stat.dwMemoryLoad))
- #print("Physical memory = %d" % stat.ullTotalPhys)
- #print(stat.ullAvailPhys)
def getPhysicalMemory():
+ #print("MemoryLoad: %d%%" % (stat.dwMemoryLoad))
+ #print("Physical memory = %d" % stat.ullTotalPhys)
+ #print(stat.ullAvailPhys)
stat = MEMORYSTATUSEX()
ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
return stat.ullTotalPhys
+ def getAvailablePhysicalMemory():
+ stat = MEMORYSTATUSEX()
+ ctypes.windll.kernel32.GlobalMemoryStatusEx(ctypes.byref(stat))
+ value = stat.ullAvailPhys
+ return value
+
+ def getAvailablePhysicalMemoryOrNone():
+ try:
+ value = getAvailablePhysicalMemory()
+ if value < 0:
+ # Value makes no sense.
+ # return None as requested in case of failure
+ print("WARNING: Returned physical memory does not make sense %d" % \
+ value)
+ return None
+ else:
+ return value
+ except:
+ return None
+
elif sys.platform.startswith('linux'):
def getPhysicalMemory():
return os.sysconf('SC_PAGESIZE') * os.sysconf('SC_PHYS_PAGES')
diff --git a/PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.c b/PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.c
deleted file mode 100644
index 4490d69..0000000
--- a/PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.c
+++ /dev/null
@@ -1,22222 +0,0 @@
-/* Generated by Cython 0.19.1 on Thu Nov 05 18:57:52 2015 */
-
-#define PY_SSIZE_T_CLEAN
-#ifndef CYTHON_USE_PYLONG_INTERNALS
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#else
-#include "pyconfig.h"
-#ifdef PYLONG_BITS_IN_DIGIT
-#define CYTHON_USE_PYLONG_INTERNALS 1
-#else
-#define CYTHON_USE_PYLONG_INTERNALS 0
-#endif
-#endif
-#endif
-#include "Python.h"
-#ifndef Py_PYTHON_H
- #error Python headers needed to compile C extensions, please install development version of Python.
-#elif PY_VERSION_HEX < 0x02040000
- #error Cython requires Python 2.4+.
-#else
-#include <stddef.h> /* For offsetof */
-#ifndef offsetof
-#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
-#endif
-#if !defined(WIN32) && !defined(MS_WINDOWS)
- #ifndef __stdcall
- #define __stdcall
- #endif
- #ifndef __cdecl
- #define __cdecl
- #endif
- #ifndef __fastcall
- #define __fastcall
- #endif
-#endif
-#ifndef DL_IMPORT
- #define DL_IMPORT(t) t
-#endif
-#ifndef DL_EXPORT
- #define DL_EXPORT(t) t
-#endif
-#ifndef PY_LONG_LONG
- #define PY_LONG_LONG LONG_LONG
-#endif
-#ifndef Py_HUGE_VAL
- #define Py_HUGE_VAL HUGE_VAL
-#endif
-#ifdef PYPY_VERSION
-#define CYTHON_COMPILING_IN_PYPY 1
-#define CYTHON_COMPILING_IN_CPYTHON 0
-#else
-#define CYTHON_COMPILING_IN_PYPY 0
-#define CYTHON_COMPILING_IN_CPYTHON 1
-#endif
-#if PY_VERSION_HEX < 0x02050000
- typedef int Py_ssize_t;
- #define PY_SSIZE_T_MAX INT_MAX
- #define PY_SSIZE_T_MIN INT_MIN
- #define PY_FORMAT_SIZE_T ""
- #define CYTHON_FORMAT_SSIZE_T ""
- #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
- #define PyInt_AsSsize_t(o) __Pyx_PyInt_AsInt(o)
- #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
- (PyErr_Format(PyExc_TypeError, \
- "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
- (PyObject*)0))
- #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
- !PyComplex_Check(o))
- #define PyIndex_Check __Pyx_PyIndex_Check
- #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
- #define __PYX_BUILD_PY_SSIZE_T "i"
-#else
- #define __PYX_BUILD_PY_SSIZE_T "n"
- #define CYTHON_FORMAT_SSIZE_T "z"
- #define __Pyx_PyIndex_Check PyIndex_Check
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
- #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
- #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
- #define PyVarObject_HEAD_INIT(type, size) \
- PyObject_HEAD_INIT(type) size,
- #define PyType_Modified(t)
- typedef struct {
- void *buf;
- PyObject *obj;
- Py_ssize_t len;
- Py_ssize_t itemsize;
- int readonly;
- int ndim;
- char *format;
- Py_ssize_t *shape;
- Py_ssize_t *strides;
- Py_ssize_t *suboffsets;
- void *internal;
- } Py_buffer;
- #define PyBUF_SIMPLE 0
- #define PyBUF_WRITABLE 0x0001
- #define PyBUF_FORMAT 0x0004
- #define PyBUF_ND 0x0008
- #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
- #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
- #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
- #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
- #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
- #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
- #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
- typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
- typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
-#endif
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
- PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#else
- #define __Pyx_BUILTIN_MODULE_NAME "builtins"
- #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
- PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
-#endif
-#if PY_MAJOR_VERSION < 3 && PY_MINOR_VERSION < 6
- #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define Py_TPFLAGS_CHECKTYPES 0
- #define Py_TPFLAGS_HAVE_INDEX 0
-#endif
-#if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
- #define Py_TPFLAGS_HAVE_NEWBUFFER 0
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define Py_TPFLAGS_HAVE_VERSION_TAG 0
-#endif
-#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
- #define CYTHON_PEP393_ENABLED 1
- #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
- 0 : _PyUnicode_Ready((PyObject *)(op)))
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
- #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
-#else
- #define CYTHON_PEP393_ENABLED 0
- #define __Pyx_PyUnicode_READY(op) (0)
- #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
- #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
- #define __Pyx_PyUnicode_READ(k, d, i) ((k=k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBaseString_Type PyUnicode_Type
- #define PyStringObject PyUnicodeObject
- #define PyString_Type PyUnicode_Type
- #define PyString_Check PyUnicode_Check
- #define PyString_CheckExact PyUnicode_CheckExact
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define PyBytesObject PyStringObject
- #define PyBytes_Type PyString_Type
- #define PyBytes_Check PyString_Check
- #define PyBytes_CheckExact PyString_CheckExact
- #define PyBytes_FromString PyString_FromString
- #define PyBytes_FromStringAndSize PyString_FromStringAndSize
- #define PyBytes_FromFormat PyString_FromFormat
- #define PyBytes_DecodeEscape PyString_DecodeEscape
- #define PyBytes_AsString PyString_AsString
- #define PyBytes_AsStringAndSize PyString_AsStringAndSize
- #define PyBytes_Size PyString_Size
- #define PyBytes_AS_STRING PyString_AS_STRING
- #define PyBytes_GET_SIZE PyString_GET_SIZE
- #define PyBytes_Repr PyString_Repr
- #define PyBytes_Concat PyString_Concat
- #define PyBytes_ConcatAndDel PyString_ConcatAndDel
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
- #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
-#else
- #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
- PyString_Check(obj) || PyUnicode_Check(obj))
- #define __Pyx_PyBaseString_CheckExact(obj) (Py_TYPE(obj) == &PyBaseString_Type)
-#endif
-#if PY_VERSION_HEX < 0x02060000
- #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
- #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
-#endif
-#ifndef PySet_CheckExact
- #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
-#endif
-#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
-#if PY_MAJOR_VERSION >= 3
- #define PyIntObject PyLongObject
- #define PyInt_Type PyLong_Type
- #define PyInt_Check(op) PyLong_Check(op)
- #define PyInt_CheckExact(op) PyLong_CheckExact(op)
- #define PyInt_FromString PyLong_FromString
- #define PyInt_FromUnicode PyLong_FromUnicode
- #define PyInt_FromLong PyLong_FromLong
- #define PyInt_FromSize_t PyLong_FromSize_t
- #define PyInt_FromSsize_t PyLong_FromSsize_t
- #define PyInt_AsLong PyLong_AsLong
- #define PyInt_AS_LONG PyLong_AS_LONG
- #define PyInt_AsSsize_t PyLong_AsSsize_t
- #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
- #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyBoolObject PyLongObject
-#endif
-#if PY_VERSION_HEX < 0x03020000
- typedef long Py_hash_t;
- #define __Pyx_PyInt_FromHash_t PyInt_FromLong
- #define __Pyx_PyInt_AsHash_t PyInt_AsLong
-#else
- #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
- #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
-#endif
-#if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
- #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
- #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
-#else
- #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
- #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
- #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
- (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
- (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
- (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
-#endif
-#if PY_MAJOR_VERSION >= 3
- #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
-#endif
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
-#else
- #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
- #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
- #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
-#endif
-#if PY_VERSION_HEX < 0x02050000
- #define __Pyx_NAMESTR(n) ((char *)(n))
- #define __Pyx_DOCSTR(n) ((char *)(n))
-#else
- #define __Pyx_NAMESTR(n) (n)
- #define __Pyx_DOCSTR(n) (n)
-#endif
-#ifndef CYTHON_INLINE
- #if defined(__GNUC__)
- #define CYTHON_INLINE __inline__
- #elif defined(_MSC_VER)
- #define CYTHON_INLINE __inline
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_INLINE inline
- #else
- #define CYTHON_INLINE
- #endif
-#endif
-#ifndef CYTHON_RESTRICT
- #if defined(__GNUC__)
- #define CYTHON_RESTRICT __restrict__
- #elif defined(_MSC_VER)
- #define CYTHON_RESTRICT __restrict
- #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
- #define CYTHON_RESTRICT restrict
- #else
- #define CYTHON_RESTRICT
- #endif
-#endif
-#ifdef NAN
-#define __PYX_NAN() ((float) NAN)
-#else
-static CYTHON_INLINE float __PYX_NAN() {
- /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
- a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
- a quiet NaN. */
- float value;
- memset(&value, 0xFF, sizeof(value));
- return value;
-}
-#endif
-
-
-#if PY_MAJOR_VERSION >= 3
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
-#else
- #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
- #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
-#endif
-
-#ifndef __PYX_EXTERN_C
- #ifdef __cplusplus
- #define __PYX_EXTERN_C extern "C"
- #else
- #define __PYX_EXTERN_C extern
- #endif
-#endif
-
-#if defined(WIN32) || defined(MS_WINDOWS)
-#define _USE_MATH_DEFINES
-#endif
-#include <math.h>
-#define __PYX_HAVE__PyMca5__PyMcaPhysics__xas___xas
-#define __PYX_HAVE_API__PyMca5__PyMcaPhysics__xas___xas
-#include "string.h"
-#include "stdio.h"
-#include "stdlib.h"
-#include "numpy/arrayobject.h"
-#include "numpy/ufuncobject.h"
-#include "polspl.h"
-#include "bessel0.h"
-#include "pythread.h"
-#include "pystate.h"
-#ifdef _OPENMP
-#include <omp.h>
-#endif /* _OPENMP */
-
-#ifdef PYREX_WITHOUT_ASSERTIONS
-#define CYTHON_WITHOUT_ASSERTIONS
-#endif
-
-#ifndef CYTHON_UNUSED
-# if defined(__GNUC__)
-# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
-# define CYTHON_UNUSED __attribute__ ((__unused__))
-# else
-# define CYTHON_UNUSED
-# endif
-#endif
-typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
- const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
-
-#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
-#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
-#define __PYX_DEFAULT_STRING_ENCODING ""
-#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
-#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
-#define __Pyx_PyBytes_FromString PyBytes_FromString
-#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char*);
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
-#else
- #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
- #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
-#endif
-#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
-#define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((char*)s)
-#define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((char*)s)
-#define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((char*)s)
-#define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((char*)s)
-#if PY_MAJOR_VERSION < 3
-static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
-{
- const Py_UNICODE *u_end = u;
- while (*u_end++) ;
- return u_end - u - 1;
-}
-#else
-#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
-#endif
-#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
-#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
-#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
-#define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
-#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);
-#if CYTHON_COMPILING_IN_CPYTHON
-#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
-#else
-#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
-#endif
-#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
-static int __Pyx_sys_getdefaultencoding_not_ascii;
-static int __Pyx_init_sys_getdefaultencoding_params() {
- PyObject* sys = NULL;
- PyObject* default_encoding = NULL;
- PyObject* ascii_chars_u = NULL;
- PyObject* ascii_chars_b = NULL;
- sys = PyImport_ImportModule("sys");
- if (sys == NULL) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
- if (default_encoding == NULL) goto bad;
- if (strcmp(PyBytes_AsString(default_encoding), "ascii") == 0) {
- __Pyx_sys_getdefaultencoding_not_ascii = 0;
- } else {
- const char* default_encoding_c = PyBytes_AS_STRING(default_encoding);
- char ascii_chars[128];
- int c;
- for (c = 0; c < 128; c++) {
- ascii_chars[c] = c;
- }
- __Pyx_sys_getdefaultencoding_not_ascii = 1;
- ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
- if (ascii_chars_u == NULL) goto bad;
- ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
- if (ascii_chars_b == NULL || strncmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
- PyErr_Format(
- PyExc_ValueError,
- "This module compiled with c_string_encoding=ascii, but default encoding '%s' is not a superset of ascii.",
- default_encoding_c);
- goto bad;
- }
- }
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- Py_XDECREF(ascii_chars_u);
- Py_XDECREF(ascii_chars_b);
- return 0;
-bad:
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- Py_XDECREF(ascii_chars_u);
- Py_XDECREF(ascii_chars_b);
- return -1;
-}
-#endif
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
-#else
-#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
-#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
-static char* __PYX_DEFAULT_STRING_ENCODING;
-static int __Pyx_init_sys_getdefaultencoding_params() {
- PyObject* sys = NULL;
- PyObject* default_encoding = NULL;
- char* default_encoding_c;
- sys = PyImport_ImportModule("sys");
- if (sys == NULL) goto bad;
- default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
- if (default_encoding == NULL) goto bad;
- default_encoding_c = PyBytes_AS_STRING(default_encoding);
- __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
- strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
- Py_DECREF(sys);
- Py_DECREF(default_encoding);
- return 0;
-bad:
- Py_XDECREF(sys);
- Py_XDECREF(default_encoding);
- return -1;
-}
-#endif
-#endif
-
-
-#ifdef __GNUC__
- /* Test for GCC > 2.95 */
- #if __GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))
- #define likely(x) __builtin_expect(!!(x), 1)
- #define unlikely(x) __builtin_expect(!!(x), 0)
- #else /* __GNUC__ > 2 ... */
- #define likely(x) (x)
- #define unlikely(x) (x)
- #endif /* __GNUC__ > 2 ... */
-#else /* __GNUC__ */
- #define likely(x) (x)
- #define unlikely(x) (x)
-#endif /* __GNUC__ */
-
-static PyObject *__pyx_m;
-static PyObject *__pyx_d;
-static PyObject *__pyx_b;
-static PyObject *__pyx_empty_tuple;
-static PyObject *__pyx_empty_bytes;
-static int __pyx_lineno;
-static int __pyx_clineno = 0;
-static const char * __pyx_cfilenm= __FILE__;
-static const char *__pyx_filename;
-
-#if !defined(CYTHON_CCOMPLEX)
- #if defined(__cplusplus)
- #define CYTHON_CCOMPLEX 1
- #elif defined(_Complex_I)
- #define CYTHON_CCOMPLEX 1
- #else
- #define CYTHON_CCOMPLEX 0
- #endif
-#endif
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- #include <complex>
- #else
- #include <complex.h>
- #endif
-#endif
-#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
- #undef _Complex_I
- #define _Complex_I 1.0fj
-#endif
-
-
-static const char *__pyx_f[] = {
- "_xas.pyx",
- "numpy.pxd",
- "stringsource",
- "type.pxd",
-};
-struct __pyx_memoryview_obj;
-typedef struct {
- struct __pyx_memoryview_obj *memview;
- char *data;
- Py_ssize_t shape[8];
- Py_ssize_t strides[8];
- Py_ssize_t suboffsets[8];
-} __Pyx_memviewslice;
-
-#define IS_UNSIGNED(type) (((type) -1) > 0)
-struct __Pyx_StructField_;
-#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
-typedef struct {
- const char* name; /* for error messages only */
- struct __Pyx_StructField_* fields;
- size_t size; /* sizeof(type) */
- size_t arraysize[8]; /* length of array in each dimension */
- int ndim;
- char typegroup; /* _R_eal, _C_omplex, Signed _I_nt, _U_nsigned int, _S_truct, _P_ointer, _O_bject, c_H_ar */
- char is_unsigned;
- int flags;
-} __Pyx_TypeInfo;
-typedef struct __Pyx_StructField_ {
- __Pyx_TypeInfo* type;
- const char* name;
- size_t offset;
-} __Pyx_StructField;
-typedef struct {
- __Pyx_StructField* field;
- size_t parent_offset;
-} __Pyx_BufFmt_StackElem;
-typedef struct {
- __Pyx_StructField root;
- __Pyx_BufFmt_StackElem* head;
- size_t fmt_offset;
- size_t new_count, enc_count;
- size_t struct_alignment;
- int is_complex;
- char enc_type;
- char new_packmode;
- char enc_packmode;
- char is_valid_array;
-} __Pyx_BufFmt_Context;
-
-#include <pythread.h>
-#ifndef CYTHON_ATOMICS
- #define CYTHON_ATOMICS 1
-#endif
-#define __pyx_atomic_int_type int
-#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 || \
- (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) && \
- !defined(__i386__)
- #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
- #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Using GNU atomics"
- #endif
-#elif CYTHON_ATOMICS && MSC_VER
- #include <Windows.h>
- #define __pyx_atomic_int_type LONG
- #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
- #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Using MSVC atomics"
- #endif
-#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
- #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
- #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Using Intel atomics"
- #endif
-#else
- #undef CYTHON_ATOMICS
- #define CYTHON_ATOMICS 0
- #ifdef __PYX_DEBUG_ATOMICS
- #warning "Not using atomics"
- #endif
-#endif
-typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
-#if CYTHON_ATOMICS
- #define __pyx_add_acquisition_count(memview) \
- __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
- __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
-#else
- #define __pyx_add_acquisition_count(memview) \
- __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
- #define __pyx_sub_acquisition_count(memview) \
- __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
-#endif
-
-
-/* "numpy.pxd":723
- * # in Cython to enable them only on the right systems.
- *
- * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
- * ctypedef npy_int16 int16_t
- * ctypedef npy_int32 int32_t
- */
-typedef npy_int8 __pyx_t_5numpy_int8_t;
-
-/* "numpy.pxd":724
- *
- * ctypedef npy_int8 int8_t
- * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
- * ctypedef npy_int32 int32_t
- * ctypedef npy_int64 int64_t
- */
-typedef npy_int16 __pyx_t_5numpy_int16_t;
-
-/* "numpy.pxd":725
- * ctypedef npy_int8 int8_t
- * ctypedef npy_int16 int16_t
- * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
- * ctypedef npy_int64 int64_t
- * #ctypedef npy_int96 int96_t
- */
-typedef npy_int32 __pyx_t_5numpy_int32_t;
-
-/* "numpy.pxd":726
- * ctypedef npy_int16 int16_t
- * ctypedef npy_int32 int32_t
- * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
- * #ctypedef npy_int96 int96_t
- * #ctypedef npy_int128 int128_t
- */
-typedef npy_int64 __pyx_t_5numpy_int64_t;
-
-/* "numpy.pxd":730
- * #ctypedef npy_int128 int128_t
- *
- * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
- * ctypedef npy_uint16 uint16_t
- * ctypedef npy_uint32 uint32_t
- */
-typedef npy_uint8 __pyx_t_5numpy_uint8_t;
-
-/* "numpy.pxd":731
- *
- * ctypedef npy_uint8 uint8_t
- * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
- * ctypedef npy_uint32 uint32_t
- * ctypedef npy_uint64 uint64_t
- */
-typedef npy_uint16 __pyx_t_5numpy_uint16_t;
-
-/* "numpy.pxd":732
- * ctypedef npy_uint8 uint8_t
- * ctypedef npy_uint16 uint16_t
- * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
- * ctypedef npy_uint64 uint64_t
- * #ctypedef npy_uint96 uint96_t
- */
-typedef npy_uint32 __pyx_t_5numpy_uint32_t;
-
-/* "numpy.pxd":733
- * ctypedef npy_uint16 uint16_t
- * ctypedef npy_uint32 uint32_t
- * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
- * #ctypedef npy_uint96 uint96_t
- * #ctypedef npy_uint128 uint128_t
- */
-typedef npy_uint64 __pyx_t_5numpy_uint64_t;
-
-/* "numpy.pxd":737
- * #ctypedef npy_uint128 uint128_t
- *
- * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
- * ctypedef npy_float64 float64_t
- * #ctypedef npy_float80 float80_t
- */
-typedef npy_float32 __pyx_t_5numpy_float32_t;
-
-/* "numpy.pxd":738
- *
- * ctypedef npy_float32 float32_t
- * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
- * #ctypedef npy_float80 float80_t
- * #ctypedef npy_float128 float128_t
- */
-typedef npy_float64 __pyx_t_5numpy_float64_t;
-
-/* "numpy.pxd":747
- * # The int types are mapped a bit surprising --
- * # numpy.int corresponds to 'l' and numpy.long to 'q'
- * ctypedef npy_long int_t # <<<<<<<<<<<<<<
- * ctypedef npy_longlong long_t
- * ctypedef npy_longlong longlong_t
- */
-typedef npy_long __pyx_t_5numpy_int_t;
-
-/* "numpy.pxd":748
- * # numpy.int corresponds to 'l' and numpy.long to 'q'
- * ctypedef npy_long int_t
- * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
- * ctypedef npy_longlong longlong_t
- *
- */
-typedef npy_longlong __pyx_t_5numpy_long_t;
-
-/* "numpy.pxd":749
- * ctypedef npy_long int_t
- * ctypedef npy_longlong long_t
- * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_ulong uint_t
- */
-typedef npy_longlong __pyx_t_5numpy_longlong_t;
-
-/* "numpy.pxd":751
- * ctypedef npy_longlong longlong_t
- *
- * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
- * ctypedef npy_ulonglong ulong_t
- * ctypedef npy_ulonglong ulonglong_t
- */
-typedef npy_ulong __pyx_t_5numpy_uint_t;
-
-/* "numpy.pxd":752
- *
- * ctypedef npy_ulong uint_t
- * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
- * ctypedef npy_ulonglong ulonglong_t
- *
- */
-typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
-
-/* "numpy.pxd":753
- * ctypedef npy_ulong uint_t
- * ctypedef npy_ulonglong ulong_t
- * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_intp intp_t
- */
-typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
-
-/* "numpy.pxd":755
- * ctypedef npy_ulonglong ulonglong_t
- *
- * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
- * ctypedef npy_uintp uintp_t
- *
- */
-typedef npy_intp __pyx_t_5numpy_intp_t;
-
-/* "numpy.pxd":756
- *
- * ctypedef npy_intp intp_t
- * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_double float_t
- */
-typedef npy_uintp __pyx_t_5numpy_uintp_t;
-
-/* "numpy.pxd":758
- * ctypedef npy_uintp uintp_t
- *
- * ctypedef npy_double float_t # <<<<<<<<<<<<<<
- * ctypedef npy_double double_t
- * ctypedef npy_longdouble longdouble_t
- */
-typedef npy_double __pyx_t_5numpy_float_t;
-
-/* "numpy.pxd":759
- *
- * ctypedef npy_double float_t
- * ctypedef npy_double double_t # <<<<<<<<<<<<<<
- * ctypedef npy_longdouble longdouble_t
- *
- */
-typedef npy_double __pyx_t_5numpy_double_t;
-
-/* "numpy.pxd":760
- * ctypedef npy_double float_t
- * ctypedef npy_double double_t
- * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_cfloat cfloat_t
- */
-typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- typedef ::std::complex< float > __pyx_t_float_complex;
- #else
- typedef float _Complex __pyx_t_float_complex;
- #endif
-#else
- typedef struct { float real, imag; } __pyx_t_float_complex;
-#endif
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- typedef ::std::complex< double > __pyx_t_double_complex;
- #else
- typedef double _Complex __pyx_t_double_complex;
- #endif
-#else
- typedef struct { double real, imag; } __pyx_t_double_complex;
-#endif
-
-
-/*--- Type declarations ---*/
-struct __pyx_memoryview_obj;
-struct __pyx_array_obj;
-struct __pyx_MemviewEnum_obj;
-struct __pyx_memoryviewslice_obj;
-
-/* "numpy.pxd":762
- * ctypedef npy_longdouble longdouble_t
- *
- * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
- * ctypedef npy_cdouble cdouble_t
- * ctypedef npy_clongdouble clongdouble_t
- */
-typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
-
-/* "numpy.pxd":763
- *
- * ctypedef npy_cfloat cfloat_t
- * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
- * ctypedef npy_clongdouble clongdouble_t
- *
- */
-typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
-
-/* "numpy.pxd":764
- * ctypedef npy_cfloat cfloat_t
- * ctypedef npy_cdouble cdouble_t
- * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
- *
- * ctypedef npy_cdouble complex_t
- */
-typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
-
-/* "numpy.pxd":766
- * ctypedef npy_clongdouble clongdouble_t
- *
- * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew1(a):
- */
-typedef npy_cdouble __pyx_t_5numpy_complex_t;
-
-/* "View.MemoryView":308
- *
- * @cname('__pyx_memoryview')
- * cdef class memoryview(object): # <<<<<<<<<<<<<<
- *
- * cdef object obj
- */
-struct __pyx_memoryview_obj {
- PyObject_HEAD
- struct __pyx_vtabstruct_memoryview *__pyx_vtab;
- PyObject *obj;
- PyObject *_size;
- PyObject *_array_interface;
- PyThread_type_lock lock;
- __pyx_atomic_int acquisition_count[2];
- __pyx_atomic_int *acquisition_count_aligned_p;
- Py_buffer view;
- int flags;
- int dtype_is_object;
- __Pyx_TypeInfo *typeinfo;
-};
-
-
-/* "View.MemoryView":96
- *
- * @cname("__pyx_array")
- * cdef class array: # <<<<<<<<<<<<<<
- *
- * cdef:
- */
-struct __pyx_array_obj {
- PyObject_HEAD
- char *data;
- Py_ssize_t len;
- char *format;
- int ndim;
- Py_ssize_t *_shape;
- Py_ssize_t *_strides;
- Py_ssize_t itemsize;
- PyObject *mode;
- PyObject *_format;
- void (*callback_free_data)(void *);
- int free_data;
- int dtype_is_object;
-};
-
-
-/* "View.MemoryView":275
- *
- * @cname('__pyx_MemviewEnum')
- * cdef class Enum(object): # <<<<<<<<<<<<<<
- * cdef object name
- * def __init__(self, name):
- */
-struct __pyx_MemviewEnum_obj {
- PyObject_HEAD
- PyObject *name;
-};
-
-
-/* "View.MemoryView":927
- *
- * @cname('__pyx_memoryviewslice')
- * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
- * "Internal class for passing memoryview slices to Python"
- *
- */
-struct __pyx_memoryviewslice_obj {
- struct __pyx_memoryview_obj __pyx_base;
- __Pyx_memviewslice from_slice;
- PyObject *from_object;
- PyObject *(*to_object_func)(char *);
- int (*to_dtype_func)(char *, PyObject *);
-};
-
-
-
-/* "View.MemoryView":308
- *
- * @cname('__pyx_memoryview')
- * cdef class memoryview(object): # <<<<<<<<<<<<<<
- *
- * cdef object obj
- */
-
-struct __pyx_vtabstruct_memoryview {
- char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
- PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
- PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
- PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
- PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
-};
-static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
-
-
-/* "View.MemoryView":927
- *
- * @cname('__pyx_memoryviewslice')
- * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
- * "Internal class for passing memoryview slices to Python"
- *
- */
-
-struct __pyx_vtabstruct__memoryviewslice {
- struct __pyx_vtabstruct_memoryview __pyx_base;
-};
-static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
-
-#ifndef CYTHON_REFNANNY
- #define CYTHON_REFNANNY 0
-#endif
-#if CYTHON_REFNANNY
- typedef struct {
- void (*INCREF)(void*, PyObject*, int);
- void (*DECREF)(void*, PyObject*, int);
- void (*GOTREF)(void*, PyObject*, int);
- void (*GIVEREF)(void*, PyObject*, int);
- void* (*SetupContext)(const char*, int, const char*);
- void (*FinishContext)(void**);
- } __Pyx_RefNannyAPIStruct;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
- static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
- #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
-#ifdef WITH_THREAD
- #define __Pyx_RefNannySetupContext(name, acquire_gil) \
- if (acquire_gil) { \
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
- PyGILState_Release(__pyx_gilstate_save); \
- } else { \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
- }
-#else
- #define __Pyx_RefNannySetupContext(name, acquire_gil) \
- __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
-#endif
- #define __Pyx_RefNannyFinishContext() \
- __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
- #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
- #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
- #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
- #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
- #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
-#else
- #define __Pyx_RefNannyDeclarations
- #define __Pyx_RefNannySetupContext(name, acquire_gil)
- #define __Pyx_RefNannyFinishContext()
- #define __Pyx_INCREF(r) Py_INCREF(r)
- #define __Pyx_DECREF(r) Py_DECREF(r)
- #define __Pyx_GOTREF(r)
- #define __Pyx_GIVEREF(r)
- #define __Pyx_XINCREF(r) Py_XINCREF(r)
- #define __Pyx_XDECREF(r) Py_XDECREF(r)
- #define __Pyx_XGOTREF(r)
- #define __Pyx_XGIVEREF(r)
-#endif /* CYTHON_REFNANNY */
-#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
-#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
-
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
- PyTypeObject* tp = Py_TYPE(obj);
- if (likely(tp->tp_getattro))
- return tp->tp_getattro(obj, attr_name);
-#if PY_MAJOR_VERSION < 3
- if (likely(tp->tp_getattr))
- return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
-#endif
- return PyObject_GetAttr(obj, attr_name);
-}
-#else
-#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
-#endif
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
-
-static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
-
-static CYTHON_INLINE int __Pyx_GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
- __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
-static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
-
-#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
-#define __Pyx_MEMVIEW_DIRECT 1
-#define __Pyx_MEMVIEW_PTR 2
-#define __Pyx_MEMVIEW_FULL 4
-#define __Pyx_MEMVIEW_CONTIG 8
-#define __Pyx_MEMVIEW_STRIDED 16
-#define __Pyx_MEMVIEW_FOLLOW 32
-#define __Pyx_IS_C_CONTIG 1
-#define __Pyx_IS_F_CONTIG 2
-static int __Pyx_init_memviewslice(
- struct __pyx_memoryview_obj *memview,
- int ndim,
- __Pyx_memviewslice *memviewslice,
- int memview_is_new_reference);
-static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
- __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
-static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
- __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
-#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
-#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
-#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
-#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
-static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
-static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
-
-static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
- Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
-
-static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
-
-static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
- PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
- const char* function_name); /*proto*/
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
-
-#define __Pyx_SetItemInt(o, i, v, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_SetItemInt_Fast(o, i, v, is_list, wraparound, boundscheck) : \
- __Pyx_SetItemInt_Generic(o, to_py_func(i), v))
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck);
-
-#define __Pyx_GetItemInt(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Fast(o, i, is_list, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-#define __Pyx_GetItemInt_List(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_List_Fast(o, i, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func, is_list, wraparound, boundscheck) \
- (((size) <= sizeof(Py_ssize_t)) ? \
- __Pyx_GetItemInt_Tuple_Fast(o, i, wraparound, boundscheck) : \
- __Pyx_GetItemInt_Generic(o, to_py_func(i)))
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck);
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
-
-static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *); /*proto*/
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *); /*proto*/
-
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
-
-#ifndef __PYX_FORCE_INIT_THREADS
- #define __PYX_FORCE_INIT_THREADS 0
-#endif
-
-#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
-
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
-
-static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
-static CYTHON_INLINE PyObject* __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));
-
-#include <string.h>
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len)) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- Py_SIZE(list) = len+1;
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
-#endif
-
-static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
-#if CYTHON_COMPILING_IN_CPYTHON
-static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
- PyListObject* L = (PyListObject*) list;
- Py_ssize_t len = Py_SIZE(list);
- if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
- Py_INCREF(x);
- PyList_SET_ITEM(list, len, x);
- Py_SIZE(list) = len+1;
- return 0;
- }
- return PyList_Append(list, x);
-}
-#else
-#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
-#endif
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
-
-static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
-
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
-static void __Pyx_WriteUnraisable(const char *name, int clineno,
- int lineno, const char *filename); /*proto*/
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/
-
-typedef struct {
- Py_ssize_t shape, strides, suboffsets;
-} __Pyx_Buf_DimInfo;
-typedef struct {
- size_t refcount;
- Py_buffer pybuffer;
-} __Pyx_Buffer;
-typedef struct {
- __Pyx_Buffer *rcbuffer;
- char *data;
- __Pyx_Buf_DimInfo diminfo[8];
-} __Pyx_LocalBuf_ND;
-
-#if PY_MAJOR_VERSION < 3
- static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
- static void __Pyx_ReleaseBuffer(Py_buffer *view);
-#else
- #define __Pyx_GetBuffer PyObject_GetBuffer
- #define __Pyx_ReleaseBuffer PyBuffer_Release
-#endif
-
-
-static Py_ssize_t __Pyx_zeros[] = {0, 0, 0, 0, 0, 0, 0, 0};
-static Py_ssize_t __Pyx_minusones[] = {-1, -1, -1, -1, -1, -1, -1, -1};
-
-static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
-
-static PyObject *__pyx_memview_get_double(const char *itemp); /* proto */
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj); /* proto */
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- #define __Pyx_CREAL(z) ((z).real())
- #define __Pyx_CIMAG(z) ((z).imag())
- #else
- #define __Pyx_CREAL(z) (__real__(z))
- #define __Pyx_CIMAG(z) (__imag__(z))
- #endif
-#else
- #define __Pyx_CREAL(z) ((z).real)
- #define __Pyx_CIMAG(z) ((z).imag)
-#endif
-#if defined(_WIN32) && defined(__cplusplus) && CYTHON_CCOMPLEX
- #define __Pyx_SET_CREAL(z,x) ((z).real(x))
- #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
-#else
- #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
- #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
-#endif
-
-static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
-
-#if CYTHON_CCOMPLEX
- #define __Pyx_c_eqf(a, b) ((a)==(b))
- #define __Pyx_c_sumf(a, b) ((a)+(b))
- #define __Pyx_c_difff(a, b) ((a)-(b))
- #define __Pyx_c_prodf(a, b) ((a)*(b))
- #define __Pyx_c_quotf(a, b) ((a)/(b))
- #define __Pyx_c_negf(a) (-(a))
- #ifdef __cplusplus
- #define __Pyx_c_is_zerof(z) ((z)==(float)0)
- #define __Pyx_c_conjf(z) (::std::conj(z))
- #if 1
- #define __Pyx_c_absf(z) (::std::abs(z))
- #define __Pyx_c_powf(a, b) (::std::pow(a, b))
- #endif
- #else
- #define __Pyx_c_is_zerof(z) ((z)==0)
- #define __Pyx_c_conjf(z) (conjf(z))
- #if 1
- #define __Pyx_c_absf(z) (cabsf(z))
- #define __Pyx_c_powf(a, b) (cpowf(a, b))
- #endif
- #endif
-#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
- static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
- #if 1
- static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
- #endif
-#endif
-
-static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
-
-#if CYTHON_CCOMPLEX
- #define __Pyx_c_eq(a, b) ((a)==(b))
- #define __Pyx_c_sum(a, b) ((a)+(b))
- #define __Pyx_c_diff(a, b) ((a)-(b))
- #define __Pyx_c_prod(a, b) ((a)*(b))
- #define __Pyx_c_quot(a, b) ((a)/(b))
- #define __Pyx_c_neg(a) (-(a))
- #ifdef __cplusplus
- #define __Pyx_c_is_zero(z) ((z)==(double)0)
- #define __Pyx_c_conj(z) (::std::conj(z))
- #if 1
- #define __Pyx_c_abs(z) (::std::abs(z))
- #define __Pyx_c_pow(a, b) (::std::pow(a, b))
- #endif
- #else
- #define __Pyx_c_is_zero(z) ((z)==0)
- #define __Pyx_c_conj(z) (conj(z))
- #if 1
- #define __Pyx_c_abs(z) (cabs(z))
- #define __Pyx_c_pow(a, b) (cpow(a, b))
- #endif
- #endif
-#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
- static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
- #if 1
- static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
- #endif
-#endif
-
-static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
- char order, int ndim);
-
-static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
- __Pyx_memviewslice *slice2,
- int ndim, size_t itemsize);
-
-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);
-
-static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject *);
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject *);
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject *);
-
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);
-
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);
-
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject *);
-
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);
-
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);
-
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);
-
-static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
-
-static int __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);
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *);
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *);
-
-static int __Pyx_check_binary_version(void);
-
-#if !defined(__Pyx_PyIdentifier_FromString)
-#if PY_MAJOR_VERSION < 3
- #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
-#else
- #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
-#endif
-#endif
-
-static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
-
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
-
-typedef struct {
- int code_line;
- PyCodeObject* code_object;
-} __Pyx_CodeObjectCacheEntry;
-struct __Pyx_CodeObjectCache {
- int count;
- int max_count;
- __Pyx_CodeObjectCacheEntry* entries;
-};
-static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
-static PyCodeObject *__pyx_find_code_object(int code_line);
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
-
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename); /*proto*/
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
-
-
-/* Module declarations from 'cython.view' */
-
-/* Module declarations from 'cython' */
-
-/* Module declarations from 'cpython.buffer' */
-
-/* Module declarations from 'cpython.ref' */
-
-/* Module declarations from 'libc.string' */
-
-/* Module declarations from 'libc.stdio' */
-
-/* Module declarations from 'cpython.object' */
-
-/* Module declarations from '__builtin__' */
-
-/* Module declarations from 'cpython.type' */
-static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
-
-/* Module declarations from 'libc.stdlib' */
-
-/* Module declarations from 'numpy' */
-
-/* Module declarations from 'numpy' */
-static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
-static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
-static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
-static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
-static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
-static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
-
-/* Module declarations from 'polspl' */
-
-/* Module declarations from 'bessel0' */
-
-/* Module declarations from 'PyMca5.PyMcaPhysics.xas._xas' */
-static PyTypeObject *__pyx_memoryview_type = 0;
-static PyTypeObject *__pyx_array_type = 0;
-static PyTypeObject *__pyx_MemviewEnum_type = 0;
-static PyTypeObject *__pyx_memoryviewslice_type = 0;
-static PyObject *generic = 0;
-static PyObject *strided = 0;
-static PyObject *indirect = 0;
-static PyObject *contiguous = 0;
-static PyObject *indirect_contiguous = 0;
-static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
-static void *__pyx_align_pointer(void *, size_t); /*proto*/
-static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
-static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
-static PyObject *_unellipsify(PyObject *, int); /*proto*/
-static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
-static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
-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*/
-static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, int); /*proto*/
-static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
-static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
-static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
-static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
-static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
-static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
-static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
-static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
-static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
-static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
-static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
-static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
-static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
-static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
-static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
-static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
-static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
-static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
-static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
-static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
-static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
-static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
-static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
-#define __Pyx_MODULE_NAME "PyMca5.PyMcaPhysics.xas._xas"
-int __pyx_module_is_main_PyMca5__PyMcaPhysics__xas___xas = 0;
-
-/* Implementation of 'PyMca5.PyMcaPhysics.xas._xas' */
-static PyObject *__pyx_builtin_range;
-static PyObject *__pyx_builtin_ValueError;
-static PyObject *__pyx_builtin_RuntimeError;
-static PyObject *__pyx_builtin_MemoryError;
-static PyObject *__pyx_builtin_enumerate;
-static PyObject *__pyx_builtin_Ellipsis;
-static PyObject *__pyx_builtin_TypeError;
-static PyObject *__pyx_builtin_xrange;
-static PyObject *__pyx_builtin_id;
-static PyObject *__pyx_builtin_IndexError;
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_j0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_2_besselMultiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_4_besselSingle(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x); /* proto */
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_6polspl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl, PyObject *__pyx_v_xh, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc); /* proto */
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_8polspl2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl0, PyObject *__pyx_v_xh0, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc); /* proto */
-static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
-static int __pyx_array_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 */
-static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
-static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
-static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
-static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
-static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
-static int __pyx_memoryview_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 */
-static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
-static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
-static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
-static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
-static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
-static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
-static char __pyx_k_9[] = "ndarray is not C contiguous";
-static char __pyx_k_11[] = "ndarray is not Fortran contiguous";
-static char __pyx_k_13[] = "Non-native byte order not supported";
-static char __pyx_k_15[] = "unknown dtype code in numpy.pxd (%d)";
-static char __pyx_k_16[] = "Format string allocated too short, see comment in numpy.pxd";
-static char __pyx_k_19[] = "Format string allocated too short.";
-static char __pyx_k_21[] = "Empty shape tuple for cython.array";
-static char __pyx_k_23[] = "itemsize <= 0 for cython.array";
-static char __pyx_k_26[] = "unable to allocate shape or strides.";
-static char __pyx_k_28[] = "Invalid shape in axis %d: %d.";
-static char __pyx_k_29[] = "Invalid mode, expected 'c' or 'fortran', got %s";
-static char __pyx_k_31[] = "unable to allocate array data.";
-static char __pyx_k_33[] = "Can only create a buffer that is contiguous in memory.";
-static char __pyx_k_35[] = "Unable to convert item to object";
-static char __pyx_k_37[] = "Buffer view does not expose strides";
-static char __pyx_k_39[] = "<MemoryView of %r at 0x%x>";
-static char __pyx_k_40[] = "<MemoryView of %r object>";
-static char __pyx_k_43[] = "Cannot index with type '%s'";
-static char __pyx_k_45[] = "Indirect dimensions not supported";
-static char __pyx_k_47[] = "Index out of bounds (axis %d)";
-static char __pyx_k_48[] = "Step may not be zero (axis %d)";
-static char __pyx_k_49[] = "All dimensions preceding dimension %d must be indexed and not sliced";
-static char __pyx_k_50[] = "Out of bounds on buffer access (axis %d)";
-static char __pyx_k_51[] = "Cannot transpose memoryview with indirect dimensions";
-static char __pyx_k_52[] = "got differing extents in dimension %d (got %d and %d)";
-static char __pyx_k_53[] = "Dimension %d is not direct";
-static char __pyx_k_56[] = "C:\\GIT\\PYMCA_REFERENCE\\pymca\\PyMca5\\PyMcaPhysics\\xas\\_xas\\cython\\_xas.pyx";
-static char __pyx_k_57[] = "PyMca5.PyMcaPhysics.xas._xas";
-static char __pyx_k_66[] = "getbuffer(obj, view, flags)";
-static char __pyx_k_67[] = "<strided and direct or indirect>";
-static char __pyx_k_69[] = "<strided and direct>";
-static char __pyx_k_71[] = "<strided and indirect>";
-static char __pyx_k_73[] = "<contiguous and direct>";
-static char __pyx_k_75[] = "<contiguous and indirect>";
-static char __pyx_k__B[] = "B";
-static char __pyx_k__H[] = "H";
-static char __pyx_k__I[] = "I";
-static char __pyx_k__L[] = "L";
-static char __pyx_k__O[] = "O";
-static char __pyx_k__Q[] = "Q";
-static char __pyx_k__a[] = "a";
-static char __pyx_k__b[] = "b";
-static char __pyx_k__c[] = "c";
-static char __pyx_k__d[] = "d";
-static char __pyx_k__f[] = "f";
-static char __pyx_k__g[] = "g";
-static char __pyx_k__h[] = "h";
-static char __pyx_k__i[] = "i";
-static char __pyx_k__j[] = "j";
-static char __pyx_k__k[] = "k";
-static char __pyx_k__l[] = "l";
-static char __pyx_k__m[] = "m";
-static char __pyx_k__n[] = "n";
-static char __pyx_k__q[] = "q";
-static char __pyx_k__t[] = "t";
-static char __pyx_k__w[] = "w";
-static char __pyx_k__x[] = "x";
-static char __pyx_k__y[] = "y";
-static char __pyx_k__Zd[] = "Zd";
-static char __pyx_k__Zf[] = "Zf";
-static char __pyx_k__Zg[] = "Zg";
-static char __pyx_k__df[] = "df";
-static char __pyx_k__i1[] = "i1";
-static char __pyx_k__id[] = "id";
-static char __pyx_k__ik[] = "ik";
-static char __pyx_k__j0[] = "j0";
-static char __pyx_k__n1[] = "n1";
-static char __pyx_k__nc[] = "nc";
-static char __pyx_k__ni[] = "ni";
-static char __pyx_k__nk[] = "nk";
-static char __pyx_k__nr[] = "nr";
-static char __pyx_k__ns[] = "ns";
-static char __pyx_k__xh[] = "xh";
-static char __pyx_k__xk[] = "xk";
-static char __pyx_k__xl[] = "xl";
-static char __pyx_k__abs[] = "abs";
-static char __pyx_k__c_c[] = "c_c";
-static char __pyx_k__c_w[] = "c_w";
-static char __pyx_k__c_x[] = "c_x";
-static char __pyx_k__c_y[] = "c_y";
-static char __pyx_k__ibl[] = "ibl";
-static char __pyx_k__nbs[] = "nbs";
-static char __pyx_k__ni1[] = "ni1";
-static char __pyx_k__nm1[] = "nm1";
-static char __pyx_k__ns1[] = "ns1";
-static char __pyx_k__obj[] = "obj";
-static char __pyx_k__xh0[] = "xh0";
-static char __pyx_k__xk0[] = "xk0";
-static char __pyx_k__xl0[] = "xl0";
-static char __pyx_k__base[] = "base";
-static char __pyx_k__c_nc[] = "c_nc";
-static char __pyx_k__c_nr[] = "c_nr";
-static char __pyx_k__c_xh[] = "c_xh";
-static char __pyx_k__c_xl[] = "c_xl";
-static char __pyx_k__copy[] = "copy";
-static char __pyx_k__mode[] = "mode";
-static char __pyx_k__name[] = "name";
-static char __pyx_k__ncol[] = "ncol";
-static char __pyx_k__ndim[] = "ndim";
-static char __pyx_k__npts[] = "npts";
-static char __pyx_k__pack[] = "pack";
-static char __pyx_k__size[] = "size";
-static char __pyx_k__step[] = "step";
-static char __pyx_k__stop[] = "stop";
-static char __pyx_k__ASCII[] = "ASCII";
-static char __pyx_k__array[] = "array";
-static char __pyx_k__dtype[] = "dtype";
-static char __pyx_k__error[] = "error";
-static char __pyx_k__flags[] = "flags";
-static char __pyx_k__int32[] = "int32";
-static char __pyx_k__numpy[] = "numpy";
-static char __pyx_k__power[] = "power";
-static char __pyx_k__range[] = "range";
-static char __pyx_k__shape[] = "shape";
-static char __pyx_k__start[] = "start";
-static char __pyx_k__zeros[] = "zeros";
-static char __pyx_k__c_npts[] = "c_npts";
-static char __pyx_k__decode[] = "decode";
-static char __pyx_k__encode[] = "encode";
-static char __pyx_k__extend[] = "extend";
-static char __pyx_k__format[] = "format";
-static char __pyx_k__ne_idl[] = "ne_idl";
-static char __pyx_k__polspl[] = "polspl";
-static char __pyx_k__result[] = "result";
-static char __pyx_k__struct[] = "struct";
-static char __pyx_k__unpack[] = "unpack";
-static char __pyx_k__xrange[] = "xrange";
-static char __pyx_k____len__[] = "__len__";
-static char __pyx_k__c_sizeC[] = "c_sizeC";
-static char __pyx_k__float64[] = "float64";
-static char __pyx_k__fortran[] = "fortran";
-static char __pyx_k__memview[] = "memview";
-static char __pyx_k__polspl2[] = "polspl2";
-static char __pyx_k__Ellipsis[] = "Ellipsis";
-static char __pyx_k____main__[] = "__main__";
-static char __pyx_k____name__[] = "__name__";
-static char __pyx_k____test__[] = "__test__";
-static char __pyx_k__itemsize[] = "itemsize";
-static char __pyx_k__TypeError[] = "TypeError";
-static char __pyx_k____class__[] = "__class__";
-static char __pyx_k__enumerate[] = "enumerate";
-static char __pyx_k__IndexError[] = "IndexError";
-static char __pyx_k__ValueError[] = "ValueError";
-static char __pyx_k____import__[] = "__import__";
-static char __pyx_k__buffer_xh0[] = "buffer_xh0";
-static char __pyx_k__buffer_xl0[] = "buffer_xl0";
-static char __pyx_k__MemoryError[] = "MemoryError";
-static char __pyx_k__RuntimeError[] = "RuntimeError";
-static char __pyx_k___besselSingle[] = "_besselSingle";
-static char __pyx_k____pyx_vtable__[] = "__pyx_vtable__";
-static char __pyx_k____pyx_getbuffer[] = "__pyx_getbuffer";
-static char __pyx_k___besselMultiple[] = "_besselMultiple";
-static char __pyx_k__allocate_buffer[] = "allocate_buffer";
-static char __pyx_k__dtype_is_object[] = "dtype_is_object";
-static char __pyx_k__ascontiguousarray[] = "ascontiguousarray";
-static char __pyx_k____pyx_releasebuffer[] = "__pyx_releasebuffer";
-static PyObject *__pyx_kp_u_11;
-static PyObject *__pyx_kp_u_13;
-static PyObject *__pyx_kp_u_15;
-static PyObject *__pyx_kp_u_16;
-static PyObject *__pyx_kp_u_19;
-static PyObject *__pyx_kp_s_21;
-static PyObject *__pyx_kp_s_23;
-static PyObject *__pyx_kp_s_26;
-static PyObject *__pyx_kp_s_28;
-static PyObject *__pyx_kp_s_29;
-static PyObject *__pyx_kp_s_31;
-static PyObject *__pyx_kp_s_33;
-static PyObject *__pyx_kp_s_35;
-static PyObject *__pyx_kp_s_37;
-static PyObject *__pyx_kp_s_39;
-static PyObject *__pyx_kp_s_40;
-static PyObject *__pyx_kp_s_43;
-static PyObject *__pyx_kp_s_45;
-static PyObject *__pyx_kp_s_50;
-static PyObject *__pyx_kp_s_52;
-static PyObject *__pyx_kp_s_56;
-static PyObject *__pyx_n_s_57;
-static PyObject *__pyx_kp_s_67;
-static PyObject *__pyx_kp_s_69;
-static PyObject *__pyx_kp_s_71;
-static PyObject *__pyx_kp_s_73;
-static PyObject *__pyx_kp_s_75;
-static PyObject *__pyx_kp_u_9;
-static PyObject *__pyx_n_s__ASCII;
-static PyObject *__pyx_n_s__Ellipsis;
-static PyObject *__pyx_n_s__IndexError;
-static PyObject *__pyx_n_s__MemoryError;
-static PyObject *__pyx_n_b__O;
-static PyObject *__pyx_n_s__RuntimeError;
-static PyObject *__pyx_n_s__TypeError;
-static PyObject *__pyx_n_s__ValueError;
-static PyObject *__pyx_n_s____class__;
-static PyObject *__pyx_n_s____import__;
-static PyObject *__pyx_n_s____len__;
-static PyObject *__pyx_n_s____main__;
-static PyObject *__pyx_n_s____name__;
-static PyObject *__pyx_n_s____pyx_getbuffer;
-static PyObject *__pyx_n_s____pyx_releasebuffer;
-static PyObject *__pyx_n_s____pyx_vtable__;
-static PyObject *__pyx_n_s____test__;
-static PyObject *__pyx_n_s___besselMultiple;
-static PyObject *__pyx_n_s___besselSingle;
-static PyObject *__pyx_n_s__a;
-static PyObject *__pyx_n_s__abs;
-static PyObject *__pyx_n_s__allocate_buffer;
-static PyObject *__pyx_n_s__array;
-static PyObject *__pyx_n_s__ascontiguousarray;
-static PyObject *__pyx_n_s__base;
-static PyObject *__pyx_n_s__buffer_xh0;
-static PyObject *__pyx_n_s__buffer_xl0;
-static PyObject *__pyx_n_b__c;
-static PyObject *__pyx_n_s__c;
-static PyObject *__pyx_n_u__c;
-static PyObject *__pyx_n_s__c_c;
-static PyObject *__pyx_n_s__c_nc;
-static PyObject *__pyx_n_s__c_npts;
-static PyObject *__pyx_n_s__c_nr;
-static PyObject *__pyx_n_s__c_sizeC;
-static PyObject *__pyx_n_s__c_w;
-static PyObject *__pyx_n_s__c_x;
-static PyObject *__pyx_n_s__c_xh;
-static PyObject *__pyx_n_s__c_xl;
-static PyObject *__pyx_n_s__c_y;
-static PyObject *__pyx_n_s__copy;
-static PyObject *__pyx_n_s__decode;
-static PyObject *__pyx_n_s__df;
-static PyObject *__pyx_n_s__dtype;
-static PyObject *__pyx_n_s__dtype_is_object;
-static PyObject *__pyx_n_s__encode;
-static PyObject *__pyx_n_s__enumerate;
-static PyObject *__pyx_n_s__error;
-static PyObject *__pyx_n_s__extend;
-static PyObject *__pyx_n_s__flags;
-static PyObject *__pyx_n_s__float64;
-static PyObject *__pyx_n_s__format;
-static PyObject *__pyx_n_b__fortran;
-static PyObject *__pyx_n_s__fortran;
-static PyObject *__pyx_n_s__i;
-static PyObject *__pyx_n_s__i1;
-static PyObject *__pyx_n_s__ibl;
-static PyObject *__pyx_n_s__id;
-static PyObject *__pyx_n_s__ik;
-static PyObject *__pyx_n_s__int32;
-static PyObject *__pyx_n_s__itemsize;
-static PyObject *__pyx_n_s__j;
-static PyObject *__pyx_n_s__j0;
-static PyObject *__pyx_n_s__k;
-static PyObject *__pyx_n_s__m;
-static PyObject *__pyx_n_s__memview;
-static PyObject *__pyx_n_s__mode;
-static PyObject *__pyx_n_s__n;
-static PyObject *__pyx_n_s__n1;
-static PyObject *__pyx_n_s__name;
-static PyObject *__pyx_n_s__nbs;
-static PyObject *__pyx_n_s__nc;
-static PyObject *__pyx_n_s__ncol;
-static PyObject *__pyx_n_s__ndim;
-static PyObject *__pyx_n_s__ne_idl;
-static PyObject *__pyx_n_s__ni;
-static PyObject *__pyx_n_s__ni1;
-static PyObject *__pyx_n_s__nk;
-static PyObject *__pyx_n_s__nm1;
-static PyObject *__pyx_n_s__npts;
-static PyObject *__pyx_n_s__nr;
-static PyObject *__pyx_n_s__ns;
-static PyObject *__pyx_n_s__ns1;
-static PyObject *__pyx_n_s__numpy;
-static PyObject *__pyx_n_s__obj;
-static PyObject *__pyx_n_s__pack;
-static PyObject *__pyx_n_s__polspl;
-static PyObject *__pyx_n_s__polspl2;
-static PyObject *__pyx_n_s__power;
-static PyObject *__pyx_n_s__range;
-static PyObject *__pyx_n_s__result;
-static PyObject *__pyx_n_s__shape;
-static PyObject *__pyx_n_s__size;
-static PyObject *__pyx_n_s__start;
-static PyObject *__pyx_n_s__step;
-static PyObject *__pyx_n_s__stop;
-static PyObject *__pyx_n_s__struct;
-static PyObject *__pyx_n_s__t;
-static PyObject *__pyx_n_s__unpack;
-static PyObject *__pyx_n_s__w;
-static PyObject *__pyx_n_s__x;
-static PyObject *__pyx_n_s__xh;
-static PyObject *__pyx_n_s__xh0;
-static PyObject *__pyx_n_s__xk;
-static PyObject *__pyx_n_s__xk0;
-static PyObject *__pyx_n_s__xl;
-static PyObject *__pyx_n_s__xl0;
-static PyObject *__pyx_n_s__xrange;
-static PyObject *__pyx_n_s__y;
-static PyObject *__pyx_n_s__zeros;
-static PyObject *__pyx_int_0;
-static PyObject *__pyx_int_1;
-static PyObject *__pyx_int_2;
-static PyObject *__pyx_int_neg_1;
-static PyObject *__pyx_int_10;
-static PyObject *__pyx_int_11;
-static PyObject *__pyx_int_15;
-static PyObject *__pyx_int_26;
-static PyObject *__pyx_int_36;
-static PyObject *__pyx_int_37;
-static PyObject *__pyx_k_tuple_1;
-static PyObject *__pyx_k_tuple_2;
-static PyObject *__pyx_k_tuple_3;
-static PyObject *__pyx_k_tuple_4;
-static PyObject *__pyx_k_tuple_5;
-static PyObject *__pyx_k_tuple_6;
-static PyObject *__pyx_k_tuple_7;
-static PyObject *__pyx_k_tuple_8;
-static PyObject *__pyx_k_tuple_10;
-static PyObject *__pyx_k_tuple_12;
-static PyObject *__pyx_k_tuple_14;
-static PyObject *__pyx_k_tuple_17;
-static PyObject *__pyx_k_tuple_18;
-static PyObject *__pyx_k_tuple_20;
-static PyObject *__pyx_k_tuple_22;
-static PyObject *__pyx_k_tuple_24;
-static PyObject *__pyx_k_tuple_25;
-static PyObject *__pyx_k_tuple_27;
-static PyObject *__pyx_k_tuple_30;
-static PyObject *__pyx_k_tuple_32;
-static PyObject *__pyx_k_tuple_34;
-static PyObject *__pyx_k_tuple_36;
-static PyObject *__pyx_k_tuple_38;
-static PyObject *__pyx_k_tuple_41;
-static PyObject *__pyx_k_tuple_42;
-static PyObject *__pyx_k_tuple_44;
-static PyObject *__pyx_k_tuple_46;
-static PyObject *__pyx_k_tuple_54;
-static PyObject *__pyx_k_tuple_58;
-static PyObject *__pyx_k_tuple_60;
-static PyObject *__pyx_k_tuple_62;
-static PyObject *__pyx_k_tuple_64;
-static PyObject *__pyx_k_tuple_68;
-static PyObject *__pyx_k_tuple_70;
-static PyObject *__pyx_k_tuple_72;
-static PyObject *__pyx_k_tuple_74;
-static PyObject *__pyx_k_tuple_76;
-static PyObject *__pyx_k_codeobj_55;
-static PyObject *__pyx_k_codeobj_59;
-static PyObject *__pyx_k_codeobj_61;
-static PyObject *__pyx_k_codeobj_63;
-static PyObject *__pyx_k_codeobj_65;
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0 = {__Pyx_NAMESTR("j0"), (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0(PyObject *__pyx_self, PyObject *__pyx_v_x) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("j0 (wrapper)", 0);
- __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_j0(__pyx_self, ((PyObject *)__pyx_v_x));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":35
- * from bessel0 cimport j0Single, j0Multiple
- *
- * def j0(x): # <<<<<<<<<<<<<<
- * if hasattr(x, "__len__"):
- * return _besselMultiple(x)
- */
-
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_j0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("j0", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":36
- *
- * def j0(x):
- * if hasattr(x, "__len__"): # <<<<<<<<<<<<<<
- * return _besselMultiple(x)
- * else:
- */
- __pyx_t_1 = PyObject_HasAttr(__pyx_v_x, ((PyObject *)__pyx_n_s____len__)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 36; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":37
- * def j0(x):
- * if hasattr(x, "__len__"):
- * return _besselMultiple(x) # <<<<<<<<<<<<<<
- * else:
- * return _besselSingle(x)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s___besselMultiple); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":39
- * return _besselMultiple(x)
- * else:
- * return _besselSingle(x) # <<<<<<<<<<<<<<
- *
- * def _besselMultiple(x):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s___besselSingle); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_3 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 39; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.j0", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple = {__Pyx_NAMESTR("_besselMultiple"), (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple(PyObject *__pyx_self, PyObject *__pyx_v_x) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_besselMultiple (wrapper)", 0);
- __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_2_besselMultiple(__pyx_self, ((PyObject *)__pyx_v_x));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":41
- * return _besselSingle(x)
- *
- * def _besselMultiple(x): # <<<<<<<<<<<<<<
- * result = numpy.array(x, copy=True, dtype=numpy.float64)
- * cdef double[:] c_x = result
- */
-
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_2_besselMultiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
- PyObject *__pyx_v_result = NULL;
- __Pyx_memviewslice __pyx_v_c_x = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_c_npts;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_7;
- Py_ssize_t __pyx_t_8;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_besselMultiple", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":42
- *
- * def _besselMultiple(x):
- * result = numpy.array(x, copy=True, dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef double[:] c_x = result
- * cdef int c_npts = c_x.size
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__array); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__copy), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 42; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_result = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":43
- * def _besselMultiple(x):
- * result = numpy.array(x, copy=True, dtype=numpy.float64)
- * cdef double[:] c_x = result # <<<<<<<<<<<<<<
- * cdef int c_npts = c_x.size
- * j0Multiple(&c_x[0], c_npts)
- */
- __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_result);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_x = __pyx_t_6;
- __pyx_t_6.memview = NULL;
- __pyx_t_6.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":44
- * result = numpy.array(x, copy=True, dtype=numpy.float64)
- * cdef double[:] c_x = result
- * cdef int c_npts = c_x.size # <<<<<<<<<<<<<<
- * j0Multiple(&c_x[0], c_npts)
- * return result
- */
- __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_c_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s__size); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyInt_AsInt(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 44; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_c_npts = __pyx_t_7;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":45
- * cdef double[:] c_x = result
- * cdef int c_npts = c_x.size
- * j0Multiple(&c_x[0], c_npts) # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_t_8 = 0;
- __pyx_t_7 = -1;
- if (__pyx_t_8 < 0) {
- __pyx_t_8 += __pyx_v_c_x.shape[0];
- if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
- } else if (unlikely(__pyx_t_8 >= __pyx_v_c_x.shape[0])) __pyx_t_7 = 0;
- if (unlikely(__pyx_t_7 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_7);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 45; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- j0Multiple((&(*((double *) ( /* dim=0 */ (__pyx_v_c_x.data + __pyx_t_8 * __pyx_v_c_x.strides[0]) )))), __pyx_v_c_npts);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":46
- * cdef int c_npts = c_x.size
- * j0Multiple(&c_x[0], c_npts)
- * return result # <<<<<<<<<<<<<<
- *
- * def _besselSingle(double x):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_result);
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas._besselMultiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_result);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_x, 1);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle(PyObject *__pyx_self, PyObject *__pyx_arg_x); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle = {__Pyx_NAMESTR("_besselSingle"), (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle, METH_O, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle(PyObject *__pyx_self, PyObject *__pyx_arg_x) {
- double __pyx_v_x;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("_besselSingle (wrapper)", 0);
- assert(__pyx_arg_x); {
- __pyx_v_x = __pyx_PyFloat_AsDouble(__pyx_arg_x); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas._besselSingle", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_4_besselSingle(__pyx_self, ((double)__pyx_v_x));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":48
- * return result
- *
- * def _besselSingle(double x): # <<<<<<<<<<<<<<
- * return j0Single(x)
- *
- */
-
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_4_besselSingle(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_besselSingle", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":49
- *
- * def _besselSingle(double x):
- * return j0Single(x) # <<<<<<<<<<<<<<
- *
- * def polspl(x, y, w, npts, xl, xh, nr, nc):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyFloat_FromDouble(j0Single(__pyx_v_x)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 49; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas._besselSingle", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl = {__Pyx_NAMESTR("polspl"), (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_x = 0;
- PyObject *__pyx_v_y = 0;
- PyObject *__pyx_v_w = 0;
- PyObject *__pyx_v_npts = 0;
- PyObject *__pyx_v_xl = 0;
- PyObject *__pyx_v_xh = 0;
- PyObject *__pyx_v_nr = 0;
- PyObject *__pyx_v_nc = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("polspl (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,&__pyx_n_s__w,&__pyx_n_s__npts,&__pyx_n_s__xl,&__pyx_n_s__xh,&__pyx_n_s__nr,&__pyx_n_s__nc,0};
- PyObject* values[8] = {0,0,0,0,0,0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
- case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__w)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 3:
- if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__npts)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 4:
- if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xl)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 5:
- if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xh)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 6:
- if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nr)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 7:
- if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nc)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polspl") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
- values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
- }
- __pyx_v_x = values[0];
- __pyx_v_y = values[1];
- __pyx_v_w = values[2];
- __pyx_v_npts = values[3];
- __pyx_v_xl = values[4];
- __pyx_v_xh = values[5];
- __pyx_v_nr = values[6];
- __pyx_v_nc = values[7];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_6polspl(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_npts, __pyx_v_xl, __pyx_v_xh, __pyx_v_nr, __pyx_v_nc);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":51
- * return j0Single(x)
- *
- * def polspl(x, y, w, npts, xl, xh, nr, nc): # <<<<<<<<<<<<<<
- * c = numpy.zeros((36,), dtype=numpy.float64)
- * cdef double[:] c_c = c
- */
-
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_6polspl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl, PyObject *__pyx_v_xh, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc) {
- PyObject *__pyx_v_c = NULL;
- __Pyx_memviewslice __pyx_v_c_c = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_v_c_x = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_v_c_y = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_v_c_w = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_c_npts;
- __Pyx_memviewslice __pyx_v_c_xl = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_v_c_xh = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_c_nr;
- __Pyx_memviewslice __pyx_v_c_nc = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_v_c_sizeC;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
- PyObject *__pyx_t_6 = NULL;
- __Pyx_memviewslice __pyx_t_7 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
- int __pyx_t_10;
- __Pyx_memviewslice __pyx_t_11 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_12 = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_memviewslice __pyx_t_13 = { 0, 0, { 0 }, { 0 }, { 0 } };
- Py_ssize_t __pyx_t_14;
- Py_ssize_t __pyx_t_15;
- Py_ssize_t __pyx_t_16;
- Py_ssize_t __pyx_t_17;
- Py_ssize_t __pyx_t_18;
- Py_ssize_t __pyx_t_19;
- Py_ssize_t __pyx_t_20;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("polspl", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":52
- *
- * def polspl(x, y, w, npts, xl, xh, nr, nc):
- * c = numpy.zeros((36,), dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef double[:] c_c = c
- * cdef double[:] c_x = numpy.ascontiguousarray(x,
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_v_c = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":53
- * def polspl(x, y, w, npts, xl, xh, nr, nc):
- * c = numpy.zeros((36,), dtype=numpy.float64)
- * cdef double[:] c_c = c # <<<<<<<<<<<<<<
- * cdef double[:] c_x = numpy.ascontiguousarray(x,
- * dtype=numpy.float64)
- */
- __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_c);
- if (unlikely(!__pyx_t_5.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_c = __pyx_t_5;
- __pyx_t_5.memview = NULL;
- __pyx_t_5.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":54
- * c = numpy.zeros((36,), dtype=numpy.float64)
- * cdef double[:] c_c = c
- * cdef double[:] c_x = numpy.ascontiguousarray(x, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef double[:] c_y = numpy.ascontiguousarray(y,
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_x);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
- __Pyx_GIVEREF(__pyx_v_x);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":55
- * cdef double[:] c_c = c
- * cdef double[:] c_x = numpy.ascontiguousarray(x,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef double[:] c_y = numpy.ascontiguousarray(y,
- * dtype=numpy.float64)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_7 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_6);
- if (unlikely(!__pyx_t_7.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_c_x = __pyx_t_7;
- __pyx_t_7.memview = NULL;
- __pyx_t_7.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":56
- * cdef double[:] c_x = numpy.ascontiguousarray(x,
- * dtype=numpy.float64)
- * cdef double[:] c_y = numpy.ascontiguousarray(y, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef double[:] c_w = numpy.ascontiguousarray(w,
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_INCREF(__pyx_v_y);
- PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_y);
- __Pyx_GIVEREF(__pyx_v_y);
- __pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":57
- * dtype=numpy.float64)
- * cdef double[:] c_y = numpy.ascontiguousarray(y,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef double[:] c_w = numpy.ascontiguousarray(w,
- * dtype=numpy.float64)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (PyDict_SetItem(__pyx_t_4, ((PyObject *)__pyx_n_s__dtype), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3);
- if (unlikely(!__pyx_t_8.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_c_y = __pyx_t_8;
- __pyx_t_8.memview = NULL;
- __pyx_t_8.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":58
- * cdef double[:] c_y = numpy.ascontiguousarray(y,
- * dtype=numpy.float64)
- * cdef double[:] c_w = numpy.ascontiguousarray(w, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef int c_npts = npts
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_w);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_w);
- __Pyx_GIVEREF(__pyx_v_w);
- __pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_6));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":59
- * dtype=numpy.float64)
- * cdef double[:] c_w = numpy.ascontiguousarray(w,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef int c_npts = npts
- * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__float64); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (PyDict_SetItem(__pyx_t_6, ((PyObject *)__pyx_n_s__dtype), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), ((PyObject *)__pyx_t_6)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1);
- if (unlikely(!__pyx_t_9.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_c_w = __pyx_t_9;
- __pyx_t_9.memview = NULL;
- __pyx_t_9.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":60
- * cdef double[:] c_w = numpy.ascontiguousarray(w,
- * dtype=numpy.float64)
- * cdef int c_npts = npts # <<<<<<<<<<<<<<
- * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
- * dtype=numpy.float64)
- */
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_npts); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_npts = __pyx_t_10;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":61
- * dtype=numpy.float64)
- * cdef int c_npts = npts
- * cdef double[:] c_xl = numpy.ascontiguousarray(xl, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_xl);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xl);
- __Pyx_GIVEREF(__pyx_v_xl);
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":62
- * cdef int c_npts = npts
- * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
- * dtype=numpy.float64)
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__dtype), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_1), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_11 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2);
- if (unlikely(!__pyx_t_11.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_c_xl = __pyx_t_11;
- __pyx_t_11.memview = NULL;
- __pyx_t_11.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":63
- * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
- * dtype=numpy.float64)
- * cdef double[:] c_xh = numpy.ascontiguousarray(xh, # <<<<<<<<<<<<<<
- * dtype=numpy.float64)
- * cdef int c_nr = nr
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_xh);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xh);
- __Pyx_GIVEREF(__pyx_v_xh);
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":64
- * dtype=numpy.float64)
- * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
- * dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef int c_nr = nr
- * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
- */
- __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__float64); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 64; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- if (PyDict_SetItem(__pyx_t_1, ((PyObject *)__pyx_n_s__dtype), __pyx_t_4) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_12 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4);
- if (unlikely(!__pyx_t_12.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 63; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_v_c_xh = __pyx_t_12;
- __pyx_t_12.memview = NULL;
- __pyx_t_12.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":65
- * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
- * dtype=numpy.float64)
- * cdef int c_nr = nr # <<<<<<<<<<<<<<
- * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
- * dtype=numpy.int32)
- */
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_v_nr); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 65; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_c_nr = __pyx_t_10;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":66
- * dtype=numpy.float64)
- * cdef int c_nr = nr
- * cdef int[:] c_nc = numpy.ascontiguousarray(nc, # <<<<<<<<<<<<<<
- * dtype=numpy.int32)
- * cdef int c_sizeC = c_c.size
- */
- __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_v_nc);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nc);
- __Pyx_GIVEREF(__pyx_v_nc);
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":67
- * cdef int c_nr = nr
- * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
- * dtype=numpy.int32) # <<<<<<<<<<<<<<
- * cdef int c_sizeC = c_c.size
- * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__int32); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 67; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), __pyx_t_6) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_4), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_13 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6);
- if (unlikely(!__pyx_t_13.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 66; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_c_nc = __pyx_t_13;
- __pyx_t_13.memview = NULL;
- __pyx_t_13.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":68
- * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
- * dtype=numpy.int32)
- * cdef int c_sizeC = c_c.size # <<<<<<<<<<<<<<
- * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
- * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC)
- */
- __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_c_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s__size); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_10 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_10 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 68; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_c_sizeC = __pyx_t_10;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":69
- * dtype=numpy.int32)
- * cdef int c_sizeC = c_c.size
- * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \ # <<<<<<<<<<<<<<
- * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC)
- * return c
- */
- __pyx_t_14 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_14 < 0) {
- __pyx_t_14 += __pyx_v_c_x.shape[0];
- if (unlikely(__pyx_t_14 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_14 >= __pyx_v_c_x.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_15 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_15 < 0) {
- __pyx_t_15 += __pyx_v_c_y.shape[0];
- if (unlikely(__pyx_t_15 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_15 >= __pyx_v_c_y.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_16 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_16 < 0) {
- __pyx_t_16 += __pyx_v_c_w.shape[0];
- if (unlikely(__pyx_t_16 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_16 >= __pyx_v_c_w.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":70
- * cdef int c_sizeC = c_c.size
- * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
- * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC) # <<<<<<<<<<<<<<
- * return c
- *
- */
- __pyx_t_17 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_17 < 0) {
- __pyx_t_17 += __pyx_v_c_xl.shape[0];
- if (unlikely(__pyx_t_17 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_17 >= __pyx_v_c_xl.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_18 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_18 < 0) {
- __pyx_t_18 += __pyx_v_c_xh.shape[0];
- if (unlikely(__pyx_t_18 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_18 >= __pyx_v_c_xh.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_19 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_19 < 0) {
- __pyx_t_19 += __pyx_v_c_nc.shape[0];
- if (unlikely(__pyx_t_19 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_19 >= __pyx_v_c_nc.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_20 = 0;
- __pyx_t_10 = -1;
- if (__pyx_t_20 < 0) {
- __pyx_t_20 += __pyx_v_c_c.shape[0];
- if (unlikely(__pyx_t_20 < 0)) __pyx_t_10 = 0;
- } else if (unlikely(__pyx_t_20 >= __pyx_v_c_c.shape[0])) __pyx_t_10 = 0;
- if (unlikely(__pyx_t_10 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_10);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- polspl((&(*((double *) ( /* dim=0 */ (__pyx_v_c_x.data + __pyx_t_14 * __pyx_v_c_x.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_c_y.data + __pyx_t_15 * __pyx_v_c_y.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_c_w.data + __pyx_t_16 * __pyx_v_c_w.strides[0]) )))), __pyx_v_c_npts, (&(*((double *) ( /* dim=0 */ (__pyx_v_c_xl.data + __pyx_t_17 * __pyx_v_c_xl.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_c_xh.data + __pyx_t_18 * __pyx_v_c_xh.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_c_nc.data + __pyx_t_19 * __pyx_v_c_nc.strides[0]) )))), __pyx_v_c_nr, (&(*((double *) ( /* dim=0 */ (__pyx_v_c_c.data + __pyx_t_20 * __pyx_v_c_c.strides[0]) )))), __pyx_v_c_sizeC);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":71
- * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
- * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC)
- * return c # <<<<<<<<<<<<<<
- *
- * def polspl2(x,y,w,npts,xl0,xh0,nr,nc):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_c);
- __pyx_r = __pyx_v_c;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
- __Pyx_XDECREF(__pyx_t_6);
- __PYX_XDEC_MEMVIEW(&__pyx_t_7, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_11, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_12, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_t_13, 1);
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_c);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_c, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_x, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_y, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_w, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_xl, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_xh, 1);
- __PYX_XDEC_MEMVIEW(&__pyx_v_c_nc, 1);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2 = {__Pyx_NAMESTR("polspl2"), (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)};
-static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_x = 0;
- PyObject *__pyx_v_y = 0;
- PyObject *__pyx_v_w = 0;
- PyObject *__pyx_v_npts = 0;
- PyObject *__pyx_v_xl0 = 0;
- PyObject *__pyx_v_xh0 = 0;
- PyObject *__pyx_v_nr = 0;
- PyObject *__pyx_v_nc = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("polspl2 (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__x,&__pyx_n_s__y,&__pyx_n_s__w,&__pyx_n_s__npts,&__pyx_n_s__xl0,&__pyx_n_s__xh0,&__pyx_n_s__nr,&__pyx_n_s__nc,0};
- PyObject* values[8] = {0,0,0,0,0,0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
- case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
- case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__x)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__y)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__w)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 3:
- if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__npts)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 4:
- if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xl0)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 5:
- if (likely((values[5] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__xh0)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 5); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 6:
- if (likely((values[6] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nr)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 6); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 7:
- if (likely((values[7] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__nc)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 7); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polspl2") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
- values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
- values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
- }
- __pyx_v_x = values[0];
- __pyx_v_y = values[1];
- __pyx_v_w = values[2];
- __pyx_v_npts = values[3];
- __pyx_v_xl0 = values[4];
- __pyx_v_xh0 = values[5];
- __pyx_v_nr = values[6];
- __pyx_v_nc = values[7];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl2", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return NULL;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_8polspl2(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_npts, __pyx_v_xl0, __pyx_v_xh0, __pyx_v_nr, __pyx_v_nc);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":73
- * return c
- *
- * def polspl2(x,y,w,npts,xl0,xh0,nr,nc): # <<<<<<<<<<<<<<
- *
- * # ;
- */
-
-static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_8polspl2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl0, PyObject *__pyx_v_xh0, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc) {
- PyArrayObject *__pyx_v_buffer_xl0 = 0;
- double *__pyx_v_xl;
- PyArrayObject *__pyx_v_buffer_xh0 = 0;
- double *__pyx_v_xh;
- PyObject *__pyx_v_df = NULL;
- PyObject *__pyx_v_a = NULL;
- PyObject *__pyx_v_nbs = NULL;
- __Pyx_memviewslice __pyx_v_xk0 = { 0, 0, { 0 }, { 0 }, { 0 } };
- double *__pyx_v_xk;
- PyObject *__pyx_v_c = NULL;
- int __pyx_v_j;
- int __pyx_v_i;
- PyObject *__pyx_v_ne_idl = NULL;
- PyObject *__pyx_v_n = NULL;
- int __pyx_v_k;
- int __pyx_v_ibl;
- int __pyx_v_ns;
- int __pyx_v_ns1;
- PyObject *__pyx_v_t = NULL;
- PyObject *__pyx_v_n1 = NULL;
- PyObject *__pyx_v_ncol = NULL;
- PyObject *__pyx_v_nk = NULL;
- PyObject *__pyx_v_ik = NULL;
- PyObject *__pyx_v_i1 = NULL;
- PyObject *__pyx_v_nm1 = NULL;
- int __pyx_v_m;
- PyObject *__pyx_v_ni = NULL;
- PyObject *__pyx_v_ni1 = NULL;
- __Pyx_LocalBuf_ND __pyx_pybuffernd_buffer_xh0;
- __Pyx_Buffer __pyx_pybuffer_buffer_xh0;
- __Pyx_LocalBuf_ND __pyx_pybuffernd_buffer_xl0;
- __Pyx_Buffer __pyx_pybuffer_buffer_xl0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyArrayObject *__pyx_t_4 = NULL;
- PyArrayObject *__pyx_t_5 = NULL;
- __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
- Py_ssize_t __pyx_t_7;
- int __pyx_t_8;
- long __pyx_t_9;
- long __pyx_t_10;
- int __pyx_t_11;
- double __pyx_t_12;
- Py_ssize_t __pyx_t_13;
- int __pyx_t_14;
- int __pyx_t_15;
- int __pyx_t_16;
- long __pyx_t_17;
- int __pyx_t_18;
- long __pyx_t_19;
- int __pyx_t_20;
- PyObject *__pyx_t_21 = NULL;
- PyObject *(*__pyx_t_22)(PyObject *);
- Py_ssize_t __pyx_t_23;
- PyObject *__pyx_t_24 = NULL;
- PyObject *__pyx_t_25 = NULL;
- long __pyx_t_26;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("polspl2", 0);
- __pyx_pybuffer_buffer_xl0.pybuffer.buf = NULL;
- __pyx_pybuffer_buffer_xl0.refcount = 0;
- __pyx_pybuffernd_buffer_xl0.data = NULL;
- __pyx_pybuffernd_buffer_xl0.rcbuffer = &__pyx_pybuffer_buffer_xl0;
- __pyx_pybuffer_buffer_xh0.pybuffer.buf = NULL;
- __pyx_pybuffer_buffer_xh0.refcount = 0;
- __pyx_pybuffernd_buffer_xh0.data = NULL;
- __pyx_pybuffernd_buffer_xh0.rcbuffer = &__pyx_pybuffer_buffer_xh0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":80
- *
- * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xl0 = \
- * numpy.ascontiguousarray(xl0, numpy.float64) # <<<<<<<<<<<<<<
- * cdef double * xl = <double *> buffer_xl0.data
- * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__float64); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_xl0);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xl0);
- __Pyx_GIVEREF(__pyx_v_xl0);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_4 = ((PyArrayObject *)__pyx_t_3);
- {
- __Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer, (PyObject*)__pyx_t_4, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
- __pyx_v_buffer_xl0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer.buf = NULL;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else {__pyx_pybuffernd_buffer_xl0.diminfo[0].strides = __pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer_xl0.diminfo[0].shape = __pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer.shape[0];
- }
- }
- __pyx_t_4 = 0;
- __pyx_v_buffer_xl0 = ((PyArrayObject *)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":81
- * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xl0 = \
- * numpy.ascontiguousarray(xl0, numpy.float64)
- * cdef double * xl = <double *> buffer_xl0.data # <<<<<<<<<<<<<<
- * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
- * numpy.ascontiguousarray(xh0, numpy.float64)
- */
- __pyx_v_xl = ((double *)__pyx_v_buffer_xl0->data);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":83
- * cdef double * xl = <double *> buffer_xl0.data
- * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
- * numpy.ascontiguousarray(xh0, numpy.float64) # <<<<<<<<<<<<<<
- * cdef double * xh = <double *> buffer_xh0.data
- * df = numpy.zeros(26)
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__ascontiguousarray); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__float64); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_xh0);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_xh0);
- __Pyx_GIVEREF(__pyx_v_xh0);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- if (!(likely(((__pyx_t_2) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 83; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = ((PyArrayObject *)__pyx_t_2);
- {
- __Pyx_BufFmt_StackElem __pyx_stack[1];
- if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer, (PyObject*)__pyx_t_5, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
- __pyx_v_buffer_xh0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer.buf = NULL;
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else {__pyx_pybuffernd_buffer_xh0.diminfo[0].strides = __pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer_xh0.diminfo[0].shape = __pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer.shape[0];
- }
- }
- __pyx_t_5 = 0;
- __pyx_v_buffer_xh0 = ((PyArrayObject *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":84
- * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
- * numpy.ascontiguousarray(xh0, numpy.float64)
- * cdef double * xh = <double *> buffer_xh0.data # <<<<<<<<<<<<<<
- * df = numpy.zeros(26)
- * a = numpy.zeros((36,37))
- */
- __pyx_v_xh = ((double *)__pyx_v_buffer_xh0->data);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":85
- * numpy.ascontiguousarray(xh0, numpy.float64)
- * cdef double * xh = <double *> buffer_xh0.data
- * df = numpy.zeros(26) # <<<<<<<<<<<<<<
- * a = numpy.zeros((36,37))
- * nbs = numpy.zeros(11,dtype=int)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_df = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":86
- * cdef double * xh = <double *> buffer_xh0.data
- * df = numpy.zeros(26)
- * a = numpy.zeros((36,37)) # <<<<<<<<<<<<<<
- * nbs = numpy.zeros(11,dtype=int)
- * cdef double[:] xk0 = numpy.zeros(10)
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_5), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_a = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":87
- * df = numpy.zeros(26)
- * a = numpy.zeros((36,37))
- * nbs = numpy.zeros(11,dtype=int) # <<<<<<<<<<<<<<
- * cdef double[:] xk0 = numpy.zeros(10)
- * cdef double * xk = &xk0[0]
- */
- __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s__zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- if (PyDict_SetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__dtype), ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_k_tuple_6), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_v_nbs = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":88
- * a = numpy.zeros((36,37))
- * nbs = numpy.zeros(11,dtype=int)
- * cdef double[:] xk0 = numpy.zeros(10) # <<<<<<<<<<<<<<
- * cdef double * xk = &xk0[0]
- * c = numpy.zeros(36)
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1);
- if (unlikely(!__pyx_t_6.memview)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_xk0 = __pyx_t_6;
- __pyx_t_6.memview = NULL;
- __pyx_t_6.data = NULL;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":89
- * nbs = numpy.zeros(11,dtype=int)
- * cdef double[:] xk0 = numpy.zeros(10)
- * cdef double * xk = &xk0[0] # <<<<<<<<<<<<<<
- * c = numpy.zeros(36)
- * cdef int j=0
- */
- __pyx_t_7 = 0;
- __pyx_t_8 = -1;
- if (__pyx_t_7 < 0) {
- __pyx_t_7 += __pyx_v_xk0.shape[0];
- if (unlikely(__pyx_t_7 < 0)) __pyx_t_8 = 0;
- } else if (unlikely(__pyx_t_7 >= __pyx_v_xk0.shape[0])) __pyx_t_8 = 0;
- if (unlikely(__pyx_t_8 != -1)) {
- __Pyx_RaiseBufferIndexError(__pyx_t_8);
- {__pyx_filename = __pyx_f[0]; __pyx_lineno = 89; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_v_xk = (&(*((double *) ( /* dim=0 */ (__pyx_v_xk0.data + __pyx_t_7 * __pyx_v_xk0.strides[0]) ))));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":90
- * cdef double[:] xk0 = numpy.zeros(10)
- * cdef double * xk = &xk0[0]
- * c = numpy.zeros(36) # <<<<<<<<<<<<<<
- * cdef int j=0
- * cdef int i=0
- */
- __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s__zeros); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_k_tuple_8), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_c = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":91
- * cdef double * xk = &xk0[0]
- * c = numpy.zeros(36)
- * cdef int j=0 # <<<<<<<<<<<<<<
- * cdef int i=0
- * ne_idl=0
- */
- __pyx_v_j = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":92
- * c = numpy.zeros(36)
- * cdef int j=0
- * cdef int i=0 # <<<<<<<<<<<<<<
- * ne_idl=0
- * n = 0
- */
- __pyx_v_i = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":93
- * cdef int j=0
- * cdef int i=0
- * ne_idl=0 # <<<<<<<<<<<<<<
- * n = 0
- * cdef int k = 0
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_ne_idl = __pyx_int_0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":94
- * cdef int i=0
- * ne_idl=0
- * n = 0 # <<<<<<<<<<<<<<
- * cdef int k = 0
- * cdef int ibl = 0
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_v_n = __pyx_int_0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":95
- * ne_idl=0
- * n = 0
- * cdef int k = 0 # <<<<<<<<<<<<<<
- * cdef int ibl = 0
- * cdef int ns = 0
- */
- __pyx_v_k = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":96
- * n = 0
- * cdef int k = 0
- * cdef int ibl = 0 # <<<<<<<<<<<<<<
- * cdef int ns = 0
- * cdef int ns1 = 0
- */
- __pyx_v_ibl = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":97
- * cdef int k = 0
- * cdef int ibl = 0
- * cdef int ns = 0 # <<<<<<<<<<<<<<
- * cdef int ns1 = 0
- *
- */
- __pyx_v_ns = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":98
- * cdef int ibl = 0
- * cdef int ns = 0
- * cdef int ns1 = 0 # <<<<<<<<<<<<<<
- *
- * nbs[1]=1
- */
- __pyx_v_ns1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":100
- * cdef int ns1 = 0
- *
- * nbs[1]=1 # <<<<<<<<<<<<<<
- * for i in range(1,nr+1):
- * n=n+int(nc[i])
- */
- if (__Pyx_SetItemInt(__pyx_v_nbs, 1, __pyx_int_1, sizeof(long), PyInt_FromLong, 0, 0, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":101
- *
- * nbs[1]=1
- * for i in range(1,nr+1): # <<<<<<<<<<<<<<
- * n=n+int(nc[i])
- * nbs[i+1]=n+1
- */
- __pyx_t_1 = PyNumber_Add(__pyx_v_nr, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":102
- * nbs[1]=1
- * for i in range(1,nr+1):
- * n=n+int(nc[i]) # <<<<<<<<<<<<<<
- * nbs[i+1]=n+1
- * if xl[i] < xh[i]:
- */
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_nc, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 102; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_v_n);
- __pyx_v_n = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":103
- * for i in range(1,nr+1):
- * n=n+int(nc[i])
- * nbs[i+1]=n+1 # <<<<<<<<<<<<<<
- * if xl[i] < xh[i]:
- * pass
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_10 = (__pyx_v_i + 1);
- if (__Pyx_SetItemInt(__pyx_v_nbs, __pyx_t_10, __pyx_t_2, sizeof(long), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":104
- * n=n+int(nc[i])
- * nbs[i+1]=n+1
- * if xl[i] < xh[i]: # <<<<<<<<<<<<<<
- * pass
- * else:
- */
- __pyx_t_11 = (((__pyx_v_xl[__pyx_v_i]) < (__pyx_v_xh[__pyx_v_i])) != 0);
- if (__pyx_t_11) {
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":107
- * pass
- * else:
- * t=xl[i] # <<<<<<<<<<<<<<
- * xl[i]=xh[i]
- * xh[i]=t
- */
- __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xl[__pyx_v_i])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":108
- * else:
- * t=xl[i]
- * xl[i]=xh[i] # <<<<<<<<<<<<<<
- * xh[i]=t
- *
- */
- (__pyx_v_xl[__pyx_v_i]) = (__pyx_v_xh[__pyx_v_i]);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":109
- * t=xl[i]
- * xl[i]=xh[i]
- * xh[i]=t # <<<<<<<<<<<<<<
- *
- * n=n+2*(nr-1)
- */
- __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- (__pyx_v_xh[__pyx_v_i]) = __pyx_t_12;
- }
- __pyx_L5:;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":111
- * xh[i]=t
- *
- * n=n+2*(nr-1) # <<<<<<<<<<<<<<
- * n1=n+1
- * xl[nr+1]=0.
- */
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_nr, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Multiply(__pyx_int_2, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_v_n);
- __pyx_v_n = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":112
- *
- * n=n+2*(nr-1)
- * n1=n+1 # <<<<<<<<<<<<<<
- * xl[nr+1]=0.
- * xh[nr+1]=0.
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_n1 = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":113
- * n=n+2*(nr-1)
- * n1=n+1
- * xl[nr+1]=0. # <<<<<<<<<<<<<<
- * xh[nr+1]=0.
- *
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_nr, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- (__pyx_v_xl[__pyx_t_13]) = 0.;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":114
- * n1=n+1
- * xl[nr+1]=0.
- * xh[nr+1]=0. # <<<<<<<<<<<<<<
- *
- * # this loop ...
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_nr, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_13 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_13 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- (__pyx_v_xh[__pyx_t_13]) = 0.;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":117
- *
- * # this loop ...
- * for ibl in range(1,nr+1): # <<<<<<<<<<<<<<
- * xk[ibl]=.5*(xh[ibl]+xl[ibl+1])
- * if (xl[ibl] > xl[ibl+1]):
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_nr, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_ibl = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":118
- * # this loop ...
- * for ibl in range(1,nr+1):
- * xk[ibl]=.5*(xh[ibl]+xl[ibl+1]) # <<<<<<<<<<<<<<
- * if (xl[ibl] > xl[ibl+1]):
- * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
- */
- (__pyx_v_xk[__pyx_v_ibl]) = (.5 * ((__pyx_v_xh[__pyx_v_ibl]) + (__pyx_v_xl[(__pyx_v_ibl + 1)])));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":119
- * for ibl in range(1,nr+1):
- * xk[ibl]=.5*(xh[ibl]+xl[ibl+1])
- * if (xl[ibl] > xl[ibl+1]): # <<<<<<<<<<<<<<
- * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
- * ns=nbs[ibl]
- */
- __pyx_t_11 = (((__pyx_v_xl[__pyx_v_ibl]) > (__pyx_v_xl[(__pyx_v_ibl + 1)])) != 0);
- if (__pyx_t_11) {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":120
- * xk[ibl]=.5*(xh[ibl]+xl[ibl+1])
- * if (xl[ibl] > xl[ibl+1]):
- * xk[ibl]=.5*(xl[ibl]+xh[ibl+1]) # <<<<<<<<<<<<<<
- * ns=nbs[ibl]
- * ne_idl=nbs[ibl+1]-1
- */
- (__pyx_v_xk[__pyx_v_ibl]) = (.5 * ((__pyx_v_xl[__pyx_v_ibl]) + (__pyx_v_xh[(__pyx_v_ibl + 1)])));
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":121
- * if (xl[ibl] > xl[ibl+1]):
- * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
- * ns=nbs[ibl] # <<<<<<<<<<<<<<
- * ne_idl=nbs[ibl+1]-1
- * for i in range(1, npts+1):
- */
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nbs, __pyx_v_ibl, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_14 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_14 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_ns = __pyx_t_14;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":122
- * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
- * ns=nbs[ibl]
- * ne_idl=nbs[ibl+1]-1 # <<<<<<<<<<<<<<
- * for i in range(1, npts+1):
- * if((x[i] < xl[ibl]) or (x[i] > xh[ibl])):
- */
- __pyx_t_10 = (__pyx_v_ibl + 1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nbs, __pyx_t_10, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_v_ne_idl);
- __pyx_v_ne_idl = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":123
- * ns=nbs[ibl]
- * ne_idl=nbs[ibl+1]-1
- * for i in range(1, npts+1): # <<<<<<<<<<<<<<
- * if((x[i] < xl[ibl]) or (x[i] > xh[ibl])):
- * pass
- */
- __pyx_t_1 = PyNumber_Add(__pyx_v_npts, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 123; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (__pyx_t_14 = 1; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
- __pyx_v_i = __pyx_t_14;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":124
- * ne_idl=nbs[ibl+1]-1
- * for i in range(1, npts+1):
- * if((x[i] < xl[ibl]) or (x[i] > xh[ibl])): # <<<<<<<<<<<<<<
- * pass
- * else:
- */
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xl[__pyx_v_ibl])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!__pyx_t_11) {
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xh[__pyx_v_ibl])); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_15 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_15 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_16 = __pyx_t_15;
- } else {
- __pyx_t_16 = __pyx_t_11;
- }
- if (__pyx_t_16) {
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":127
- * pass
- * else:
- * df[ns]=1.0 # <<<<<<<<<<<<<<
- * ns1=ns+1
- * for j in range(ns1,ne_idl+1):
- */
- __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (__Pyx_SetItemInt(__pyx_v_df, __pyx_v_ns, __pyx_t_1, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":128
- * else:
- * df[ns]=1.0
- * ns1=ns+1 # <<<<<<<<<<<<<<
- * for j in range(ns1,ne_idl+1):
- * df[j]=df[j-1]*x[i]
- */
- __pyx_v_ns1 = (__pyx_v_ns + 1);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":129
- * df[ns]=1.0
- * ns1=ns+1
- * for j in range(ns1,ne_idl+1): # <<<<<<<<<<<<<<
- * df[j]=df[j-1]*x[i]
- * for j in range(ns,ne_idl+1):
- */
- __pyx_t_1 = PyNumber_Add(__pyx_v_ne_idl, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_17 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (__pyx_t_18 = __pyx_v_ns1; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
- __pyx_v_j = __pyx_t_18;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":130
- * ns1=ns+1
- * for j in range(ns1,ne_idl+1):
- * df[j]=df[j-1]*x[i] # <<<<<<<<<<<<<<
- * for j in range(ns,ne_idl+1):
- * for k in range(j,ne_idl+1):
- */
- __pyx_t_19 = (__pyx_v_j - 1);
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_df, __pyx_t_19, sizeof(long), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__Pyx_SetItemInt(__pyx_v_df, __pyx_v_j, __pyx_t_3, sizeof(int), PyInt_FromLong, 0, 1, 1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":131
- * for j in range(ns1,ne_idl+1):
- * df[j]=df[j-1]*x[i]
- * for j in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
- * for k in range(j,ne_idl+1):
- * a[j,k]=a[j,k]+df[j]*df[k]*w[i]
- */
- __pyx_t_3 = PyNumber_Add(__pyx_v_ne_idl, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_17 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (__pyx_t_18 = __pyx_v_ns; __pyx_t_18 < __pyx_t_17; __pyx_t_18+=1) {
- __pyx_v_j = __pyx_t_18;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":132
- * df[j]=df[j-1]*x[i]
- * for j in range(ns,ne_idl+1):
- * for k in range(j,ne_idl+1): # <<<<<<<<<<<<<<
- * a[j,k]=a[j,k]+df[j]*df[k]*w[i]
- * a[j,n1]=a[j,n1]+df[j]*y[i]*w[i]
- */
- __pyx_t_3 = PyNumber_Add(__pyx_v_ne_idl, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_19 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (__pyx_t_20 = __pyx_v_j; __pyx_t_20 < __pyx_t_19; __pyx_t_20+=1) {
- __pyx_v_k = __pyx_t_20;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":133
- * for j in range(ns,ne_idl+1):
- * for k in range(j,ne_idl+1):
- * a[j,k]=a[j,k]+df[j]*df[k]*w[i] # <<<<<<<<<<<<<<
- * a[j,n1]=a[j,n1]+df[j]*y[i]*w[i]
- * # ... has to be faster
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_3 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_1)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_df, __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_df, __pyx_v_k, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyNumber_Multiply(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_w, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_1 = PyNumber_Multiply(__pyx_t_21, __pyx_t_3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_21), __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":134
- * for k in range(j,ne_idl+1):
- * a[j,k]=a[j,k]+df[j]*df[k]*w[i]
- * a[j,n1]=a[j,n1]+df[j]*y[i]*w[i] # <<<<<<<<<<<<<<
- * # ... has to be faster
- *
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_n1);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_v_n1);
- __Pyx_GIVEREF(__pyx_v_n1);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_21)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __pyx_t_21 = __Pyx_GetItemInt(__pyx_v_df, __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyNumber_Multiply(__pyx_t_21, __pyx_t_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_w, __pyx_v_i, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Add(__pyx_t_3, __pyx_t_21); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __pyx_t_21 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- __Pyx_INCREF(__pyx_v_n1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_n1);
- __Pyx_GIVEREF(__pyx_v_n1);
- __pyx_t_21 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_3), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- }
- }
- __pyx_L11:;
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":137
- * # ... has to be faster
- *
- * ncol=nbs[nr+1]-1 # <<<<<<<<<<<<<<
- * nk=nr-1
- *
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_nr, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_nbs, __pyx_t_2); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_ncol = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":138
- *
- * ncol=nbs[nr+1]-1
- * nk=nr-1 # <<<<<<<<<<<<<<
- *
- * if (nk == 0):
- */
- __pyx_t_2 = PyNumber_Subtract(__pyx_v_nr, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_v_nk = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":140
- * nk=nr-1
- *
- * if (nk == 0): # <<<<<<<<<<<<<<
- * pass
- * else:
- */
- __pyx_t_2 = PyObject_RichCompare(__pyx_v_nk, __pyx_int_0, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- if (__pyx_t_16) {
- goto __pyx_L18;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":143
- * pass
- * else:
- * for ik in range(1,nk+1): # <<<<<<<<<<<<<<
- * ncol=ncol+1
- * ns=nbs[ik]
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_nk, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_int_1);
- __Pyx_GIVEREF(__pyx_int_1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- if (PyList_CheckExact(__pyx_t_2) || PyTuple_CheckExact(__pyx_t_2)) {
- __pyx_t_3 = __pyx_t_2; __Pyx_INCREF(__pyx_t_3); __pyx_t_13 = 0;
- __pyx_t_22 = NULL;
- } else {
- __pyx_t_13 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_22 = Py_TYPE(__pyx_t_3)->tp_iternext;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (;;) {
- if (!__pyx_t_22 && PyList_CheckExact(__pyx_t_3)) {
- if (__pyx_t_13 >= PyList_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_22 && PyTuple_CheckExact(__pyx_t_3)) {
- if (__pyx_t_13 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_13); __Pyx_INCREF(__pyx_t_2); __pyx_t_13++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_2 = PySequence_ITEM(__pyx_t_3, __pyx_t_13); __pyx_t_13++; if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_2 = __pyx_t_22(__pyx_t_3);
- if (unlikely(!__pyx_t_2)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_2);
- }
- __Pyx_XDECREF(__pyx_v_ik);
- __pyx_v_ik = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":144
- * else:
- * for ik in range(1,nk+1):
- * ncol=ncol+1 # <<<<<<<<<<<<<<
- * ns=nbs[ik]
- * ne_idl=nbs[ik+1]-1
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_ncol, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_v_ncol);
- __pyx_v_ncol = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":145
- * for ik in range(1,nk+1):
- * ncol=ncol+1
- * ns=nbs[ik] # <<<<<<<<<<<<<<
- * ne_idl=nbs[ik+1]-1
- * a[ns,ncol]=-1.
- */
- __pyx_t_2 = PyObject_GetItem(__pyx_v_nbs, __pyx_v_ik); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_v_ns = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":146
- * ncol=ncol+1
- * ns=nbs[ik]
- * ne_idl=nbs[ik+1]-1 # <<<<<<<<<<<<<<
- * a[ns,ncol]=-1.
- * ns=ns+1
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_ik, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = PyObject_GetItem(__pyx_v_nbs, __pyx_t_2); if (!__pyx_t_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Subtract(__pyx_t_21, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_v_ne_idl);
- __pyx_v_ne_idl = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":147
- * ns=nbs[ik]
- * ne_idl=nbs[ik+1]-1
- * a[ns,ncol]=-1. # <<<<<<<<<<<<<<
- * ns=ns+1
- * for i in range(ns,ne_idl+1):
- */
- __pyx_t_2 = PyFloat_FromDouble(-1.); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = PyInt_FromLong(__pyx_v_ns); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_21 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_1), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":148
- * ne_idl=nbs[ik+1]-1
- * a[ns,ncol]=-1.
- * ns=ns+1 # <<<<<<<<<<<<<<
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- */
- __pyx_v_ns = (__pyx_v_ns + 1);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":149
- * a[ns,ncol]=-1.
- * ns=ns+1
- * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- * ncol=ncol+1
- */
- __pyx_t_2 = PyNumber_Add(__pyx_v_ne_idl, __pyx_int_1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_2); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- for (__pyx_t_8 = __pyx_v_ns; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":150
- * ns=ns+1
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=a[i-1,ncol]*xk[ik] # <<<<<<<<<<<<<<
- * ncol=ncol+1
- * a[ns,ncol]=-1.
- */
- __pyx_t_2 = PyInt_FromLong((__pyx_v_i - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_1)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_23])); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_21 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_1 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_2), __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":151
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- * ncol=ncol+1 # <<<<<<<<<<<<<<
- * a[ns,ncol]=-1.
- * ns=ns+1
- */
- __pyx_t_21 = PyNumber_Add(__pyx_v_ncol, __pyx_int_1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_v_ncol);
- __pyx_v_ncol = __pyx_t_21;
- __pyx_t_21 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":152
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- * ncol=ncol+1
- * a[ns,ncol]=-1. # <<<<<<<<<<<<<<
- * ns=ns+1
- * if (ns > ne_idl):
- */
- __pyx_t_21 = PyFloat_FromDouble(-1.); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_ns); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_2 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_1), __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":153
- * ncol=ncol+1
- * a[ns,ncol]=-1.
- * ns=ns+1 # <<<<<<<<<<<<<<
- * if (ns > ne_idl):
- * pass
- */
- __pyx_v_ns = (__pyx_v_ns + 1);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":154
- * a[ns,ncol]=-1.
- * ns=ns+1
- * if (ns > ne_idl): # <<<<<<<<<<<<<<
- * pass
- * else:
- */
- __pyx_t_21 = PyInt_FromLong(__pyx_v_ns); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_1 = PyObject_RichCompare(__pyx_t_21, __pyx_v_ne_idl, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 154; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- if (__pyx_t_16) {
- goto __pyx_L23;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":157
- * pass
- * else:
- * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
- * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1))
- * ncol=ncol-1
- */
- __pyx_t_1 = PyNumber_Add(__pyx_v_ne_idl, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (__pyx_t_8 = __pyx_v_ns; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":158
- * else:
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1)) # <<<<<<<<<<<<<<
- * ncol=ncol-1
- * ns=nbs[ik+1]
- */
- __pyx_t_1 = PyInt_FromLong(((__pyx_v_ns - __pyx_v_i) - 2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s__power); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_21 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_23])); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_24 = PyInt_FromLong(((__pyx_v_i - __pyx_v_ns) + 1)); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_25 = PyTuple_New(2); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- PyTuple_SET_ITEM(__pyx_t_25, 0, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_25, 1, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- __pyx_t_21 = 0;
- __pyx_t_24 = 0;
- __pyx_t_24 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_25), NULL); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_25)); __pyx_t_25 = 0;
- __pyx_t_25 = PyNumber_Multiply(__pyx_t_1, __pyx_t_24); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __pyx_t_24 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_24 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_1), __pyx_t_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
- }
- }
- __pyx_L23:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":159
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1))
- * ncol=ncol-1 # <<<<<<<<<<<<<<
- * ns=nbs[ik+1]
- * ne_idl=nbs[ik+2]-1
- */
- __pyx_t_25 = PyNumber_Subtract(__pyx_v_ncol, __pyx_int_1); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 159; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __Pyx_DECREF(__pyx_v_ncol);
- __pyx_v_ncol = __pyx_t_25;
- __pyx_t_25 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":160
- * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1))
- * ncol=ncol-1
- * ns=nbs[ik+1] # <<<<<<<<<<<<<<
- * ne_idl=nbs[ik+2]-1
- * a[ns,ncol]=1.0
- */
- __pyx_t_25 = PyNumber_Add(__pyx_v_ik, __pyx_int_1); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __pyx_t_1 = PyObject_GetItem(__pyx_v_nbs, __pyx_t_25); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
- __pyx_t_8 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_v_ns = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":161
- * ncol=ncol-1
- * ns=nbs[ik+1]
- * ne_idl=nbs[ik+2]-1 # <<<<<<<<<<<<<<
- * a[ns,ncol]=1.0
- * ns=ns+1
- */
- __pyx_t_1 = PyNumber_Add(__pyx_v_ik, __pyx_int_2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_25 = PyObject_GetItem(__pyx_v_nbs, __pyx_t_1); if (!__pyx_t_25) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Subtract(__pyx_t_25, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 161; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
- __Pyx_DECREF(__pyx_v_ne_idl);
- __pyx_v_ne_idl = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":162
- * ns=nbs[ik+1]
- * ne_idl=nbs[ik+2]-1
- * a[ns,ncol]=1.0 # <<<<<<<<<<<<<<
- * ns=ns+1
- * for i in range(ns,ne_idl+1):
- */
- __pyx_t_1 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_25 = PyInt_FromLong(__pyx_v_ns); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_25);
- __Pyx_GIVEREF(__pyx_t_25);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_25 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_24), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":163
- * ne_idl=nbs[ik+2]-1
- * a[ns,ncol]=1.0
- * ns=ns+1 # <<<<<<<<<<<<<<
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- */
- __pyx_v_ns = (__pyx_v_ns + 1);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":164
- * a[ns,ncol]=1.0
- * ns=ns+1
- * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- * ncol=ncol+1
- */
- __pyx_t_1 = PyNumber_Add(__pyx_v_ne_idl, __pyx_int_1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- for (__pyx_t_8 = __pyx_v_ns; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":165
- * ns=ns+1
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=a[i-1,ncol]*xk[ik] # <<<<<<<<<<<<<<
- * ncol=ncol+1
- * a[ns,ncol]=1.0
- */
- __pyx_t_1 = PyInt_FromLong((__pyx_v_i - 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_24)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_24 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_23])); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_25 = PyNumber_Multiply(__pyx_t_1, __pyx_t_24); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __pyx_t_24 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_24 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_1), __pyx_t_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":166
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- * ncol=ncol+1 # <<<<<<<<<<<<<<
- * a[ns,ncol]=1.0
- * ns=ns+1
- */
- __pyx_t_25 = PyNumber_Add(__pyx_v_ncol, __pyx_int_1); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __Pyx_DECREF(__pyx_v_ncol);
- __pyx_v_ncol = __pyx_t_25;
- __pyx_t_25 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":167
- * a[i,ncol]=a[i-1,ncol]*xk[ik]
- * ncol=ncol+1
- * a[ns,ncol]=1.0 # <<<<<<<<<<<<<<
- * ns=ns+1
- * if (ns > ne_idl):
- */
- __pyx_t_25 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_ns); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_1 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_24), __pyx_t_25) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":168
- * ncol=ncol+1
- * a[ns,ncol]=1.0
- * ns=ns+1 # <<<<<<<<<<<<<<
- * if (ns > ne_idl):
- * pass
- */
- __pyx_v_ns = (__pyx_v_ns + 1);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":169
- * a[ns,ncol]=1.0
- * ns=ns+1
- * if (ns > ne_idl): # <<<<<<<<<<<<<<
- * pass
- * else:
- */
- __pyx_t_25 = PyInt_FromLong(__pyx_v_ns); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __pyx_t_24 = PyObject_RichCompare(__pyx_t_25, __pyx_v_ne_idl, Py_GT); __Pyx_XGOTREF(__pyx_t_24); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
- __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_24); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- if (__pyx_t_16) {
- goto __pyx_L28;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":172
- * pass
- * else:
- * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
- * a[i,ncol]=(i-ns+2)*numpy.power(xk[ik],(i-ns+1))
- *
- */
- __pyx_t_24 = PyNumber_Add(__pyx_v_ne_idl, __pyx_int_1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_24); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- for (__pyx_t_8 = __pyx_v_ns; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":173
- * else:
- * for i in range(ns,ne_idl+1):
- * a[i,ncol]=(i-ns+2)*numpy.power(xk[ik],(i-ns+1)) # <<<<<<<<<<<<<<
- *
- * for i in range(1,n+1):
- */
- __pyx_t_24 = PyInt_FromLong(((__pyx_v_i - __pyx_v_ns) + 2)); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_25 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_25, __pyx_n_s__power); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_25); __pyx_t_25 = 0;
- __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_25 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_23])); if (unlikely(!__pyx_t_25)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_25);
- __pyx_t_2 = PyInt_FromLong(((__pyx_v_i - __pyx_v_ns) + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_25);
- __Pyx_GIVEREF(__pyx_t_25);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_25 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_21), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __pyx_t_21 = PyNumber_Multiply(__pyx_t_24, __pyx_t_2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_v_ncol);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_v_ncol);
- __Pyx_GIVEREF(__pyx_v_ncol);
- __pyx_t_2 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_24), __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- }
- }
- __pyx_L28:;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __pyx_L18:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":175
- * a[i,ncol]=(i-ns+2)*numpy.power(xk[ik],(i-ns+1))
- *
- * for i in range(1,n+1): # <<<<<<<<<<<<<<
- * i1=i-1
- * for j in range(1,i1+1):
- */
- __pyx_t_3 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":176
- *
- * for i in range(1,n+1):
- * i1=i-1 # <<<<<<<<<<<<<<
- * for j in range(1,i1+1):
- * a[i,j]=a[j,i]
- */
- __pyx_t_3 = PyInt_FromLong((__pyx_v_i - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_v_i1);
- __pyx_v_i1 = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":177
- * for i in range(1,n+1):
- * i1=i-1
- * for j in range(1,i1+1): # <<<<<<<<<<<<<<
- * a[i,j]=a[j,i]
- * nm1=n-1
- */
- __pyx_t_3 = PyNumber_Add(__pyx_v_i1, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (__pyx_t_14 = 1; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
- __pyx_v_j = __pyx_t_14;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":178
- * i1=i-1
- * for j in range(1,i1+1):
- * a[i,j]=a[j,i] # <<<<<<<<<<<<<<
- * nm1=n-1
- *
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- __pyx_t_3 = 0;
- __pyx_t_21 = 0;
- __pyx_t_21 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_24)); if (!__pyx_t_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __pyx_t_24 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_24 = 0;
- __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_2), __pyx_t_21) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":179
- * for j in range(1,i1+1):
- * a[i,j]=a[j,i]
- * nm1=n-1 # <<<<<<<<<<<<<<
- *
- * for i in range(1,nm1+1):
- */
- __pyx_t_21 = PyNumber_Subtract(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_v_nm1 = __pyx_t_21;
- __pyx_t_21 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":181
- * nm1=n-1
- *
- * for i in range(1,nm1+1): # <<<<<<<<<<<<<<
- * i1=i+1
- * m=i
- */
- __pyx_t_21 = PyNumber_Add(__pyx_v_nm1, __pyx_int_1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_21); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 181; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":182
- *
- * for i in range(1,nm1+1):
- * i1=i+1 # <<<<<<<<<<<<<<
- * m=i
- * t=numpy.abs(a[i,i])
- */
- __pyx_t_21 = PyInt_FromLong((__pyx_v_i + 1)); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_XDECREF(__pyx_v_i1);
- __pyx_v_i1 = __pyx_t_21;
- __pyx_t_21 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":183
- * for i in range(1,nm1+1):
- * i1=i+1
- * m=i # <<<<<<<<<<<<<<
- * t=numpy.abs(a[i,i])
- * for j in range(i1,n+1):
- */
- __pyx_v_m = __pyx_v_i;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":184
- * i1=i+1
- * m=i
- * t=numpy.abs(a[i,i]) # <<<<<<<<<<<<<<
- * for j in range(i1,n+1):
- * if (t >= numpy.abs(a[j,i])):
- */
- __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s__abs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __pyx_t_21 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_21 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_24)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __pyx_t_24 = PyTuple_New(1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_24), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __Pyx_XDECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":185
- * m=i
- * t=numpy.abs(a[i,i])
- * for j in range(i1,n+1): # <<<<<<<<<<<<<<
- * if (t >= numpy.abs(a[j,i])):
- * pass
- */
- __pyx_t_3 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_17 = __Pyx_PyInt_AsLong(__pyx_v_i1); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_14 = __pyx_t_17; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
- __pyx_v_j = __pyx_t_14;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":186
- * t=numpy.abs(a[i,i])
- * for j in range(i1,n+1):
- * if (t >= numpy.abs(a[j,i])): # <<<<<<<<<<<<<<
- * pass
- * else:
- */
- __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_24 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s__abs); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_3 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_21)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __pyx_t_21 = PyTuple_New(1); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_t_24, ((PyObject *)__pyx_t_21), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __pyx_t_21 = PyObject_RichCompare(__pyx_v_t, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_21); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_16 = __Pyx_PyObject_IsTrue(__pyx_t_21); if (unlikely(__pyx_t_16 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- if (__pyx_t_16) {
- goto __pyx_L39;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":189
- * pass
- * else:
- * m=j # <<<<<<<<<<<<<<
- * t=numpy.abs(a[j,i])
- * if (m == i):
- */
- __pyx_v_m = __pyx_v_j;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":190
- * else:
- * m=j
- * t=numpy.abs(a[j,i]) # <<<<<<<<<<<<<<
- * if (m == i):
- * pass
- */
- __pyx_t_21 = __Pyx_GetModuleGlobalName(__pyx_n_s__numpy); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_21, __pyx_n_s__abs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __pyx_t_21 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_24 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- __pyx_t_21 = 0;
- __pyx_t_24 = 0;
- __pyx_t_24 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_3)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- __pyx_t_24 = 0;
- __pyx_t_24 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_24;
- __pyx_t_24 = 0;
- }
- __pyx_L39:;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":191
- * m=j
- * t=numpy.abs(a[j,i])
- * if (m == i): # <<<<<<<<<<<<<<
- * pass
- * else:
- */
- __pyx_t_16 = ((__pyx_v_m == __pyx_v_i) != 0);
- if (__pyx_t_16) {
- goto __pyx_L40;
- }
- /*else*/ {
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":194
- * pass
- * else:
- * for j in range(1,n1+1): # <<<<<<<<<<<<<<
- * t=a[i,j]
- * a[i,j]=a[m,j]
- */
- __pyx_t_24 = PyNumber_Add(__pyx_v_n1, __pyx_int_1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_t_24); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- for (__pyx_t_14 = 1; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
- __pyx_v_j = __pyx_t_14;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":195
- * else:
- * for j in range(1,n1+1):
- * t=a[i,j] # <<<<<<<<<<<<<<
- * a[i,j]=a[m,j]
- * a[m,j]=t
- */
- __pyx_t_24 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_24 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_2)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":196
- * for j in range(1,n1+1):
- * t=a[i,j]
- * a[i,j]=a[m,j] # <<<<<<<<<<<<<<
- * a[m,j]=t
- * for j in range(i1,n+1):
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_2 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_3 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_24)); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __pyx_t_24 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_24 = 0;
- __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_21), __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":197
- * t=a[i,j]
- * a[i,j]=a[m,j]
- * a[m,j]=t # <<<<<<<<<<<<<<
- * for j in range(i1,n+1):
- * t=a[j,i]/a[i,i]
- */
- __pyx_t_2 = PyInt_FromLong(__pyx_v_m); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_21 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- __pyx_t_2 = 0;
- __pyx_t_21 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_3), __pyx_v_t) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- }
- }
- __pyx_L40:;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":198
- * a[i,j]=a[m,j]
- * a[m,j]=t
- * for j in range(i1,n+1): # <<<<<<<<<<<<<<
- * t=a[j,i]/a[i,i]
- * for k in range(i1,n1+1):
- */
- __pyx_t_3 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_t_3); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_17 = __Pyx_PyInt_AsLong(__pyx_v_i1); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_14 = __pyx_t_17; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
- __pyx_v_j = __pyx_t_14;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":199
- * a[m,j]=t
- * for j in range(i1,n+1):
- * t=a[j,i]/a[i,i] # <<<<<<<<<<<<<<
- * for k in range(i1,n1+1):
- * a[j,k]=a[j,k]-t*a[i,k]
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- __pyx_t_3 = 0;
- __pyx_t_21 = 0;
- __pyx_t_21 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_2)); if (!__pyx_t_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_24)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __pyx_t_24 = __Pyx_PyNumber_Divide(__pyx_t_21, __pyx_t_3); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_24;
- __pyx_t_24 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":200
- * for j in range(i1,n+1):
- * t=a[j,i]/a[i,i]
- * for k in range(i1,n1+1): # <<<<<<<<<<<<<<
- * a[j,k]=a[j,k]-t*a[i,k]
- * c[n]=a[n,n1]/a[n,n]
- */
- __pyx_t_24 = PyNumber_Add(__pyx_v_n1, __pyx_int_1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_19 = __Pyx_PyInt_AsLong(__pyx_t_24); if (unlikely((__pyx_t_19 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __pyx_t_26 = __Pyx_PyInt_AsLong(__pyx_v_i1); if (unlikely((__pyx_t_26 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_18 = __pyx_t_26; __pyx_t_18 < __pyx_t_19; __pyx_t_18+=1) {
- __pyx_v_k = __pyx_t_18;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":201
- * t=a[j,i]/a[i,i]
- * for k in range(i1,n1+1):
- * a[j,k]=a[j,k]-t*a[i,k] # <<<<<<<<<<<<<<
- * c[n]=a[n,n1]/a[n,n]
- * for i in range(1,nm1+1):
- */
- __pyx_t_24 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_24 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_21)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __pyx_t_21 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __pyx_t_24 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_21);
- __Pyx_GIVEREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_24);
- __Pyx_GIVEREF(__pyx_t_24);
- __pyx_t_21 = 0;
- __pyx_t_24 = 0;
- __pyx_t_24 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_2)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyNumber_Multiply(__pyx_v_t, __pyx_t_24); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __pyx_t_24 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_k); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_a, ((PyObject *)__pyx_t_21), __pyx_t_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 201; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- }
- }
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":202
- * for k in range(i1,n1+1):
- * a[j,k]=a[j,k]-t*a[i,k]
- * c[n]=a[n,n1]/a[n,n] # <<<<<<<<<<<<<<
- * for i in range(1,nm1+1):
- * ni=n-i
- */
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_INCREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- __Pyx_INCREF(__pyx_v_n1);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_v_n1);
- __Pyx_GIVEREF(__pyx_v_n1);
- __pyx_t_21 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_24)); if (!__pyx_t_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __pyx_t_24 = PyTuple_New(2); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_INCREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_24, 0, __pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- __Pyx_INCREF(__pyx_v_n);
- PyTuple_SET_ITEM(__pyx_t_24, 1, __pyx_v_n);
- __Pyx_GIVEREF(__pyx_v_n);
- __pyx_t_3 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_24)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_24)); __pyx_t_24 = 0;
- __pyx_t_24 = __Pyx_PyNumber_Divide(__pyx_t_21, __pyx_t_3); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (PyObject_SetItem(__pyx_v_c, __pyx_v_n, __pyx_t_24) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":203
- * a[j,k]=a[j,k]-t*a[i,k]
- * c[n]=a[n,n1]/a[n,n]
- * for i in range(1,nm1+1): # <<<<<<<<<<<<<<
- * ni=n-i
- * t=a[ni,n1]
- */
- __pyx_t_24 = PyNumber_Add(__pyx_v_nm1, __pyx_int_1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_9 = __Pyx_PyInt_AsLong(__pyx_t_24); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 203; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- for (__pyx_t_8 = 1; __pyx_t_8 < __pyx_t_9; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":204
- * c[n]=a[n,n1]/a[n,n]
- * for i in range(1,nm1+1):
- * ni=n-i # <<<<<<<<<<<<<<
- * t=a[ni,n1]
- * ni1=ni+1
- */
- __pyx_t_24 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_n, __pyx_t_24); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __Pyx_XDECREF(__pyx_v_ni);
- __pyx_v_ni = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":205
- * for i in range(1,nm1+1):
- * ni=n-i
- * t=a[ni,n1] # <<<<<<<<<<<<<<
- * ni1=ni+1
- * for j in range(ni1,n+1):
- */
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_ni);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ni);
- __Pyx_GIVEREF(__pyx_v_ni);
- __Pyx_INCREF(__pyx_v_n1);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_n1);
- __Pyx_GIVEREF(__pyx_v_n1);
- __pyx_t_24 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_3)); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_24;
- __pyx_t_24 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":206
- * ni=n-i
- * t=a[ni,n1]
- * ni1=ni+1 # <<<<<<<<<<<<<<
- * for j in range(ni1,n+1):
- * t=t-c[j]*a[ni,j]
- */
- __pyx_t_24 = PyNumber_Add(__pyx_v_ni, __pyx_int_1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __Pyx_XDECREF(__pyx_v_ni1);
- __pyx_v_ni1 = __pyx_t_24;
- __pyx_t_24 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":207
- * t=a[ni,n1]
- * ni1=ni+1
- * for j in range(ni1,n+1): # <<<<<<<<<<<<<<
- * t=t-c[j]*a[ni,j]
- * c[ni]=t/a[ni,ni]
- */
- __pyx_t_24 = PyNumber_Add(__pyx_v_n, __pyx_int_1); if (unlikely(!__pyx_t_24)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_10 = __Pyx_PyInt_AsLong(__pyx_t_24); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __pyx_t_17 = __Pyx_PyInt_AsLong(__pyx_v_ni1); if (unlikely((__pyx_t_17 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- for (__pyx_t_14 = __pyx_t_17; __pyx_t_14 < __pyx_t_10; __pyx_t_14+=1) {
- __pyx_v_j = __pyx_t_14;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":208
- * ni1=ni+1
- * for j in range(ni1,n+1):
- * t=t-c[j]*a[ni,j] # <<<<<<<<<<<<<<
- * c[ni]=t/a[ni,ni]
- *
- */
- __pyx_t_24 = __Pyx_GetItemInt(__pyx_v_c, __pyx_v_j, sizeof(int), PyInt_FromLong, 0, 1, 1); if (!__pyx_t_24) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_24);
- __pyx_t_3 = PyInt_FromLong(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_21 = PyTuple_New(2); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_INCREF(__pyx_v_ni);
- PyTuple_SET_ITEM(__pyx_t_21, 0, __pyx_v_ni);
- __Pyx_GIVEREF(__pyx_v_ni);
- PyTuple_SET_ITEM(__pyx_t_21, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_21)); if (!__pyx_t_3) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_21)); __pyx_t_21 = 0;
- __pyx_t_21 = PyNumber_Multiply(__pyx_t_24, __pyx_t_3); if (unlikely(!__pyx_t_21)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_v_t, __pyx_t_21); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- __Pyx_DECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_3;
- __pyx_t_3 = 0;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":209
- * for j in range(ni1,n+1):
- * t=t-c[j]*a[ni,j]
- * c[ni]=t/a[ni,ni] # <<<<<<<<<<<<<<
- *
- * return c
- */
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_ni);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_ni);
- __Pyx_GIVEREF(__pyx_v_ni);
- __Pyx_INCREF(__pyx_v_ni);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ni);
- __Pyx_GIVEREF(__pyx_v_ni);
- __pyx_t_21 = PyObject_GetItem(__pyx_v_a, ((PyObject *)__pyx_t_3)); if (!__pyx_t_21) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_21);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_t_21); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
- if (PyObject_SetItem(__pyx_v_c, __pyx_v_ni, __pyx_t_3) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 209; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":211
- * c[ni]=t/a[ni,ni]
- *
- * return c # <<<<<<<<<<<<<<
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_c);
- __pyx_r = __pyx_v_c;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
- __Pyx_XDECREF(__pyx_t_21);
- __Pyx_XDECREF(__pyx_t_24);
- __Pyx_XDECREF(__pyx_t_25);
- { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
- __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer);
- __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
- __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl2", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- goto __pyx_L2;
- __pyx_L0:;
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer);
- __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer);
- __pyx_L2:;
- __Pyx_XDECREF((PyObject *)__pyx_v_buffer_xl0);
- __Pyx_XDECREF((PyObject *)__pyx_v_buffer_xh0);
- __Pyx_XDECREF(__pyx_v_df);
- __Pyx_XDECREF(__pyx_v_a);
- __Pyx_XDECREF(__pyx_v_nbs);
- __PYX_XDEC_MEMVIEW(&__pyx_v_xk0, 1);
- __Pyx_XDECREF(__pyx_v_c);
- __Pyx_XDECREF(__pyx_v_ne_idl);
- __Pyx_XDECREF(__pyx_v_n);
- __Pyx_XDECREF(__pyx_v_t);
- __Pyx_XDECREF(__pyx_v_n1);
- __Pyx_XDECREF(__pyx_v_ncol);
- __Pyx_XDECREF(__pyx_v_nk);
- __Pyx_XDECREF(__pyx_v_ik);
- __Pyx_XDECREF(__pyx_v_i1);
- __Pyx_XDECREF(__pyx_v_nm1);
- __Pyx_XDECREF(__pyx_v_ni);
- __Pyx_XDECREF(__pyx_v_ni1);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":194
- * # experimental exception made for __getbuffer__ and __releasebuffer__
- * # -- the details of this may change.
- * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
- * # This implementation of getbuffer is geared towards Cython
- * # requirements, and does not yet fullfill the PEP.
- */
-
-static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_v_copy_shape;
- int __pyx_v_i;
- int __pyx_v_ndim;
- int __pyx_v_endian_detector;
- int __pyx_v_little_endian;
- int __pyx_v_t;
- char *__pyx_v_f;
- PyArray_Descr *__pyx_v_descr = 0;
- int __pyx_v_offset;
- int __pyx_v_hasfields;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- char *__pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- if (__pyx_v_info != NULL) {
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
- }
-
- /* "numpy.pxd":200
- * # of flags
- *
- * if info == NULL: return # <<<<<<<<<<<<<<
- *
- * cdef int copy_shape, i, ndim
- */
- __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
- if (__pyx_t_1) {
- __pyx_r = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "numpy.pxd":203
- *
- * cdef int copy_shape, i, ndim
- * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
- *
- */
- __pyx_v_endian_detector = 1;
-
- /* "numpy.pxd":204
- * cdef int copy_shape, i, ndim
- * cdef int endian_detector = 1
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
- *
- * ndim = PyArray_NDIM(self)
- */
- __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
-
- /* "numpy.pxd":206
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
- *
- * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
- *
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- */
- __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
-
- /* "numpy.pxd":208
- * ndim = PyArray_NDIM(self)
- *
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
- * copy_shape = 1
- * else:
- */
- __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":209
- *
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- * copy_shape = 1 # <<<<<<<<<<<<<<
- * else:
- * copy_shape = 0
- */
- __pyx_v_copy_shape = 1;
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "numpy.pxd":211
- * copy_shape = 1
- * else:
- * copy_shape = 0 # <<<<<<<<<<<<<<
- *
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- */
- __pyx_v_copy_shape = 0;
- }
- __pyx_L4:;
-
- /* "numpy.pxd":213
- * copy_shape = 0
- *
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not C contiguous")
- */
- __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":214
- *
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
- * raise ValueError(u"ndarray is not C contiguous")
- *
- */
- __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
- __pyx_t_3 = __pyx_t_2;
- } else {
- __pyx_t_3 = __pyx_t_1;
- }
- if (__pyx_t_3) {
-
- /* "numpy.pxd":215
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_10), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "numpy.pxd":217
- * raise ValueError(u"ndarray is not C contiguous")
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not Fortran contiguous")
- */
- __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
- if (__pyx_t_3) {
-
- /* "numpy.pxd":218
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
- * raise ValueError(u"ndarray is not Fortran contiguous")
- *
- */
- __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
- __pyx_t_2 = __pyx_t_1;
- } else {
- __pyx_t_2 = __pyx_t_3;
- }
- if (__pyx_t_2) {
-
- /* "numpy.pxd":219
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
- *
- * info.buf = PyArray_DATA(self)
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_12), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "numpy.pxd":221
- * raise ValueError(u"ndarray is not Fortran contiguous")
- *
- * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
- * info.ndim = ndim
- * if copy_shape:
- */
- __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
-
- /* "numpy.pxd":222
- *
- * info.buf = PyArray_DATA(self)
- * info.ndim = ndim # <<<<<<<<<<<<<<
- * if copy_shape:
- * # Allocate new buffer for strides and shape info.
- */
- __pyx_v_info->ndim = __pyx_v_ndim;
-
- /* "numpy.pxd":223
- * info.buf = PyArray_DATA(self)
- * info.ndim = ndim
- * if copy_shape: # <<<<<<<<<<<<<<
- * # Allocate new buffer for strides and shape info.
- * # This is allocated as one block, strides first.
- */
- __pyx_t_2 = (__pyx_v_copy_shape != 0);
- if (__pyx_t_2) {
-
- /* "numpy.pxd":226
- * # Allocate new buffer for strides and shape info.
- * # This is allocated as one block, strides first.
- * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
- * info.shape = info.strides + ndim
- * for i in range(ndim):
- */
- __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
-
- /* "numpy.pxd":227
- * # This is allocated as one block, strides first.
- * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
- * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * info.strides[i] = PyArray_STRIDES(self)[i]
- */
- __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
-
- /* "numpy.pxd":228
- * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
- * info.shape = info.strides + ndim
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * info.strides[i] = PyArray_STRIDES(self)[i]
- * info.shape[i] = PyArray_DIMS(self)[i]
- */
- __pyx_t_5 = __pyx_v_ndim;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_i = __pyx_t_6;
-
- /* "numpy.pxd":229
- * info.shape = info.strides + ndim
- * for i in range(ndim):
- * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
- * info.shape[i] = PyArray_DIMS(self)[i]
- * else:
- */
- (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
-
- /* "numpy.pxd":230
- * for i in range(ndim):
- * info.strides[i] = PyArray_STRIDES(self)[i]
- * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
- * else:
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- */
- (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
- }
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "numpy.pxd":232
- * info.shape[i] = PyArray_DIMS(self)[i]
- * else:
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
- * info.suboffsets = NULL
- */
- __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
-
- /* "numpy.pxd":233
- * else:
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
- * info.suboffsets = NULL
- * info.itemsize = PyArray_ITEMSIZE(self)
- */
- __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
- }
- __pyx_L7:;
-
- /* "numpy.pxd":234
- * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- * info.itemsize = PyArray_ITEMSIZE(self)
- * info.readonly = not PyArray_ISWRITEABLE(self)
- */
- __pyx_v_info->suboffsets = NULL;
-
- /* "numpy.pxd":235
- * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
- * info.suboffsets = NULL
- * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
- * info.readonly = not PyArray_ISWRITEABLE(self)
- *
- */
- __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
-
- /* "numpy.pxd":236
- * info.suboffsets = NULL
- * info.itemsize = PyArray_ITEMSIZE(self)
- * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
- *
- * cdef int t
- */
- __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
-
- /* "numpy.pxd":239
- *
- * cdef int t
- * cdef char* f = NULL # <<<<<<<<<<<<<<
- * cdef dtype descr = self.descr
- * cdef list stack
- */
- __pyx_v_f = NULL;
-
- /* "numpy.pxd":240
- * cdef int t
- * cdef char* f = NULL
- * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
- * cdef list stack
- * cdef int offset
- */
- __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
- __Pyx_INCREF(__pyx_t_4);
- __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
- __pyx_t_4 = 0;
-
- /* "numpy.pxd":244
- * cdef int offset
- *
- * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
- *
- * if not hasfields and not copy_shape:
- */
- __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
-
- /* "numpy.pxd":246
- * cdef bint hasfields = PyDataType_HASFIELDS(descr)
- *
- * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
- * # do not call releasebuffer
- * info.obj = None
- */
- __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
- if (__pyx_t_2) {
- __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
- __pyx_t_1 = __pyx_t_3;
- } else {
- __pyx_t_1 = __pyx_t_2;
- }
- if (__pyx_t_1) {
-
- /* "numpy.pxd":248
- * if not hasfields and not copy_shape:
- * # do not call releasebuffer
- * info.obj = None # <<<<<<<<<<<<<<
- * else:
- * # need to call releasebuffer
- */
- __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = Py_None;
- goto __pyx_L10;
- }
- /*else*/ {
-
- /* "numpy.pxd":251
- * else:
- * # need to call releasebuffer
- * info.obj = self # <<<<<<<<<<<<<<
- *
- * if not hasfields:
- */
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
- }
- __pyx_L10:;
-
- /* "numpy.pxd":253
- * info.obj = self
- *
- * if not hasfields: # <<<<<<<<<<<<<<
- * t = descr.type_num
- * if ((descr.byteorder == c'>' and little_endian) or
- */
- __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":254
- *
- * if not hasfields:
- * t = descr.type_num # <<<<<<<<<<<<<<
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)):
- */
- __pyx_t_5 = __pyx_v_descr->type_num;
- __pyx_v_t = __pyx_t_5;
-
- /* "numpy.pxd":255
- * if not hasfields:
- * t = descr.type_num
- * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported")
- */
- __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
- if (__pyx_t_1) {
- __pyx_t_2 = (__pyx_v_little_endian != 0);
- } else {
- __pyx_t_2 = __pyx_t_1;
- }
- if (!__pyx_t_2) {
-
- /* "numpy.pxd":256
- * t = descr.type_num
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
- * raise ValueError(u"Non-native byte order not supported")
- * if t == NPY_BYTE: f = "b"
- */
- __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
- if (__pyx_t_1) {
- __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
- __pyx_t_7 = __pyx_t_3;
- } else {
- __pyx_t_7 = __pyx_t_1;
- }
- __pyx_t_1 = __pyx_t_7;
- } else {
- __pyx_t_1 = __pyx_t_2;
- }
- if (__pyx_t_1) {
-
- /* "numpy.pxd":257
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_14), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "numpy.pxd":274
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- */
- switch (__pyx_v_t) {
-
- /* "numpy.pxd":258
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported")
- * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h"
- */
- case NPY_BYTE:
- __pyx_v_f = __pyx_k__b;
- break;
-
- /* "numpy.pxd":259
- * raise ValueError(u"Non-native byte order not supported")
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H"
- */
- case NPY_UBYTE:
- __pyx_v_f = __pyx_k__B;
- break;
-
- /* "numpy.pxd":260
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i"
- */
- case NPY_SHORT:
- __pyx_v_f = __pyx_k__h;
- break;
-
- /* "numpy.pxd":261
- * elif t == NPY_UBYTE: f = "B"
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I"
- */
- case NPY_USHORT:
- __pyx_v_f = __pyx_k__H;
- break;
-
- /* "numpy.pxd":262
- * elif t == NPY_SHORT: f = "h"
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l"
- */
- case NPY_INT:
- __pyx_v_f = __pyx_k__i;
- break;
-
- /* "numpy.pxd":263
- * elif t == NPY_USHORT: f = "H"
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L"
- */
- case NPY_UINT:
- __pyx_v_f = __pyx_k__I;
- break;
-
- /* "numpy.pxd":264
- * elif t == NPY_INT: f = "i"
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q"
- */
- case NPY_LONG:
- __pyx_v_f = __pyx_k__l;
- break;
-
- /* "numpy.pxd":265
- * elif t == NPY_UINT: f = "I"
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q"
- */
- case NPY_ULONG:
- __pyx_v_f = __pyx_k__L;
- break;
-
- /* "numpy.pxd":266
- * elif t == NPY_LONG: f = "l"
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f"
- */
- case NPY_LONGLONG:
- __pyx_v_f = __pyx_k__q;
- break;
-
- /* "numpy.pxd":267
- * elif t == NPY_ULONG: f = "L"
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d"
- */
- case NPY_ULONGLONG:
- __pyx_v_f = __pyx_k__Q;
- break;
-
- /* "numpy.pxd":268
- * elif t == NPY_LONGLONG: f = "q"
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g"
- */
- case NPY_FLOAT:
- __pyx_v_f = __pyx_k__f;
- break;
-
- /* "numpy.pxd":269
- * elif t == NPY_ULONGLONG: f = "Q"
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_CFLOAT: f = "Zf"
- */
- case NPY_DOUBLE:
- __pyx_v_f = __pyx_k__d;
- break;
-
- /* "numpy.pxd":270
- * elif t == NPY_FLOAT: f = "f"
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
- * elif t == NPY_CFLOAT: f = "Zf"
- * elif t == NPY_CDOUBLE: f = "Zd"
- */
- case NPY_LONGDOUBLE:
- __pyx_v_f = __pyx_k__g;
- break;
-
- /* "numpy.pxd":271
- * elif t == NPY_DOUBLE: f = "d"
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- */
- case NPY_CFLOAT:
- __pyx_v_f = __pyx_k__Zf;
- break;
-
- /* "numpy.pxd":272
- * elif t == NPY_LONGDOUBLE: f = "g"
- * elif t == NPY_CFLOAT: f = "Zf"
- * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- * elif t == NPY_OBJECT: f = "O"
- */
- case NPY_CDOUBLE:
- __pyx_v_f = __pyx_k__Zd;
- break;
-
- /* "numpy.pxd":273
- * elif t == NPY_CFLOAT: f = "Zf"
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
- * elif t == NPY_OBJECT: f = "O"
- * else:
- */
- case NPY_CLONGDOUBLE:
- __pyx_v_f = __pyx_k__Zg;
- break;
-
- /* "numpy.pxd":274
- * elif t == NPY_CDOUBLE: f = "Zd"
- * elif t == NPY_CLONGDOUBLE: f = "Zg"
- * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- */
- case NPY_OBJECT:
- __pyx_v_f = __pyx_k__O;
- break;
- default:
-
- /* "numpy.pxd":276
- * elif t == NPY_OBJECT: f = "O"
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
- * info.format = f
- * return
- */
- __pyx_t_4 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_15), __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- break;
- }
-
- /* "numpy.pxd":277
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- * info.format = f # <<<<<<<<<<<<<<
- * return
- * else:
- */
- __pyx_v_info->format = __pyx_v_f;
-
- /* "numpy.pxd":278
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- * info.format = f
- * return # <<<<<<<<<<<<<<
- * else:
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- */
- __pyx_r = 0;
- goto __pyx_L0;
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "numpy.pxd":280
- * return
- * else:
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
- * info.format[0] = c'^' # Native data types, manual alignment
- * offset = 0
- */
- __pyx_v_info->format = ((char *)malloc(255));
-
- /* "numpy.pxd":281
- * else:
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
- * offset = 0
- * f = _util_dtypestring(descr, info.format + 1,
- */
- (__pyx_v_info->format[0]) = '^';
-
- /* "numpy.pxd":282
- * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
- * info.format[0] = c'^' # Native data types, manual alignment
- * offset = 0 # <<<<<<<<<<<<<<
- * f = _util_dtypestring(descr, info.format + 1,
- * info.format + _buffer_format_string_len,
- */
- __pyx_v_offset = 0;
-
- /* "numpy.pxd":285
- * f = _util_dtypestring(descr, info.format + 1,
- * info.format + _buffer_format_string_len,
- * &offset) # <<<<<<<<<<<<<<
- * f[0] = c'\0' # Terminate format string
- *
- */
- __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_f = __pyx_t_9;
-
- /* "numpy.pxd":286
- * info.format + _buffer_format_string_len,
- * &offset)
- * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
- *
- * def __releasebuffer__(ndarray self, Py_buffer* info):
- */
- (__pyx_v_f[0]) = '\x00';
- }
- __pyx_L11:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
- }
- goto __pyx_L2;
- __pyx_L0:;
- if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(Py_None);
- __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
- }
- __pyx_L2:;
- __Pyx_XDECREF((PyObject *)__pyx_v_descr);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
-static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
- __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "numpy.pxd":288
- * f[0] = c'\0' # Terminate format string
- *
- * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
- * if PyArray_HASFIELDS(self):
- * stdlib.free(info.format)
- */
-
-static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__releasebuffer__", 0);
-
- /* "numpy.pxd":289
- *
- * def __releasebuffer__(ndarray self, Py_buffer* info):
- * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
- * stdlib.free(info.format)
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- */
- __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":290
- * def __releasebuffer__(ndarray self, Py_buffer* info):
- * if PyArray_HASFIELDS(self):
- * stdlib.free(info.format) # <<<<<<<<<<<<<<
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- * stdlib.free(info.strides)
- */
- free(__pyx_v_info->format);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "numpy.pxd":291
- * if PyArray_HASFIELDS(self):
- * stdlib.free(info.format)
- * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
- * stdlib.free(info.strides)
- * # info.shape was stored after info.strides in the same block
- */
- __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":292
- * stdlib.free(info.format)
- * if sizeof(npy_intp) != sizeof(Py_ssize_t):
- * stdlib.free(info.strides) # <<<<<<<<<<<<<<
- * # info.shape was stored after info.strides in the same block
- *
- */
- free(__pyx_v_info->strides);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "numpy.pxd":768
- * ctypedef npy_cdouble complex_t
- *
- * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(1, <void*>a)
- *
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
-
- /* "numpy.pxd":769
- *
- * cdef inline object PyArray_MultiIterNew1(a):
- * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew2(a, b):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":771
- * return PyArray_MultiIterNew(1, <void*>a)
- *
- * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
- *
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
-
- /* "numpy.pxd":772
- *
- * cdef inline object PyArray_MultiIterNew2(a, b):
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew3(a, b, c):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":774
- * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
- *
- * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
- *
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
-
- /* "numpy.pxd":775
- *
- * cdef inline object PyArray_MultiIterNew3(a, b, c):
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":777
- * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
- *
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
- *
- */
-
-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) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
-
- /* "numpy.pxd":778
- *
- * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
- *
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
- */
- __Pyx_XDECREF(__pyx_r);
- __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_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":780
- * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
- *
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
- *
- */
-
-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) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
-
- /* "numpy.pxd":781
- *
- * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
- *
- * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
- */
- __Pyx_XDECREF(__pyx_r);
- __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_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":783
- * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
- *
- * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
- * # Recursive utility function used in __getbuffer__ to get format
- * # string. The new location in the format string is returned.
- */
-
-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) {
- PyArray_Descr *__pyx_v_child = 0;
- int __pyx_v_endian_detector;
- int __pyx_v_little_endian;
- PyObject *__pyx_v_fields = 0;
- PyObject *__pyx_v_childname = NULL;
- PyObject *__pyx_v_new_offset = NULL;
- PyObject *__pyx_v_t = NULL;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- Py_ssize_t __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *(*__pyx_t_6)(PyObject *);
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- int __pyx_t_10;
- long __pyx_t_11;
- char *__pyx_t_12;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_util_dtypestring", 0);
-
- /* "numpy.pxd":790
- * cdef int delta_offset
- * cdef tuple i
- * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
- * cdef tuple fields
- */
- __pyx_v_endian_detector = 1;
-
- /* "numpy.pxd":791
- * cdef tuple i
- * cdef int endian_detector = 1
- * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
- * cdef tuple fields
- *
- */
- __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
-
- /* "numpy.pxd":794
- * cdef tuple fields
- *
- * for childname in descr.names: # <<<<<<<<<<<<<<
- * fields = descr.fields[childname]
- * child, new_offset = fields
- */
- if (unlikely(((PyObject *)__pyx_v_descr->names) == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_1 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
- for (;;) {
- if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- __Pyx_XDECREF(__pyx_v_childname);
- __pyx_v_childname = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "numpy.pxd":795
- *
- * for childname in descr.names:
- * fields = descr.fields[childname] # <<<<<<<<<<<<<<
- * child, new_offset = fields
- *
- */
- __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_t_3) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected tuple, got %.200s", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_XDECREF(((PyObject *)__pyx_v_fields));
- __pyx_v_fields = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "numpy.pxd":796
- * for childname in descr.names:
- * fields = descr.fields[childname]
- * child, new_offset = fields # <<<<<<<<<<<<<<
- *
- * if (end - f) - (new_offset - offset[0]) < 15:
- */
- if (likely(PyTuple_CheckExact(((PyObject *)__pyx_v_fields)))) {
- PyObject* sequence = ((PyObject *)__pyx_v_fields);
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_t_4);
- #else
- __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- #endif
- } else if (1) {
- __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_5 = PyObject_GetIter(((PyObject *)__pyx_v_fields)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_6 = Py_TYPE(__pyx_t_5)->tp_iternext;
- index = 0; __pyx_t_3 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_3)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- index = 1; __pyx_t_4 = __pyx_t_6(__pyx_t_5); if (unlikely(!__pyx_t_4)) goto __pyx_L5_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_6(__pyx_t_5), 2) < 0) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = NULL;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L6_unpacking_done;
- __pyx_L5_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L6_unpacking_done:;
- }
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_XDECREF(((PyObject *)__pyx_v_child));
- __pyx_v_child = ((PyArray_Descr *)__pyx_t_3);
- __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_v_new_offset);
- __pyx_v_new_offset = __pyx_t_4;
- __pyx_t_4 = 0;
-
- /* "numpy.pxd":798
- * child, new_offset = fields
- *
- * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
- *
- */
- __pyx_t_4 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_3); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_RichCompare(__pyx_t_3, __pyx_int_15, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
-
- /* "numpy.pxd":799
- *
- * if (end - f) - (new_offset - offset[0]) < 15:
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
- *
- * if ((child.byteorder == c'>' and little_endian) or
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_17), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "numpy.pxd":801
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
- *
- * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
- * (child.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported")
- */
- __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
- if (__pyx_t_7) {
- __pyx_t_8 = (__pyx_v_little_endian != 0);
- } else {
- __pyx_t_8 = __pyx_t_7;
- }
- if (!__pyx_t_8) {
-
- /* "numpy.pxd":802
- *
- * if ((child.byteorder == c'>' and little_endian) or
- * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
- * raise ValueError(u"Non-native byte order not supported")
- * # One could encode it in the format string and have Cython
- */
- __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
- if (__pyx_t_7) {
- __pyx_t_9 = ((!(__pyx_v_little_endian != 0)) != 0);
- __pyx_t_10 = __pyx_t_9;
- } else {
- __pyx_t_10 = __pyx_t_7;
- }
- __pyx_t_7 = __pyx_t_10;
- } else {
- __pyx_t_7 = __pyx_t_8;
- }
- if (__pyx_t_7) {
-
- /* "numpy.pxd":803
- * if ((child.byteorder == c'>' and little_endian) or
- * (child.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * # One could encode it in the format string and have Cython
- * # complain instead, BUT: < and > in format strings also imply
- */
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_18), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "numpy.pxd":813
- *
- * # Output padding bytes
- * while offset[0] < new_offset: # <<<<<<<<<<<<<<
- * f[0] = 120 # "x"; pad byte
- * f += 1
- */
- while (1) {
- __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (!__pyx_t_7) break;
-
- /* "numpy.pxd":814
- * # Output padding bytes
- * while offset[0] < new_offset:
- * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
- * f += 1
- * offset[0] += 1
- */
- (__pyx_v_f[0]) = 120;
-
- /* "numpy.pxd":815
- * while offset[0] < new_offset:
- * f[0] = 120 # "x"; pad byte
- * f += 1 # <<<<<<<<<<<<<<
- * offset[0] += 1
- *
- */
- __pyx_v_f = (__pyx_v_f + 1);
-
- /* "numpy.pxd":816
- * f[0] = 120 # "x"; pad byte
- * f += 1
- * offset[0] += 1 # <<<<<<<<<<<<<<
- *
- * offset[0] += child.itemsize
- */
- __pyx_t_11 = 0;
- (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + 1);
- }
-
- /* "numpy.pxd":818
- * offset[0] += 1
- *
- * offset[0] += child.itemsize # <<<<<<<<<<<<<<
- *
- * if not PyDataType_HASFIELDS(child):
- */
- __pyx_t_11 = 0;
- (__pyx_v_offset[__pyx_t_11]) = ((__pyx_v_offset[__pyx_t_11]) + __pyx_v_child->elsize);
-
- /* "numpy.pxd":820
- * offset[0] += child.itemsize
- *
- * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
- * t = child.type_num
- * if end - f < 5:
- */
- __pyx_t_7 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
- if (__pyx_t_7) {
-
- /* "numpy.pxd":821
- *
- * if not PyDataType_HASFIELDS(child):
- * t = child.type_num # <<<<<<<<<<<<<<
- * if end - f < 5:
- * raise RuntimeError(u"Format string allocated too short.")
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_v_t);
- __pyx_v_t = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "numpy.pxd":822
- * if not PyDataType_HASFIELDS(child):
- * t = child.type_num
- * if end - f < 5: # <<<<<<<<<<<<<<
- * raise RuntimeError(u"Format string allocated too short.")
- *
- */
- __pyx_t_7 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
- if (__pyx_t_7) {
-
- /* "numpy.pxd":823
- * t = child.type_num
- * if end - f < 5:
- * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
- *
- * # Until ticket #99 is fixed, use integers to avoid warnings
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_k_tuple_20), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "numpy.pxd":826
- *
- * # Until ticket #99 is fixed, use integers to avoid warnings
- * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 98;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":827
- * # Until ticket #99 is fixed, use integers to avoid warnings
- * if t == NPY_BYTE: f[0] = 98 #"b"
- * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 66;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":828
- * if t == NPY_BYTE: f[0] = 98 #"b"
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
- * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- * elif t == NPY_INT: f[0] = 105 #"i"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 104;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":829
- * elif t == NPY_UBYTE: f[0] = 66 #"B"
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
- * elif t == NPY_INT: f[0] = 105 #"i"
- * elif t == NPY_UINT: f[0] = 73 #"I"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 72;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":830
- * elif t == NPY_SHORT: f[0] = 104 #"h"
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
- * elif t == NPY_UINT: f[0] = 73 #"I"
- * elif t == NPY_LONG: f[0] = 108 #"l"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 105;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":831
- * elif t == NPY_USHORT: f[0] = 72 #"H"
- * elif t == NPY_INT: f[0] = 105 #"i"
- * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
- * elif t == NPY_LONG: f[0] = 108 #"l"
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 73;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":832
- * elif t == NPY_INT: f[0] = 105 #"i"
- * elif t == NPY_UINT: f[0] = 73 #"I"
- * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 108;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":833
- * elif t == NPY_UINT: f[0] = 73 #"I"
- * elif t == NPY_LONG: f[0] = 108 #"l"
- * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 76;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":834
- * elif t == NPY_LONG: f[0] = 108 #"l"
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 113;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":835
- * elif t == NPY_ULONG: f[0] = 76 #"L"
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- */
- __pyx_t_5 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 81;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":836
- * elif t == NPY_LONGLONG: f[0] = 113 #"q"
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 102;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":837
- * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- */
- __pyx_t_5 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 100;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":838
- * elif t == NPY_FLOAT: f[0] = 102 #"f"
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- */
- __pyx_t_3 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 103;
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":839
- * elif t == NPY_DOUBLE: f[0] = 100 #"d"
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
- */
- __pyx_t_5 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 90;
- (__pyx_v_f[1]) = 102;
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":840
- * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
- */
- __pyx_t_3 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 90;
- (__pyx_v_f[1]) = 100;
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":841
- * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
- * else:
- */
- __pyx_t_5 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 90;
- (__pyx_v_f[1]) = 103;
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L13;
- }
-
- /* "numpy.pxd":842
- * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
- * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
- * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- */
- __pyx_t_3 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_7 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_7) {
- (__pyx_v_f[0]) = 79;
- goto __pyx_L13;
- }
- /*else*/ {
-
- /* "numpy.pxd":844
- * elif t == NPY_OBJECT: f[0] = 79 #"O"
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
- * f += 1
- * else:
- */
- __pyx_t_5 = PyNumber_Remainder(((PyObject *)__pyx_kp_u_15), __pyx_v_t); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_5, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L13:;
-
- /* "numpy.pxd":845
- * else:
- * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
- * f += 1 # <<<<<<<<<<<<<<
- * else:
- * # Cython ignores struct boundary information ("T{...}"),
- */
- __pyx_v_f = (__pyx_v_f + 1);
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "numpy.pxd":849
- * # Cython ignores struct boundary information ("T{...}"),
- * # so don't output it
- * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
- * return f
- *
- */
- __pyx_t_12 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_12 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_f = __pyx_t_12;
- }
- __pyx_L11:;
- }
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "numpy.pxd":850
- * # so don't output it
- * f = _util_dtypestring(child, f, end, offset)
- * return f # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_f;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_child);
- __Pyx_XDECREF(__pyx_v_fields);
- __Pyx_XDECREF(__pyx_v_childname);
- __Pyx_XDECREF(__pyx_v_new_offset);
- __Pyx_XDECREF(__pyx_v_t);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "numpy.pxd":965
- *
- *
- * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
- * cdef PyObject* baseptr
- * if base is None:
- */
-
-static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
- PyObject *__pyx_v_baseptr;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("set_array_base", 0);
-
- /* "numpy.pxd":967
- * cdef inline void set_array_base(ndarray arr, object base):
- * cdef PyObject* baseptr
- * if base is None: # <<<<<<<<<<<<<<
- * baseptr = NULL
- * else:
- */
- __pyx_t_1 = (__pyx_v_base == Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "numpy.pxd":968
- * cdef PyObject* baseptr
- * if base is None:
- * baseptr = NULL # <<<<<<<<<<<<<<
- * else:
- * Py_INCREF(base) # important to do this before decref below!
- */
- __pyx_v_baseptr = NULL;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "numpy.pxd":970
- * baseptr = NULL
- * else:
- * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
- * baseptr = <PyObject*>base
- * Py_XDECREF(arr.base)
- */
- Py_INCREF(__pyx_v_base);
-
- /* "numpy.pxd":971
- * else:
- * Py_INCREF(base) # important to do this before decref below!
- * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
- * Py_XDECREF(arr.base)
- * arr.base = baseptr
- */
- __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
- }
- __pyx_L3:;
-
- /* "numpy.pxd":972
- * Py_INCREF(base) # important to do this before decref below!
- * baseptr = <PyObject*>base
- * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
- * arr.base = baseptr
- *
- */
- Py_XDECREF(__pyx_v_arr->base);
-
- /* "numpy.pxd":973
- * baseptr = <PyObject*>base
- * Py_XDECREF(arr.base)
- * arr.base = baseptr # <<<<<<<<<<<<<<
- *
- * cdef inline object get_array_base(ndarray arr):
- */
- __pyx_v_arr->base = __pyx_v_baseptr;
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "numpy.pxd":975
- * arr.base = baseptr
- *
- * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
- * if arr.base is NULL:
- * return None
- */
-
-static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("get_array_base", 0);
-
- /* "numpy.pxd":976
- *
- * cdef inline object get_array_base(ndarray arr):
- * if arr.base is NULL: # <<<<<<<<<<<<<<
- * return None
- * else:
- */
- __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "numpy.pxd":977
- * cdef inline object get_array_base(ndarray arr):
- * if arr.base is NULL:
- * return None # <<<<<<<<<<<<<<
- * else:
- * return <object>arr.base
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_None);
- __pyx_r = Py_None;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "numpy.pxd":979
- * return None
- * else:
- * return <object>arr.base # <<<<<<<<<<<<<<
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
- __pyx_r = ((PyObject *)__pyx_v_arr->base);
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_shape = 0;
- Py_ssize_t __pyx_v_itemsize;
- PyObject *__pyx_v_format = 0;
- PyObject *__pyx_v_mode = 0;
- int __pyx_v_allocate_buffer;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
- {
- 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};
- PyObject* values[5] = {0,0,0,0,0};
- values[3] = ((PyObject *)__pyx_n_u__c);
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__shape)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__itemsize)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__format)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 3:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__mode);
- if (value) { values[3] = value; kw_args--; }
- }
- case 4:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__allocate_buffer);
- if (value) { values[4] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
- case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_shape = ((PyObject*)values[0]);
- __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_v_format = values[2];
- __pyx_v_mode = values[3];
- if (values[4]) {
- __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 114; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "View.MemoryView":114
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
- * mode=u"c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
- *
- * cdef int idx
- */
- __pyx_v_allocate_buffer = ((int)1);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
- PyErr_Format(PyExc_TypeError, "Argument 'format' must not be None"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_r = __pyx_array_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);
- goto __pyx_L0;
- __pyx_L1_error:;
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":113
- * cdef bint dtype_is_object
- *
- * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
- * mode=u"c", bint allocate_buffer=True):
- *
- */
-
-static int __pyx_array_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) {
- int __pyx_v_idx;
- Py_ssize_t __pyx_v_i;
- PyObject **__pyx_v_p;
- PyObject *__pyx_v_encode = NULL;
- PyObject *__pyx_v_dim = NULL;
- char __pyx_v_order;
- PyObject *__pyx_v_decode = NULL;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- char *__pyx_t_4;
- int __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- PyObject *__pyx_t_9 = NULL;
- Py_ssize_t __pyx_t_10;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__cinit__", 0);
- __Pyx_INCREF(__pyx_v_format);
- __Pyx_INCREF(__pyx_v_mode);
-
- /* "View.MemoryView":120
- * cdef PyObject **p
- *
- * self.ndim = len(shape) # <<<<<<<<<<<<<<
- * self.itemsize = itemsize
- *
- */
- if (unlikely(((PyObject *)__pyx_v_shape) == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_1 = PyTuple_GET_SIZE(((PyObject *)__pyx_v_shape)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->ndim = __pyx_t_1;
-
- /* "View.MemoryView":121
- *
- * self.ndim = len(shape)
- * self.itemsize = itemsize # <<<<<<<<<<<<<<
- *
- * if not self.ndim:
- */
- __pyx_v_self->itemsize = __pyx_v_itemsize;
-
- /* "View.MemoryView":123
- * self.itemsize = itemsize
- *
- * if not self.ndim: # <<<<<<<<<<<<<<
- * raise ValueError("Empty shape tuple for cython.array")
- *
- */
- __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":124
- *
- * if not self.ndim:
- * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
- *
- * if self.itemsize <= 0:
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_22), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":126
- * raise ValueError("Empty shape tuple for cython.array")
- *
- * if self.itemsize <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("itemsize <= 0 for cython.array")
- *
- */
- __pyx_t_2 = ((__pyx_v_self->itemsize <= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":127
- *
- * if self.itemsize <= 0:
- * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
- *
- * encode = getattr(format, 'encode', None)
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_24), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":129
- * raise ValueError("itemsize <= 0 for cython.array")
- *
- * encode = getattr(format, 'encode', None) # <<<<<<<<<<<<<<
- * if encode:
- * format = encode('ASCII')
- */
- __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_format, ((PyObject *)__pyx_n_s__encode), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_encode = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":130
- *
- * encode = getattr(format, 'encode', None)
- * if encode: # <<<<<<<<<<<<<<
- * format = encode('ASCII')
- * self._format = format
- */
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_encode); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_2) {
-
- /* "View.MemoryView":131
- * encode = getattr(format, 'encode', None)
- * if encode:
- * format = encode('ASCII') # <<<<<<<<<<<<<<
- * self._format = format
- * self.format = self._format
- */
- __pyx_t_3 = PyObject_Call(__pyx_v_encode, ((PyObject *)__pyx_k_tuple_25), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_v_format);
- __pyx_v_format = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":132
- * if encode:
- * format = encode('ASCII')
- * self._format = format # <<<<<<<<<<<<<<
- * self.format = self._format
- *
- */
- if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_v_format)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 132; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(__pyx_v_format);
- __Pyx_GIVEREF(__pyx_v_format);
- __Pyx_GOTREF(__pyx_v_self->_format);
- __Pyx_DECREF(((PyObject *)__pyx_v_self->_format));
- __pyx_v_self->_format = ((PyObject*)__pyx_v_format);
-
- /* "View.MemoryView":133
- * format = encode('ASCII')
- * self._format = format
- * self.format = self._format # <<<<<<<<<<<<<<
- *
- * self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- */
- __pyx_t_4 = __Pyx_PyObject_AsString(((PyObject *)__pyx_v_self->_format)); if (unlikely((!__pyx_t_4) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_self->format = __pyx_t_4;
-
- /* "View.MemoryView":135
- * self.format = self._format
- *
- * self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim) # <<<<<<<<<<<<<<
- * self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- *
- */
- __pyx_v_self->_shape = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim)));
-
- /* "View.MemoryView":136
- *
- * self._shape = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- * self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim) # <<<<<<<<<<<<<<
- *
- * if not self._shape or not self._strides:
- */
- __pyx_v_self->_strides = ((Py_ssize_t *)malloc(((sizeof(Py_ssize_t)) * __pyx_v_self->ndim)));
-
- /* "View.MemoryView":138
- * self._strides = <Py_ssize_t *> malloc(sizeof(Py_ssize_t)*self.ndim)
- *
- * if not self._shape or not self._strides: # <<<<<<<<<<<<<<
- * free(self._shape)
- * free(self._strides)
- */
- __pyx_t_2 = ((!(__pyx_v_self->_shape != 0)) != 0);
- if (!__pyx_t_2) {
- __pyx_t_5 = ((!(__pyx_v_self->_strides != 0)) != 0);
- __pyx_t_6 = __pyx_t_5;
- } else {
- __pyx_t_6 = __pyx_t_2;
- }
- if (__pyx_t_6) {
-
- /* "View.MemoryView":139
- *
- * if not self._shape or not self._strides:
- * free(self._shape) # <<<<<<<<<<<<<<
- * free(self._strides)
- * raise MemoryError("unable to allocate shape or strides.")
- */
- free(__pyx_v_self->_shape);
-
- /* "View.MemoryView":140
- * if not self._shape or not self._strides:
- * free(self._shape)
- * free(self._strides) # <<<<<<<<<<<<<<
- * raise MemoryError("unable to allocate shape or strides.")
- *
- */
- free(__pyx_v_self->_strides);
-
- /* "View.MemoryView":141
- * free(self._shape)
- * free(self._strides)
- * raise MemoryError("unable to allocate shape or strides.") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_27), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":144
- *
- *
- * idx = 0 # <<<<<<<<<<<<<<
- * for idx, dim in enumerate(shape):
- * if dim <= 0:
- */
- __pyx_v_idx = 0;
-
- /* "View.MemoryView":145
- *
- * idx = 0
- * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
- * if dim <= 0:
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
- */
- __pyx_t_7 = 0;
- __pyx_t_3 = ((PyObject *)__pyx_v_shape); __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
- for (;;) {
- if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_8 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_8); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_8 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- __Pyx_XDECREF(__pyx_v_dim);
- __pyx_v_dim = __pyx_t_8;
- __pyx_t_8 = 0;
- __pyx_v_idx = __pyx_t_7;
- __pyx_t_7 = (__pyx_t_7 + 1);
-
- /* "View.MemoryView":146
- * idx = 0
- * for idx, dim in enumerate(shape):
- * if dim <= 0: # <<<<<<<<<<<<<<
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
- *
- */
- __pyx_t_8 = PyObject_RichCompare(__pyx_v_dim, __pyx_int_0, Py_LE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 146; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (__pyx_t_6) {
-
- /* "View.MemoryView":147
- * for idx, dim in enumerate(shape):
- * if dim <= 0:
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
- *
- * self._shape[idx] = dim
- */
- __pyx_t_8 = PyInt_FromLong(__pyx_v_idx); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyTuple_New(2); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_v_dim);
- PyTuple_SET_ITEM(__pyx_t_9, 1, __pyx_v_dim);
- __Pyx_GIVEREF(__pyx_v_dim);
- __pyx_t_8 = 0;
- __pyx_t_8 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_28), ((PyObject *)__pyx_t_9)); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_8));
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __pyx_t_9 = PyTuple_New(1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- PyTuple_SET_ITEM(__pyx_t_9, 0, ((PyObject *)__pyx_t_8));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_9), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(((PyObject *)__pyx_t_9)); __pyx_t_9 = 0;
- __Pyx_Raise(__pyx_t_8, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 147; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "View.MemoryView":149
- * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
- *
- * self._shape[idx] = dim # <<<<<<<<<<<<<<
- * idx += 1
- *
- */
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_dim); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_t_10;
-
- /* "View.MemoryView":150
- *
- * self._shape[idx] = dim
- * idx += 1 # <<<<<<<<<<<<<<
- *
- * if mode not in ("fortran", "c"):
- */
- __pyx_v_idx = (__pyx_v_idx + 1);
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "View.MemoryView":152
- * idx += 1
- *
- * if mode not in ("fortran", "c"): # <<<<<<<<<<<<<<
- * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
- *
- */
- __Pyx_INCREF(__pyx_v_mode);
- __pyx_t_3 = __pyx_v_mode;
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__fortran), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- if (((int)__pyx_t_6)) {
- __pyx_t_8 = PyObject_RichCompare(__pyx_t_3, ((PyObject *)__pyx_n_s__c), Py_NE); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_5 = ((int)__pyx_t_2);
- } else {
- __pyx_t_5 = ((int)__pyx_t_6);
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_6 = (__pyx_t_5 != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":153
- *
- * if mode not in ("fortran", "c"):
- * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
- *
- * cdef char order
- */
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_29), __pyx_v_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L10;
- }
- __pyx_L10:;
-
- /* "View.MemoryView":156
- *
- * cdef char order
- * if mode == 'fortran': # <<<<<<<<<<<<<<
- * order = 'F'
- * else:
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_mode, ((PyObject *)__pyx_n_s__fortran), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- if (__pyx_t_6) {
-
- /* "View.MemoryView":157
- * cdef char order
- * if mode == 'fortran':
- * order = 'F' # <<<<<<<<<<<<<<
- * else:
- * order = 'C'
- */
- __pyx_v_order = 'F';
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "View.MemoryView":159
- * order = 'F'
- * else:
- * order = 'C' # <<<<<<<<<<<<<<
- *
- * self.len = fill_contig_strides_array(self._shape, self._strides,
- */
- __pyx_v_order = 'C';
- }
- __pyx_L11:;
-
- /* "View.MemoryView":161
- * order = 'C'
- *
- * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
- * itemsize, self.ndim, order)
- *
- */
- __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);
-
- /* "View.MemoryView":164
- * itemsize, self.ndim, order)
- *
- * decode = getattr(mode, 'decode', None) # <<<<<<<<<<<<<<
- * if decode:
- * mode = decode('ASCII')
- */
- __pyx_t_3 = __Pyx_GetAttr3(__pyx_v_mode, ((PyObject *)__pyx_n_s__decode), Py_None); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_decode = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":165
- *
- * decode = getattr(mode, 'decode', None)
- * if decode: # <<<<<<<<<<<<<<
- * mode = decode('ASCII')
- * self.mode = mode
- */
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_decode); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_6) {
-
- /* "View.MemoryView":166
- * decode = getattr(mode, 'decode', None)
- * if decode:
- * mode = decode('ASCII') # <<<<<<<<<<<<<<
- * self.mode = mode
- *
- */
- __pyx_t_3 = PyObject_Call(__pyx_v_decode, ((PyObject *)__pyx_k_tuple_30), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_v_mode);
- __pyx_v_mode = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "View.MemoryView":167
- * if decode:
- * mode = decode('ASCII')
- * self.mode = mode # <<<<<<<<<<<<<<
- *
- * self.free_data = allocate_buffer
- */
- if (!(likely(PyUnicode_CheckExact(__pyx_v_mode))||((__pyx_v_mode) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected unicode, got %.200s", Py_TYPE(__pyx_v_mode)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(__pyx_v_mode);
- __Pyx_GIVEREF(__pyx_v_mode);
- __Pyx_GOTREF(__pyx_v_self->mode);
- __Pyx_DECREF(((PyObject *)__pyx_v_self->mode));
- __pyx_v_self->mode = ((PyObject*)__pyx_v_mode);
-
- /* "View.MemoryView":169
- * self.mode = mode
- *
- * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
- * self.dtype_is_object = format == b'O'
- * if allocate_buffer:
- */
- __pyx_v_self->free_data = __pyx_v_allocate_buffer;
-
- /* "View.MemoryView":170
- *
- * self.free_data = allocate_buffer
- * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
- * if allocate_buffer:
- * self.data = <char *>malloc(self.len)
- */
- __pyx_t_3 = PyObject_RichCompare(__pyx_v_format, ((PyObject *)__pyx_n_b__O), Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_v_self->dtype_is_object = __pyx_t_6;
-
- /* "View.MemoryView":171
- * self.free_data = allocate_buffer
- * self.dtype_is_object = format == b'O'
- * if allocate_buffer: # <<<<<<<<<<<<<<
- * self.data = <char *>malloc(self.len)
- * if not self.data:
- */
- __pyx_t_6 = (__pyx_v_allocate_buffer != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":172
- * self.dtype_is_object = format == b'O'
- * if allocate_buffer:
- * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
- * if not self.data:
- * raise MemoryError("unable to allocate array data.")
- */
- __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
-
- /* "View.MemoryView":173
- * if allocate_buffer:
- * self.data = <char *>malloc(self.len)
- * if not self.data: # <<<<<<<<<<<<<<
- * raise MemoryError("unable to allocate array data.")
- *
- */
- __pyx_t_6 = ((!(__pyx_v_self->data != 0)) != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":174
- * self.data = <char *>malloc(self.len)
- * if not self.data:
- * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
- *
- * if self.dtype_is_object:
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_MemoryError, ((PyObject *)__pyx_k_tuple_32), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
- }
- __pyx_L14:;
-
- /* "View.MemoryView":176
- * raise MemoryError("unable to allocate array data.")
- *
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * p = <PyObject **> self.data
- * for i in range(self.len / itemsize):
- */
- __pyx_t_6 = (__pyx_v_self->dtype_is_object != 0);
- if (__pyx_t_6) {
-
- /* "View.MemoryView":177
- *
- * if self.dtype_is_object:
- * p = <PyObject **> self.data # <<<<<<<<<<<<<<
- * for i in range(self.len / itemsize):
- * p[i] = Py_None
- */
- __pyx_v_p = ((PyObject **)__pyx_v_self->data);
-
- /* "View.MemoryView":178
- * if self.dtype_is_object:
- * p = <PyObject **> self.data
- * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
- * p[i] = Py_None
- * Py_INCREF(Py_None)
- */
- if (unlikely(__pyx_v_itemsize == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
- for (__pyx_t_10 = 0; __pyx_t_10 < __pyx_t_1; __pyx_t_10+=1) {
- __pyx_v_i = __pyx_t_10;
-
- /* "View.MemoryView":179
- * p = <PyObject **> self.data
- * for i in range(self.len / itemsize):
- * p[i] = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- (__pyx_v_p[__pyx_v_i]) = Py_None;
-
- /* "View.MemoryView":180
- * for i in range(self.len / itemsize):
- * p[i] = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- Py_INCREF(Py_None);
- }
- goto __pyx_L15;
- }
- __pyx_L15:;
- goto __pyx_L13;
- }
- __pyx_L13:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_encode);
- __Pyx_XDECREF(__pyx_v_dim);
- __Pyx_XDECREF(__pyx_v_decode);
- __Pyx_XDECREF(__pyx_v_format);
- __Pyx_XDECREF(__pyx_v_mode);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":183
- *
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
- * cdef int bufmode = -1
- * if self.mode == b"c":
- */
-
-static int __pyx_array_getbuffer_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_v_bufmode;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- char *__pyx_t_4;
- Py_ssize_t __pyx_t_5;
- int __pyx_t_6;
- Py_ssize_t *__pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- if (__pyx_v_info != NULL) {
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
- }
-
- /* "View.MemoryView":184
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1 # <<<<<<<<<<<<<<
- * if self.mode == b"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- */
- __pyx_v_bufmode = -1;
-
- /* "View.MemoryView":185
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * cdef int bufmode = -1
- * if self.mode == b"c": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == b"fortran":
- */
- __pyx_t_1 = (__Pyx_PyUnicode_Equals(((PyObject *)__pyx_v_self->mode), ((PyObject *)__pyx_n_b__c), Py_EQ)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":186
- * cdef int bufmode = -1
- * if self.mode == b"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
- * elif self.mode == b"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- */
- __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":187
- * if self.mode == b"c":
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == b"fortran": # <<<<<<<<<<<<<<
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- */
- __pyx_t_2 = (__Pyx_PyUnicode_Equals(((PyObject *)__pyx_v_self->mode), ((PyObject *)__pyx_n_b__fortran), Py_EQ)); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":188
- * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * elif self.mode == b"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- */
- __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":189
- * elif self.mode == b"fortran":
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode): # <<<<<<<<<<<<<<
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- * info.buf = self.data
- */
- __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":190
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
- * info.buf = self.data
- * info.len = self.len
- */
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_34), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":191
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- * info.buf = self.data # <<<<<<<<<<<<<<
- * info.len = self.len
- * info.ndim = self.ndim
- */
- __pyx_t_4 = __pyx_v_self->data;
- __pyx_v_info->buf = __pyx_t_4;
-
- /* "View.MemoryView":192
- * raise ValueError("Can only create a buffer that is contiguous in memory.")
- * info.buf = self.data
- * info.len = self.len # <<<<<<<<<<<<<<
- * info.ndim = self.ndim
- * info.shape = self._shape
- */
- __pyx_t_5 = __pyx_v_self->len;
- __pyx_v_info->len = __pyx_t_5;
-
- /* "View.MemoryView":193
- * info.buf = self.data
- * info.len = self.len
- * info.ndim = self.ndim # <<<<<<<<<<<<<<
- * info.shape = self._shape
- * info.strides = self._strides
- */
- __pyx_t_6 = __pyx_v_self->ndim;
- __pyx_v_info->ndim = __pyx_t_6;
-
- /* "View.MemoryView":194
- * info.len = self.len
- * info.ndim = self.ndim
- * info.shape = self._shape # <<<<<<<<<<<<<<
- * info.strides = self._strides
- * info.suboffsets = NULL
- */
- __pyx_t_7 = __pyx_v_self->_shape;
- __pyx_v_info->shape = __pyx_t_7;
-
- /* "View.MemoryView":195
- * info.ndim = self.ndim
- * info.shape = self._shape
- * info.strides = self._strides # <<<<<<<<<<<<<<
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize
- */
- __pyx_t_7 = __pyx_v_self->_strides;
- __pyx_v_info->strides = __pyx_t_7;
-
- /* "View.MemoryView":196
- * info.shape = self._shape
- * info.strides = self._strides
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- * info.itemsize = self.itemsize
- * info.readonly = 0
- */
- __pyx_v_info->suboffsets = NULL;
-
- /* "View.MemoryView":197
- * info.strides = self._strides
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
- * info.readonly = 0
- *
- */
- __pyx_t_5 = __pyx_v_self->itemsize;
- __pyx_v_info->itemsize = __pyx_t_5;
-
- /* "View.MemoryView":198
- * info.suboffsets = NULL
- * info.itemsize = self.itemsize
- * info.readonly = 0 # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- __pyx_v_info->readonly = 0;
-
- /* "View.MemoryView":200
- * info.readonly = 0
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * info.format = self.format
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":201
- *
- * if flags & PyBUF_FORMAT:
- * info.format = self.format # <<<<<<<<<<<<<<
- * else:
- * info.format = NULL
- */
- __pyx_t_4 = __pyx_v_self->format;
- __pyx_v_info->format = __pyx_t_4;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":203
- * info.format = self.format
- * else:
- * info.format = NULL # <<<<<<<<<<<<<<
- *
- * info.obj = self
- */
- __pyx_v_info->format = NULL;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":205
- * info.format = NULL
- *
- * info.obj = self # <<<<<<<<<<<<<<
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
- */
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
- }
- goto __pyx_L2;
- __pyx_L0:;
- if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(Py_None);
- __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
- }
- __pyx_L2:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_array_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":209
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
- *
- * def __dealloc__(array self): # <<<<<<<<<<<<<<
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- */
-
-static void __pyx_array_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":210
- *
- * def __dealloc__(array self):
- * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
- * self.callback_free_data(self.data)
- * elif self.free_data:
- */
- __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":211
- * def __dealloc__(array self):
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
- * elif self.free_data:
- * if self.dtype_is_object:
- */
- __pyx_v_self->callback_free_data(__pyx_v_self->data);
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":212
- * if self.callback_free_data != NULL:
- * self.callback_free_data(self.data)
- * elif self.free_data: # <<<<<<<<<<<<<<
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape,
- */
- __pyx_t_1 = (__pyx_v_self->free_data != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":213
- * self.callback_free_data(self.data)
- * elif self.free_data:
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * refcount_objects_in_slice(self.data, self._shape,
- * self._strides, self.ndim, False)
- */
- __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":215
- * if self.dtype_is_object:
- * refcount_objects_in_slice(self.data, self._shape,
- * self._strides, self.ndim, False) # <<<<<<<<<<<<<<
- * free(self.data)
- *
- */
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":216
- * refcount_objects_in_slice(self.data, self._shape,
- * self._strides, self.ndim, False)
- * free(self.data) # <<<<<<<<<<<<<<
- *
- * free(self._strides)
- */
- free(__pyx_v_self->data);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":218
- * free(self.data)
- *
- * free(self._strides) # <<<<<<<<<<<<<<
- * free(self._shape)
- *
- */
- free(__pyx_v_self->_strides);
-
- /* "View.MemoryView":219
- *
- * free(self._strides)
- * free(self._shape) # <<<<<<<<<<<<<<
- *
- * property memview:
- */
- free(__pyx_v_self->_shape);
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* Python wrapper */
-static PyObject *get_memview(PyObject *__pyx_v_self); /*proto*/
-static PyObject *get_memview(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = get_memview_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":223
- * property memview:
- * @cname('get_memview')
- * def __get__(self): # <<<<<<<<<<<<<<
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
- */
-
-static PyObject *get_memview_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":225
- * def __get__(self):
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
- * return memoryview(self, flags, self.dtype_is_object)
- *
- */
- __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
-
- /* "View.MemoryView":226
- *
- * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
- * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
-static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
- __pyx_r = __pyx_array_MemoryView_5array_6__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":229
- *
- *
- * def __getattr__(self, attr): # <<<<<<<<<<<<<<
- * return getattr(self.memview, attr)
- *
- */
-
-static PyObject *__pyx_array_MemoryView_5array_6__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getattr__", 0);
-
- /* "View.MemoryView":230
- *
- * def __getattr__(self, attr):
- * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
- *
- * def __getitem__(self, item):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
-static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_array_MemoryView_5array_8__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":232
- * return getattr(self.memview, attr)
- *
- * def __getitem__(self, item): # <<<<<<<<<<<<<<
- * return self.memview[item]
- *
- */
-
-static PyObject *__pyx_array_MemoryView_5array_8__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "View.MemoryView":233
- *
- * def __getitem__(self, item):
- * return self.memview[item] # <<<<<<<<<<<<<<
- *
- * def __setitem__(self, item, value):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (!__pyx_t_2) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
- __pyx_r = __pyx_array_MemoryView_5array_10__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":235
- * return self.memview[item]
- *
- * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
- * self.memview[item] = value
- *
- */
-
-static int __pyx_array_MemoryView_5array_10__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setitem__", 0);
-
- /* "View.MemoryView":236
- *
- * def __setitem__(self, item, value):
- * self.memview[item] = value # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__memview); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":240
- *
- * @cname("__pyx_array_new")
- * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
- * char *mode, char *buf):
- * cdef array result
- */
-
-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) {
- struct __pyx_array_obj *__pyx_v_result = 0;
- struct __pyx_array_obj *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("array_cwrapper", 0);
-
- /* "View.MemoryView":244
- * cdef array result
- *
- * if buf == NULL: # <<<<<<<<<<<<<<
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
- * else:
- */
- __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":245
- *
- * if buf == NULL:
- * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
- * else:
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
- */
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_INCREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_v_shape));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_5, 2, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- PyTuple_SET_ITEM(__pyx_t_5, 3, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":247
- * result = array(shape, itemsize, format, mode.decode('ASCII'))
- * else:
- * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
- * allocate_buffer=False)
- * result.data = buf
- */
- __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_3 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_shape));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_shape));
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_2, 2, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- PyTuple_SET_ITEM(__pyx_t_2, 3, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_4 = 0;
- __pyx_t_5 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
-
- /* "View.MemoryView":248
- * else:
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
- * allocate_buffer=False) # <<<<<<<<<<<<<<
- * result.data = buf
- *
- */
- __pyx_t_5 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 248; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (PyDict_SetItem(__pyx_t_3, ((PyObject *)__pyx_n_s__allocate_buffer), __pyx_t_5) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject *)__pyx_array_type)), ((PyObject *)__pyx_t_2), ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 247; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
- __pyx_t_5 = 0;
-
- /* "View.MemoryView":249
- * result = array(shape, itemsize, format, mode.decode('ASCII'),
- * allocate_buffer=False)
- * result.data = buf # <<<<<<<<<<<<<<
- *
- * return result
- */
- __pyx_v_result->data = __pyx_v_buf;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":251
- * result.data = buf
- *
- * return result # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
-
- __pyx_r = ((struct __pyx_array_obj *)Py_None); __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_name = 0;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__name,0};
- PyObject* values[1] = {0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__name)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
- goto __pyx_L5_argtuple_error;
- } else {
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- }
- __pyx_v_name = values[0];
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 277; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":277
- * cdef class Enum(object):
- * cdef object name
- * def __init__(self, name): # <<<<<<<<<<<<<<
- * self.name = name
- * def __repr__(self):
- */
-
-static int __pyx_MemviewEnum_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__init__", 0);
-
- /* "View.MemoryView":278
- * cdef object name
- * def __init__(self, name):
- * self.name = name # <<<<<<<<<<<<<<
- * def __repr__(self):
- * return self.name
- */
- __Pyx_INCREF(__pyx_v_name);
- __Pyx_GIVEREF(__pyx_v_name);
- __Pyx_GOTREF(__pyx_v_self->name);
- __Pyx_DECREF(__pyx_v_self->name);
- __pyx_v_self->name = __pyx_v_name;
-
- __pyx_r = 0;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_MemviewEnum_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":279
- * def __init__(self, name):
- * self.name = name
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return self.name
- *
- */
-
-static PyObject *__pyx_MemviewEnum_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "View.MemoryView":280
- * self.name = name
- * def __repr__(self):
- * return self.name # <<<<<<<<<<<<<<
- *
- * cdef generic = Enum("<strided and direct or indirect>")
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->name);
- __pyx_r = __pyx_v_self->name;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":294
- *
- * @cname('__pyx_align_pointer')
- * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
- * "Align pointer memory on a given boundary"
- * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
- */
-
-static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
- Py_intptr_t __pyx_v_aligned_p;
- size_t __pyx_v_offset;
- void *__pyx_r;
- int __pyx_t_1;
-
- /* "View.MemoryView":296
- * cdef void *align_pointer(void *memory, size_t alignment) nogil:
- * "Align pointer memory on a given boundary"
- * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
- * cdef size_t offset
- *
- */
- __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
-
- /* "View.MemoryView":300
- *
- * with cython.cdivision(True):
- * offset = aligned_p % alignment # <<<<<<<<<<<<<<
- *
- * if offset > 0:
- */
- __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
-
- /* "View.MemoryView":302
- * offset = aligned_p % alignment
- *
- * if offset > 0: # <<<<<<<<<<<<<<
- * aligned_p += alignment - offset
- *
- */
- __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":303
- *
- * if offset > 0:
- * aligned_p += alignment - offset # <<<<<<<<<<<<<<
- *
- * return <void *> aligned_p
- */
- __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":305
- * aligned_p += alignment - offset
- *
- * return <void *> aligned_p # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview')
- */
- __pyx_r = ((void *)__pyx_v_aligned_p);
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
-static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
- PyObject *__pyx_v_obj = 0;
- int __pyx_v_flags;
- int __pyx_v_dtype_is_object;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
- {
- static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__obj,&__pyx_n_s__flags,&__pyx_n_s__dtype_is_object,0};
- PyObject* values[3] = {0,0,0};
- if (unlikely(__pyx_kwds)) {
- Py_ssize_t kw_args;
- const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
- switch (pos_args) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- case 0: break;
- default: goto __pyx_L5_argtuple_error;
- }
- kw_args = PyDict_Size(__pyx_kwds);
- switch (pos_args) {
- case 0:
- if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__obj)) != 0)) kw_args--;
- else goto __pyx_L5_argtuple_error;
- case 1:
- if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s__flags)) != 0)) kw_args--;
- else {
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- case 2:
- if (kw_args > 0) {
- PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s__dtype_is_object);
- if (value) { values[2] = value; kw_args--; }
- }
- }
- if (unlikely(kw_args > 0)) {
- if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- }
- } else {
- switch (PyTuple_GET_SIZE(__pyx_args)) {
- case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
- case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
- values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
- break;
- default: goto __pyx_L5_argtuple_error;
- }
- }
- __pyx_v_obj = values[0];
- __pyx_v_flags = __Pyx_PyInt_AsInt(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- if (values[2]) {
- __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- } else {
-
- /* "View.MemoryView":323
- * cdef __Pyx_TypeInfo *typeinfo
- *
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
- * self.obj = obj
- * self.flags = flags
- */
- __pyx_v_dtype_is_object = ((int)0);
- }
- }
- goto __pyx_L4_argument_unpacking_done;
- __pyx_L5_argtuple_error:;
- __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 323; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __pyx_L3_error:;
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __Pyx_RefNannyFinishContext();
- return -1;
- __pyx_L4_argument_unpacking_done:;
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-static int __pyx_memoryview_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__cinit__", 0);
-
- /* "View.MemoryView":324
- *
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
- * self.obj = obj # <<<<<<<<<<<<<<
- * self.flags = flags
- * if type(self) is memoryview or obj is not None:
- */
- __Pyx_INCREF(__pyx_v_obj);
- __Pyx_GIVEREF(__pyx_v_obj);
- __Pyx_GOTREF(__pyx_v_self->obj);
- __Pyx_DECREF(__pyx_v_self->obj);
- __pyx_v_self->obj = __pyx_v_obj;
-
- /* "View.MemoryView":325
- * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
- * self.obj = obj
- * self.flags = flags # <<<<<<<<<<<<<<
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags)
- */
- __pyx_v_self->flags = __pyx_v_flags;
-
- /* "View.MemoryView":326
- * self.obj = obj
- * self.flags = flags
- * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if <PyObject *> self.view.obj == NULL:
- */
- __pyx_t_1 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)((PyObject *)__pyx_memoryview_type)));
- if (!(__pyx_t_1 != 0)) {
- __pyx_t_2 = (__pyx_v_obj != Py_None);
- __pyx_t_3 = (__pyx_t_2 != 0);
- } else {
- __pyx_t_3 = (__pyx_t_1 != 0);
- }
- if (__pyx_t_3) {
-
- /* "View.MemoryView":327
- * self.flags = flags
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
- * if <PyObject *> self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None
- */
- __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":328
- * if type(self) is memoryview or obj is not None:
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
- * (<__pyx_buffer *> &self.view).obj = Py_None
- * Py_INCREF(Py_None)
- */
- __pyx_t_3 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":329
- * __Pyx_GetBuffer(obj, &self.view, flags)
- * if <PyObject *> self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
-
- /* "View.MemoryView":330
- * if <PyObject *> self.view.obj == NULL:
- * (<__pyx_buffer *> &self.view).obj = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * self.lock = PyThread_allocate_lock()
- */
- Py_INCREF(Py_None);
- goto __pyx_L4;
- }
- __pyx_L4:;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":332
- * Py_INCREF(Py_None)
- *
- * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
- * if self.lock == NULL:
- * raise MemoryError
- */
- __pyx_v_self->lock = PyThread_allocate_lock();
-
- /* "View.MemoryView":333
- *
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- *
- */
- __pyx_t_3 = ((__pyx_v_self->lock == NULL) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":334
- * self.lock = PyThread_allocate_lock()
- * if self.lock == NULL:
- * raise MemoryError # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":336
- * raise MemoryError
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * self.dtype_is_object = self.view.format == b'O'
- * else:
- */
- __pyx_t_3 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":337
- *
- * if flags & PyBUF_FORMAT:
- * self.dtype_is_object = self.view.format == b'O' # <<<<<<<<<<<<<<
- * else:
- * self.dtype_is_object = dtype_is_object
- */
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_6 = PyObject_RichCompare(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_n_b__O), Py_EQ); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_v_self->dtype_is_object = __pyx_t_3;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":339
- * self.dtype_is_object = self.view.format == b'O'
- * else:
- * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
- *
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
- */
- __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":341
- * self.dtype_is_object = dtype_is_object
- *
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
- * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
- * self.typeinfo = NULL
- */
- __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
-
- /* "View.MemoryView":343
- * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
- * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
- * self.typeinfo = NULL # <<<<<<<<<<<<<<
- *
- * def __dealloc__(memoryview self):
- */
- __pyx_v_self->typeinfo = NULL;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":345
- * self.typeinfo = NULL
- *
- * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view)
- */
-
-static void __pyx_memoryview_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":346
- *
- * def __dealloc__(memoryview self):
- * if self.obj is not None: # <<<<<<<<<<<<<<
- * __Pyx_ReleaseBuffer(&self.view)
- *
- */
- __pyx_t_1 = (__pyx_v_self->obj != Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":347
- * def __dealloc__(memoryview self):
- * if self.obj is not None:
- * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
- *
- * if self.lock != NULL:
- */
- __Pyx_ReleaseBuffer((&__pyx_v_self->view));
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":349
- * __Pyx_ReleaseBuffer(&self.view)
- *
- * if self.lock != NULL: # <<<<<<<<<<<<<<
- * PyThread_free_lock(self.lock)
- *
- */
- __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":350
- *
- * if self.lock != NULL:
- * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
- *
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
- */
- PyThread_free_lock(__pyx_v_self->lock);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":352
- * PyThread_free_lock(self.lock)
- *
- * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dim
- * cdef char *itemp = <char *> self.view.buf
- */
-
-static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
- Py_ssize_t __pyx_v_dim;
- char *__pyx_v_itemp;
- PyObject *__pyx_v_idx = NULL;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- Py_ssize_t __pyx_t_3;
- PyObject *(*__pyx_t_4)(PyObject *);
- PyObject *__pyx_t_5 = NULL;
- Py_ssize_t __pyx_t_6;
- char *__pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_item_pointer", 0);
-
- /* "View.MemoryView":354
- * cdef char *get_item_pointer(memoryview self, object index) except NULL:
- * cdef Py_ssize_t dim
- * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
- *
- * for dim, idx in enumerate(index):
- */
- __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
-
- /* "View.MemoryView":356
- * cdef char *itemp = <char *> self.view.buf
- *
- * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
- *
- */
- __pyx_t_1 = 0;
- if (PyList_CheckExact(__pyx_v_index) || PyTuple_CheckExact(__pyx_v_index)) {
- __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
- __pyx_t_4 = NULL;
- } else {
- __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_2)) {
- if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_2)) {
- if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_5 = __pyx_t_4(__pyx_t_2);
- if (unlikely(!__pyx_t_5)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 356; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_5);
- }
- __Pyx_XDECREF(__pyx_v_idx);
- __pyx_v_idx = __pyx_t_5;
- __pyx_t_5 = 0;
- __pyx_v_dim = __pyx_t_1;
- __pyx_t_1 = (__pyx_t_1 + 1);
-
- /* "View.MemoryView":357
- *
- * for dim, idx in enumerate(index):
- * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
- *
- * return itemp
- */
- __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 357; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_itemp = __pyx_t_7;
- }
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":359
- * itemp = pybuffer_index(&self.view, itemp, idx, dim)
- *
- * return itemp # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_itemp;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_idx);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
-static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":362
- *
- *
- * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
- * if index is Ellipsis:
- * return self
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
- PyObject *__pyx_v_have_slices = NULL;
- PyObject *__pyx_v_indices = NULL;
- char *__pyx_v_itemp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *(*__pyx_t_7)(PyObject *);
- char *__pyx_t_8;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__getitem__", 0);
-
- /* "View.MemoryView":363
- *
- * def __getitem__(memoryview self, object index):
- * if index is Ellipsis: # <<<<<<<<<<<<<<
- * return self
- *
- */
- __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":364
- * def __getitem__(memoryview self, object index):
- * if index is Ellipsis:
- * return self # <<<<<<<<<<<<<<
- *
- * have_slices, indices = _unellipsify(index, self.view.ndim)
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __pyx_r = ((PyObject *)__pyx_v_self);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":366
- * return self
- *
- * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
- *
- * cdef char *itemp
- */
- __pyx_t_3 = ((PyObject *)_unellipsify(__pyx_v_index, __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (likely(PyTuple_CheckExact(__pyx_t_3))) {
- PyObject* sequence = __pyx_t_3;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_4);
- __Pyx_INCREF(__pyx_t_5);
- #else
- __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- #endif
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- } else if (1) {
- __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_6 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_7 = Py_TYPE(__pyx_t_6)->tp_iternext;
- index = 0; __pyx_t_4 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_4)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_4);
- index = 1; __pyx_t_5 = __pyx_t_7(__pyx_t_6); if (unlikely(!__pyx_t_5)) goto __pyx_L4_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_5);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_7(__pyx_t_6), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_7 = NULL;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L5_unpacking_done;
- __pyx_L4_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __pyx_t_7 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 366; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L5_unpacking_done:;
- }
- __pyx_v_have_slices = __pyx_t_4;
- __pyx_t_4 = 0;
- __pyx_v_indices = __pyx_t_5;
- __pyx_t_5 = 0;
-
- /* "View.MemoryView":369
- *
- * cdef char *itemp
- * if have_slices: # <<<<<<<<<<<<<<
- * return memview_slice(self, indices)
- * else:
- */
- __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_2) {
-
- /* "View.MemoryView":370
- * cdef char *itemp
- * if have_slices:
- * return memview_slice(self, indices) # <<<<<<<<<<<<<<
- * else:
- * itemp = self.get_item_pointer(indices)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":372
- * return memview_slice(self, indices)
- * else:
- * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
- * return self.convert_item_to_object(itemp)
- *
- */
- __pyx_t_8 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_8 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 372; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_itemp = __pyx_t_8;
-
- /* "View.MemoryView":373
- * else:
- * itemp = self.get_item_pointer(indices)
- * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
- *
- * def __setitem__(memoryview self, object index, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __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_filename = __pyx_f[2]; __pyx_lineno = 373; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
- }
- __pyx_L6:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_indices);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
-static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":375
- * return self.convert_item_to_object(itemp)
- *
- * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
- * have_slices, index = _unellipsify(index, self.view.ndim)
- *
- */
-
-static int __pyx_memoryview_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- PyObject *__pyx_v_have_slices = NULL;
- PyObject *__pyx_v_obj = NULL;
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *(*__pyx_t_5)(PyObject *);
- int __pyx_t_6;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__setitem__", 0);
- __Pyx_INCREF(__pyx_v_index);
-
- /* "View.MemoryView":376
- *
- * def __setitem__(memoryview self, object index, object value):
- * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
- *
- * if have_slices:
- */
- __pyx_t_1 = ((PyObject *)_unellipsify(__pyx_v_index, __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (likely(PyTuple_CheckExact(__pyx_t_1))) {
- PyObject* sequence = __pyx_t_1;
- #if CYTHON_COMPILING_IN_CPYTHON
- Py_ssize_t size = Py_SIZE(sequence);
- #else
- Py_ssize_t size = PySequence_Size(sequence);
- #endif
- if (unlikely(size != 2)) {
- if (size > 2) __Pyx_RaiseTooManyValuesError(2);
- else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
- __pyx_t_3 = PyTuple_GET_ITEM(sequence, 1);
- __Pyx_INCREF(__pyx_t_2);
- __Pyx_INCREF(__pyx_t_3);
- #else
- __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- #endif
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- } else if (1) {
- __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- } else
- {
- Py_ssize_t index = -1;
- __pyx_t_4 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
- index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_2);
- index = 1; __pyx_t_3 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_3)) goto __pyx_L3_unpacking_failed;
- __Pyx_GOTREF(__pyx_t_3);
- if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_5 = NULL;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L4_unpacking_done;
- __pyx_L3_unpacking_failed:;
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_5 = NULL;
- if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 376; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_L4_unpacking_done:;
- }
- __pyx_v_have_slices = __pyx_t_2;
- __pyx_t_2 = 0;
- __Pyx_DECREF(__pyx_v_index);
- __pyx_v_index = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":378
- * have_slices, index = _unellipsify(index, self.view.ndim)
- *
- * if have_slices: # <<<<<<<<<<<<<<
- * obj = self.is_slice(value)
- * if obj:
- */
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 378; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_6) {
-
- /* "View.MemoryView":379
- *
- * if have_slices:
- * obj = self.is_slice(value) # <<<<<<<<<<<<<<
- * if obj:
- * self.setitem_slice_assignment(self[index], obj)
- */
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 379; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_obj = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":380
- * if have_slices:
- * obj = self.is_slice(value)
- * if obj: # <<<<<<<<<<<<<<
- * self.setitem_slice_assignment(self[index], obj)
- * else:
- */
- __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 380; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_6) {
-
- /* "View.MemoryView":381
- * obj = self.is_slice(value)
- * if obj:
- * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
- * else:
- * self.setitem_slice_assign_scalar(self[index], value)
- */
- __pyx_t_1 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (!__pyx_t_1) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_1, __pyx_v_obj); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 381; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":383
- * self.setitem_slice_assignment(self[index], obj)
- * else:
- * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
- * else:
- * self.setitem_indexed(index, value)
- */
- __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (!__pyx_t_3) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_3), __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 383; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L6:;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":385
- * self.setitem_slice_assign_scalar(self[index], value)
- * else:
- * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
- *
- * cdef is_slice(self, obj):
- */
- __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 385; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- }
- __pyx_L5:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_obj);
- __Pyx_XDECREF(__pyx_v_index);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":387
- * self.setitem_indexed(index, value)
- *
- * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
- * if not isinstance(obj, memoryview):
- * try:
- */
-
-static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_slice", 0);
- __Pyx_INCREF(__pyx_v_obj);
-
- /* "View.MemoryView":388
- *
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
- * try:
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, ((PyObject *)__pyx_memoryview_type));
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":389
- * cdef is_slice(self, obj):
- * if not isinstance(obj, memoryview):
- * try: # <<<<<<<<<<<<<<
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_5);
- /*try:*/ {
-
- /* "View.MemoryView":390
- * if not isinstance(obj, memoryview):
- * try:
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
- * self.dtype_is_object)
- * except TypeError:
- */
- __pyx_t_6 = PyInt_FromLong((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "View.MemoryView":391
- * try:
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object) # <<<<<<<<<<<<<<
- * except TypeError:
- * return None
- */
- __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 391; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_INCREF(__pyx_v_obj);
- PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
- __Pyx_GIVEREF(__pyx_v_obj);
- PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
- __Pyx_GIVEREF(__pyx_t_7);
- __pyx_t_6 = 0;
- __pyx_t_7 = 0;
- __pyx_t_7 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 390; __pyx_clineno = __LINE__; goto __pyx_L4_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_v_obj);
- __pyx_v_obj = __pyx_t_7;
- __pyx_t_7 = 0;
- }
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
- goto __pyx_L11_try_end;
- __pyx_L4_error:;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
-
- /* "View.MemoryView":392
- * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
- * self.dtype_is_object)
- * except TypeError: # <<<<<<<<<<<<<<
- * return None
- *
- */
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_builtin_TypeError);
- if (__pyx_t_9) {
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L6_except_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_GOTREF(__pyx_t_6);
-
- /* "View.MemoryView":393
- * self.dtype_is_object)
- * except TypeError:
- * return None # <<<<<<<<<<<<<<
- *
- * return obj
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_None);
- __pyx_r = Py_None;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L7_except_return;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- goto __pyx_L5_exception_handled;
- }
- __pyx_L6_except_error:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L1_error;
- __pyx_L7_except_return:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- goto __pyx_L0;
- __pyx_L5_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_XGIVEREF(__pyx_t_5);
- __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
- __pyx_L11_try_end:;
- }
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":395
- * return None
- *
- * return obj # <<<<<<<<<<<<<<
- *
- * cdef setitem_slice_assignment(self, dst, src):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_obj);
- __pyx_r = __pyx_v_obj;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_obj);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":397
- * return obj
- *
- * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice dst_slice
- * cdef __Pyx_memviewslice src_slice
- */
-
-static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
- __Pyx_memviewslice __pyx_v_dst_slice;
- __Pyx_memviewslice __pyx_v_src_slice;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
-
- /* "View.MemoryView":401
- * cdef __Pyx_memviewslice src_slice
- *
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
- * get_slice_from_memview(dst, &dst_slice)[0],
- * src.ndim, dst.ndim, self.dtype_is_object)
- */
- if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":402
- *
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
- * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
- * src.ndim, dst.ndim, self.dtype_is_object)
- *
- */
- if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 402; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":403
- * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
- * get_slice_from_memview(dst, &dst_slice)[0],
- * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s__ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 403; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __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 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 401; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":405
- * src.ndim, dst.ndim, self.dtype_is_object)
- *
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
- * cdef int array[128]
- * cdef void *tmp = NULL
- */
-
-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) {
- int __pyx_v_array[128];
- void *__pyx_v_tmp;
- void *__pyx_v_item;
- __Pyx_memviewslice __pyx_v_tmp_slice;
- __Pyx_memviewslice *__pyx_v_dst_slice;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- PyObject *__pyx_t_7 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
-
- /* "View.MemoryView":407
- * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
- * cdef int array[128]
- * cdef void *tmp = NULL # <<<<<<<<<<<<<<
- * cdef void *item
- *
- */
- __pyx_v_tmp = NULL;
-
- /* "View.MemoryView":411
- *
- * cdef __Pyx_memviewslice tmp_slice, *dst_slice
- * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
- *
- * if <size_t>self.view.itemsize > sizeof(array):
- */
- __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
-
- /* "View.MemoryView":413
- * dst_slice = get_slice_from_memview(dst, &tmp_slice)
- *
- * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
- * tmp = malloc(self.view.itemsize)
- * if tmp == NULL:
- */
- __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":414
- *
- * if <size_t>self.view.itemsize > sizeof(array):
- * tmp = malloc(self.view.itemsize) # <<<<<<<<<<<<<<
- * if tmp == NULL:
- * raise MemoryError
- */
- __pyx_v_tmp = malloc(__pyx_v_self->view.itemsize);
-
- /* "View.MemoryView":415
- * if <size_t>self.view.itemsize > sizeof(array):
- * tmp = malloc(self.view.itemsize)
- * if tmp == NULL: # <<<<<<<<<<<<<<
- * raise MemoryError
- * item = tmp
- */
- __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":416
- * tmp = malloc(self.view.itemsize)
- * if tmp == NULL:
- * raise MemoryError # <<<<<<<<<<<<<<
- * item = tmp
- * else:
- */
- PyErr_NoMemory(); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 416; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":417
- * if tmp == NULL:
- * raise MemoryError
- * item = tmp # <<<<<<<<<<<<<<
- * else:
- * item = <void *> array
- */
- __pyx_v_item = __pyx_v_tmp;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":419
- * item = tmp
- * else:
- * item = <void *> array # <<<<<<<<<<<<<<
- *
- * if self.dtype_is_object:
- */
- __pyx_v_item = ((void *)__pyx_v_array);
- }
- __pyx_L3:;
-
- /* "View.MemoryView":421
- * item = <void *> array
- *
- * if self.dtype_is_object: # <<<<<<<<<<<<<<
- * (<PyObject **> item)[0] = <PyObject *> value
- * else:
- */
- __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":422
- *
- * if self.dtype_is_object:
- * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
- * else:
- * try:
- */
- (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":424
- * (<PyObject **> item)[0] = <PyObject *> value
- * else:
- * try: # <<<<<<<<<<<<<<
- * self.assign_item_from_object(<char *> item, value)
- * except:
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_2);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- /*try:*/ {
-
- /* "View.MemoryView":425
- * else:
- * try:
- * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
- * except:
- * free(tmp)
- */
- __pyx_t_5 = ((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_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L6_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L13_try_end;
- __pyx_L6_error:;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "View.MemoryView":426
- * try:
- * self.assign_item_from_object(<char *> item, value)
- * except: # <<<<<<<<<<<<<<
- * free(tmp)
- * raise
- */
- /*except:*/ {
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 426; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_7);
-
- /* "View.MemoryView":427
- * self.assign_item_from_object(<char *> item, value)
- * except:
- * free(tmp) # <<<<<<<<<<<<<<
- * raise
- *
- */
- free(__pyx_v_tmp);
-
- /* "View.MemoryView":428
- * except:
- * free(tmp)
- * raise # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_GIVEREF(__pyx_t_5);
- __Pyx_GIVEREF(__pyx_t_6);
- __Pyx_GIVEREF(__pyx_t_7);
- __Pyx_ErrRestore(__pyx_t_5, __pyx_t_6, __pyx_t_7);
- __pyx_t_5 = 0; __pyx_t_6 = 0; __pyx_t_7 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L8_except_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L7_exception_handled;
- }
- __pyx_L8_except_error:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L1_error;
- __pyx_L7_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- __pyx_L13_try_end:;
- }
- }
- __pyx_L5:;
-
- /* "View.MemoryView":432
- *
- *
- * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- */
- __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":433
- *
- * if self.view.suboffsets != NULL:
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- * item, self.dtype_is_object)
- */
- __pyx_t_7 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 433; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- goto __pyx_L16;
- }
- __pyx_L16:;
-
- /* "View.MemoryView":435
- * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- * item, self.dtype_is_object) # <<<<<<<<<<<<<<
- * free(tmp)
- *
- */
- __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);
-
- /* "View.MemoryView":436
- * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
- * item, self.dtype_is_object)
- * free(tmp) # <<<<<<<<<<<<<<
- *
- * cdef setitem_indexed(self, index, value):
- */
- free(__pyx_v_tmp);
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":438
- * free(tmp)
- *
- * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
- * cdef char *itemp = self.get_item_pointer(index)
- * self.assign_item_from_object(itemp, value)
- */
-
-static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
- char *__pyx_v_itemp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- char *__pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("setitem_indexed", 0);
-
- /* "View.MemoryView":439
- *
- * cdef setitem_indexed(self, index, value):
- * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
- * self.assign_item_from_object(itemp, value)
- *
- */
- __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 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 439; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_itemp = __pyx_t_1;
-
- /* "View.MemoryView":440
- * cdef setitem_indexed(self, index, value):
- * cdef char *itemp = self.get_item_pointer(index)
- * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
- *
- * cdef convert_item_to_object(self, char *itemp):
- */
- __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_filename = __pyx_f[2]; __pyx_lineno = 440; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":442
- * self.assign_item_from_object(itemp, value)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
-static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
- PyObject *__pyx_v_struct = NULL;
- PyObject *__pyx_v_bytesitem = 0;
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- size_t __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
-
- /* "View.MemoryView":445
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- * import struct # <<<<<<<<<<<<<<
- * cdef bytes bytesitem
- *
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 445; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_struct = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":448
- * cdef bytes bytesitem
- *
- * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
- * try:
- * result = struct.unpack(self.view.format, bytesitem)
- */
- __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 448; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":449
- *
- * bytesitem = itemp[:self.view.itemsize]
- * try: # <<<<<<<<<<<<<<
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- */
- {
- __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
- __Pyx_XGOTREF(__pyx_t_2);
- __Pyx_XGOTREF(__pyx_t_3);
- __Pyx_XGOTREF(__pyx_t_4);
- /*try:*/ {
-
- /* "View.MemoryView":450
- * bytesitem = itemp[:self.view.itemsize]
- * try:
- * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
- * except struct.error:
- * raise ValueError("Unable to convert item to object")
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__unpack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(__pyx_t_6);
- PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_5));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_5));
- __Pyx_INCREF(((PyObject *)__pyx_v_bytesitem));
- PyTuple_SET_ITEM(__pyx_t_6, 1, ((PyObject *)__pyx_v_bytesitem));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_bytesitem));
- __pyx_t_5 = 0;
- __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 450; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- __pyx_v_result = __pyx_t_5;
- __pyx_t_5 = 0;
- }
- /*else:*/ {
-
- /* "View.MemoryView":454
- * raise ValueError("Unable to convert item to object")
- * else:
- * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
- * return result[0]
- * return result
- */
- __pyx_t_7 = strlen(__pyx_v_self->view.format);
- __pyx_t_8 = ((__pyx_t_7 == 1) != 0);
- if (__pyx_t_8) {
-
- /* "View.MemoryView":455
- * else:
- * if len(self.view.format) == 1:
- * return result[0] # <<<<<<<<<<<<<<
- * return result
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_5 = __Pyx_GetItemInt(__pyx_v_result, 0, sizeof(long), PyInt_FromLong, 0, 0, 1); if (!__pyx_t_5) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 455; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L6_except_return;
- goto __pyx_L11;
- }
- __pyx_L11:;
-
- /* "View.MemoryView":456
- * if len(self.view.format) == 1:
- * return result[0]
- * return result # <<<<<<<<<<<<<<
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_result);
- __pyx_r = __pyx_v_result;
- goto __pyx_L6_except_return;
- }
- __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
- __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
- goto __pyx_L10_try_end;
- __pyx_L3_error:;
- __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
-
- /* "View.MemoryView":451
- * try:
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error: # <<<<<<<<<<<<<<
- * raise ValueError("Unable to convert item to object")
- * else:
- */
- __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__error); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_t_9 = PyErr_ExceptionMatches(__pyx_t_5);
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- if (__pyx_t_9) {
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_GOTREF(__pyx_t_1);
-
- /* "View.MemoryView":452
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
- * else:
- * if len(self.view.format) == 1:
- */
- __pyx_t_10 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_36), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L5_except_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- goto __pyx_L4_exception_handled;
- }
- __pyx_L5_except_error:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L1_error;
- __pyx_L6_except_return:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- goto __pyx_L0;
- __pyx_L4_exception_handled:;
- __Pyx_XGIVEREF(__pyx_t_2);
- __Pyx_XGIVEREF(__pyx_t_3);
- __Pyx_XGIVEREF(__pyx_t_4);
- __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
- __pyx_L10_try_end:;
- }
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_struct);
- __Pyx_XDECREF(__pyx_v_bytesitem);
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":458
- * return result
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- */
-
-static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
- PyObject *__pyx_v_struct = NULL;
- char __pyx_v_c;
- PyObject *__pyx_v_bytesvalue = 0;
- Py_ssize_t __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- PyObject *__pyx_t_5 = NULL;
- PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
- PyObject *__pyx_t_8 = NULL;
- char *__pyx_t_9;
- char *__pyx_t_10;
- char *__pyx_t_11;
- char *__pyx_t_12;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
-
- /* "View.MemoryView":461
- * """Only used if instantiated manually by the user, or if Cython doesn't
- * know how to convert the type"""
- * import struct # <<<<<<<<<<<<<<
- * cdef char c
- * cdef bytes bytesvalue
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__struct), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 461; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_v_struct = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":466
- * cdef Py_ssize_t i
- *
- * if isinstance(value, tuple): # <<<<<<<<<<<<<<
- * bytesvalue = struct.pack(self.view.format, *value)
- * else:
- */
- __pyx_t_2 = PyTuple_Check(__pyx_v_value);
- __pyx_t_3 = (__pyx_t_2 != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":467
- *
- * if isinstance(value, tuple):
- * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
- * else:
- * bytesvalue = struct.pack(self.view.format, value)
- */
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__pack); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- PyTuple_SET_ITEM(__pyx_t_5, 0, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_4 = 0;
- __pyx_t_4 = PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_6 = PyNumber_Add(((PyObject *)__pyx_t_5), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_6));
- __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_4)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 467; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":469
- * bytesvalue = struct.pack(self.view.format, *value)
- * else:
- * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
- *
- * for i, c in enumerate(bytesvalue):
- */
- __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s__pack); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_6));
- __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_6));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
- __Pyx_INCREF(__pyx_v_value);
- PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_value);
- __Pyx_GIVEREF(__pyx_v_value);
- __pyx_t_6 = 0;
- __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- if (!(likely(PyBytes_CheckExact(__pyx_t_6))||((__pyx_t_6) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected bytes, got %.200s", Py_TYPE(__pyx_t_6)->tp_name), 0))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 469; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_bytesvalue = ((PyObject*)__pyx_t_6);
- __pyx_t_6 = 0;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":471
- * bytesvalue = struct.pack(self.view.format, value)
- *
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
- * itemp[i] = c
- *
- */
- __pyx_t_7 = 0;
- if (unlikely(((PyObject *)__pyx_v_bytesvalue) == Py_None)) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __Pyx_INCREF(((PyObject *)__pyx_v_bytesvalue));
- __pyx_t_8 = __pyx_v_bytesvalue;
- __pyx_t_10 = PyBytes_AS_STRING(__pyx_t_8);
- __pyx_t_11 = (__pyx_t_10 + PyBytes_GET_SIZE(__pyx_t_8));
- for (__pyx_t_12 = __pyx_t_10; __pyx_t_12 < __pyx_t_11; __pyx_t_12++) {
- __pyx_t_9 = __pyx_t_12;
- __pyx_v_c = (__pyx_t_9[0]);
-
- /* "View.MemoryView":472
- *
- * for i, c in enumerate(bytesvalue):
- * itemp[i] = c # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- __pyx_v_i = __pyx_t_7;
-
- /* "View.MemoryView":471
- * bytesvalue = struct.pack(self.view.format, value)
- *
- * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
- * itemp[i] = c
- *
- */
- __pyx_t_7 = (__pyx_t_7 + 1);
-
- /* "View.MemoryView":472
- *
- * for i, c in enumerate(bytesvalue):
- * itemp[i] = c # <<<<<<<<<<<<<<
- *
- * @cname('getbuffer')
- */
- (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
- }
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(((PyObject *)__pyx_t_8));
- __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_struct);
- __Pyx_XDECREF(__pyx_v_bytesvalue);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
-static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":475
- *
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
- * if flags & PyBUF_STRIDES:
- * info.shape = self.view.shape
- */
-
-static int __pyx_memoryview_getbuffer_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- Py_ssize_t *__pyx_t_2;
- char *__pyx_t_3;
- void *__pyx_t_4;
- int __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- __Pyx_RefNannySetupContext("__getbuffer__", 0);
- if (__pyx_v_info != NULL) {
- __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
- __Pyx_GIVEREF(__pyx_v_info->obj);
- }
-
- /* "View.MemoryView":476
- * @cname('getbuffer')
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.shape = self.view.shape
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":477
- * def __getbuffer__(self, Py_buffer *info, int flags):
- * if flags & PyBUF_STRIDES:
- * info.shape = self.view.shape # <<<<<<<<<<<<<<
- * else:
- * info.shape = NULL
- */
- __pyx_t_2 = __pyx_v_self->view.shape;
- __pyx_v_info->shape = __pyx_t_2;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":479
- * info.shape = self.view.shape
- * else:
- * info.shape = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_STRIDES:
- */
- __pyx_v_info->shape = NULL;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":481
- * info.shape = NULL
- *
- * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
- * info.strides = self.view.strides
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":482
- *
- * if flags & PyBUF_STRIDES:
- * info.strides = self.view.strides # <<<<<<<<<<<<<<
- * else:
- * info.strides = NULL
- */
- __pyx_t_2 = __pyx_v_self->view.strides;
- __pyx_v_info->strides = __pyx_t_2;
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "View.MemoryView":484
- * info.strides = self.view.strides
- * else:
- * info.strides = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_INDIRECT:
- */
- __pyx_v_info->strides = NULL;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":486
- * info.strides = NULL
- *
- * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
- * info.suboffsets = self.view.suboffsets
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":487
- *
- * if flags & PyBUF_INDIRECT:
- * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
- * else:
- * info.suboffsets = NULL
- */
- __pyx_t_2 = __pyx_v_self->view.suboffsets;
- __pyx_v_info->suboffsets = __pyx_t_2;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":489
- * info.suboffsets = self.view.suboffsets
- * else:
- * info.suboffsets = NULL # <<<<<<<<<<<<<<
- *
- * if flags & PyBUF_FORMAT:
- */
- __pyx_v_info->suboffsets = NULL;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":491
- * info.suboffsets = NULL
- *
- * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
- * info.format = self.view.format
- * else:
- */
- __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":492
- *
- * if flags & PyBUF_FORMAT:
- * info.format = self.view.format # <<<<<<<<<<<<<<
- * else:
- * info.format = NULL
- */
- __pyx_t_3 = __pyx_v_self->view.format;
- __pyx_v_info->format = __pyx_t_3;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":494
- * info.format = self.view.format
- * else:
- * info.format = NULL # <<<<<<<<<<<<<<
- *
- * info.buf = self.view.buf
- */
- __pyx_v_info->format = NULL;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":496
- * info.format = NULL
- *
- * info.buf = self.view.buf # <<<<<<<<<<<<<<
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize
- */
- __pyx_t_4 = __pyx_v_self->view.buf;
- __pyx_v_info->buf = __pyx_t_4;
-
- /* "View.MemoryView":497
- *
- * info.buf = self.view.buf
- * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len
- */
- __pyx_t_5 = __pyx_v_self->view.ndim;
- __pyx_v_info->ndim = __pyx_t_5;
-
- /* "View.MemoryView":498
- * info.buf = self.view.buf
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
- * info.len = self.view.len
- * info.readonly = 0
- */
- __pyx_t_6 = __pyx_v_self->view.itemsize;
- __pyx_v_info->itemsize = __pyx_t_6;
-
- /* "View.MemoryView":499
- * info.ndim = self.view.ndim
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len # <<<<<<<<<<<<<<
- * info.readonly = 0
- * info.obj = self
- */
- __pyx_t_6 = __pyx_v_self->view.len;
- __pyx_v_info->len = __pyx_t_6;
-
- /* "View.MemoryView":500
- * info.itemsize = self.view.itemsize
- * info.len = self.view.len
- * info.readonly = 0 # <<<<<<<<<<<<<<
- * info.obj = self
- *
- */
- __pyx_v_info->readonly = 0;
-
- /* "View.MemoryView":501
- * info.len = self.view.len
- * info.readonly = 0
- * info.obj = self # <<<<<<<<<<<<<<
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
- */
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __Pyx_GOTREF(__pyx_v_info->obj);
- __Pyx_DECREF(__pyx_v_info->obj);
- __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
-
- __pyx_r = 0;
- if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
- __Pyx_GOTREF(Py_None);
- __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
- }
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_transpose(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":508
- * property T:
- * @cname('__pyx_memoryview_transpose')
- * def __get__(self): # <<<<<<<<<<<<<<
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- */
-
-static PyObject *__pyx_memoryview_transpose_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":509
- * @cname('__pyx_memoryview_transpose')
- * def __get__(self):
- * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
- * transpose_memslice(&result.from_slice)
- * return result
- */
- __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 509; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":510
- * def __get__(self):
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 510; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":511
- * cdef _memoryviewslice result = memoryview_copy(self)
- * transpose_memslice(&result.from_slice)
- * return result # <<<<<<<<<<<<<<
- *
- * property base:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview__get__base(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":515
- * property base:
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.obj
- *
- */
-
-static PyObject *__pyx_memoryview__get__base_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":516
- * @cname('__pyx_memoryview__get__base')
- * def __get__(self):
- * return self.obj # <<<<<<<<<<<<<<
- *
- * property shape:
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->obj);
- __pyx_r = __pyx_v_self->obj;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_shape(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":520
- * property shape:
- * @cname('__pyx_memoryview_get_shape')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)])
- *
- */
-
-static PyObject *__pyx_memoryview_get_shape_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":521
- * @cname('__pyx_memoryview_get_shape')
- * def __get__(self):
- * return tuple([self.view.shape[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
- *
- * property strides:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __pyx_v_self->view.ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
- __pyx_t_4 = PyInt_FromSsize_t((__pyx_v_self->view.shape[__pyx_v_i])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_4))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- }
- __pyx_t_4 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_1))); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __pyx_r = ((PyObject *)__pyx_t_4);
- __pyx_t_4 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_strides(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":525
- * property strides:
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.strides == NULL:
- *
- */
-
-static PyObject *__pyx_memoryview_get_strides_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":526
- * @cname('__pyx_memoryview_get_strides')
- * def __get__(self):
- * if self.view.strides == NULL: # <<<<<<<<<<<<<<
- *
- * raise ValueError("Buffer view does not expose strides")
- */
- __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":528
- * if self.view.strides == NULL:
- *
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
- *
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
- */
- __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_38), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":530
- * raise ValueError("Buffer view does not expose strides")
- *
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
- *
- * property suboffsets:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_v_self->view.ndim;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
- __pyx_v_i = __pyx_t_4;
- __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.strides[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __pyx_t_5 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_2))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 530; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_suboffsets(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":534
- * property suboffsets:
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim
- */
-
-static PyObject *__pyx_memoryview_get_suboffsets_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_t_3;
- int __pyx_t_4;
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":535
- * @cname('__pyx_memoryview_get_suboffsets')
- * def __get__(self):
- * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
- * return [-1] * self.view.ndim
- *
- */
- __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":536
- * def __get__(self):
- * if self.view.suboffsets == NULL:
- * return [-1] * self.view.ndim # <<<<<<<<<<<<<<
- *
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)])
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(1 * ((__pyx_v_self->view.ndim<0) ? 0:__pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 536; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- { Py_ssize_t __pyx_temp;
- for (__pyx_temp=0; __pyx_temp < __pyx_v_self->view.ndim; __pyx_temp++) {
- __Pyx_INCREF(__pyx_int_neg_1);
- PyList_SET_ITEM(__pyx_t_2, __pyx_temp, __pyx_int_neg_1);
- __Pyx_GIVEREF(__pyx_int_neg_1);
- }
- }
- __pyx_r = ((PyObject *)__pyx_t_2);
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":538
- * return [-1] * self.view.ndim
- *
- * return tuple([self.view.suboffsets[i] for i in xrange(self.view.ndim)]) # <<<<<<<<<<<<<<
- *
- * property ndim:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = __pyx_v_self->view.ndim;
- for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
- __pyx_v_i = __pyx_t_4;
- __pyx_t_5 = PyInt_FromSsize_t((__pyx_v_self->view.suboffsets[__pyx_v_i])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_5))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
- }
- __pyx_t_5 = ((PyObject *)PyList_AsTuple(((PyObject*)__pyx_t_2))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 538; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_5));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_5);
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_ndim(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":542
- * property ndim:
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.ndim
- *
- */
-
-static PyObject *__pyx_memoryview_get_ndim_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":543
- * @cname('__pyx_memoryview_get_ndim')
- * def __get__(self):
- * return self.view.ndim # <<<<<<<<<<<<<<
- *
- * property itemsize:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromLong(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 543; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_itemsize(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":547
- * property itemsize:
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.view.itemsize
- *
- */
-
-static PyObject *__pyx_memoryview_get_itemsize_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":548
- * @cname('__pyx_memoryview_get_itemsize')
- * def __get__(self):
- * return self.view.itemsize # <<<<<<<<<<<<<<
- *
- * property nbytes:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 548; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_nbytes(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":552
- * property nbytes:
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.size * self.view.itemsize
- *
- */
-
-static PyObject *__pyx_memoryview_get_nbytes_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":553
- * @cname('__pyx_memoryview_get_nbytes')
- * def __get__(self):
- * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
- *
- * property size:
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 553; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_r = __pyx_t_3;
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview_get_size(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":557
- * property size:
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self): # <<<<<<<<<<<<<<
- * if self._size is None:
- * result = 1
- */
-
-static PyObject *__pyx_memoryview_get_size_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_v_length = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
- PyObject *(*__pyx_t_6)(PyObject *);
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":558
- * @cname('__pyx_memoryview_get_size')
- * def __get__(self):
- * if self._size is None: # <<<<<<<<<<<<<<
- * result = 1
- *
- */
- __pyx_t_1 = (__pyx_v_self->_size == Py_None);
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":559
- * def __get__(self):
- * if self._size is None:
- * result = 1 # <<<<<<<<<<<<<<
- *
- * for length in self.shape:
- */
- __Pyx_INCREF(__pyx_int_1);
- __pyx_v_result = __pyx_int_1;
-
- /* "View.MemoryView":561
- * result = 1
- *
- * for length in self.shape: # <<<<<<<<<<<<<<
- * result *= length
- *
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__shape); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
- __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
- }
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- for (;;) {
- if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_3 = __pyx_t_6(__pyx_t_4);
- if (unlikely(!__pyx_t_3)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 561; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_3);
- }
- __Pyx_XDECREF(__pyx_v_length);
- __pyx_v_length = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":562
- *
- * for length in self.shape:
- * result *= length # <<<<<<<<<<<<<<
- *
- * self._size = result
- */
- __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 562; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_v_result);
- __pyx_v_result = __pyx_t_3;
- __pyx_t_3 = 0;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
-
- /* "View.MemoryView":564
- * result *= length
- *
- * self._size = result # <<<<<<<<<<<<<<
- *
- * return self._size
- */
- __Pyx_INCREF(__pyx_v_result);
- __Pyx_GIVEREF(__pyx_v_result);
- __Pyx_GOTREF(__pyx_v_self->_size);
- __Pyx_DECREF(__pyx_v_self->_size);
- __pyx_v_self->_size = __pyx_v_result;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":566
- * self._size = result
- *
- * return self._size # <<<<<<<<<<<<<<
- *
- * def __len__(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->_size);
- __pyx_r = __pyx_v_self->_size;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_length);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
-static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":568
- * return self._size
- *
- * def __len__(self): # <<<<<<<<<<<<<<
- * if self.view.ndim >= 1:
- * return self.view.shape[0]
- */
-
-static Py_ssize_t __pyx_memoryview_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
- Py_ssize_t __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("__len__", 0);
-
- /* "View.MemoryView":569
- *
- * def __len__(self):
- * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
- * return self.view.shape[0]
- *
- */
- __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":570
- * def __len__(self):
- * if self.view.ndim >= 1:
- * return self.view.shape[0] # <<<<<<<<<<<<<<
- *
- * return 0
- */
- __pyx_r = (__pyx_v_self->view.shape[0]);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":572
- * return self.view.shape[0]
- *
- * return 0 # <<<<<<<<<<<<<<
- *
- * def __repr__(self):
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":574
- * return 0
- *
- * def __repr__(self): # <<<<<<<<<<<<<<
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
- * id(self))
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__repr__", 0);
-
- /* "View.MemoryView":575
- *
- * def __repr__(self):
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
- * id(self))
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
-
- /* "View.MemoryView":576
- * def __repr__(self):
- * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
- * id(self)) # <<<<<<<<<<<<<<
- *
- * def __str__(self):
- */
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_INCREF(((PyObject *)__pyx_v_self));
- PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
- __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
- __pyx_t_3 = PyObject_Call(__pyx_builtin_id, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_1 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_39), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 575; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":578
- * id(self))
- *
- * def __str__(self): # <<<<<<<<<<<<<<
- * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
- *
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("__str__", 0);
-
- /* "View.MemoryView":579
- *
- * def __str__(self):
- * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s__base); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s____class__); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s____name__); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- __pyx_t_1 = 0;
- __pyx_t_1 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_40), ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 579; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __pyx_r = ((PyObject *)__pyx_t_1);
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":582
- *
- *
- * def is_c_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice *__pyx_v_mslice;
- __Pyx_memviewslice __pyx_v_tmp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_c_contig", 0);
-
- /* "View.MemoryView":584
- * def is_c_contig(self):
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'C', self.view.ndim)
- *
- */
- __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
-
- /* "View.MemoryView":585
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'C', self.view.ndim) # <<<<<<<<<<<<<<
- *
- * def is_f_contig(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 585; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":587
- * return slice_is_contig(mslice, 'C', self.view.ndim)
- *
- * def is_f_contig(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice *__pyx_v_mslice;
- __Pyx_memviewslice __pyx_v_tmp;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("is_f_contig", 0);
-
- /* "View.MemoryView":589
- * def is_f_contig(self):
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
- * return slice_is_contig(mslice, 'F', self.view.ndim)
- *
- */
- __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
-
- /* "View.MemoryView":590
- * cdef __Pyx_memviewslice *mslice, tmp
- * mslice = get_slice_from_memview(self, &tmp)
- * return slice_is_contig(mslice, 'F', self.view.ndim) # <<<<<<<<<<<<<<
- *
- * def copy(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig(__pyx_v_mslice, 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 590; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("copy (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":592
- * return slice_is_contig(mslice, 'F', self.view.ndim)
- *
- * def copy(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice mslice
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice __pyx_v_mslice;
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("copy", 0);
-
- /* "View.MemoryView":594
- * def copy(self):
- * cdef __Pyx_memviewslice mslice
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
- *
- * slice_copy(self, &mslice)
- */
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
-
- /* "View.MemoryView":596
- * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
- *
- * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
- * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
- * self.view.itemsize,
- */
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
-
- /* "View.MemoryView":600
- * self.view.itemsize,
- * flags|PyBUF_C_CONTIGUOUS,
- * self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * return memoryview_copy_from_slice(self, &mslice)
- */
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), __pyx_k__c, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 597; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_mslice = __pyx_t_1;
-
- /* "View.MemoryView":602
- * self.dtype_is_object)
- *
- * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
- *
- * def copy_fortran(self):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
-static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
- __pyx_r = __pyx_memoryview_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":604
- * return memoryview_copy_from_slice(self, &mslice)
- *
- * def copy_fortran(self): # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice src, dst
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
- */
-
-static PyObject *__pyx_memoryview_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
- __Pyx_memviewslice __pyx_v_src;
- __Pyx_memviewslice __pyx_v_dst;
- int __pyx_v_flags;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_memviewslice __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("copy_fortran", 0);
-
- /* "View.MemoryView":606
- * def copy_fortran(self):
- * cdef __Pyx_memviewslice src, dst
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
- *
- * slice_copy(self, &src)
- */
- __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
-
- /* "View.MemoryView":608
- * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
- *
- * slice_copy(self, &src) # <<<<<<<<<<<<<<
- * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
- * self.view.itemsize,
- */
- __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
-
- /* "View.MemoryView":612
- * self.view.itemsize,
- * flags|PyBUF_F_CONTIGUOUS,
- * self.dtype_is_object) # <<<<<<<<<<<<<<
- *
- * return memoryview_copy_from_slice(self, &dst)
- */
- __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), __pyx_k__fortran, __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_dst = __pyx_t_1;
-
- /* "View.MemoryView":614
- * self.dtype_is_object)
- *
- * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 614; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":618
- *
- * @cname('__pyx_memoryview_new')
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo
- */
-
-static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
- struct __pyx_memoryview_obj *__pyx_v_result = 0;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
-
- /* "View.MemoryView":619
- * @cname('__pyx_memoryview_new')
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
- * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
- * result.typeinfo = typeinfo
- * return result
- */
- __pyx_t_1 = PyInt_FromLong(__pyx_v_flags); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_o);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
- __Pyx_GIVEREF(__pyx_v_o);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryview_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 619; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":620
- * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
- * return result
- *
- */
- __pyx_v_result->typeinfo = __pyx_v_typeinfo;
-
- /* "View.MemoryView":621
- * cdef memoryview result = memoryview(o, flags, dtype_is_object)
- * result.typeinfo = typeinfo
- * return result # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_check')
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":624
- *
- * @cname('__pyx_memoryview_check')
- * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
- * return isinstance(o, memoryview)
- *
- */
-
-static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- __Pyx_RefNannySetupContext("memoryview_check", 0);
-
- /* "View.MemoryView":625
- * @cname('__pyx_memoryview_check')
- * cdef inline bint memoryview_check(object o):
- * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
- *
- * cdef tuple _unellipsify(object index, int ndim):
- */
- __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, ((PyObject *)__pyx_memoryview_type));
- __pyx_r = __pyx_t_1;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":627
- * return isinstance(o, memoryview)
- *
- * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
- * """
- * Replace all ellipses with full slices and fill incomplete indices with
- */
-
-static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
- PyObject *__pyx_v_tup = NULL;
- PyObject *__pyx_v_result = NULL;
- PyObject *__pyx_v_have_slices = NULL;
- int __pyx_v_seen_ellipsis;
- CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
- PyObject *__pyx_v_item = NULL;
- PyObject *__pyx_v_nslices = NULL;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- Py_ssize_t __pyx_t_5;
- PyObject *(*__pyx_t_6)(PyObject *);
- PyObject *__pyx_t_7 = NULL;
- PyObject *__pyx_t_8 = NULL;
- Py_ssize_t __pyx_t_9;
- PyObject *__pyx_t_10 = NULL;
- int __pyx_t_11;
- int __pyx_t_12;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("_unellipsify", 0);
-
- /* "View.MemoryView":632
- * full slices.
- * """
- * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
- * tup = (index,)
- * else:
- */
- __pyx_t_1 = PyTuple_Check(__pyx_v_index);
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":633
- * """
- * if not isinstance(index, tuple):
- * tup = (index,) # <<<<<<<<<<<<<<
- * else:
- * tup = index
- */
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(__pyx_v_index);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
- __Pyx_GIVEREF(__pyx_v_index);
- __pyx_v_tup = ((PyObject *)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":635
- * tup = (index,)
- * else:
- * tup = index # <<<<<<<<<<<<<<
- *
- * result = []
- */
- __Pyx_INCREF(__pyx_v_index);
- __pyx_v_tup = __pyx_v_index;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":637
- * tup = index
- *
- * result = [] # <<<<<<<<<<<<<<
- * have_slices = False
- * seen_ellipsis = False
- */
- __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 637; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_result = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":638
- *
- * result = []
- * have_slices = False # <<<<<<<<<<<<<<
- * seen_ellipsis = False
- * for idx, item in enumerate(tup):
- */
- __pyx_t_3 = __Pyx_PyBool_FromLong(0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 638; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_have_slices = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":639
- * result = []
- * have_slices = False
- * seen_ellipsis = False # <<<<<<<<<<<<<<
- * for idx, item in enumerate(tup):
- * if item is Ellipsis:
- */
- __pyx_v_seen_ellipsis = 0;
-
- /* "View.MemoryView":640
- * have_slices = False
- * seen_ellipsis = False
- * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
- * if item is Ellipsis:
- * if not seen_ellipsis:
- */
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_3 = __pyx_int_0;
- if (PyList_CheckExact(__pyx_v_tup) || PyTuple_CheckExact(__pyx_v_tup)) {
- __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
- __pyx_t_6 = NULL;
- } else {
- __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_6 && PyList_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_6 && PyTuple_CheckExact(__pyx_t_4)) {
- if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __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_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_7 = __pyx_t_6(__pyx_t_4);
- if (unlikely(!__pyx_t_7)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_7);
- }
- __Pyx_XDECREF(__pyx_v_item);
- __pyx_v_item = __pyx_t_7;
- __pyx_t_7 = 0;
- __Pyx_INCREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_v_idx);
- __pyx_v_idx = __pyx_t_3;
- __pyx_t_7 = PyNumber_Add(__pyx_t_3, __pyx_int_1); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 640; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __Pyx_DECREF(__pyx_t_3);
- __pyx_t_3 = __pyx_t_7;
- __pyx_t_7 = 0;
-
- /* "View.MemoryView":641
- * seen_ellipsis = False
- * for idx, item in enumerate(tup):
- * if item is Ellipsis: # <<<<<<<<<<<<<<
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
- */
- __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":642
- * for idx, item in enumerate(tup):
- * if item is Ellipsis:
- * if not seen_ellipsis: # <<<<<<<<<<<<<<
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
- * seen_ellipsis = True
- */
- __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":643
- * if item is Ellipsis:
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
- * seen_ellipsis = True
- * else:
- */
- __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s__extend); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_7);
- __pyx_t_8 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_41), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __pyx_t_9 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_10 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_9) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_9) + 1))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- { Py_ssize_t __pyx_temp;
- for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_9) + 1); __pyx_temp++) {
- __Pyx_INCREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_10, __pyx_temp, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- }
- }
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_10));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
-
- /* "View.MemoryView":644
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1))
- * seen_ellipsis = True # <<<<<<<<<<<<<<
- * else:
- * result.append(slice(None))
- */
- __pyx_v_seen_ellipsis = 1;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":646
- * seen_ellipsis = True
- * else:
- * result.append(slice(None)) # <<<<<<<<<<<<<<
- * have_slices = True
- * else:
- */
- __pyx_t_10 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_42), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_t_10); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- }
- __pyx_L7:;
-
- /* "View.MemoryView":647
- * else:
- * result.append(slice(None))
- * have_slices = True # <<<<<<<<<<<<<<
- * else:
- * if not isinstance(item, slice) and not PyIndex_Check(item):
- */
- __pyx_t_10 = __Pyx_PyBool_FromLong(1); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 647; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(__pyx_v_have_slices);
- __pyx_v_have_slices = __pyx_t_10;
- __pyx_t_10 = 0;
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":649
- * have_slices = True
- * else:
- * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
- * raise TypeError("Cannot index with type '%s'" % type(item))
- *
- */
- __pyx_t_1 = PySlice_Check(__pyx_v_item);
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
- __pyx_t_1 = ((!(__Pyx_PyIndex_Check(__pyx_v_item) != 0)) != 0);
- __pyx_t_12 = __pyx_t_1;
- } else {
- __pyx_t_12 = __pyx_t_2;
- }
- if (__pyx_t_12) {
-
- /* "View.MemoryView":650
- * else:
- * if not isinstance(item, slice) and not PyIndex_Check(item):
- * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
- *
- * have_slices = have_slices or isinstance(item, slice)
- */
- __pyx_t_10 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_43), ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_10));
- __pyx_t_8 = PyTuple_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_8, 0, ((PyObject *)__pyx_t_10));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_10));
- __pyx_t_10 = 0;
- __pyx_t_10 = PyObject_Call(__pyx_builtin_TypeError, ((PyObject *)__pyx_t_8), NULL); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __Pyx_DECREF(((PyObject *)__pyx_t_8)); __pyx_t_8 = 0;
- __Pyx_Raise(__pyx_t_10, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 650; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "View.MemoryView":652
- * raise TypeError("Cannot index with type '%s'" % type(item))
- *
- * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
- * result.append(item)
- *
- */
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_12) {
- __pyx_t_12 = PySlice_Check(__pyx_v_item);
- __pyx_t_10 = __Pyx_PyBool_FromLong(__pyx_t_12); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 652; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_10);
- __pyx_t_8 = __pyx_t_10;
- __pyx_t_10 = 0;
- } else {
- __Pyx_INCREF(__pyx_v_have_slices);
- __pyx_t_8 = __pyx_v_have_slices;
- }
- __Pyx_DECREF(__pyx_v_have_slices);
- __pyx_v_have_slices = __pyx_t_8;
- __pyx_t_8 = 0;
-
- /* "View.MemoryView":653
- *
- * have_slices = have_slices or isinstance(item, slice)
- * result.append(item) # <<<<<<<<<<<<<<
- *
- * nslices = ndim - len(result)
- */
- __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 653; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L6:;
- }
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
-
- /* "View.MemoryView":655
- * result.append(item)
- *
- * nslices = ndim - len(result) # <<<<<<<<<<<<<<
- * if nslices:
- * result.extend([slice(None)] * nslices)
- */
- __pyx_t_5 = PyList_GET_SIZE(((PyObject *)__pyx_v_result)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_t_3 = PyInt_FromSsize_t((__pyx_v_ndim - __pyx_t_5)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 655; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_v_nslices = __pyx_t_3;
- __pyx_t_3 = 0;
-
- /* "View.MemoryView":656
- *
- * nslices = ndim - len(result)
- * if nslices: # <<<<<<<<<<<<<<
- * result.extend([slice(None)] * nslices)
- *
- */
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_nslices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 656; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__pyx_t_12) {
-
- /* "View.MemoryView":657
- * nslices = ndim - len(result)
- * if nslices:
- * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
- *
- * return have_slices or nslices, tuple(result)
- */
- __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_result), __pyx_n_s__extend); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)(&PySlice_Type))), ((PyObject *)__pyx_k_tuple_44), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_8 = PyList_New(1); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- PyList_SET_ITEM(__pyx_t_8, 0, __pyx_t_4);
- __Pyx_GIVEREF(__pyx_t_4);
- { PyObject* __pyx_temp = PyNumber_InPlaceMultiply(__pyx_t_8, __pyx_v_nslices); if (unlikely(!__pyx_temp)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_temp);
- __Pyx_DECREF(__pyx_t_8);
- __pyx_t_8 = __pyx_temp;
- }
- __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_8));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_8));
- __pyx_t_8 = 0;
- __pyx_t_8 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_8);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "View.MemoryView":659
- * result.extend([slice(None)] * nslices)
- *
- * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
- *
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
- __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_12) {
- __Pyx_INCREF(__pyx_v_nslices);
- __pyx_t_8 = __pyx_v_nslices;
- } else {
- __Pyx_INCREF(__pyx_v_have_slices);
- __pyx_t_8 = __pyx_v_have_slices;
- }
- __pyx_t_4 = ((PyObject *)PyList_AsTuple(__pyx_v_result)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 659; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8);
- __Pyx_GIVEREF(__pyx_t_8);
- PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_8 = 0;
- __pyx_t_4 = 0;
- __pyx_r = ((PyObject*)__pyx_t_3);
- __pyx_t_3 = 0;
- goto __pyx_L0;
-
- __pyx_r = ((PyObject*)Py_None); __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_XDECREF(__pyx_t_7);
- __Pyx_XDECREF(__pyx_t_8);
- __Pyx_XDECREF(__pyx_t_10);
- __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_tup);
- __Pyx_XDECREF(__pyx_v_result);
- __Pyx_XDECREF(__pyx_v_have_slices);
- __Pyx_XDECREF(__pyx_v_idx);
- __Pyx_XDECREF(__pyx_v_item);
- __Pyx_XDECREF(__pyx_v_nslices);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":661
- * return have_slices or nslices, tuple(result)
- *
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
- * cdef int i
- * for i in range(ndim):
- */
-
-static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
-
- /* "View.MemoryView":663
- * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
- * cdef int i
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if suboffsets[i] >= 0:
- * raise ValueError("Indirect dimensions not supported")
- */
- __pyx_t_1 = __pyx_v_ndim;
- for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
- __pyx_v_i = __pyx_t_2;
-
- /* "View.MemoryView":664
- * cdef int i
- * for i in range(ndim):
- * if suboffsets[i] >= 0: # <<<<<<<<<<<<<<
- * raise ValueError("Indirect dimensions not supported")
- *
- */
- __pyx_t_3 = (((__pyx_v_suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":665
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
- * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_46), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
- }
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":672
- *
- * @cname('__pyx_memview_slice')
- * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
- * cdef int new_ndim = 0, suboffset_dim = -1, dim
- * cdef bint negative_step
- */
-
-static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
- int __pyx_v_new_ndim;
- int __pyx_v_suboffset_dim;
- int __pyx_v_dim;
- __Pyx_memviewslice __pyx_v_src;
- __Pyx_memviewslice __pyx_v_dst;
- __Pyx_memviewslice *__pyx_v_p_src;
- struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
- __Pyx_memviewslice *__pyx_v_p_dst;
- int *__pyx_v_p_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;
- PyObject *__pyx_v_index = NULL;
- struct __pyx_memoryview_obj *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- struct __pyx_memoryview_obj *__pyx_t_3;
- char *__pyx_t_4;
- int __pyx_t_5;
- PyObject *__pyx_t_6 = NULL;
- Py_ssize_t __pyx_t_7;
- PyObject *(*__pyx_t_8)(PyObject *);
- PyObject *__pyx_t_9 = NULL;
- Py_ssize_t __pyx_t_10;
- int __pyx_t_11;
- PyObject *__pyx_t_12 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memview_slice", 0);
-
- /* "View.MemoryView":673
- * @cname('__pyx_memview_slice')
- * cdef memoryview memview_slice(memoryview memview, object indices):
- * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
- * cdef bint negative_step
- * cdef __Pyx_memviewslice src, dst
- */
- __pyx_v_new_ndim = 0;
- __pyx_v_suboffset_dim = -1;
-
- /* "View.MemoryView":680
- *
- *
- * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
- *
- * cdef _memoryviewslice memviewsliceobj
- */
- memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst)));
-
- /* "View.MemoryView":684
- * cdef _memoryviewslice memviewsliceobj
- *
- * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
- *
- * if isinstance(memview, _memoryviewslice):
- */
- #ifndef CYTHON_WITHOUT_ASSERTIONS
- if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
- PyErr_SetNone(PyExc_AssertionError);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 684; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- #endif
-
- /* "View.MemoryView":686
- * assert memview.view.ndim > 0
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * memviewsliceobj = memview
- * p_src = &memviewsliceobj.from_slice
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":687
- *
- * if isinstance(memview, _memoryviewslice):
- * memviewsliceobj = memview # <<<<<<<<<<<<<<
- * p_src = &memviewsliceobj.from_slice
- * else:
- */
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 687; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(((PyObject *)__pyx_v_memview));
- __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview);
-
- /* "View.MemoryView":688
- * if isinstance(memview, _memoryviewslice):
- * memviewsliceobj = memview
- * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
- * else:
- * slice_copy(memview, &src)
- */
- __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":690
- * p_src = &memviewsliceobj.from_slice
- * else:
- * slice_copy(memview, &src) # <<<<<<<<<<<<<<
- * p_src = &src
- *
- */
- __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
-
- /* "View.MemoryView":691
- * else:
- * slice_copy(memview, &src)
- * p_src = &src # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_p_src = (&__pyx_v_src);
- }
- __pyx_L3:;
-
- /* "View.MemoryView":697
- *
- *
- * dst.memview = p_src.memview # <<<<<<<<<<<<<<
- * dst.data = p_src.data
- *
- */
- __pyx_t_3 = __pyx_v_p_src->memview;
- __pyx_v_dst.memview = __pyx_t_3;
-
- /* "View.MemoryView":698
- *
- * dst.memview = p_src.memview
- * dst.data = p_src.data # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_4 = __pyx_v_p_src->data;
- __pyx_v_dst.data = __pyx_t_4;
-
- /* "View.MemoryView":703
- *
- *
- * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
- * cdef int *p_suboffset_dim = &suboffset_dim
- * cdef Py_ssize_t start, stop, step
- */
- __pyx_v_p_dst = (&__pyx_v_dst);
-
- /* "View.MemoryView":704
- *
- * cdef __Pyx_memviewslice *p_dst = &dst
- * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
- * cdef Py_ssize_t start, stop, step
- * cdef bint have_start, have_stop, have_step
- */
- __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
-
- /* "View.MemoryView":708
- * cdef bint have_start, have_stop, have_step
- *
- * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
- * if PyIndex_Check(index):
- * slice_memviewslice(
- */
- __pyx_t_5 = 0;
- if (PyList_CheckExact(__pyx_v_indices) || PyTuple_CheckExact(__pyx_v_indices)) {
- __pyx_t_6 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_6); __pyx_t_7 = 0;
- __pyx_t_8 = NULL;
- } else {
- __pyx_t_7 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- __pyx_t_8 = Py_TYPE(__pyx_t_6)->tp_iternext;
- }
- for (;;) {
- if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_6)) {
- if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_6)) {
- if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
- #if CYTHON_COMPILING_IN_CPYTHON
- __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_t_9 = PySequence_ITEM(__pyx_t_6, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- } else {
- __pyx_t_9 = __pyx_t_8(__pyx_t_6);
- if (unlikely(!__pyx_t_9)) {
- if (PyErr_Occurred()) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
- else {__pyx_filename = __pyx_f[2]; __pyx_lineno = 708; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- break;
- }
- __Pyx_GOTREF(__pyx_t_9);
- }
- __Pyx_XDECREF(__pyx_v_index);
- __pyx_v_index = __pyx_t_9;
- __pyx_t_9 = 0;
- __pyx_v_dim = __pyx_t_5;
- __pyx_t_5 = (__pyx_t_5 + 1);
-
- /* "View.MemoryView":709
- *
- * for dim, index in enumerate(indices):
- * if PyIndex_Check(index): # <<<<<<<<<<<<<<
- * slice_memviewslice(
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
- */
- __pyx_t_2 = (__Pyx_PyIndex_Check(__pyx_v_index) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":713
- * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
- * dim, new_ndim, p_suboffset_dim,
- * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
- * 0, 0, 0, # have_{start,stop,step}
- * False)
- */
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 713; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":715
- * index, 0, 0, # start, stop, step
- * 0, 0, 0, # have_{start,stop,step}
- * False) # <<<<<<<<<<<<<<
- * elif index is None:
- * p_dst.shape[new_ndim] = 1
- */
- __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 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
-
- /* "View.MemoryView":716
- * 0, 0, 0, # have_{start,stop,step}
- * False)
- * elif index is None: # <<<<<<<<<<<<<<
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0
- */
- __pyx_t_2 = (__pyx_v_index == Py_None);
- __pyx_t_1 = (__pyx_t_2 != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":717
- * False)
- * elif index is None:
- * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1
- */
- (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
-
- /* "View.MemoryView":718
- * elif index is None:
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
- * p_dst.suboffsets[new_ndim] = -1
- * new_ndim += 1
- */
- (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
-
- /* "View.MemoryView":719
- * p_dst.shape[new_ndim] = 1
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
- * new_ndim += 1
- * else:
- */
- (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1;
-
- /* "View.MemoryView":720
- * p_dst.strides[new_ndim] = 0
- * p_dst.suboffsets[new_ndim] = -1
- * new_ndim += 1 # <<<<<<<<<<<<<<
- * else:
- * start = index.start or 0
- */
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":722
- * new_ndim += 1
- * else:
- * start = index.start or 0 # <<<<<<<<<<<<<<
- * stop = index.stop or 0
- * step = index.step or 0
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_12 = __pyx_int_0;
- } else {
- __pyx_t_12 = __pyx_t_9;
- __pyx_t_9 = 0;
- }
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 722; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_start = __pyx_t_10;
-
- /* "View.MemoryView":723
- * else:
- * start = index.start or 0
- * stop = index.stop or 0 # <<<<<<<<<<<<<<
- * step = index.step or 0
- *
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_12); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_9 = __pyx_int_0;
- } else {
- __pyx_t_9 = __pyx_t_12;
- __pyx_t_12 = 0;
- }
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 723; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __pyx_v_stop = __pyx_t_10;
-
- /* "View.MemoryView":724
- * start = index.start or 0
- * stop = index.stop or 0
- * step = index.step or 0 # <<<<<<<<<<<<<<
- *
- * have_start = index.start is not None
- */
- __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__step); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_9);
- __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!__pyx_t_1) {
- __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
- __Pyx_INCREF(__pyx_int_0);
- __pyx_t_12 = __pyx_int_0;
- } else {
- __pyx_t_12 = __pyx_t_9;
- __pyx_t_9 = 0;
- }
- __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_t_12); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 724; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_step = __pyx_t_10;
-
- /* "View.MemoryView":726
- * step = index.step or 0
- *
- * have_start = index.start is not None # <<<<<<<<<<<<<<
- * have_stop = index.stop is not None
- * have_step = index.step is not None
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__start); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 726; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = (__pyx_t_12 != Py_None);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_have_start = __pyx_t_1;
-
- /* "View.MemoryView":727
- *
- * have_start = index.start is not None
- * have_stop = index.stop is not None # <<<<<<<<<<<<<<
- * have_step = index.step is not None
- *
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__stop); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 727; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = (__pyx_t_12 != Py_None);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_have_stop = __pyx_t_1;
-
- /* "View.MemoryView":728
- * have_start = index.start is not None
- * have_stop = index.stop is not None
- * have_step = index.step is not None # <<<<<<<<<<<<<<
- *
- * slice_memviewslice(
- */
- __pyx_t_12 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s__step); if (unlikely(!__pyx_t_12)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_12);
- __pyx_t_1 = (__pyx_t_12 != Py_None);
- __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
- __pyx_v_have_step = __pyx_t_1;
-
- /* "View.MemoryView":735
- * start, stop, step,
- * have_start, have_stop, have_step,
- * True) # <<<<<<<<<<<<<<
- * new_ndim += 1
- *
- */
- __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 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":736
- * have_start, have_stop, have_step,
- * True)
- * new_ndim += 1 # <<<<<<<<<<<<<<
- *
- * if isinstance(memview, _memoryviewslice):
- */
- __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
- }
- __pyx_L6:;
- }
- __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
-
- /* "View.MemoryView":738
- * new_ndim += 1
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func,
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":739
- *
- * if isinstance(memview, _memoryviewslice):
- * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
- * memviewsliceobj.to_object_func,
- * memviewsliceobj.to_dtype_func,
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
-
- /* "View.MemoryView":740
- * if isinstance(memview, _memoryviewslice):
- * return memoryview_fromslice(dst, new_ndim,
- * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
- * memviewsliceobj.to_dtype_func,
- * memview.dtype_is_object)
- */
- if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); {__pyx_filename = __pyx_f[2]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;} }
-
- /* "View.MemoryView":742
- * memviewsliceobj.to_object_func,
- * memviewsliceobj.to_dtype_func,
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
- */
- __pyx_t_6 = __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_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_6);
- __pyx_t_6 = 0;
- goto __pyx_L0;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":744
- * memview.dtype_is_object)
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
- * memview.dtype_is_object)
- *
- */
- __Pyx_XDECREF(((PyObject *)__pyx_r));
-
- /* "View.MemoryView":745
- * else:
- * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_6);
- if (!(likely(((__pyx_t_6) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_6, __pyx_memoryview_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_6);
- __pyx_t_6 = 0;
- goto __pyx_L0;
- }
- __pyx_L7:;
-
- __pyx_r = ((struct __pyx_memoryview_obj *)Py_None); __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_6);
- __Pyx_XDECREF(__pyx_t_9);
- __Pyx_XDECREF(__pyx_t_12);
- __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
- __Pyx_XDECREF(__pyx_v_index);
- __Pyx_XGIVEREF((PyObject *)__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":769
- *
- * @cname('__pyx_memoryview_slice_memviewslice')
- * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *dst,
- * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
- */
-
-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) {
- Py_ssize_t __pyx_v_new_shape;
- int __pyx_v_negative_step;
- int __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":789
- * cdef bint negative_step
- *
- * if not is_slice: # <<<<<<<<<<<<<<
- *
- * if start < 0:
- */
- __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":791
- * if not is_slice:
- *
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if not 0 <= start < shape:
- */
- __pyx_t_1 = ((__pyx_v_start < 0) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":792
- *
- * if start < 0:
- * start += shape # <<<<<<<<<<<<<<
- * if not 0 <= start < shape:
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
- */
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
- goto __pyx_L4;
- }
- __pyx_L4:;
-
- /* "View.MemoryView":793
- * if start < 0:
- * start += shape
- * if not 0 <= start < shape: # <<<<<<<<<<<<<<
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
- * else:
- */
- __pyx_t_1 = (0 <= __pyx_v_start);
- if (__pyx_t_1) {
- __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
- }
- __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":794
- * start += shape
- * if not 0 <= start < shape:
- * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
- * else:
- *
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_47, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":797
- * else:
- *
- * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
- *
- * if have_step and step == 0:
- */
- __pyx_t_2 = (__pyx_v_have_step != 0);
- if (__pyx_t_2) {
- __pyx_t_1 = (__pyx_v_step < 0);
- __pyx_t_4 = __pyx_t_1;
- } else {
- __pyx_t_4 = __pyx_t_2;
- }
- __pyx_v_negative_step = __pyx_t_4;
-
- /* "View.MemoryView":799
- * negative_step = have_step != 0 and step < 0
- *
- * if have_step and step == 0: # <<<<<<<<<<<<<<
- * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
- *
- */
- if ((__pyx_v_have_step != 0)) {
- __pyx_t_4 = (__pyx_v_step == 0);
- __pyx_t_2 = __pyx_t_4;
- } else {
- __pyx_t_2 = (__pyx_v_have_step != 0);
- }
- if (__pyx_t_2) {
-
- /* "View.MemoryView":800
- *
- * if have_step and step == 0:
- * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_48, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 800; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":803
- *
- *
- * if have_start: # <<<<<<<<<<<<<<
- * if start < 0:
- * start += shape
- */
- __pyx_t_2 = (__pyx_v_have_start != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":804
- *
- * if have_start:
- * if start < 0: # <<<<<<<<<<<<<<
- * start += shape
- * if start < 0:
- */
- __pyx_t_2 = ((__pyx_v_start < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":805
- * if have_start:
- * if start < 0:
- * start += shape # <<<<<<<<<<<<<<
- * if start < 0:
- * start = 0
- */
- __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
-
- /* "View.MemoryView":806
- * if start < 0:
- * start += shape
- * if start < 0: # <<<<<<<<<<<<<<
- * start = 0
- * elif start >= shape:
- */
- __pyx_t_2 = ((__pyx_v_start < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":807
- * start += shape
- * if start < 0:
- * start = 0 # <<<<<<<<<<<<<<
- * elif start >= shape:
- * if negative_step:
- */
- __pyx_v_start = 0;
- goto __pyx_L9;
- }
- __pyx_L9:;
- goto __pyx_L8;
- }
-
- /* "View.MemoryView":808
- * if start < 0:
- * start = 0
- * elif start >= shape: # <<<<<<<<<<<<<<
- * if negative_step:
- * start = shape - 1
- */
- __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":809
- * start = 0
- * elif start >= shape:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- __pyx_t_2 = (__pyx_v_negative_step != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":810
- * elif start >= shape:
- * if negative_step:
- * start = shape - 1 # <<<<<<<<<<<<<<
- * else:
- * start = shape
- */
- __pyx_v_start = (__pyx_v_shape - 1);
- goto __pyx_L10;
- }
- /*else*/ {
-
- /* "View.MemoryView":812
- * start = shape - 1
- * else:
- * start = shape # <<<<<<<<<<<<<<
- * else:
- * if negative_step:
- */
- __pyx_v_start = __pyx_v_shape;
- }
- __pyx_L10:;
- goto __pyx_L8;
- }
- __pyx_L8:;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":814
- * start = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * start = shape - 1
- * else:
- */
- __pyx_t_2 = (__pyx_v_negative_step != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":815
- * else:
- * if negative_step:
- * start = shape - 1 # <<<<<<<<<<<<<<
- * else:
- * start = 0
- */
- __pyx_v_start = (__pyx_v_shape - 1);
- goto __pyx_L11;
- }
- /*else*/ {
-
- /* "View.MemoryView":817
- * start = shape - 1
- * else:
- * start = 0 # <<<<<<<<<<<<<<
- *
- * if have_stop:
- */
- __pyx_v_start = 0;
- }
- __pyx_L11:;
- }
- __pyx_L7:;
-
- /* "View.MemoryView":819
- * start = 0
- *
- * if have_stop: # <<<<<<<<<<<<<<
- * if stop < 0:
- * stop += shape
- */
- __pyx_t_2 = (__pyx_v_have_stop != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":820
- *
- * if have_stop:
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop += shape
- * if stop < 0:
- */
- __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":821
- * if have_stop:
- * if stop < 0:
- * stop += shape # <<<<<<<<<<<<<<
- * if stop < 0:
- * stop = 0
- */
- __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
-
- /* "View.MemoryView":822
- * if stop < 0:
- * stop += shape
- * if stop < 0: # <<<<<<<<<<<<<<
- * stop = 0
- * elif stop > shape:
- */
- __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":823
- * stop += shape
- * if stop < 0:
- * stop = 0 # <<<<<<<<<<<<<<
- * elif stop > shape:
- * stop = shape
- */
- __pyx_v_stop = 0;
- goto __pyx_L14;
- }
- __pyx_L14:;
- goto __pyx_L13;
- }
-
- /* "View.MemoryView":824
- * if stop < 0:
- * stop = 0
- * elif stop > shape: # <<<<<<<<<<<<<<
- * stop = shape
- * else:
- */
- __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":825
- * stop = 0
- * elif stop > shape:
- * stop = shape # <<<<<<<<<<<<<<
- * else:
- * if negative_step:
- */
- __pyx_v_stop = __pyx_v_shape;
- goto __pyx_L13;
- }
- __pyx_L13:;
- goto __pyx_L12;
- }
- /*else*/ {
-
- /* "View.MemoryView":827
- * stop = shape
- * else:
- * if negative_step: # <<<<<<<<<<<<<<
- * stop = -1
- * else:
- */
- __pyx_t_2 = (__pyx_v_negative_step != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":828
- * else:
- * if negative_step:
- * stop = -1 # <<<<<<<<<<<<<<
- * else:
- * stop = shape
- */
- __pyx_v_stop = -1;
- goto __pyx_L15;
- }
- /*else*/ {
-
- /* "View.MemoryView":830
- * stop = -1
- * else:
- * stop = shape # <<<<<<<<<<<<<<
- *
- * if not have_step:
- */
- __pyx_v_stop = __pyx_v_shape;
- }
- __pyx_L15:;
- }
- __pyx_L12:;
-
- /* "View.MemoryView":832
- * stop = shape
- *
- * if not have_step: # <<<<<<<<<<<<<<
- * step = 1
- *
- */
- __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":833
- *
- * if not have_step:
- * step = 1 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_step = 1;
- goto __pyx_L16;
- }
- __pyx_L16:;
-
- /* "View.MemoryView":837
- *
- * with cython.cdivision(True):
- * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
- *
- * if (stop - start) - step * new_shape:
- */
- __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
-
- /* "View.MemoryView":839
- * new_shape = (stop - start) // step
- *
- * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
- * new_shape += 1
- *
- */
- __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":840
- *
- * if (stop - start) - step * new_shape:
- * new_shape += 1 # <<<<<<<<<<<<<<
- *
- * if new_shape < 0:
- */
- __pyx_v_new_shape = (__pyx_v_new_shape + 1);
- goto __pyx_L17;
- }
- __pyx_L17:;
-
- /* "View.MemoryView":842
- * new_shape += 1
- *
- * if new_shape < 0: # <<<<<<<<<<<<<<
- * new_shape = 0
- *
- */
- __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":843
- *
- * if new_shape < 0:
- * new_shape = 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_new_shape = 0;
- goto __pyx_L18;
- }
- __pyx_L18:;
-
- /* "View.MemoryView":846
- *
- *
- * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
- * dst.shape[new_ndim] = new_shape
- * dst.suboffsets[new_ndim] = suboffset
- */
- (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
-
- /* "View.MemoryView":847
- *
- * dst.strides[new_ndim] = stride * step
- * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
- * dst.suboffsets[new_ndim] = suboffset
- *
- */
- (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
-
- /* "View.MemoryView":848
- * dst.strides[new_ndim] = stride * step
- * dst.shape[new_ndim] = new_shape
- * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
- *
- *
- */
- (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":851
- *
- *
- * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
- * dst.data += start * stride
- * else:
- */
- __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":852
- *
- * if suboffset_dim[0] < 0:
- * dst.data += start * stride # <<<<<<<<<<<<<<
- * else:
- * dst.suboffsets[suboffset_dim[0]] += start * stride
- */
- __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
- goto __pyx_L19;
- }
- /*else*/ {
-
- /* "View.MemoryView":854
- * dst.data += start * stride
- * else:
- * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
- *
- * if suboffset >= 0:
- */
- __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
- (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
- }
- __pyx_L19:;
-
- /* "View.MemoryView":856
- * dst.suboffsets[suboffset_dim[0]] += start * stride
- *
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * if not is_slice:
- * if new_ndim == 0:
- */
- __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":857
- *
- * if suboffset >= 0:
- * if not is_slice: # <<<<<<<<<<<<<<
- * if new_ndim == 0:
- * dst.data = (<char **> dst.data)[0] + suboffset
- */
- __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":858
- * if suboffset >= 0:
- * if not is_slice:
- * if new_ndim == 0: # <<<<<<<<<<<<<<
- * dst.data = (<char **> dst.data)[0] + suboffset
- * else:
- */
- __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":859
- * if not is_slice:
- * if new_ndim == 0:
- * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
- * else:
- * _err_dim(IndexError, "All dimensions preceding dimension %d "
- */
- __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
- goto __pyx_L22;
- }
- /*else*/ {
-
- /* "View.MemoryView":862
- * else:
- * _err_dim(IndexError, "All dimensions preceding dimension %d "
- * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
- * else:
- * suboffset_dim[0] = new_ndim
- */
- __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, __pyx_k_49, __pyx_v_dim); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L22:;
- goto __pyx_L21;
- }
- /*else*/ {
-
- /* "View.MemoryView":864
- * "must be indexed and not sliced", dim)
- * else:
- * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
- *
- * return 0
- */
- (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
- }
- __pyx_L21:;
- goto __pyx_L20;
- }
- __pyx_L20:;
-
- /* "View.MemoryView":866
- * suboffset_dim[0] = new_ndim
- *
- * return 0 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = -1;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":872
- *
- * @cname('__pyx_pybuffer_index')
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
- * int dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1
- */
-
-static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, int __pyx_v_dim) {
- Py_ssize_t __pyx_v_shape;
- Py_ssize_t __pyx_v_stride;
- Py_ssize_t __pyx_v_suboffset;
- Py_ssize_t __pyx_v_itemsize;
- char *__pyx_v_resultp;
- char *__pyx_r;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("pybuffer_index", 0);
-
- /* "View.MemoryView":874
- * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
- * int dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
- * cdef Py_ssize_t itemsize = view.itemsize
- * cdef char *resultp
- */
- __pyx_v_suboffset = -1;
-
- /* "View.MemoryView":875
- * int dim) except NULL:
- * cdef Py_ssize_t shape, stride, suboffset = -1
- * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
- * cdef char *resultp
- *
- */
- __pyx_t_1 = __pyx_v_view->itemsize;
- __pyx_v_itemsize = __pyx_t_1;
-
- /* "View.MemoryView":878
- * cdef char *resultp
- *
- * if view.ndim == 0: # <<<<<<<<<<<<<<
- * shape = view.len / itemsize
- * stride = itemsize
- */
- __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":879
- *
- * if view.ndim == 0:
- * shape = view.len / itemsize # <<<<<<<<<<<<<<
- * stride = itemsize
- * else:
- */
- if (unlikely(__pyx_v_itemsize == 0)) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_ZeroDivisionError, "integer division or modulo by zero");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- else if (sizeof(Py_ssize_t) == sizeof(long) && unlikely(__pyx_v_itemsize == -1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- PyErr_Format(PyExc_OverflowError, "value too large to perform division");
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 879; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
-
- /* "View.MemoryView":880
- * if view.ndim == 0:
- * shape = view.len / itemsize
- * stride = itemsize # <<<<<<<<<<<<<<
- * else:
- * shape = view.shape[dim]
- */
- __pyx_v_stride = __pyx_v_itemsize;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":882
- * stride = itemsize
- * else:
- * shape = view.shape[dim] # <<<<<<<<<<<<<<
- * stride = view.strides[dim]
- * if view.suboffsets != NULL:
- */
- __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
-
- /* "View.MemoryView":883
- * else:
- * shape = view.shape[dim]
- * stride = view.strides[dim] # <<<<<<<<<<<<<<
- * if view.suboffsets != NULL:
- * suboffset = view.suboffsets[dim]
- */
- __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
-
- /* "View.MemoryView":884
- * shape = view.shape[dim]
- * stride = view.strides[dim]
- * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
- * suboffset = view.suboffsets[dim]
- *
- */
- __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":885
- * stride = view.strides[dim]
- * if view.suboffsets != NULL:
- * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
- *
- * if index < 0:
- */
- __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
- goto __pyx_L4;
- }
- __pyx_L4:;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":887
- * suboffset = view.suboffsets[dim]
- *
- * if index < 0: # <<<<<<<<<<<<<<
- * index += view.shape[dim]
- * if index < 0:
- */
- __pyx_t_2 = ((__pyx_v_index < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":888
- *
- * if index < 0:
- * index += view.shape[dim] # <<<<<<<<<<<<<<
- * if index < 0:
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- */
- __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
-
- /* "View.MemoryView":889
- * if index < 0:
- * index += view.shape[dim]
- * if index < 0: # <<<<<<<<<<<<<<
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- */
- __pyx_t_2 = ((__pyx_v_index < 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":890
- * index += view.shape[dim]
- * if index < 0:
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
- *
- * if index >= shape:
- */
- __pyx_t_3 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_50), __pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_4));
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
- __pyx_t_4 = 0;
- __pyx_t_4 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_4, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 890; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L6;
- }
- __pyx_L6:;
- goto __pyx_L5;
- }
- __pyx_L5:;
-
- /* "View.MemoryView":892
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- * if index >= shape: # <<<<<<<<<<<<<<
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- */
- __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":893
- *
- * if index >= shape:
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
- *
- * resultp = bufp + index * stride
- */
- __pyx_t_4 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_50), __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_IndexError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 893; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L7;
- }
- __pyx_L7:;
-
- /* "View.MemoryView":895
- * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
- *
- * resultp = bufp + index * stride # <<<<<<<<<<<<<<
- * if suboffset >= 0:
- * resultp = (<char **> resultp)[0] + suboffset
- */
- __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
-
- /* "View.MemoryView":896
- *
- * resultp = bufp + index * stride
- * if suboffset >= 0: # <<<<<<<<<<<<<<
- * resultp = (<char **> resultp)[0] + suboffset
- *
- */
- __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":897
- * resultp = bufp + index * stride
- * if suboffset >= 0:
- * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
- *
- * return resultp
- */
- __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
- goto __pyx_L8;
- }
- __pyx_L8:;
-
- /* "View.MemoryView":899
- * resultp = (<char **> resultp)[0] + suboffset
- *
- * return resultp # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_resultp;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = NULL;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":905
- *
- * @cname('__pyx_memslice_transpose')
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
- * cdef int ndim = memslice.memview.view.ndim
- *
- */
-
-static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
- int __pyx_v_ndim;
- Py_ssize_t *__pyx_v_shape;
- Py_ssize_t *__pyx_v_strides;
- int __pyx_v_i;
- int __pyx_v_j;
- int __pyx_r;
- int __pyx_t_1;
- Py_ssize_t *__pyx_t_2;
- long __pyx_t_3;
- Py_ssize_t __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- int __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_t_9;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":906
- * @cname('__pyx_memslice_transpose')
- * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
- * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
- *
- * cdef Py_ssize_t *shape = memslice.shape
- */
- __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
- __pyx_v_ndim = __pyx_t_1;
-
- /* "View.MemoryView":908
- * cdef int ndim = memslice.memview.view.ndim
- *
- * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
- * cdef Py_ssize_t *strides = memslice.strides
- *
- */
- __pyx_t_2 = __pyx_v_memslice->shape;
- __pyx_v_shape = __pyx_t_2;
-
- /* "View.MemoryView":909
- *
- * cdef Py_ssize_t *shape = memslice.shape
- * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = __pyx_v_memslice->strides;
- __pyx_v_strides = __pyx_t_2;
-
- /* "View.MemoryView":913
- *
- * cdef int i, j
- * for i in range(ndim / 2): # <<<<<<<<<<<<<<
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i]
- */
- __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
- for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_3; __pyx_t_1+=1) {
- __pyx_v_i = __pyx_t_1;
-
- /* "View.MemoryView":914
- * cdef int i, j
- * for i in range(ndim / 2):
- * j = ndim - 1 - i # <<<<<<<<<<<<<<
- * strides[i], strides[j] = strides[j], strides[i]
- * shape[i], shape[j] = shape[j], shape[i]
- */
- __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
-
- /* "View.MemoryView":915
- * for i in range(ndim / 2):
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
- * shape[i], shape[j] = shape[j], shape[i]
- *
- */
- __pyx_t_4 = (__pyx_v_strides[__pyx_v_j]);
- __pyx_t_5 = (__pyx_v_strides[__pyx_v_i]);
- (__pyx_v_strides[__pyx_v_i]) = __pyx_t_4;
- (__pyx_v_strides[__pyx_v_j]) = __pyx_t_5;
-
- /* "View.MemoryView":916
- * j = ndim - 1 - i
- * strides[i], strides[j] = strides[j], strides[i]
- * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
- */
- __pyx_t_5 = (__pyx_v_shape[__pyx_v_j]);
- __pyx_t_4 = (__pyx_v_shape[__pyx_v_i]);
- (__pyx_v_shape[__pyx_v_i]) = __pyx_t_5;
- (__pyx_v_shape[__pyx_v_j]) = __pyx_t_4;
-
- /* "View.MemoryView":918
- * shape[i], shape[j] = shape[j], shape[i]
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
- *
- */
- __pyx_t_6 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
- if (!__pyx_t_6) {
- __pyx_t_7 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
- __pyx_t_8 = __pyx_t_7;
- } else {
- __pyx_t_8 = __pyx_t_6;
- }
- if (__pyx_t_8) {
-
- /* "View.MemoryView":919
- *
- * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
- *
- * return 1
- */
- __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, __pyx_k_51); if (unlikely(__pyx_t_9 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 919; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L5;
- }
- __pyx_L5:;
- }
-
- /* "View.MemoryView":921
- * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
- *
- * return 1 # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = 1;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* Python wrapper */
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
-static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
- __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":938
- * cdef int (*to_dtype_func)(char *, object) except 0
- *
- * def __dealloc__(self): # <<<<<<<<<<<<<<
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
- *
- */
-
-static void __pyx_memoryviewslice_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__dealloc__", 0);
-
- /* "View.MemoryView":939
- *
- * def __dealloc__(self):
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
- *
- * cdef convert_item_to_object(self, char *itemp):
- */
- __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":941
- * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
- *
- * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
- * if self.to_object_func != NULL:
- * return self.to_object_func(itemp)
- */
-
-static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("convert_item_to_object", 0);
-
- /* "View.MemoryView":942
- *
- * cdef convert_item_to_object(self, char *itemp):
- * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
- * return self.to_object_func(itemp)
- * else:
- */
- __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":943
- * cdef convert_item_to_object(self, char *itemp):
- * if self.to_object_func != NULL:
- * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
- * else:
- * return memoryview.convert_item_to_object(self, itemp)
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 943; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":945
- * return self.to_object_func(itemp)
- * else:
- * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_2 = __pyx_vtabptr_memoryview->convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 945; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_r = __pyx_t_2;
- __pyx_t_2 = 0;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":947
- * return memoryview.convert_item_to_object(self, itemp)
- *
- * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
- * if self.to_dtype_func != NULL:
- * self.to_dtype_func(itemp, value)
- */
-
-static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("assign_item_from_object", 0);
-
- /* "View.MemoryView":948
- *
- * cdef assign_item_from_object(self, char *itemp, object value):
- * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
- * self.to_dtype_func(itemp, value)
- * else:
- */
- __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":949
- * cdef assign_item_from_object(self, char *itemp, object value):
- * if self.to_dtype_func != NULL:
- * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
- * else:
- * memoryview.assign_item_from_object(self, itemp, value)
- */
- __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 949; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":951
- * self.to_dtype_func(itemp, value)
- * else:
- * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
- *
- * property base:
- */
- __pyx_t_3 = __pyx_vtabptr_memoryview->assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 951; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- }
- __pyx_L3:;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* Python wrapper */
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self); /*proto*/
-static PyObject *__pyx_memoryviewslice__get__base(PyObject *__pyx_v_self) {
- PyObject *__pyx_r = 0;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
- __pyx_r = __pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":955
- * property base:
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self): # <<<<<<<<<<<<<<
- * return self.from_object
- *
- */
-
-static PyObject *__pyx_memoryviewslice__get__base_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__get__", 0);
-
- /* "View.MemoryView":956
- * @cname('__pyx_memoryviewslice__get__base')
- * def __get__(self):
- * return self.from_object # <<<<<<<<<<<<<<
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(__pyx_v_self->from_object);
- __pyx_r = __pyx_v_self->from_object;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":962
- *
- * @cname('__pyx_memoryview_fromslice')
- * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
- * int ndim,
- * object (*to_object_func)(char *),
- */
-
-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) {
- struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
- int __pyx_v_i;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- __Pyx_TypeInfo *__pyx_t_4;
- Py_buffer __pyx_t_5;
- Py_ssize_t __pyx_t_6;
- int __pyx_t_7;
- int __pyx_t_8;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
-
- /* "View.MemoryView":971
- * cdef int i
- *
- * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
- * return None
- *
- */
- __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":972
- *
- * if <PyObject *> memviewslice.memview == Py_None:
- * return None # <<<<<<<<<<<<<<
- *
- *
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(Py_None);
- __pyx_r = Py_None;
- goto __pyx_L0;
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":977
- *
- *
- * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
- *
- * result.from_slice = memviewslice
- */
- __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_INCREF(Py_None);
- PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
- __Pyx_GIVEREF(Py_None);
- __Pyx_INCREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
- __Pyx_GIVEREF(__pyx_int_0);
- PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject *)__pyx_memoryviewslice_type)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 977; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":979
- * result = _memoryviewslice(None, 0, dtype_is_object)
- *
- * result.from_slice = memviewslice # <<<<<<<<<<<<<<
- * __PYX_INC_MEMVIEW(&memviewslice, 1)
- *
- */
- __pyx_v_result->from_slice = __pyx_v_memviewslice;
-
- /* "View.MemoryView":980
- *
- * result.from_slice = memviewslice
- * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
- *
- * result.from_object = (<memoryview> memviewslice.memview).base
- */
- __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
-
- /* "View.MemoryView":982
- * __PYX_INC_MEMVIEW(&memviewslice, 1)
- *
- * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
- * result.typeinfo = memviewslice.memview.typeinfo
- *
- */
- __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s__base); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 982; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- __Pyx_GOTREF(__pyx_v_result->from_object);
- __Pyx_DECREF(__pyx_v_result->from_object);
- __pyx_v_result->from_object = __pyx_t_2;
- __pyx_t_2 = 0;
-
- /* "View.MemoryView":983
- *
- * result.from_object = (<memoryview> memviewslice.memview).base
- * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
- *
- * result.view = memviewslice.memview.view
- */
- __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
- __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
-
- /* "View.MemoryView":985
- * result.typeinfo = memviewslice.memview.typeinfo
- *
- * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
- * result.view.buf = <void *> memviewslice.data
- * result.view.ndim = ndim
- */
- __pyx_t_5 = __pyx_v_memviewslice.memview->view;
- __pyx_v_result->__pyx_base.view = __pyx_t_5;
-
- /* "View.MemoryView":986
- *
- * result.view = memviewslice.memview.view
- * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None
- */
- __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
-
- /* "View.MemoryView":987
- * result.view = memviewslice.memview.view
- * result.view.buf = <void *> memviewslice.data
- * result.view.ndim = ndim # <<<<<<<<<<<<<<
- * (<__pyx_buffer *> &result.view).obj = Py_None
- * Py_INCREF(Py_None)
- */
- __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
-
- /* "View.MemoryView":988
- * result.view.buf = <void *> memviewslice.data
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
- * Py_INCREF(Py_None)
- *
- */
- ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
-
- /* "View.MemoryView":989
- * result.view.ndim = ndim
- * (<__pyx_buffer *> &result.view).obj = Py_None
- * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
- *
- * result.flags = PyBUF_RECORDS
- */
- Py_INCREF(Py_None);
-
- /* "View.MemoryView":991
- * Py_INCREF(Py_None)
- *
- * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
- *
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape
- */
- __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
-
- /* "View.MemoryView":993
- * result.flags = PyBUF_RECORDS
- *
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
- * result.view.strides = <Py_ssize_t *> result.from_slice.strides
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
- */
- __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
-
- /* "View.MemoryView":994
- *
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape
- * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
- *
- */
- __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
-
- /* "View.MemoryView":995
- * result.view.shape = <Py_ssize_t *> result.from_slice.shape
- * result.view.strides = <Py_ssize_t *> result.from_slice.strides
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
- *
- * result.view.len = result.view.itemsize
- */
- __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
-
- /* "View.MemoryView":997
- * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
- *
- * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i]
- */
- __pyx_t_6 = __pyx_v_result->__pyx_base.view.itemsize;
- __pyx_v_result->__pyx_base.view.len = __pyx_t_6;
-
- /* "View.MemoryView":998
- *
- * result.view.len = result.view.itemsize
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * result.view.len *= result.view.shape[i]
- *
- */
- __pyx_t_7 = __pyx_v_ndim;
- for (__pyx_t_8 = 0; __pyx_t_8 < __pyx_t_7; __pyx_t_8+=1) {
- __pyx_v_i = __pyx_t_8;
-
- /* "View.MemoryView":999
- * result.view.len = result.view.itemsize
- * for i in range(ndim):
- * result.view.len *= result.view.shape[i] # <<<<<<<<<<<<<<
- *
- * result.to_object_func = to_object_func
- */
- __pyx_v_result->__pyx_base.view.len = (__pyx_v_result->__pyx_base.view.len * (__pyx_v_result->__pyx_base.view.shape[__pyx_v_i]));
- }
-
- /* "View.MemoryView":1001
- * result.view.len *= result.view.shape[i]
- *
- * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
- * result.to_dtype_func = to_dtype_func
- *
- */
- __pyx_v_result->to_object_func = __pyx_v_to_object_func;
-
- /* "View.MemoryView":1002
- *
- * result.to_object_func = to_object_func
- * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
- *
- * return result
- */
- __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
-
- /* "View.MemoryView":1004
- * result.to_dtype_func = to_dtype_func
- *
- * return result # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_get_slice_from_memoryview')
- */
- __Pyx_XDECREF(__pyx_r);
- __Pyx_INCREF(((PyObject *)__pyx_v_result));
- __pyx_r = ((PyObject *)__pyx_v_result);
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_result);
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1007
- *
- * @cname('__pyx_memoryview_get_slice_from_memoryview')
- * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *mslice):
- * cdef _memoryviewslice obj
- */
-
-static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
- struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
- __Pyx_memviewslice *__pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
-
- /* "View.MemoryView":1010
- * __Pyx_memviewslice *mslice):
- * cdef _memoryviewslice obj
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * obj = memview
- * return &obj.from_slice
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1011
- * cdef _memoryviewslice obj
- * if isinstance(memview, _memoryviewslice):
- * obj = memview # <<<<<<<<<<<<<<
- * return &obj.from_slice
- * else:
- */
- if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1011; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_INCREF(((PyObject *)__pyx_v_memview));
- __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview);
-
- /* "View.MemoryView":1012
- * if isinstance(memview, _memoryviewslice):
- * obj = memview
- * return &obj.from_slice # <<<<<<<<<<<<<<
- * else:
- * slice_copy(memview, mslice)
- */
- __pyx_r = (&__pyx_v_obj->from_slice);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1014
- * return &obj.from_slice
- * else:
- * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
- * return mslice
- *
- */
- __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
-
- /* "View.MemoryView":1015
- * else:
- * slice_copy(memview, mslice)
- * return mslice # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_slice_copy')
- */
- __pyx_r = __pyx_v_mslice;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XDECREF((PyObject *)__pyx_v_obj);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1018
- *
- * @cname('__pyx_memoryview_slice_copy')
- * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
- * cdef int dim
- * cdef Py_ssize_t *shape, *strides, *suboffsets
- */
-
-static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
- int __pyx_v_dim;
- Py_ssize_t *__pyx_v_shape;
- Py_ssize_t *__pyx_v_strides;
- Py_ssize_t *__pyx_v_suboffsets;
- __Pyx_RefNannyDeclarations
- Py_ssize_t *__pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- __Pyx_RefNannySetupContext("slice_copy", 0);
-
- /* "View.MemoryView":1022
- * cdef Py_ssize_t *shape, *strides, *suboffsets
- *
- * shape = memview.view.shape # <<<<<<<<<<<<<<
- * strides = memview.view.strides
- * suboffsets = memview.view.suboffsets
- */
- __pyx_t_1 = __pyx_v_memview->view.shape;
- __pyx_v_shape = __pyx_t_1;
-
- /* "View.MemoryView":1023
- *
- * shape = memview.view.shape
- * strides = memview.view.strides # <<<<<<<<<<<<<<
- * suboffsets = memview.view.suboffsets
- *
- */
- __pyx_t_1 = __pyx_v_memview->view.strides;
- __pyx_v_strides = __pyx_t_1;
-
- /* "View.MemoryView":1024
- * shape = memview.view.shape
- * strides = memview.view.strides
- * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
- *
- * dst.memview = <__pyx_memoryview *> memview
- */
- __pyx_t_1 = __pyx_v_memview->view.suboffsets;
- __pyx_v_suboffsets = __pyx_t_1;
-
- /* "View.MemoryView":1026
- * suboffsets = memview.view.suboffsets
- *
- * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
- * dst.data = <char *> memview.view.buf
- *
- */
- __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
-
- /* "View.MemoryView":1027
- *
- * dst.memview = <__pyx_memoryview *> memview
- * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
- *
- * for dim in range(memview.view.ndim):
- */
- __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
-
- /* "View.MemoryView":1029
- * dst.data = <char *> memview.view.buf
- *
- * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
- * dst.shape[dim] = shape[dim]
- * dst.strides[dim] = strides[dim]
- */
- __pyx_t_2 = __pyx_v_memview->view.ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_dim = __pyx_t_3;
-
- /* "View.MemoryView":1030
- *
- * for dim in range(memview.view.ndim):
- * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
- * dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
- */
- (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
-
- /* "View.MemoryView":1031
- * for dim in range(memview.view.ndim):
- * dst.shape[dim] = shape[dim]
- * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1
- */
- (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
-
- /* "View.MemoryView":1032
- * dst.shape[dim] = shape[dim]
- * dst.strides[dim] = strides[dim]
- * if suboffsets == NULL: # <<<<<<<<<<<<<<
- * dst.suboffsets[dim] = -1
- * else:
- */
- __pyx_t_4 = ((__pyx_v_suboffsets == NULL) != 0);
- if (__pyx_t_4) {
-
- /* "View.MemoryView":1033
- * dst.strides[dim] = strides[dim]
- * if suboffsets == NULL:
- * dst.suboffsets[dim] = -1 # <<<<<<<<<<<<<<
- * else:
- * dst.suboffsets[dim] = suboffsets[dim]
- */
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = -1;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":1035
- * dst.suboffsets[dim] = -1
- * else:
- * dst.suboffsets[dim] = suboffsets[dim] # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_object')
- */
- (__pyx_v_dst->suboffsets[__pyx_v_dim]) = (__pyx_v_suboffsets[__pyx_v_dim]);
- }
- __pyx_L5:;
- }
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":1038
- *
- * @cname('__pyx_memoryview_copy_object')
- * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
- * "Create a new memoryview object"
- * cdef __Pyx_memviewslice memviewslice
- */
-
-static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
- __Pyx_memviewslice __pyx_v_memviewslice;
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_copy", 0);
-
- /* "View.MemoryView":1041
- * "Create a new memoryview object"
- * cdef __Pyx_memviewslice memviewslice
- * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
- * return memoryview_copy_from_slice(memview, &memviewslice)
- *
- */
- __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
-
- /* "View.MemoryView":1042
- * cdef __Pyx_memviewslice memviewslice
- * slice_copy(memview, &memviewslice)
- * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_object_from_slice')
- */
- __Pyx_XDECREF(__pyx_r);
- __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1042; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_r = __pyx_t_1;
- __pyx_t_1 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1045
- *
- * @cname('__pyx_memoryview_copy_object_from_slice')
- * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
- * """
- * Create a new memoryview object from a given memoryview object and slice.
- */
-
-static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
- PyObject *(*__pyx_v_to_object_func)(char *);
- int (*__pyx_v_to_dtype_func)(char *, PyObject *);
- PyObject *__pyx_r = NULL;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- int __pyx_t_2;
- PyObject *(*__pyx_t_3)(char *);
- int (*__pyx_t_4)(char *, PyObject *);
- PyObject *__pyx_t_5 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
-
- /* "View.MemoryView":1052
- * cdef int (*to_dtype_func)(char *, object) except 0
- *
- * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
- * to_object_func = (<_memoryviewslice> memview).to_object_func
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
- */
- __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), ((PyObject *)__pyx_memoryviewslice_type));
- __pyx_t_2 = (__pyx_t_1 != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1053
- *
- * if isinstance(memview, _memoryviewslice):
- * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
- * else:
- */
- __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
- __pyx_v_to_object_func = __pyx_t_3;
-
- /* "View.MemoryView":1054
- * if isinstance(memview, _memoryviewslice):
- * to_object_func = (<_memoryviewslice> memview).to_object_func
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
- * else:
- * to_object_func = NULL
- */
- __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
- __pyx_v_to_dtype_func = __pyx_t_4;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1056
- * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
- * else:
- * to_object_func = NULL # <<<<<<<<<<<<<<
- * to_dtype_func = NULL
- *
- */
- __pyx_v_to_object_func = NULL;
-
- /* "View.MemoryView":1057
- * else:
- * to_object_func = NULL
- * to_dtype_func = NULL # <<<<<<<<<<<<<<
- *
- * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
- */
- __pyx_v_to_dtype_func = NULL;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1059
- * to_dtype_func = NULL
- *
- * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
- * to_object_func, to_dtype_func,
- * memview.dtype_is_object)
- */
- __Pyx_XDECREF(__pyx_r);
-
- /* "View.MemoryView":1061
- * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
- * to_object_func, to_dtype_func,
- * memview.dtype_is_object) # <<<<<<<<<<<<<<
- *
- *
- */
- __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_filename = __pyx_f[2]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_5);
- __pyx_r = __pyx_t_5;
- __pyx_t_5 = 0;
- goto __pyx_L0;
-
- __pyx_r = Py_None; __Pyx_INCREF(Py_None);
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_5);
- __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = 0;
- __pyx_L0:;
- __Pyx_XGIVEREF(__pyx_r);
- __Pyx_RefNannyFinishContext();
- return __pyx_r;
-}
-
-/* "View.MemoryView":1067
- *
- *
- * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
- * if arg < 0:
- * return -arg
- */
-
-static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
- Py_ssize_t __pyx_r;
- int __pyx_t_1;
-
- /* "View.MemoryView":1068
- *
- * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
- * if arg < 0: # <<<<<<<<<<<<<<
- * return -arg
- * else:
- */
- __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1069
- * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
- * if arg < 0:
- * return -arg # <<<<<<<<<<<<<<
- * else:
- * return arg
- */
- __pyx_r = (-__pyx_v_arg);
- goto __pyx_L0;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1071
- * return -arg
- * else:
- * return arg # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_get_best_slice_order')
- */
- __pyx_r = __pyx_v_arg;
- goto __pyx_L0;
- }
- __pyx_L3:;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1074
- *
- * @cname('__pyx_get_best_slice_order')
- * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
- * """
- * Figure out the best memory access order for a given slice.
- */
-
-static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
- int __pyx_v_i;
- Py_ssize_t __pyx_v_c_stride;
- Py_ssize_t __pyx_v_f_stride;
- char __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
-
- /* "View.MemoryView":1079
- * """
- * cdef int i
- * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
- * cdef Py_ssize_t f_stride = 0
- *
- */
- __pyx_v_c_stride = 0;
-
- /* "View.MemoryView":1080
- * cdef int i
- * cdef Py_ssize_t c_stride = 0
- * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
- *
- * for i in range(ndim - 1, -1, -1):
- */
- __pyx_v_f_stride = 0;
-
- /* "View.MemoryView":1082
- * cdef Py_ssize_t f_stride = 0
- *
- * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
- * if mslice.shape[i] > 1:
- * c_stride = mslice.strides[i]
- */
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
- __pyx_v_i = __pyx_t_1;
-
- /* "View.MemoryView":1083
- *
- * for i in range(ndim - 1, -1, -1):
- * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
- * c_stride = mslice.strides[i]
- * break
- */
- __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1084
- * for i in range(ndim - 1, -1, -1):
- * if mslice.shape[i] > 1:
- * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
- * break
- *
- */
- __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
-
- /* "View.MemoryView":1085
- * if mslice.shape[i] > 1:
- * c_stride = mslice.strides[i]
- * break # <<<<<<<<<<<<<<
- *
- * for i in range(ndim):
- */
- goto __pyx_L4_break;
- goto __pyx_L5;
- }
- __pyx_L5:;
- }
- __pyx_L4_break:;
-
- /* "View.MemoryView":1087
- * break
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if mslice.shape[i] > 1:
- * f_stride = mslice.strides[i]
- */
- __pyx_t_1 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_1; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1088
- *
- * for i in range(ndim):
- * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
- * f_stride = mslice.strides[i]
- * break
- */
- __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1089
- * for i in range(ndim):
- * if mslice.shape[i] > 1:
- * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
- * break
- *
- */
- __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
-
- /* "View.MemoryView":1090
- * if mslice.shape[i] > 1:
- * f_stride = mslice.strides[i]
- * break # <<<<<<<<<<<<<<
- *
- * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
- */
- goto __pyx_L7_break;
- goto __pyx_L8;
- }
- __pyx_L8:;
- }
- __pyx_L7_break:;
-
- /* "View.MemoryView":1092
- * break
- *
- * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
- * return 'C'
- * else:
- */
- __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1093
- *
- * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
- * return 'C' # <<<<<<<<<<<<<<
- * else:
- * return 'F'
- */
- __pyx_r = 'C';
- goto __pyx_L0;
- goto __pyx_L9;
- }
- /*else*/ {
-
- /* "View.MemoryView":1095
- * return 'C'
- * else:
- * return 'F' # <<<<<<<<<<<<<<
- *
- * @cython.cdivision(True)
- */
- __pyx_r = 'F';
- goto __pyx_L0;
- }
- __pyx_L9:;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1098
- *
- * @cython.cdivision(True)
- * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
- * char *dst_data, Py_ssize_t *dst_strides,
- * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
- */
-
-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) {
- CYTHON_UNUSED Py_ssize_t __pyx_v_i;
- CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
- Py_ssize_t __pyx_v_dst_extent;
- Py_ssize_t __pyx_v_src_stride;
- Py_ssize_t __pyx_v_dst_stride;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- Py_ssize_t __pyx_t_5;
- Py_ssize_t __pyx_t_6;
-
- /* "View.MemoryView":1105
- *
- * cdef Py_ssize_t i
- * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dst_extent = dst_shape[0]
- * cdef Py_ssize_t src_stride = src_strides[0]
- */
- __pyx_v_src_extent = (__pyx_v_src_shape[0]);
-
- /* "View.MemoryView":1106
- * cdef Py_ssize_t i
- * cdef Py_ssize_t src_extent = src_shape[0]
- * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t src_stride = src_strides[0]
- * cdef Py_ssize_t dst_stride = dst_strides[0]
- */
- __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
-
- /* "View.MemoryView":1107
- * cdef Py_ssize_t src_extent = src_shape[0]
- * cdef Py_ssize_t dst_extent = dst_shape[0]
- * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t dst_stride = dst_strides[0]
- *
- */
- __pyx_v_src_stride = (__pyx_v_src_strides[0]);
-
- /* "View.MemoryView":1108
- * cdef Py_ssize_t dst_extent = dst_shape[0]
- * cdef Py_ssize_t src_stride = src_strides[0]
- * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
- *
- * if ndim == 1:
- */
- __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
-
- /* "View.MemoryView":1110
- * cdef Py_ssize_t dst_stride = dst_strides[0]
- *
- * if ndim == 1: # <<<<<<<<<<<<<<
- * if (src_stride > 0 and dst_stride > 0 and
- * <size_t> src_stride == itemsize == <size_t> dst_stride):
- */
- __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1111
- *
- * if ndim == 1:
- * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
- * <size_t> src_stride == itemsize == <size_t> dst_stride):
- * memcpy(dst_data, src_data, itemsize * dst_extent)
- */
- __pyx_t_1 = ((__pyx_v_src_stride > 0) != 0);
- if (__pyx_t_1) {
- __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1112
- * if ndim == 1:
- * if (src_stride > 0 and dst_stride > 0 and
- * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
- * memcpy(dst_data, src_data, itemsize * dst_extent)
- * else:
- */
- __pyx_t_3 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
- if (__pyx_t_3) {
- __pyx_t_3 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
- }
- __pyx_t_4 = (__pyx_t_3 != 0);
- } else {
- __pyx_t_4 = __pyx_t_2;
- }
- __pyx_t_2 = __pyx_t_4;
- } else {
- __pyx_t_2 = __pyx_t_1;
- }
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1113
- * if (src_stride > 0 and dst_stride > 0 and
- * <size_t> src_stride == itemsize == <size_t> dst_stride):
- * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
- * else:
- * for i in range(dst_extent):
- */
- memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent));
- goto __pyx_L4;
- }
- /*else*/ {
-
- /* "View.MemoryView":1115
- * memcpy(dst_data, src_data, itemsize * dst_extent)
- * else:
- * for i in range(dst_extent): # <<<<<<<<<<<<<<
- * memcpy(dst_data, src_data, itemsize)
- * src_data += src_stride
- */
- __pyx_t_5 = __pyx_v_dst_extent;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_i = __pyx_t_6;
-
- /* "View.MemoryView":1116
- * else:
- * for i in range(dst_extent):
- * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
- * src_data += src_stride
- * dst_data += dst_stride
- */
- memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize);
-
- /* "View.MemoryView":1117
- * for i in range(dst_extent):
- * memcpy(dst_data, src_data, itemsize)
- * src_data += src_stride # <<<<<<<<<<<<<<
- * dst_data += dst_stride
- * else:
- */
- __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
-
- /* "View.MemoryView":1118
- * memcpy(dst_data, src_data, itemsize)
- * src_data += src_stride
- * dst_data += dst_stride # <<<<<<<<<<<<<<
- * else:
- * for i in range(dst_extent):
- */
- __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
- }
- }
- __pyx_L4:;
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1120
- * dst_data += dst_stride
- * else:
- * for i in range(dst_extent): # <<<<<<<<<<<<<<
- * _copy_strided_to_strided(src_data, src_strides + 1,
- * dst_data, dst_strides + 1,
- */
- __pyx_t_5 = __pyx_v_dst_extent;
- for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
- __pyx_v_i = __pyx_t_6;
-
- /* "View.MemoryView":1124
- * dst_data, dst_strides + 1,
- * src_shape + 1, dst_shape + 1,
- * ndim - 1, itemsize) # <<<<<<<<<<<<<<
- * src_data += src_stride
- * dst_data += dst_stride
- */
- _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);
-
- /* "View.MemoryView":1125
- * src_shape + 1, dst_shape + 1,
- * ndim - 1, itemsize)
- * src_data += src_stride # <<<<<<<<<<<<<<
- * dst_data += dst_stride
- *
- */
- __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
-
- /* "View.MemoryView":1126
- * ndim - 1, itemsize)
- * src_data += src_stride
- * dst_data += dst_stride # <<<<<<<<<<<<<<
- *
- * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
- */
- __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
- }
- }
- __pyx_L3:;
-
-}
-
-/* "View.MemoryView":1128
- * dst_data += dst_stride
- *
- * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *dst,
- * int ndim, size_t itemsize) nogil:
- */
-
-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) {
-
- /* "View.MemoryView":1132
- * int ndim, size_t itemsize) nogil:
- * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides,
- * src.shape, dst.shape, ndim, itemsize) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_slice_get_size')
- */
- _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);
-
-}
-
-/* "View.MemoryView":1135
- *
- * @cname('__pyx_memoryview_slice_get_size')
- * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
- * "Return the size of the memory occupied by the slice in number of bytes"
- * cdef int i
- */
-
-static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
- int __pyx_v_i;
- Py_ssize_t __pyx_v_size;
- Py_ssize_t __pyx_r;
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
-
- /* "View.MemoryView":1138
- * "Return the size of the memory occupied by the slice in number of bytes"
- * cdef int i
- * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
- *
- * for i in range(ndim):
- */
- __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
- __pyx_v_size = __pyx_t_1;
-
- /* "View.MemoryView":1140
- * cdef Py_ssize_t size = src.memview.view.itemsize
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * size *= src.shape[i]
- *
- */
- __pyx_t_2 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1141
- *
- * for i in range(ndim):
- * size *= src.shape[i] # <<<<<<<<<<<<<<
- *
- * return size
- */
- __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
- }
-
- /* "View.MemoryView":1143
- * size *= src.shape[i]
- *
- * return size # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_fill_contig_strides_array')
- */
- __pyx_r = __pyx_v_size;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1146
- *
- * @cname('__pyx_fill_contig_strides_array')
- * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
- * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
- * int ndim, char order) nogil:
- */
-
-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) {
- int __pyx_v_idx;
- Py_ssize_t __pyx_r;
- int __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
-
- /* "View.MemoryView":1155
- * cdef int idx
- *
- * if order == 'F': # <<<<<<<<<<<<<<
- * for idx in range(ndim):
- * strides[idx] = stride
- */
- __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1156
- *
- * if order == 'F':
- * for idx in range(ndim): # <<<<<<<<<<<<<<
- * strides[idx] = stride
- * stride = stride * shape[idx]
- */
- __pyx_t_2 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_idx = __pyx_t_3;
-
- /* "View.MemoryView":1157
- * if order == 'F':
- * for idx in range(ndim):
- * strides[idx] = stride # <<<<<<<<<<<<<<
- * stride = stride * shape[idx]
- * else:
- */
- (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
-
- /* "View.MemoryView":1158
- * for idx in range(ndim):
- * strides[idx] = stride
- * stride = stride * shape[idx] # <<<<<<<<<<<<<<
- * else:
- * for idx in range(ndim - 1, -1, -1):
- */
- __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1160
- * stride = stride * shape[idx]
- * else:
- * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
- * strides[idx] = stride
- * stride = stride * shape[idx]
- */
- for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
- __pyx_v_idx = __pyx_t_2;
-
- /* "View.MemoryView":1161
- * else:
- * for idx in range(ndim - 1, -1, -1):
- * strides[idx] = stride # <<<<<<<<<<<<<<
- * stride = stride * shape[idx]
- *
- */
- (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
-
- /* "View.MemoryView":1162
- * for idx in range(ndim - 1, -1, -1):
- * strides[idx] = stride
- * stride = stride * shape[idx] # <<<<<<<<<<<<<<
- *
- * return stride
- */
- __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
- }
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1164
- * stride = stride * shape[idx]
- *
- * return stride # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_data_to_temp')
- */
- __pyx_r = __pyx_v_stride;
- goto __pyx_L0;
-
- __pyx_r = 0;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1167
- *
- * @cname('__pyx_memoryview_copy_data_to_temp')
- * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice *tmpslice,
- * char order,
- */
-
-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) {
- int __pyx_v_i;
- void *__pyx_v_result;
- size_t __pyx_v_itemsize;
- size_t __pyx_v_size;
- void *__pyx_r;
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- struct __pyx_memoryview_obj *__pyx_t_4;
- int __pyx_t_5;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":1178
- * cdef void *result
- *
- * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
- * cdef size_t size = slice_get_size(src, ndim)
- *
- */
- __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
- __pyx_v_itemsize = __pyx_t_1;
-
- /* "View.MemoryView":1179
- *
- * cdef size_t itemsize = src.memview.view.itemsize
- * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
- *
- * result = malloc(size)
- */
- __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
-
- /* "View.MemoryView":1181
- * cdef size_t size = slice_get_size(src, ndim)
- *
- * result = malloc(size) # <<<<<<<<<<<<<<
- * if not result:
- * _err(MemoryError, NULL)
- */
- __pyx_v_result = malloc(__pyx_v_size);
-
- /* "View.MemoryView":1182
- *
- * result = malloc(size)
- * if not result: # <<<<<<<<<<<<<<
- * _err(MemoryError, NULL)
- *
- */
- __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1183
- * result = malloc(size)
- * if not result:
- * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1186
- *
- *
- * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
- * tmpslice.memview = src.memview
- * for i in range(ndim):
- */
- __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
-
- /* "View.MemoryView":1187
- *
- * tmpslice.data = <char *> result
- * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
- * for i in range(ndim):
- * tmpslice.shape[i] = src.shape[i]
- */
- __pyx_t_4 = __pyx_v_src->memview;
- __pyx_v_tmpslice->memview = __pyx_t_4;
-
- /* "View.MemoryView":1188
- * tmpslice.data = <char *> result
- * tmpslice.memview = src.memview
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * tmpslice.shape[i] = src.shape[i]
- * tmpslice.suboffsets[i] = -1
- */
- __pyx_t_3 = __pyx_v_ndim;
- for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
- __pyx_v_i = __pyx_t_5;
-
- /* "View.MemoryView":1189
- * tmpslice.memview = src.memview
- * for i in range(ndim):
- * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
- * tmpslice.suboffsets[i] = -1
- *
- */
- (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
-
- /* "View.MemoryView":1190
- * for i in range(ndim):
- * tmpslice.shape[i] = src.shape[i]
- * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
- *
- * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
- */
- (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1;
- }
-
- /* "View.MemoryView":1193
- *
- * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
- * ndim, order) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order);
-
- /* "View.MemoryView":1196
- *
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if tmpslice.shape[i] == 1:
- * tmpslice.strides[i] = 0
- */
- __pyx_t_3 = __pyx_v_ndim;
- for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_3; __pyx_t_5+=1) {
- __pyx_v_i = __pyx_t_5;
-
- /* "View.MemoryView":1197
- *
- * for i in range(ndim):
- * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
- * tmpslice.strides[i] = 0
- *
- */
- __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1198
- * for i in range(ndim):
- * if tmpslice.shape[i] == 1:
- * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
- *
- * if slice_is_contig(src, order, ndim):
- */
- (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
- goto __pyx_L8;
- }
- __pyx_L8:;
- }
-
- /* "View.MemoryView":1200
- * tmpslice.strides[i] = 0
- *
- * if slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
- * memcpy(result, src.data, size)
- * else:
- */
- __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1201
- *
- * if slice_is_contig(src, order, ndim):
- * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
- * else:
- * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
- */
- memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size);
- goto __pyx_L9;
- }
- /*else*/ {
-
- /* "View.MemoryView":1203
- * memcpy(result, src.data, size)
- * else:
- * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
- *
- * return result
- */
- copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
- }
- __pyx_L9:;
-
- /* "View.MemoryView":1205
- * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
- *
- * return result # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_r = __pyx_v_result;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = NULL;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1210
- *
- * @cname('__pyx_memoryview_err_extents')
- * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
- * Py_ssize_t extent2) except -1 with gil:
- * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
- */
-
-static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- PyObject *__pyx_t_4 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("_err_extents", 0);
-
- /* "View.MemoryView":1213
- * Py_ssize_t extent2) except -1 with gil:
- * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
- * (i, extent1, extent2)) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_err_dim')
- */
- __pyx_t_1 = PyInt_FromLong(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1213; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
- __Pyx_GIVEREF(__pyx_t_1);
- PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
- __Pyx_GIVEREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_1 = 0;
- __pyx_t_2 = 0;
- __pyx_t_3 = 0;
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_kp_s_52), ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_3));
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_4);
- PyTuple_SET_ITEM(__pyx_t_4, 0, ((PyObject *)__pyx_t_3));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_3));
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_XDECREF(__pyx_t_4);
- __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- return __pyx_r;
-}
-
-/* "View.MemoryView":1216
- *
- * @cname('__pyx_memoryview_err_dim')
- * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
- * raise error(msg.decode('ascii') % dim)
- *
- */
-
-static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- PyObject *__pyx_t_1 = NULL;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("_err_dim", 0);
- __Pyx_INCREF(__pyx_v_error);
-
- /* "View.MemoryView":1217
- * @cname('__pyx_memoryview_err_dim')
- * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
- * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_err')
- */
- __pyx_t_1 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- __pyx_t_2 = PyInt_FromLong(__pyx_v_dim); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __pyx_t_3 = PyNumber_Remainder(((PyObject *)__pyx_t_1), __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
- __Pyx_GIVEREF(__pyx_t_3);
- __pyx_t_3 = 0;
- __pyx_t_3 = PyObject_Call(__pyx_v_error, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
- __Pyx_Raise(__pyx_t_3, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1217; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_error);
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- return __pyx_r;
-}
-
-/* "View.MemoryView":1220
- *
- * @cname('__pyx_memoryview_err')
- * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
- * if msg != NULL:
- * raise error(msg.decode('ascii'))
- */
-
-static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
- int __pyx_r;
- __Pyx_RefNannyDeclarations
- int __pyx_t_1;
- PyObject *__pyx_t_2 = NULL;
- PyObject *__pyx_t_3 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("_err", 0);
- __Pyx_INCREF(__pyx_v_error);
-
- /* "View.MemoryView":1221
- * @cname('__pyx_memoryview_err')
- * cdef int _err(object error, char *msg) except -1 with gil:
- * if msg != NULL: # <<<<<<<<<<<<<<
- * raise error(msg.decode('ascii'))
- * else:
- */
- __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1222
- * cdef int _err(object error, char *msg) except -1 with gil:
- * if msg != NULL:
- * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
- * else:
- * raise error
- */
- __pyx_t_2 = ((PyObject *)__Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_2));
- __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_3);
- PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_2));
- __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
- __pyx_t_2 = 0;
- __pyx_t_2 = PyObject_Call(__pyx_v_error, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_2);
- __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
- __Pyx_Raise(__pyx_t_2, 0, 0, 0);
- __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1222; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1224
- * raise error(msg.decode('ascii'))
- * else:
- * raise error # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_copy_contents')
- */
- __Pyx_Raise(__pyx_v_error, 0, 0, 0);
- {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L3:;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_2);
- __Pyx_XDECREF(__pyx_t_3);
- __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
- __pyx_r = -1;
- __pyx_L0:;
- __Pyx_XDECREF(__pyx_v_error);
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- return __pyx_r;
-}
-
-/* "View.MemoryView":1227
- *
- * @cname('__pyx_memoryview_copy_contents')
- * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
- * __Pyx_memviewslice dst,
- * int src_ndim, int dst_ndim,
- */
-
-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) {
- void *__pyx_v_tmpdata;
- size_t __pyx_v_itemsize;
- int __pyx_v_i;
- char __pyx_v_order;
- int __pyx_v_broadcasting;
- int __pyx_v_direct_copy;
- __Pyx_memviewslice __pyx_v_tmp;
- int __pyx_v_ndim;
- int __pyx_r;
- Py_ssize_t __pyx_t_1;
- int __pyx_t_2;
- int __pyx_t_3;
- int __pyx_t_4;
- int __pyx_t_5;
- void *__pyx_t_6;
- int __pyx_t_7;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
-
- /* "View.MemoryView":1235
- * Check for overlapping memory and verify the shapes.
- * """
- * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
- * cdef size_t itemsize = src.memview.view.itemsize
- * cdef int i
- */
- __pyx_v_tmpdata = NULL;
-
- /* "View.MemoryView":1236
- * """
- * cdef void *tmpdata = NULL
- * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
- * cdef int i
- * cdef char order = get_best_order(&src, src_ndim)
- */
- __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
- __pyx_v_itemsize = __pyx_t_1;
-
- /* "View.MemoryView":1238
- * cdef size_t itemsize = src.memview.view.itemsize
- * cdef int i
- * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
- * cdef bint broadcasting = False
- * cdef bint direct_copy = False
- */
- __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
-
- /* "View.MemoryView":1239
- * cdef int i
- * cdef char order = get_best_order(&src, src_ndim)
- * cdef bint broadcasting = False # <<<<<<<<<<<<<<
- * cdef bint direct_copy = False
- * cdef __Pyx_memviewslice tmp
- */
- __pyx_v_broadcasting = 0;
-
- /* "View.MemoryView":1240
- * cdef char order = get_best_order(&src, src_ndim)
- * cdef bint broadcasting = False
- * cdef bint direct_copy = False # <<<<<<<<<<<<<<
- * cdef __Pyx_memviewslice tmp
- *
- */
- __pyx_v_direct_copy = 0;
-
- /* "View.MemoryView":1243
- * cdef __Pyx_memviewslice tmp
- *
- * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
- * broadcast_leading(&src, src_ndim, dst_ndim)
- * elif dst_ndim < src_ndim:
- */
- __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1244
- *
- * if src_ndim < dst_ndim:
- * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
- * elif dst_ndim < src_ndim:
- * broadcast_leading(&dst, dst_ndim, src_ndim)
- */
- __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
- goto __pyx_L3;
- }
-
- /* "View.MemoryView":1245
- * if src_ndim < dst_ndim:
- * broadcast_leading(&src, src_ndim, dst_ndim)
- * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
- * broadcast_leading(&dst, dst_ndim, src_ndim)
- *
- */
- __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1246
- * broadcast_leading(&src, src_ndim, dst_ndim)
- * elif dst_ndim < src_ndim:
- * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
- *
- * cdef int ndim = max(src_ndim, dst_ndim)
- */
- __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
- /* "View.MemoryView":1248
- * broadcast_leading(&dst, dst_ndim, src_ndim)
- *
- * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
- *
- * for i in range(ndim):
- */
- __pyx_t_3 = __pyx_v_dst_ndim;
- __pyx_t_4 = __pyx_v_src_ndim;
- if (((__pyx_t_3 > __pyx_t_4) != 0)) {
- __pyx_t_5 = __pyx_t_3;
- } else {
- __pyx_t_5 = __pyx_t_4;
- }
- __pyx_v_ndim = __pyx_t_5;
-
- /* "View.MemoryView":1250
- * cdef int ndim = max(src_ndim, dst_ndim)
- *
- * for i in range(ndim): # <<<<<<<<<<<<<<
- * if src.shape[i] != dst.shape[i]:
- * if src.shape[i] == 1:
- */
- __pyx_t_5 = __pyx_v_ndim;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_5; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1251
- *
- * for i in range(ndim):
- * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
- * if src.shape[i] == 1:
- * broadcasting = True
- */
- __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1252
- * for i in range(ndim):
- * if src.shape[i] != dst.shape[i]:
- * if src.shape[i] == 1: # <<<<<<<<<<<<<<
- * broadcasting = True
- * src.strides[i] = 0
- */
- __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1253
- * if src.shape[i] != dst.shape[i]:
- * if src.shape[i] == 1:
- * broadcasting = True # <<<<<<<<<<<<<<
- * src.strides[i] = 0
- * else:
- */
- __pyx_v_broadcasting = 1;
-
- /* "View.MemoryView":1254
- * if src.shape[i] == 1:
- * broadcasting = True
- * src.strides[i] = 0 # <<<<<<<<<<<<<<
- * else:
- * _err_extents(i, dst.shape[i], src.shape[i])
- */
- (__pyx_v_src.strides[__pyx_v_i]) = 0;
- goto __pyx_L7;
- }
- /*else*/ {
-
- /* "View.MemoryView":1256
- * src.strides[i] = 0
- * else:
- * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
- *
- * if src.suboffsets[i] >= 0:
- */
- __pyx_t_4 = __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_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1256; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- __pyx_L7:;
- goto __pyx_L6;
- }
- __pyx_L6:;
-
- /* "View.MemoryView":1258
- * _err_extents(i, dst.shape[i], src.shape[i])
- *
- * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
- * _err_dim(ValueError, "Dimension %d is not direct", i)
- *
- */
- __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1259
- *
- * if src.suboffsets[i] >= 0:
- * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
- *
- * if slices_overlap(&src, &dst, ndim, itemsize):
- */
- __pyx_t_4 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, __pyx_k_53, __pyx_v_i); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1259; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L8;
- }
- __pyx_L8:;
- }
-
- /* "View.MemoryView":1261
- * _err_dim(ValueError, "Dimension %d is not direct", i)
- *
- * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
- *
- * if not slice_is_contig(&src, order, ndim):
- */
- __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1263
- * if slices_overlap(&src, &dst, ndim, itemsize):
- *
- * if not slice_is_contig(&src, order, ndim): # <<<<<<<<<<<<<<
- * order = get_best_order(&dst, ndim)
- *
- */
- __pyx_t_2 = ((!(__pyx_memviewslice_is_contig((&__pyx_v_src), __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1264
- *
- * if not slice_is_contig(&src, order, ndim):
- * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
- *
- * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
- */
- __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
- goto __pyx_L10;
- }
- __pyx_L10:;
-
- /* "View.MemoryView":1266
- * order = get_best_order(&dst, ndim)
- *
- * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
- * src = tmp
- *
- */
- __pyx_t_6 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_6 == NULL)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_v_tmpdata = __pyx_t_6;
-
- /* "View.MemoryView":1267
- *
- * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
- * src = tmp # <<<<<<<<<<<<<<
- *
- * if not broadcasting:
- */
- __pyx_v_src = __pyx_v_tmp;
- goto __pyx_L9;
- }
- __pyx_L9:;
-
- /* "View.MemoryView":1269
- * src = tmp
- *
- * if not broadcasting: # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1272
- *
- *
- * if slice_is_contig(&src, 'C', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
- */
- __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'C', __pyx_v_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1273
- *
- * if slice_is_contig(&src, 'C', ndim):
- * direct_copy = slice_is_contig(&dst, 'C', ndim) # <<<<<<<<<<<<<<
- * elif slice_is_contig(&src, 'F', ndim):
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
- */
- __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'C', __pyx_v_ndim);
- goto __pyx_L12;
- }
-
- /* "View.MemoryView":1274
- * if slice_is_contig(&src, 'C', ndim):
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim): # <<<<<<<<<<<<<<
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
- *
- */
- __pyx_t_2 = (__pyx_memviewslice_is_contig((&__pyx_v_src), 'F', __pyx_v_ndim) != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1275
- * direct_copy = slice_is_contig(&dst, 'C', ndim)
- * elif slice_is_contig(&src, 'F', ndim):
- * direct_copy = slice_is_contig(&dst, 'F', ndim) # <<<<<<<<<<<<<<
- *
- * if direct_copy:
- */
- __pyx_v_direct_copy = __pyx_memviewslice_is_contig((&__pyx_v_dst), 'F', __pyx_v_ndim);
- goto __pyx_L12;
- }
- __pyx_L12:;
-
- /* "View.MemoryView":1277
- * direct_copy = slice_is_contig(&dst, 'F', ndim)
- *
- * if direct_copy: # <<<<<<<<<<<<<<
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- */
- __pyx_t_2 = (__pyx_v_direct_copy != 0);
- if (__pyx_t_2) {
-
- /* "View.MemoryView":1279
- * if direct_copy:
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
-
- /* "View.MemoryView":1280
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- * return 0
- */
- memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim));
-
- /* "View.MemoryView":1281
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
- * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
- * return 0
- *
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
-
- /* "View.MemoryView":1282
- * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- * return 0 # <<<<<<<<<<<<<<
- *
- * if order == 'F' == get_best_order(&dst, ndim):
- */
- __pyx_r = 0;
- goto __pyx_L0;
- goto __pyx_L13;
- }
- __pyx_L13:;
- goto __pyx_L11;
- }
- __pyx_L11:;
-
- /* "View.MemoryView":1284
- * return 0
- *
- * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_2 = (__pyx_v_order == 'F');
- if (__pyx_t_2) {
- __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
- }
- __pyx_t_7 = (__pyx_t_2 != 0);
- if (__pyx_t_7) {
-
- /* "View.MemoryView":1287
- *
- *
- * transpose_memslice(&src) # <<<<<<<<<<<<<<
- * transpose_memslice(&dst)
- *
- */
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":1288
- *
- * transpose_memslice(&src)
- * transpose_memslice(&dst) # <<<<<<<<<<<<<<
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- */
- __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == 0)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 1288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- goto __pyx_L14;
- }
- __pyx_L14:;
-
- /* "View.MemoryView":1290
- * transpose_memslice(&dst)
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
- * copy_strided_to_strided(&src, &dst, ndim, itemsize)
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
-
- /* "View.MemoryView":1291
- *
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- *
- */
- copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
-
- /* "View.MemoryView":1292
- * refcount_copying(&dst, dtype_is_object, ndim, False)
- * copy_strided_to_strided(&src, &dst, ndim, itemsize)
- * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
- *
- * free(tmpdata)
- */
- __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
-
- /* "View.MemoryView":1294
- * refcount_copying(&dst, dtype_is_object, ndim, True)
- *
- * free(tmpdata) # <<<<<<<<<<<<<<
- * return 0
- *
- */
- free(__pyx_v_tmpdata);
-
- /* "View.MemoryView":1295
- *
- * free(tmpdata)
- * return 0 # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_broadcast_leading')
- */
- __pyx_r = 0;
- goto __pyx_L0;
-
- __pyx_r = 0;
- goto __pyx_L0;
- __pyx_L1_error:;
- {
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
- }
- __pyx_r = -1;
- __pyx_L0:;
- return __pyx_r;
-}
-
-/* "View.MemoryView":1298
- *
- * @cname('__pyx_memoryview_broadcast_leading')
- * cdef void broadcast_leading(__Pyx_memviewslice *slice, # <<<<<<<<<<<<<<
- * int ndim,
- * int ndim_other) nogil:
- */
-
-static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_slice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
- int __pyx_v_i;
- int __pyx_v_offset;
- int __pyx_t_1;
- int __pyx_t_2;
-
- /* "View.MemoryView":1302
- * int ndim_other) nogil:
- * cdef int i
- * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
- *
- * for i in range(ndim - 1, -1, -1):
- */
- __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
-
- /* "View.MemoryView":1304
- * cdef int offset = ndim_other - ndim
- *
- * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
- * slice.shape[i + offset] = slice.shape[i]
- * slice.strides[i + offset] = slice.strides[i]
- */
- for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
- __pyx_v_i = __pyx_t_1;
-
- /* "View.MemoryView":1305
- *
- * for i in range(ndim - 1, -1, -1):
- * slice.shape[i + offset] = slice.shape[i] # <<<<<<<<<<<<<<
- * slice.strides[i + offset] = slice.strides[i]
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
- */
- (__pyx_v_slice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->shape[__pyx_v_i]);
-
- /* "View.MemoryView":1306
- * for i in range(ndim - 1, -1, -1):
- * slice.shape[i + offset] = slice.shape[i]
- * slice.strides[i + offset] = slice.strides[i] # <<<<<<<<<<<<<<
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
- *
- */
- (__pyx_v_slice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->strides[__pyx_v_i]);
-
- /* "View.MemoryView":1307
- * slice.shape[i + offset] = slice.shape[i]
- * slice.strides[i + offset] = slice.strides[i]
- * slice.suboffsets[i + offset] = slice.suboffsets[i] # <<<<<<<<<<<<<<
- *
- * for i in range(offset):
- */
- (__pyx_v_slice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_slice->suboffsets[__pyx_v_i]);
- }
-
- /* "View.MemoryView":1309
- * slice.suboffsets[i + offset] = slice.suboffsets[i]
- *
- * for i in range(offset): # <<<<<<<<<<<<<<
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- */
- __pyx_t_1 = __pyx_v_offset;
- for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
- __pyx_v_i = __pyx_t_2;
-
- /* "View.MemoryView":1310
- *
- * for i in range(offset):
- * slice.shape[i] = 1 # <<<<<<<<<<<<<<
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1
- */
- (__pyx_v_slice->shape[__pyx_v_i]) = 1;
-
- /* "View.MemoryView":1311
- * for i in range(offset):
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0] # <<<<<<<<<<<<<<
- * slice.suboffsets[i] = -1
- *
- */
- (__pyx_v_slice->strides[__pyx_v_i]) = (__pyx_v_slice->strides[0]);
-
- /* "View.MemoryView":1312
- * slice.shape[i] = 1
- * slice.strides[i] = slice.strides[0]
- * slice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
- *
- *
- */
- (__pyx_v_slice->suboffsets[__pyx_v_i]) = -1;
- }
-
-}
-
-/* "View.MemoryView":1320
- *
- * @cname('__pyx_memoryview_refcount_copying')
- * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
- * int ndim, bint inc) nogil:
- *
- */
-
-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) {
- int __pyx_t_1;
-
- /* "View.MemoryView":1324
- *
- *
- * if dtype_is_object: # <<<<<<<<<<<<<<
- * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
- * dst.strides, ndim, inc)
- */
- __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1326
- * if dtype_is_object:
- * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
- * dst.strides, ndim, inc) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
- */
- __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);
- goto __pyx_L3;
- }
- __pyx_L3:;
-
-}
-
-/* "View.MemoryView":1329
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
- * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim,
- * bint inc) with gil:
- */
-
-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) {
- __Pyx_RefNannyDeclarations
- #ifdef WITH_THREAD
- PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();
- #endif
- __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
-
- /* "View.MemoryView":1332
- * Py_ssize_t *strides, int ndim,
- * bint inc) with gil:
- * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice')
- */
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
-
- __Pyx_RefNannyFinishContext();
- #ifdef WITH_THREAD
- PyGILState_Release(__pyx_gilstate_save);
- #endif
-}
-
-/* "View.MemoryView":1335
- *
- * @cname('__pyx_memoryview_refcount_objects_in_slice')
- * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim, bint inc):
- * cdef Py_ssize_t i
- */
-
-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) {
- CYTHON_UNUSED Py_ssize_t __pyx_v_i;
- __Pyx_RefNannyDeclarations
- Py_ssize_t __pyx_t_1;
- Py_ssize_t __pyx_t_2;
- int __pyx_t_3;
- __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
-
- /* "View.MemoryView":1339
- * cdef Py_ssize_t i
- *
- * for i in range(shape[0]): # <<<<<<<<<<<<<<
- * if ndim == 1:
- * if inc:
- */
- __pyx_t_1 = (__pyx_v_shape[0]);
- for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_1; __pyx_t_2+=1) {
- __pyx_v_i = __pyx_t_2;
-
- /* "View.MemoryView":1340
- *
- * for i in range(shape[0]):
- * if ndim == 1: # <<<<<<<<<<<<<<
- * if inc:
- * Py_INCREF((<PyObject **> data)[0])
- */
- __pyx_t_3 = ((__pyx_v_ndim == 1) != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":1341
- * for i in range(shape[0]):
- * if ndim == 1:
- * if inc: # <<<<<<<<<<<<<<
- * Py_INCREF((<PyObject **> data)[0])
- * else:
- */
- __pyx_t_3 = (__pyx_v_inc != 0);
- if (__pyx_t_3) {
-
- /* "View.MemoryView":1342
- * if ndim == 1:
- * if inc:
- * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
- * else:
- * Py_DECREF((<PyObject **> data)[0])
- */
- Py_INCREF((((PyObject **)__pyx_v_data)[0]));
- goto __pyx_L6;
- }
- /*else*/ {
-
- /* "View.MemoryView":1344
- * Py_INCREF((<PyObject **> data)[0])
- * else:
- * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
- * else:
- * refcount_objects_in_slice(data, shape + 1, strides + 1,
- */
- Py_DECREF((((PyObject **)__pyx_v_data)[0]));
- }
- __pyx_L6:;
- goto __pyx_L5;
- }
- /*else*/ {
-
- /* "View.MemoryView":1347
- * else:
- * refcount_objects_in_slice(data, shape + 1, strides + 1,
- * ndim - 1, inc) # <<<<<<<<<<<<<<
- *
- * data += strides[0]
- */
- __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
- }
- __pyx_L5:;
-
- /* "View.MemoryView":1349
- * ndim - 1, inc)
- *
- * data += strides[0] # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
- }
-
- __Pyx_RefNannyFinishContext();
-}
-
-/* "View.MemoryView":1355
- *
- * @cname('__pyx_memoryview_slice_assign_scalar')
- * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
- * size_t itemsize, void *item,
- * bint dtype_is_object) nogil:
- */
-
-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) {
-
- /* "View.MemoryView":1358
- * size_t itemsize, void *item,
- * bint dtype_is_object) nogil:
- * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
- * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
- * itemsize, item)
- */
- __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
-
- /* "View.MemoryView":1360
- * refcount_copying(dst, dtype_is_object, ndim, False)
- * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
- * itemsize, item) # <<<<<<<<<<<<<<
- * refcount_copying(dst, dtype_is_object, ndim, True)
- *
- */
- __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);
-
- /* "View.MemoryView":1361
- * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
- * itemsize, item)
- * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
-
-}
-
-/* "View.MemoryView":1365
- *
- * @cname('__pyx_memoryview__slice_assign_scalar')
- * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim,
- * size_t itemsize, void *item) nogil:
- */
-
-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) {
- CYTHON_UNUSED Py_ssize_t __pyx_v_i;
- Py_ssize_t __pyx_v_stride;
- Py_ssize_t __pyx_v_extent;
- int __pyx_t_1;
- Py_ssize_t __pyx_t_2;
- Py_ssize_t __pyx_t_3;
-
- /* "View.MemoryView":1369
- * size_t itemsize, void *item) nogil:
- * cdef Py_ssize_t i
- * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
- * cdef Py_ssize_t extent = shape[0]
- *
- */
- __pyx_v_stride = (__pyx_v_strides[0]);
-
- /* "View.MemoryView":1370
- * cdef Py_ssize_t i
- * cdef Py_ssize_t stride = strides[0]
- * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
- *
- * if ndim == 1:
- */
- __pyx_v_extent = (__pyx_v_shape[0]);
-
- /* "View.MemoryView":1372
- * cdef Py_ssize_t extent = shape[0]
- *
- * if ndim == 1: # <<<<<<<<<<<<<<
- * for i in range(extent):
- * memcpy(data, item, itemsize)
- */
- __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
- if (__pyx_t_1) {
-
- /* "View.MemoryView":1373
- *
- * if ndim == 1:
- * for i in range(extent): # <<<<<<<<<<<<<<
- * memcpy(data, item, itemsize)
- * data += stride
- */
- __pyx_t_2 = __pyx_v_extent;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1374
- * if ndim == 1:
- * for i in range(extent):
- * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
- * data += stride
- * else:
- */
- memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize);
-
- /* "View.MemoryView":1375
- * for i in range(extent):
- * memcpy(data, item, itemsize)
- * data += stride # <<<<<<<<<<<<<<
- * else:
- * for i in range(extent):
- */
- __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
- }
- goto __pyx_L3;
- }
- /*else*/ {
-
- /* "View.MemoryView":1377
- * data += stride
- * else:
- * for i in range(extent): # <<<<<<<<<<<<<<
- * _slice_assign_scalar(data, shape + 1, strides + 1,
- * ndim - 1, itemsize, item)
- */
- __pyx_t_2 = __pyx_v_extent;
- for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
- __pyx_v_i = __pyx_t_3;
-
- /* "View.MemoryView":1379
- * for i in range(extent):
- * _slice_assign_scalar(data, shape + 1, strides + 1,
- * ndim - 1, itemsize, item) # <<<<<<<<<<<<<<
- * data += stride
- *
- */
- __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);
-
- /* "View.MemoryView":1380
- * _slice_assign_scalar(data, shape + 1, strides + 1,
- * ndim - 1, itemsize, item)
- * data += stride # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
- }
- }
- __pyx_L3:;
-
-}
-static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
-
-static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_memoryview_obj *p;
- PyObject *o;
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_memoryview_obj *)o);
- p->__pyx_vtab = __pyx_vtabptr_memoryview;
- p->obj = Py_None; Py_INCREF(Py_None);
- p->_size = Py_None; Py_INCREF(Py_None);
- p->_array_interface = Py_None; Py_INCREF(Py_None);
- p->view.obj = NULL;
- if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) {
- Py_DECREF(o); o = 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_memoryview(PyObject *o) {
- struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
- PyObject_GC_UnTrack(o);
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_memoryview___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- Py_CLEAR(p->obj);
- Py_CLEAR(p->_size);
- Py_CLEAR(p->_array_interface);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
- if (p->obj) {
- e = (*v)(p->obj, a); if (e) return e;
- }
- if (p->_size) {
- e = (*v)(p->_size, a); if (e) return e;
- }
- if (p->_array_interface) {
- e = (*v)(p->_array_interface, a); if (e) return e;
- }
- if (p->view.obj) {
- e = (*v)(p->view.obj, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_memoryview(PyObject *o) {
- struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->obj);
- p->obj = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_size);
- p->_size = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_array_interface);
- p->_array_interface = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- Py_CLEAR(p->view.obj);
- return 0;
-}
-static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
- PyObject *r;
- PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
- r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
- Py_DECREF(x);
- return r;
-}
-
-static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
- if (v) {
- return __pyx_memoryview___setitem__(o, i, v);
- }
- else {
- PyErr_Format(PyExc_NotImplementedError,
- "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
- return -1;
- }
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_transpose(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview__get__base(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_shape(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_strides(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_suboffsets(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_ndim(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_itemsize(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_nbytes(o);
-}
-
-static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryview_get_size(o);
-}
-
-static PyMethodDef __pyx_methods_memoryview[] = {
- {__Pyx_NAMESTR("is_c_contig"), (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("is_f_contig"), (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, __Pyx_DOCSTR(0)},
- {__Pyx_NAMESTR("copy_fortran"), (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, __Pyx_DOCSTR(0)},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_memoryview[] = {
- {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, 0, 0},
- {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, 0, 0},
- {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, 0, 0},
- {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, 0, 0},
- {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, 0, 0},
- {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, 0, 0},
- {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, 0, 0},
- {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, 0, 0},
- {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, 0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
- __pyx_memoryview___len__, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- __pyx_sq_item_memoryview, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
- __pyx_memoryview___len__, /*mp_length*/
- __pyx_memoryview___getitem__, /*mp_subscript*/
- __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getreadbuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getwritebuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getsegcount*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getcharbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- __pyx_memoryview_getbuffer, /*bf_getbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_releasebuffer*/
- #endif
-};
-
-static PyTypeObject __pyx_type___pyx_memoryview = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaPhysics.xas._xas.memoryview"), /*tp_name*/
- sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- __pyx_memoryview___repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- __pyx_memoryview___str__, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_memoryview, /*tp_traverse*/
- __pyx_tp_clear_memoryview, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_memoryview, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_memoryview, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_memoryview, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_array_obj *p;
- PyObject *o;
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_array_obj *)o);
- p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
- p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
- if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) {
- Py_DECREF(o); o = 0;
- }
- return o;
-}
-
-static void __pyx_tp_dealloc_array(PyObject *o) {
- struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
- PyObject_GC_UnTrack(o);
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_array___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- Py_CLEAR(p->mode);
- Py_CLEAR(p->_format);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_array(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
- if (p->mode) {
- e = (*v)(p->mode, a); if (e) return e;
- }
- if (p->_format) {
- e = (*v)(p->_format, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_array(PyObject *o) {
- struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->mode);
- p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- tmp = ((PyObject*)p->_format);
- p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
- PyObject *r;
- PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
- r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
- Py_DECREF(x);
- return r;
-}
-
-static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
- if (v) {
- return __pyx_array___setitem__(o, i, v);
- }
- else {
- PyErr_Format(PyExc_NotImplementedError,
- "Subscript deletion not supported by %s", Py_TYPE(o)->tp_name);
- return -1;
- }
-}
-
-static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
- PyObject *v = PyObject_GenericGetAttr(o, n);
- if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
- PyErr_Clear();
- v = __pyx_array___getattr__(o, n);
- }
- return v;
-}
-
-static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
- return get_memview(o);
-}
-
-static PyMethodDef __pyx_methods_array[] = {
- {__Pyx_NAMESTR("__getattr__"), (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, __Pyx_DOCSTR(0)},
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets_array[] = {
- {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, 0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PySequenceMethods __pyx_tp_as_sequence_array = {
- 0, /*sq_length*/
- 0, /*sq_concat*/
- 0, /*sq_repeat*/
- __pyx_sq_item_array, /*sq_item*/
- 0, /*sq_slice*/
- 0, /*sq_ass_item*/
- 0, /*sq_ass_slice*/
- 0, /*sq_contains*/
- 0, /*sq_inplace_concat*/
- 0, /*sq_inplace_repeat*/
-};
-
-static PyMappingMethods __pyx_tp_as_mapping_array = {
- 0, /*mp_length*/
- __pyx_array___getitem__, /*mp_subscript*/
- __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
-};
-
-static PyBufferProcs __pyx_tp_as_buffer_array = {
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getreadbuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getwritebuffer*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getsegcount*/
- #endif
- #if PY_MAJOR_VERSION < 3
- 0, /*bf_getcharbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- __pyx_array_getbuffer, /*bf_getbuffer*/
- #endif
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*bf_releasebuffer*/
- #endif
-};
-
-static PyTypeObject __pyx_type___pyx_array = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaPhysics.xas._xas.array"), /*tp_name*/
- sizeof(struct __pyx_array_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_array, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- 0, /*tp_repr*/
- 0, /*tp_as_number*/
- &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
- &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- __pyx_tp_getattro_array, /*tp_getattro*/
- 0, /*tp_setattro*/
- &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_array, /*tp_traverse*/
- __pyx_tp_clear_array, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_array, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets_array, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_array, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
- struct __pyx_MemviewEnum_obj *p;
- PyObject *o;
- o = (*t->tp_alloc)(t, 0);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_MemviewEnum_obj *)o);
- p->name = Py_None; Py_INCREF(Py_None);
- return o;
-}
-
-static void __pyx_tp_dealloc_Enum(PyObject *o) {
- struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
- PyObject_GC_UnTrack(o);
- Py_CLEAR(p->name);
- (*Py_TYPE(o)->tp_free)(o);
-}
-
-static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
- if (p->name) {
- e = (*v)(p->name, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear_Enum(PyObject *o) {
- struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
- PyObject* tmp;
- tmp = ((PyObject*)p->name);
- p->name = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- return 0;
-}
-
-static PyMethodDef __pyx_methods_Enum[] = {
- {0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type___pyx_MemviewEnum = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaPhysics.xas._xas.Enum"), /*tp_name*/
- sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc_Enum, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- __pyx_MemviewEnum___repr__, /*tp_repr*/
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- 0, /*tp_str*/
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- 0, /*tp_doc*/
- __pyx_tp_traverse_Enum, /*tp_traverse*/
- __pyx_tp_clear_Enum, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods_Enum, /*tp_methods*/
- 0, /*tp_members*/
- 0, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- __pyx_MemviewEnum___init__, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new_Enum, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
-
-static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
- struct __pyx_memoryviewslice_obj *p;
- PyObject *o = __pyx_tp_new_memoryview(t, a, k);
- if (unlikely(!o)) return 0;
- p = ((struct __pyx_memoryviewslice_obj *)o);
- p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
- p->from_object = Py_None; Py_INCREF(Py_None);
- p->from_slice.memview = NULL;
- return o;
-}
-
-static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
- struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
- PyObject_GC_UnTrack(o);
- {
- PyObject *etype, *eval, *etb;
- PyErr_Fetch(&etype, &eval, &etb);
- ++Py_REFCNT(o);
- __pyx_memoryviewslice___dealloc__(o);
- if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
- --Py_REFCNT(o);
- PyErr_Restore(etype, eval, etb);
- }
- Py_CLEAR(p->from_object);
- PyObject_GC_Track(o);
- __pyx_tp_dealloc_memoryview(o);
-}
-
-static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
- int e;
- struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
- e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
- if (p->from_object) {
- e = (*v)(p->from_object, a); if (e) return e;
- }
- return 0;
-}
-
-static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
- struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
- PyObject* tmp;
- __pyx_tp_clear_memoryview(o);
- tmp = ((PyObject*)p->from_object);
- p->from_object = Py_None; Py_INCREF(Py_None);
- Py_XDECREF(tmp);
- __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
- return 0;
-}
-
-static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
- return __pyx_memoryviewslice__get__base(o);
-}
-
-static PyMethodDef __pyx_methods__memoryviewslice[] = {
- {0, 0, 0, 0}
-};
-
-static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
- {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, 0, 0},
- {0, 0, 0, 0, 0}
-};
-
-static PyTypeObject __pyx_type___pyx_memoryviewslice = {
- PyVarObject_HEAD_INIT(0, 0)
- __Pyx_NAMESTR("PyMca5.PyMcaPhysics.xas._xas._memoryviewslice"), /*tp_name*/
- sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
- 0, /*tp_itemsize*/
- __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
- 0, /*tp_print*/
- 0, /*tp_getattr*/
- 0, /*tp_setattr*/
- #if PY_MAJOR_VERSION < 3
- 0, /*tp_compare*/
- #else
- 0, /*reserved*/
- #endif
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_memoryview___repr__, /*tp_repr*/
- #else
- 0, /*tp_repr*/
- #endif
- 0, /*tp_as_number*/
- 0, /*tp_as_sequence*/
- 0, /*tp_as_mapping*/
- 0, /*tp_hash*/
- 0, /*tp_call*/
- #if CYTHON_COMPILING_IN_PYPY
- __pyx_memoryview___str__, /*tp_str*/
- #else
- 0, /*tp_str*/
- #endif
- 0, /*tp_getattro*/
- 0, /*tp_setattro*/
- 0, /*tp_as_buffer*/
- Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
- __Pyx_DOCSTR("Internal class for passing memoryview slices to Python"), /*tp_doc*/
- __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
- __pyx_tp_clear__memoryviewslice, /*tp_clear*/
- 0, /*tp_richcompare*/
- 0, /*tp_weaklistoffset*/
- 0, /*tp_iter*/
- 0, /*tp_iternext*/
- __pyx_methods__memoryviewslice, /*tp_methods*/
- 0, /*tp_members*/
- __pyx_getsets__memoryviewslice, /*tp_getset*/
- 0, /*tp_base*/
- 0, /*tp_dict*/
- 0, /*tp_descr_get*/
- 0, /*tp_descr_set*/
- 0, /*tp_dictoffset*/
- 0, /*tp_init*/
- 0, /*tp_alloc*/
- __pyx_tp_new__memoryviewslice, /*tp_new*/
- 0, /*tp_free*/
- 0, /*tp_is_gc*/
- 0, /*tp_bases*/
- 0, /*tp_mro*/
- 0, /*tp_cache*/
- 0, /*tp_subclasses*/
- 0, /*tp_weaklist*/
- 0, /*tp_del*/
- #if PY_VERSION_HEX >= 0x02060000
- 0, /*tp_version_tag*/
- #endif
-};
-
-static PyMethodDef __pyx_methods[] = {
- {0, 0, 0, 0}
-};
-
-#if PY_MAJOR_VERSION >= 3
-static struct PyModuleDef __pyx_moduledef = {
- #if PY_VERSION_HEX < 0x03020000
- { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
- #else
- PyModuleDef_HEAD_INIT,
- #endif
- __Pyx_NAMESTR("_xas"),
- 0, /* m_doc */
- -1, /* m_size */
- __pyx_methods /* m_methods */,
- NULL, /* m_reload */
- NULL, /* m_traverse */
- NULL, /* m_clear */
- NULL /* m_free */
-};
-#endif
-
-static __Pyx_StringTabEntry __pyx_string_tab[] = {
- {&__pyx_kp_u_11, __pyx_k_11, sizeof(__pyx_k_11), 0, 1, 0, 0},
- {&__pyx_kp_u_13, __pyx_k_13, sizeof(__pyx_k_13), 0, 1, 0, 0},
- {&__pyx_kp_u_15, __pyx_k_15, sizeof(__pyx_k_15), 0, 1, 0, 0},
- {&__pyx_kp_u_16, __pyx_k_16, sizeof(__pyx_k_16), 0, 1, 0, 0},
- {&__pyx_kp_u_19, __pyx_k_19, sizeof(__pyx_k_19), 0, 1, 0, 0},
- {&__pyx_kp_s_21, __pyx_k_21, sizeof(__pyx_k_21), 0, 0, 1, 0},
- {&__pyx_kp_s_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 1, 0},
- {&__pyx_kp_s_26, __pyx_k_26, sizeof(__pyx_k_26), 0, 0, 1, 0},
- {&__pyx_kp_s_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 1, 0},
- {&__pyx_kp_s_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 1, 0},
- {&__pyx_kp_s_31, __pyx_k_31, sizeof(__pyx_k_31), 0, 0, 1, 0},
- {&__pyx_kp_s_33, __pyx_k_33, sizeof(__pyx_k_33), 0, 0, 1, 0},
- {&__pyx_kp_s_35, __pyx_k_35, sizeof(__pyx_k_35), 0, 0, 1, 0},
- {&__pyx_kp_s_37, __pyx_k_37, sizeof(__pyx_k_37), 0, 0, 1, 0},
- {&__pyx_kp_s_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 0, 1, 0},
- {&__pyx_kp_s_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 0, 1, 0},
- {&__pyx_kp_s_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 0, 1, 0},
- {&__pyx_kp_s_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 0, 1, 0},
- {&__pyx_kp_s_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 0, 1, 0},
- {&__pyx_kp_s_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 0, 1, 0},
- {&__pyx_kp_s_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 0, 1, 0},
- {&__pyx_n_s_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 1, 1},
- {&__pyx_kp_s_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 1, 0},
- {&__pyx_kp_s_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 1, 0},
- {&__pyx_kp_s_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 0, 1, 0},
- {&__pyx_kp_s_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 1, 0},
- {&__pyx_kp_s_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 1, 0},
- {&__pyx_kp_u_9, __pyx_k_9, sizeof(__pyx_k_9), 0, 1, 0, 0},
- {&__pyx_n_s__ASCII, __pyx_k__ASCII, sizeof(__pyx_k__ASCII), 0, 0, 1, 1},
- {&__pyx_n_s__Ellipsis, __pyx_k__Ellipsis, sizeof(__pyx_k__Ellipsis), 0, 0, 1, 1},
- {&__pyx_n_s__IndexError, __pyx_k__IndexError, sizeof(__pyx_k__IndexError), 0, 0, 1, 1},
- {&__pyx_n_s__MemoryError, __pyx_k__MemoryError, sizeof(__pyx_k__MemoryError), 0, 0, 1, 1},
- {&__pyx_n_b__O, __pyx_k__O, sizeof(__pyx_k__O), 0, 0, 0, 1},
- {&__pyx_n_s__RuntimeError, __pyx_k__RuntimeError, sizeof(__pyx_k__RuntimeError), 0, 0, 1, 1},
- {&__pyx_n_s__TypeError, __pyx_k__TypeError, sizeof(__pyx_k__TypeError), 0, 0, 1, 1},
- {&__pyx_n_s__ValueError, __pyx_k__ValueError, sizeof(__pyx_k__ValueError), 0, 0, 1, 1},
- {&__pyx_n_s____class__, __pyx_k____class__, sizeof(__pyx_k____class__), 0, 0, 1, 1},
- {&__pyx_n_s____import__, __pyx_k____import__, sizeof(__pyx_k____import__), 0, 0, 1, 1},
- {&__pyx_n_s____len__, __pyx_k____len__, sizeof(__pyx_k____len__), 0, 0, 1, 1},
- {&__pyx_n_s____main__, __pyx_k____main__, sizeof(__pyx_k____main__), 0, 0, 1, 1},
- {&__pyx_n_s____name__, __pyx_k____name__, sizeof(__pyx_k____name__), 0, 0, 1, 1},
- {&__pyx_n_s____pyx_getbuffer, __pyx_k____pyx_getbuffer, sizeof(__pyx_k____pyx_getbuffer), 0, 0, 1, 1},
- {&__pyx_n_s____pyx_releasebuffer, __pyx_k____pyx_releasebuffer, sizeof(__pyx_k____pyx_releasebuffer), 0, 0, 1, 1},
- {&__pyx_n_s____pyx_vtable__, __pyx_k____pyx_vtable__, sizeof(__pyx_k____pyx_vtable__), 0, 0, 1, 1},
- {&__pyx_n_s____test__, __pyx_k____test__, sizeof(__pyx_k____test__), 0, 0, 1, 1},
- {&__pyx_n_s___besselMultiple, __pyx_k___besselMultiple, sizeof(__pyx_k___besselMultiple), 0, 0, 1, 1},
- {&__pyx_n_s___besselSingle, __pyx_k___besselSingle, sizeof(__pyx_k___besselSingle), 0, 0, 1, 1},
- {&__pyx_n_s__a, __pyx_k__a, sizeof(__pyx_k__a), 0, 0, 1, 1},
- {&__pyx_n_s__abs, __pyx_k__abs, sizeof(__pyx_k__abs), 0, 0, 1, 1},
- {&__pyx_n_s__allocate_buffer, __pyx_k__allocate_buffer, sizeof(__pyx_k__allocate_buffer), 0, 0, 1, 1},
- {&__pyx_n_s__array, __pyx_k__array, sizeof(__pyx_k__array), 0, 0, 1, 1},
- {&__pyx_n_s__ascontiguousarray, __pyx_k__ascontiguousarray, sizeof(__pyx_k__ascontiguousarray), 0, 0, 1, 1},
- {&__pyx_n_s__base, __pyx_k__base, sizeof(__pyx_k__base), 0, 0, 1, 1},
- {&__pyx_n_s__buffer_xh0, __pyx_k__buffer_xh0, sizeof(__pyx_k__buffer_xh0), 0, 0, 1, 1},
- {&__pyx_n_s__buffer_xl0, __pyx_k__buffer_xl0, sizeof(__pyx_k__buffer_xl0), 0, 0, 1, 1},
- {&__pyx_n_b__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 0, 1},
- {&__pyx_n_s__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 0, 1, 1},
- {&__pyx_n_u__c, __pyx_k__c, sizeof(__pyx_k__c), 0, 1, 0, 1},
- {&__pyx_n_s__c_c, __pyx_k__c_c, sizeof(__pyx_k__c_c), 0, 0, 1, 1},
- {&__pyx_n_s__c_nc, __pyx_k__c_nc, sizeof(__pyx_k__c_nc), 0, 0, 1, 1},
- {&__pyx_n_s__c_npts, __pyx_k__c_npts, sizeof(__pyx_k__c_npts), 0, 0, 1, 1},
- {&__pyx_n_s__c_nr, __pyx_k__c_nr, sizeof(__pyx_k__c_nr), 0, 0, 1, 1},
- {&__pyx_n_s__c_sizeC, __pyx_k__c_sizeC, sizeof(__pyx_k__c_sizeC), 0, 0, 1, 1},
- {&__pyx_n_s__c_w, __pyx_k__c_w, sizeof(__pyx_k__c_w), 0, 0, 1, 1},
- {&__pyx_n_s__c_x, __pyx_k__c_x, sizeof(__pyx_k__c_x), 0, 0, 1, 1},
- {&__pyx_n_s__c_xh, __pyx_k__c_xh, sizeof(__pyx_k__c_xh), 0, 0, 1, 1},
- {&__pyx_n_s__c_xl, __pyx_k__c_xl, sizeof(__pyx_k__c_xl), 0, 0, 1, 1},
- {&__pyx_n_s__c_y, __pyx_k__c_y, sizeof(__pyx_k__c_y), 0, 0, 1, 1},
- {&__pyx_n_s__copy, __pyx_k__copy, sizeof(__pyx_k__copy), 0, 0, 1, 1},
- {&__pyx_n_s__decode, __pyx_k__decode, sizeof(__pyx_k__decode), 0, 0, 1, 1},
- {&__pyx_n_s__df, __pyx_k__df, sizeof(__pyx_k__df), 0, 0, 1, 1},
- {&__pyx_n_s__dtype, __pyx_k__dtype, sizeof(__pyx_k__dtype), 0, 0, 1, 1},
- {&__pyx_n_s__dtype_is_object, __pyx_k__dtype_is_object, sizeof(__pyx_k__dtype_is_object), 0, 0, 1, 1},
- {&__pyx_n_s__encode, __pyx_k__encode, sizeof(__pyx_k__encode), 0, 0, 1, 1},
- {&__pyx_n_s__enumerate, __pyx_k__enumerate, sizeof(__pyx_k__enumerate), 0, 0, 1, 1},
- {&__pyx_n_s__error, __pyx_k__error, sizeof(__pyx_k__error), 0, 0, 1, 1},
- {&__pyx_n_s__extend, __pyx_k__extend, sizeof(__pyx_k__extend), 0, 0, 1, 1},
- {&__pyx_n_s__flags, __pyx_k__flags, sizeof(__pyx_k__flags), 0, 0, 1, 1},
- {&__pyx_n_s__float64, __pyx_k__float64, sizeof(__pyx_k__float64), 0, 0, 1, 1},
- {&__pyx_n_s__format, __pyx_k__format, sizeof(__pyx_k__format), 0, 0, 1, 1},
- {&__pyx_n_b__fortran, __pyx_k__fortran, sizeof(__pyx_k__fortran), 0, 0, 0, 1},
- {&__pyx_n_s__fortran, __pyx_k__fortran, sizeof(__pyx_k__fortran), 0, 0, 1, 1},
- {&__pyx_n_s__i, __pyx_k__i, sizeof(__pyx_k__i), 0, 0, 1, 1},
- {&__pyx_n_s__i1, __pyx_k__i1, sizeof(__pyx_k__i1), 0, 0, 1, 1},
- {&__pyx_n_s__ibl, __pyx_k__ibl, sizeof(__pyx_k__ibl), 0, 0, 1, 1},
- {&__pyx_n_s__id, __pyx_k__id, sizeof(__pyx_k__id), 0, 0, 1, 1},
- {&__pyx_n_s__ik, __pyx_k__ik, sizeof(__pyx_k__ik), 0, 0, 1, 1},
- {&__pyx_n_s__int32, __pyx_k__int32, sizeof(__pyx_k__int32), 0, 0, 1, 1},
- {&__pyx_n_s__itemsize, __pyx_k__itemsize, sizeof(__pyx_k__itemsize), 0, 0, 1, 1},
- {&__pyx_n_s__j, __pyx_k__j, sizeof(__pyx_k__j), 0, 0, 1, 1},
- {&__pyx_n_s__j0, __pyx_k__j0, sizeof(__pyx_k__j0), 0, 0, 1, 1},
- {&__pyx_n_s__k, __pyx_k__k, sizeof(__pyx_k__k), 0, 0, 1, 1},
- {&__pyx_n_s__m, __pyx_k__m, sizeof(__pyx_k__m), 0, 0, 1, 1},
- {&__pyx_n_s__memview, __pyx_k__memview, sizeof(__pyx_k__memview), 0, 0, 1, 1},
- {&__pyx_n_s__mode, __pyx_k__mode, sizeof(__pyx_k__mode), 0, 0, 1, 1},
- {&__pyx_n_s__n, __pyx_k__n, sizeof(__pyx_k__n), 0, 0, 1, 1},
- {&__pyx_n_s__n1, __pyx_k__n1, sizeof(__pyx_k__n1), 0, 0, 1, 1},
- {&__pyx_n_s__name, __pyx_k__name, sizeof(__pyx_k__name), 0, 0, 1, 1},
- {&__pyx_n_s__nbs, __pyx_k__nbs, sizeof(__pyx_k__nbs), 0, 0, 1, 1},
- {&__pyx_n_s__nc, __pyx_k__nc, sizeof(__pyx_k__nc), 0, 0, 1, 1},
- {&__pyx_n_s__ncol, __pyx_k__ncol, sizeof(__pyx_k__ncol), 0, 0, 1, 1},
- {&__pyx_n_s__ndim, __pyx_k__ndim, sizeof(__pyx_k__ndim), 0, 0, 1, 1},
- {&__pyx_n_s__ne_idl, __pyx_k__ne_idl, sizeof(__pyx_k__ne_idl), 0, 0, 1, 1},
- {&__pyx_n_s__ni, __pyx_k__ni, sizeof(__pyx_k__ni), 0, 0, 1, 1},
- {&__pyx_n_s__ni1, __pyx_k__ni1, sizeof(__pyx_k__ni1), 0, 0, 1, 1},
- {&__pyx_n_s__nk, __pyx_k__nk, sizeof(__pyx_k__nk), 0, 0, 1, 1},
- {&__pyx_n_s__nm1, __pyx_k__nm1, sizeof(__pyx_k__nm1), 0, 0, 1, 1},
- {&__pyx_n_s__npts, __pyx_k__npts, sizeof(__pyx_k__npts), 0, 0, 1, 1},
- {&__pyx_n_s__nr, __pyx_k__nr, sizeof(__pyx_k__nr), 0, 0, 1, 1},
- {&__pyx_n_s__ns, __pyx_k__ns, sizeof(__pyx_k__ns), 0, 0, 1, 1},
- {&__pyx_n_s__ns1, __pyx_k__ns1, sizeof(__pyx_k__ns1), 0, 0, 1, 1},
- {&__pyx_n_s__numpy, __pyx_k__numpy, sizeof(__pyx_k__numpy), 0, 0, 1, 1},
- {&__pyx_n_s__obj, __pyx_k__obj, sizeof(__pyx_k__obj), 0, 0, 1, 1},
- {&__pyx_n_s__pack, __pyx_k__pack, sizeof(__pyx_k__pack), 0, 0, 1, 1},
- {&__pyx_n_s__polspl, __pyx_k__polspl, sizeof(__pyx_k__polspl), 0, 0, 1, 1},
- {&__pyx_n_s__polspl2, __pyx_k__polspl2, sizeof(__pyx_k__polspl2), 0, 0, 1, 1},
- {&__pyx_n_s__power, __pyx_k__power, sizeof(__pyx_k__power), 0, 0, 1, 1},
- {&__pyx_n_s__range, __pyx_k__range, sizeof(__pyx_k__range), 0, 0, 1, 1},
- {&__pyx_n_s__result, __pyx_k__result, sizeof(__pyx_k__result), 0, 0, 1, 1},
- {&__pyx_n_s__shape, __pyx_k__shape, sizeof(__pyx_k__shape), 0, 0, 1, 1},
- {&__pyx_n_s__size, __pyx_k__size, sizeof(__pyx_k__size), 0, 0, 1, 1},
- {&__pyx_n_s__start, __pyx_k__start, sizeof(__pyx_k__start), 0, 0, 1, 1},
- {&__pyx_n_s__step, __pyx_k__step, sizeof(__pyx_k__step), 0, 0, 1, 1},
- {&__pyx_n_s__stop, __pyx_k__stop, sizeof(__pyx_k__stop), 0, 0, 1, 1},
- {&__pyx_n_s__struct, __pyx_k__struct, sizeof(__pyx_k__struct), 0, 0, 1, 1},
- {&__pyx_n_s__t, __pyx_k__t, sizeof(__pyx_k__t), 0, 0, 1, 1},
- {&__pyx_n_s__unpack, __pyx_k__unpack, sizeof(__pyx_k__unpack), 0, 0, 1, 1},
- {&__pyx_n_s__w, __pyx_k__w, sizeof(__pyx_k__w), 0, 0, 1, 1},
- {&__pyx_n_s__x, __pyx_k__x, sizeof(__pyx_k__x), 0, 0, 1, 1},
- {&__pyx_n_s__xh, __pyx_k__xh, sizeof(__pyx_k__xh), 0, 0, 1, 1},
- {&__pyx_n_s__xh0, __pyx_k__xh0, sizeof(__pyx_k__xh0), 0, 0, 1, 1},
- {&__pyx_n_s__xk, __pyx_k__xk, sizeof(__pyx_k__xk), 0, 0, 1, 1},
- {&__pyx_n_s__xk0, __pyx_k__xk0, sizeof(__pyx_k__xk0), 0, 0, 1, 1},
- {&__pyx_n_s__xl, __pyx_k__xl, sizeof(__pyx_k__xl), 0, 0, 1, 1},
- {&__pyx_n_s__xl0, __pyx_k__xl0, sizeof(__pyx_k__xl0), 0, 0, 1, 1},
- {&__pyx_n_s__xrange, __pyx_k__xrange, sizeof(__pyx_k__xrange), 0, 0, 1, 1},
- {&__pyx_n_s__y, __pyx_k__y, sizeof(__pyx_k__y), 0, 0, 1, 1},
- {&__pyx_n_s__zeros, __pyx_k__zeros, sizeof(__pyx_k__zeros), 0, 0, 1, 1},
- {0, 0, 0, 0, 0, 0, 0}
-};
-static int __Pyx_InitCachedBuiltins(void) {
- __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 101; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s__ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s__RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s__MemoryError); if (!__pyx_builtin_MemoryError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s__enumerate); if (!__pyx_builtin_enumerate) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s__Ellipsis); if (!__pyx_builtin_Ellipsis) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 363; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s__TypeError); if (!__pyx_builtin_TypeError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 392; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if PY_MAJOR_VERSION >= 3
- __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s__range); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #else
- __pyx_builtin_xrange = __Pyx_GetBuiltinName(__pyx_n_s__xrange); if (!__pyx_builtin_xrange) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 521; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s__id); if (!__pyx_builtin_id) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 576; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s__IndexError); if (!__pyx_builtin_IndexError) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-static int __Pyx_InitCachedConstants(void) {
- __Pyx_RefNannyDeclarations
- __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":52
- *
- * def polspl(x, y, w, npts, xl, xh, nr, nc):
- * c = numpy.zeros((36,), dtype=numpy.float64) # <<<<<<<<<<<<<<
- * cdef double[:] c_c = c
- * cdef double[:] c_x = numpy.ascontiguousarray(x,
- */
- __pyx_k_tuple_1 = PyTuple_Pack(1, __pyx_int_36); if (unlikely(!__pyx_k_tuple_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_1);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_1));
- __pyx_k_tuple_2 = PyTuple_Pack(1, ((PyObject *)__pyx_k_tuple_1)); if (unlikely(!__pyx_k_tuple_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_2);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_2));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":85
- * numpy.ascontiguousarray(xh0, numpy.float64)
- * cdef double * xh = <double *> buffer_xh0.data
- * df = numpy.zeros(26) # <<<<<<<<<<<<<<
- * a = numpy.zeros((36,37))
- * nbs = numpy.zeros(11,dtype=int)
- */
- __pyx_k_tuple_3 = PyTuple_Pack(1, __pyx_int_26); if (unlikely(!__pyx_k_tuple_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 85; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_3);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_3));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":86
- * cdef double * xh = <double *> buffer_xh0.data
- * df = numpy.zeros(26)
- * a = numpy.zeros((36,37)) # <<<<<<<<<<<<<<
- * nbs = numpy.zeros(11,dtype=int)
- * cdef double[:] xk0 = numpy.zeros(10)
- */
- __pyx_k_tuple_4 = PyTuple_Pack(2, __pyx_int_36, __pyx_int_37); if (unlikely(!__pyx_k_tuple_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_4);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_4));
- __pyx_k_tuple_5 = PyTuple_Pack(1, ((PyObject *)__pyx_k_tuple_4)); if (unlikely(!__pyx_k_tuple_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 86; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_5);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_5));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":87
- * df = numpy.zeros(26)
- * a = numpy.zeros((36,37))
- * nbs = numpy.zeros(11,dtype=int) # <<<<<<<<<<<<<<
- * cdef double[:] xk0 = numpy.zeros(10)
- * cdef double * xk = &xk0[0]
- */
- __pyx_k_tuple_6 = PyTuple_Pack(1, __pyx_int_11); if (unlikely(!__pyx_k_tuple_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_6);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_6));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":88
- * a = numpy.zeros((36,37))
- * nbs = numpy.zeros(11,dtype=int)
- * cdef double[:] xk0 = numpy.zeros(10) # <<<<<<<<<<<<<<
- * cdef double * xk = &xk0[0]
- * c = numpy.zeros(36)
- */
- __pyx_k_tuple_7 = PyTuple_Pack(1, __pyx_int_10); if (unlikely(!__pyx_k_tuple_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 88; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_7);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_7));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":90
- * cdef double[:] xk0 = numpy.zeros(10)
- * cdef double * xk = &xk0[0]
- * c = numpy.zeros(36) # <<<<<<<<<<<<<<
- * cdef int j=0
- * cdef int i=0
- */
- __pyx_k_tuple_8 = PyTuple_Pack(1, __pyx_int_36); if (unlikely(!__pyx_k_tuple_8)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_8);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_8));
-
- /* "numpy.pxd":215
- * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
- *
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- */
- __pyx_k_tuple_10 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_9)); if (unlikely(!__pyx_k_tuple_10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_10);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_10));
-
- /* "numpy.pxd":219
- * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
- * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
- * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
- *
- * info.buf = PyArray_DATA(self)
- */
- __pyx_k_tuple_12 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_11)); if (unlikely(!__pyx_k_tuple_12)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_12);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_12));
-
- /* "numpy.pxd":257
- * if ((descr.byteorder == c'>' and little_endian) or
- * (descr.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * if t == NPY_BYTE: f = "b"
- * elif t == NPY_UBYTE: f = "B"
- */
- __pyx_k_tuple_14 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_13)); if (unlikely(!__pyx_k_tuple_14)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_14);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_14));
-
- /* "numpy.pxd":799
- *
- * if (end - f) - (new_offset - offset[0]) < 15:
- * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
- *
- * if ((child.byteorder == c'>' and little_endian) or
- */
- __pyx_k_tuple_17 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_16)); if (unlikely(!__pyx_k_tuple_17)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_17);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_17));
-
- /* "numpy.pxd":803
- * if ((child.byteorder == c'>' and little_endian) or
- * (child.byteorder == c'<' and not little_endian)):
- * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
- * # One could encode it in the format string and have Cython
- * # complain instead, BUT: < and > in format strings also imply
- */
- __pyx_k_tuple_18 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_13)); if (unlikely(!__pyx_k_tuple_18)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_18);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_18));
-
- /* "numpy.pxd":823
- * t = child.type_num
- * if end - f < 5:
- * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
- *
- * # Until ticket #99 is fixed, use integers to avoid warnings
- */
- __pyx_k_tuple_20 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_u_19)); if (unlikely(!__pyx_k_tuple_20)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_20);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_20));
-
- /* "View.MemoryView":124
- *
- * if not self.ndim:
- * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
- *
- * if self.itemsize <= 0:
- */
- __pyx_k_tuple_22 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_21)); if (unlikely(!__pyx_k_tuple_22)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_22);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_22));
-
- /* "View.MemoryView":127
- *
- * if self.itemsize <= 0:
- * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
- *
- * encode = getattr(format, 'encode', None)
- */
- __pyx_k_tuple_24 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_23)); if (unlikely(!__pyx_k_tuple_24)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_24);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_24));
-
- /* "View.MemoryView":131
- * encode = getattr(format, 'encode', None)
- * if encode:
- * format = encode('ASCII') # <<<<<<<<<<<<<<
- * self._format = format
- * self.format = self._format
- */
- __pyx_k_tuple_25 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ASCII)); if (unlikely(!__pyx_k_tuple_25)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_25);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_25));
-
- /* "View.MemoryView":141
- * free(self._shape)
- * free(self._strides)
- * raise MemoryError("unable to allocate shape or strides.") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_27 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_26)); if (unlikely(!__pyx_k_tuple_27)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_27);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_27));
-
- /* "View.MemoryView":166
- * decode = getattr(mode, 'decode', None)
- * if decode:
- * mode = decode('ASCII') # <<<<<<<<<<<<<<
- * self.mode = mode
- *
- */
- __pyx_k_tuple_30 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__ASCII)); if (unlikely(!__pyx_k_tuple_30)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_30);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_30));
-
- /* "View.MemoryView":174
- * self.data = <char *>malloc(self.len)
- * if not self.data:
- * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
- *
- * if self.dtype_is_object:
- */
- __pyx_k_tuple_32 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_31)); if (unlikely(!__pyx_k_tuple_32)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_32);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_32));
-
- /* "View.MemoryView":190
- * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
- * if not (flags & bufmode):
- * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
- * info.buf = self.data
- * info.len = self.len
- */
- __pyx_k_tuple_34 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_33)); if (unlikely(!__pyx_k_tuple_34)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_34);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_34));
-
- /* "View.MemoryView":452
- * result = struct.unpack(self.view.format, bytesitem)
- * except struct.error:
- * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
- * else:
- * if len(self.view.format) == 1:
- */
- __pyx_k_tuple_36 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_35)); if (unlikely(!__pyx_k_tuple_36)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 452; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_36);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_36));
-
- /* "View.MemoryView":528
- * if self.view.strides == NULL:
- *
- * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
- *
- * return tuple([self.view.strides[i] for i in xrange(self.view.ndim)])
- */
- __pyx_k_tuple_38 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_37)); if (unlikely(!__pyx_k_tuple_38)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 528; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_38);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_38));
-
- /* "View.MemoryView":643
- * if item is Ellipsis:
- * if not seen_ellipsis:
- * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
- * seen_ellipsis = True
- * else:
- */
- __pyx_k_tuple_41 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_41)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_41);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_41));
-
- /* "View.MemoryView":646
- * seen_ellipsis = True
- * else:
- * result.append(slice(None)) # <<<<<<<<<<<<<<
- * have_slices = True
- * else:
- */
- __pyx_k_tuple_42 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_42)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 646; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_42);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_42));
-
- /* "View.MemoryView":657
- * nslices = ndim - len(result)
- * if nslices:
- * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
- *
- * return have_slices or nslices, tuple(result)
- */
- __pyx_k_tuple_44 = PyTuple_Pack(1, Py_None); if (unlikely(!__pyx_k_tuple_44)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_44);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_44));
-
- /* "View.MemoryView":665
- * for i in range(ndim):
- * if suboffsets[i] >= 0:
- * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_46 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_45)); if (unlikely(!__pyx_k_tuple_46)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 665; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_46);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_46));
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":35
- * from bessel0 cimport j0Single, j0Multiple
- *
- * def j0(x): # <<<<<<<<<<<<<<
- * if hasattr(x, "__len__"):
- * return _besselMultiple(x)
- */
- __pyx_k_tuple_54 = PyTuple_Pack(1, ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_54)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_54);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_54));
- __pyx_k_codeobj_55 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__j0, 35, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_55)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":41
- * return _besselSingle(x)
- *
- * def _besselMultiple(x): # <<<<<<<<<<<<<<
- * result = numpy.array(x, copy=True, dtype=numpy.float64)
- * cdef double[:] c_x = result
- */
- __pyx_k_tuple_58 = PyTuple_Pack(4, ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__result), ((PyObject *)__pyx_n_s__c_x), ((PyObject *)__pyx_n_s__c_npts)); if (unlikely(!__pyx_k_tuple_58)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_58);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_58));
- __pyx_k_codeobj_59 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s___besselMultiple, 41, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_59)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":48
- * return result
- *
- * def _besselSingle(double x): # <<<<<<<<<<<<<<
- * return j0Single(x)
- *
- */
- __pyx_k_tuple_60 = PyTuple_Pack(2, ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__x)); if (unlikely(!__pyx_k_tuple_60)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_60);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_60));
- __pyx_k_codeobj_61 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_60, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s___besselSingle, 48, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_61)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":51
- * return j0Single(x)
- *
- * def polspl(x, y, w, npts, xl, xh, nr, nc): # <<<<<<<<<<<<<<
- * c = numpy.zeros((36,), dtype=numpy.float64)
- * cdef double[:] c_c = c
- */
- __pyx_k_tuple_62 = PyTuple_Pack(19, ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__y), ((PyObject *)__pyx_n_s__w), ((PyObject *)__pyx_n_s__npts), ((PyObject *)__pyx_n_s__xl), ((PyObject *)__pyx_n_s__xh), ((PyObject *)__pyx_n_s__nr), ((PyObject *)__pyx_n_s__nc), ((PyObject *)__pyx_n_s__c), ((PyObject *)__pyx_n_s__c_c), ((PyObject *)__pyx_n_s__c_x), ((PyObject *)__pyx_n_s__c_y), ((PyObject *)__pyx_n_s__c_w), ((PyObject *)__pyx_n_s__c_npts), ((PyObject *)__pyx_n_s__c_xl), ((PyObject *)__pyx_n_s__c_xh), ((PyObject *)__pyx_n_s__c_nr), ((PyObject *)__pyx_n_s__c_nc), ((PyObject *)__pyx_n_s__c_sizeC)); if (unlikely(!__pyx_k_tuple_62)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_62);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_62));
- __pyx_k_codeobj_63 = (PyObject*)__Pyx_PyCode_New(8, 0, 19, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_62, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__polspl, 51, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_63)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":73
- * return c
- *
- * def polspl2(x,y,w,npts,xl0,xh0,nr,nc): # <<<<<<<<<<<<<<
- *
- * # ;
- */
- __pyx_k_tuple_64 = PyTuple_Pack(36, ((PyObject *)__pyx_n_s__x), ((PyObject *)__pyx_n_s__y), ((PyObject *)__pyx_n_s__w), ((PyObject *)__pyx_n_s__npts), ((PyObject *)__pyx_n_s__xl0), ((PyObject *)__pyx_n_s__xh0), ((PyObject *)__pyx_n_s__nr), ((PyObject *)__pyx_n_s__nc), ((PyObject *)__pyx_n_s__buffer_xl0), ((PyObject *)__pyx_n_s__xl), ((PyObject *)__pyx_n_s__buffer_xh0), ((PyObject *)__pyx_n_s__xh), ((PyObject *)__pyx_n_s__df), ((PyObject *)__pyx_n_s__a), ((PyObject *)__pyx_n_s__nbs), ((PyObject *)__pyx_n_s__xk0), ((PyObject *)__pyx_n_s__xk), ((PyObject *)__pyx_n_s__c), ((PyObject *)__pyx_n_s__j), ((PyObject *)__pyx_n_s__i), ((PyObject *)__pyx_n_s__ne_idl), ((PyObject *)__pyx_n_s__n), ((PyObject *)__pyx_n_s__k), ((PyObject *)__pyx_n_s__ibl), ((PyObject *)__pyx_n_s__ns), ((PyObject *)__pyx_n_s__ns1), ((PyObject *)__pyx_n_s__t), ((PyObject *)__pyx_n_s__n1), ((PyObject *)__pyx_n_s__ncol), ((PyObject *)__pyx_n_s__nk), ((PyObject *)__pyx_n_s__ik), ((PyObject *)__pyx_n_s__i1), ((PyObject *)__pyx_n_s__nm1), ((PyObject *)__pyx_n_s__m), ((PyObject *)__pyx_n_s__ni), ((PyObject *)__pyx_n_s__ni1)); if (unlikely(!__pyx_k_tuple_64)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_64);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_64));
- __pyx_k_codeobj_65 = (PyObject*)__Pyx_PyCode_New(8, 0, 36, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_k_tuple_64, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_56, __pyx_n_s__polspl2, 73, __pyx_empty_bytes); if (unlikely(!__pyx_k_codeobj_65)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
-
- /* "View.MemoryView":282
- * return self.name
- *
- * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>")
- */
- __pyx_k_tuple_68 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_67)); if (unlikely(!__pyx_k_tuple_68)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_68);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_68));
-
- /* "View.MemoryView":283
- *
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
- * cdef indirect = Enum("<strided and indirect>")
- *
- */
- __pyx_k_tuple_70 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_69)); if (unlikely(!__pyx_k_tuple_70)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_70);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_70));
-
- /* "View.MemoryView":284
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_72 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_71)); if (unlikely(!__pyx_k_tuple_72)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_72);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_72));
-
- /* "View.MemoryView":287
- *
- *
- * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
- * cdef indirect_contiguous = Enum("<contiguous and indirect>")
- *
- */
- __pyx_k_tuple_74 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_73)); if (unlikely(!__pyx_k_tuple_74)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_74);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_74));
-
- /* "View.MemoryView":288
- *
- * cdef contiguous = Enum("<contiguous and direct>")
- * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_k_tuple_76 = PyTuple_Pack(1, ((PyObject *)__pyx_kp_s_75)); if (unlikely(!__pyx_k_tuple_76)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_k_tuple_76);
- __Pyx_GIVEREF(((PyObject *)__pyx_k_tuple_76));
- __Pyx_RefNannyFinishContext();
- return 0;
- __pyx_L1_error:;
- __Pyx_RefNannyFinishContext();
- return -1;
-}
-
-static int __Pyx_InitGlobals(void) {
- if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- return 0;
- __pyx_L1_error:;
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-PyMODINIT_FUNC init_xas(void); /*proto*/
-PyMODINIT_FUNC init_xas(void)
-#else
-PyMODINIT_FUNC PyInit__xas(void); /*proto*/
-PyMODINIT_FUNC PyInit__xas(void)
-#endif
-{
- PyObject *__pyx_t_1 = NULL;
- int __pyx_lineno = 0;
- const char *__pyx_filename = NULL;
- int __pyx_clineno = 0;
- __Pyx_RefNannyDeclarations
- #if CYTHON_REFNANNY
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
- if (!__Pyx_RefNanny) {
- PyErr_Clear();
- __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
- if (!__Pyx_RefNanny)
- Py_FatalError("failed to import 'refnanny' module");
- }
- #endif
- __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit__xas(void)", 0);
- if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #ifdef __Pyx_CyFunction_USED
- if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- #ifdef __Pyx_FusedFunction_USED
- if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- #ifdef __Pyx_Generator_USED
- if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- /*--- Library function declarations ---*/
- /*--- Threads initialization code ---*/
- #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
- #ifdef WITH_THREAD /* Python build with threading support? */
- PyEval_InitThreads();
- #endif
- #endif
- /*--- Module creation code ---*/
- #if PY_MAJOR_VERSION < 3
- __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_xas"), __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
- #else
- __pyx_m = PyModule_Create(&__pyx_moduledef);
- #endif
- if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- Py_INCREF(__pyx_d);
- #if PY_MAJOR_VERSION >= 3
- {
- PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (!PyDict_GetItemString(modules, "PyMca5.PyMcaPhysics.xas._xas")) {
- if (unlikely(PyDict_SetItemString(modules, "PyMca5.PyMcaPhysics.xas._xas", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- }
- }
- #endif
- __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if CYTHON_COMPILING_IN_PYPY
- Py_INCREF(__pyx_b);
- #endif
- if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- /*--- Initialize various global constants etc. ---*/
- if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
- if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- #endif
- if (__pyx_module_is_main_PyMca5__PyMcaPhysics__xas___xas) {
- if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s____main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
- }
- /*--- Builtin init code ---*/
- if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Constants init code ---*/
- if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Global init code ---*/
- generic = Py_None; Py_INCREF(Py_None);
- strided = Py_None; Py_INCREF(Py_None);
- indirect = Py_None; Py_INCREF(Py_None);
- contiguous = Py_None; Py_INCREF(Py_None);
- indirect_contiguous = Py_None; Py_INCREF(Py_None);
- /*--- Variable export code ---*/
- /*--- Function export code ---*/
- /*--- Type init code ---*/
- __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
- __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
- __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
- __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
- __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
- __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
- __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
- __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
- if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
- if (PyType_Ready(&__pyx_type___pyx_array) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 96; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_array_type = &__pyx_type___pyx_array;
- if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
- __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
- __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
- __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
- __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
- __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
- if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 927; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
- /*--- Type import code ---*/
- __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
- #if CYTHON_COMPILING_IN_PYPY
- sizeof(PyTypeObject),
- #else
- sizeof(PyHeapTypeObject),
- #endif
- 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- /*--- Variable import code ---*/
- /*--- Function import code ---*/
- /*--- Execution code ---*/
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":30
- * #############################################################################*[inserted by cython to avoid comment closer]/
- * cimport cython
- * import numpy # <<<<<<<<<<<<<<
- * cimport numpy
- * from polspl cimport polspl as _polspl
- */
- __pyx_t_1 = __Pyx_Import(((PyObject *)__pyx_n_s__numpy), 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__numpy, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":35
- * from bessel0 cimport j0Single, j0Multiple
- *
- * def j0(x): # <<<<<<<<<<<<<<
- * if hasattr(x, "__len__"):
- * return _besselMultiple(x)
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0, NULL, __pyx_n_s_57); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__j0, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":41
- * return _besselSingle(x)
- *
- * def _besselMultiple(x): # <<<<<<<<<<<<<<
- * result = numpy.array(x, copy=True, dtype=numpy.float64)
- * cdef double[:] c_x = result
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple, NULL, __pyx_n_s_57); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___besselMultiple, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 41; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":48
- * return result
- *
- * def _besselSingle(double x): # <<<<<<<<<<<<<<
- * return j0Single(x)
- *
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle, NULL, __pyx_n_s_57); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s___besselSingle, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 48; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":51
- * return j0Single(x)
- *
- * def polspl(x, y, w, npts, xl, xh, nr, nc): # <<<<<<<<<<<<<<
- * c = numpy.zeros((36,), dtype=numpy.float64)
- * cdef double[:] c_c = c
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl, NULL, __pyx_n_s_57); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__polspl, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":73
- * return c
- *
- * def polspl2(x,y,w,npts,xl0,xh0,nr,nc): # <<<<<<<<<<<<<<
- *
- * # ;
- */
- __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2, NULL, __pyx_n_s_57); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_d, __pyx_n_s__polspl2, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
-
- /* "C:\GIT\PYMCA_REFERENCE\pymca\PyMca5\PyMcaPhysics\xas\_xas\cython\_xas.pyx":1
- * #/[inserted by cython to avoid comment start]*########################################################################## # <<<<<<<<<<<<<<
- * #
- * # The PyMca X-Ray Fluorescence Toolkit
- */
- __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(((PyObject *)__pyx_t_1));
- if (PyDict_SetItem(__pyx_d, __pyx_n_s____test__, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
-
- /* "View.MemoryView":207
- * info.obj = self
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
- *
- * def __dealloc__(array self):
- */
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), __pyx_k_66); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_array_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_array_type);
-
- /* "View.MemoryView":282
- * return self.name
- *
- * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>")
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_68), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 282; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(generic);
- __Pyx_DECREF(generic);
- __Pyx_GIVEREF(__pyx_t_1);
- generic = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":283
- *
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
- * cdef indirect = Enum("<strided and indirect>")
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_70), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(strided);
- __Pyx_DECREF(strided);
- __Pyx_GIVEREF(__pyx_t_1);
- strided = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":284
- * cdef generic = Enum("<strided and direct or indirect>")
- * cdef strided = Enum("<strided and direct>") # default
- * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_72), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(indirect);
- __Pyx_DECREF(indirect);
- __Pyx_GIVEREF(__pyx_t_1);
- indirect = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":287
- *
- *
- * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
- * cdef indirect_contiguous = Enum("<contiguous and indirect>")
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_74), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 287; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(contiguous);
- __Pyx_DECREF(contiguous);
- __Pyx_GIVEREF(__pyx_t_1);
- contiguous = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":288
- *
- * cdef contiguous = Enum("<contiguous and direct>")
- * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject *)__pyx_MemviewEnum_type)), ((PyObject *)__pyx_k_tuple_76), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 288; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- __Pyx_XGOTREF(indirect_contiguous);
- __Pyx_DECREF(indirect_contiguous);
- __Pyx_GIVEREF(__pyx_t_1);
- indirect_contiguous = __pyx_t_1;
- __pyx_t_1 = 0;
-
- /* "View.MemoryView":503
- * info.obj = self
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_66); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_memoryview_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 503; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_memoryview_type);
-
- /* "View.MemoryView":958
- * return self.from_object
- *
- * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
- *
- *
- */
- __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), __pyx_k_66); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_GOTREF(__pyx_t_1);
- if (PyDict_SetItem(__pyx_memoryviewslice_type->tp_dict, __pyx_n_s____pyx_getbuffer, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 958; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
- __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
- PyType_Modified(__pyx_memoryviewslice_type);
-
- /* "View.MemoryView":1365
- *
- * @cname('__pyx_memoryview__slice_assign_scalar')
- * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
- * Py_ssize_t *strides, int ndim,
- * size_t itemsize, void *item) nogil:
- */
- goto __pyx_L0;
- __pyx_L1_error:;
- __Pyx_XDECREF(__pyx_t_1);
- if (__pyx_m) {
- __Pyx_AddTraceback("init PyMca5.PyMcaPhysics.xas._xas", __pyx_clineno, __pyx_lineno, __pyx_filename);
- Py_DECREF(__pyx_m); __pyx_m = 0;
- } else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_ImportError, "init PyMca5.PyMcaPhysics.xas._xas");
- }
- __pyx_L0:;
- __Pyx_RefNannyFinishContext();
- #if PY_MAJOR_VERSION < 3
- return;
- #else
- return __pyx_m;
- #endif
-}
-
-/* Runtime support code */
-#if CYTHON_REFNANNY
-static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
- PyObject *m = NULL, *p = NULL;
- void *r = NULL;
- m = PyImport_ImportModule((char *)modname);
- if (!m) goto end;
- p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
- if (!p) goto end;
- r = PyLong_AsVoidPtr(p);
-end:
- Py_XDECREF(p);
- Py_XDECREF(m);
- return (__Pyx_RefNannyAPIStruct *)r;
-}
-#endif /* CYTHON_REFNANNY */
-
-static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
- PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
- if (unlikely(!result)) {
- PyErr_Format(PyExc_NameError,
-#if PY_MAJOR_VERSION >= 3
- "name '%U' is not defined", name);
-#else
- "name '%s' is not defined", PyString_AS_STRING(name));
-#endif
- }
- return result;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
- PyObject *result;
-#if CYTHON_COMPILING_IN_CPYTHON
- result = PyDict_GetItem(__pyx_d, name);
- if (result) {
- Py_INCREF(result);
- } else {
-#else
- result = PyObject_GetItem(__pyx_d, name);
- if (!result) {
- PyErr_Clear();
-#endif
- result = __Pyx_GetBuiltinName(name);
- }
- return result;
-}
-
-static void __Pyx_RaiseBufferIndexError(int axis) {
- PyErr_Format(PyExc_IndexError,
- "Out of bounds on buffer access (axis %d)", axis);
-}
-
-static CYTHON_INLINE int __Pyx_IsLittleEndian(void) {
- unsigned int n = 1;
- return *(unsigned char*)(&n) != 0;
-}
-static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
- __Pyx_BufFmt_StackElem* stack,
- __Pyx_TypeInfo* type) {
- stack[0].field = &ctx->root;
- stack[0].parent_offset = 0;
- ctx->root.type = type;
- ctx->root.name = "buffer dtype";
- ctx->root.offset = 0;
- ctx->head = stack;
- ctx->head->field = &ctx->root;
- ctx->fmt_offset = 0;
- ctx->head->parent_offset = 0;
- ctx->new_packmode = '@';
- ctx->enc_packmode = '@';
- ctx->new_count = 1;
- ctx->enc_count = 0;
- ctx->enc_type = 0;
- ctx->is_complex = 0;
- ctx->is_valid_array = 0;
- ctx->struct_alignment = 0;
- while (type->typegroup == 'S') {
- ++ctx->head;
- ctx->head->field = type->fields;
- ctx->head->parent_offset = 0;
- type = type->fields->type;
- }
-}
-static int __Pyx_BufFmt_ParseNumber(const char** ts) {
- int count;
- const char* t = *ts;
- if (*t < '0' || *t > '9') {
- return -1;
- } else {
- count = *t++ - '0';
- while (*t >= '0' && *t < '9') {
- count *= 10;
- count += *t++ - '0';
- }
- }
- *ts = t;
- return count;
-}
-static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
- int number = __Pyx_BufFmt_ParseNumber(ts);
- if (number == -1) /* First char was not a digit */
- PyErr_Format(PyExc_ValueError,\
- "Does not understand character buffer dtype format string ('%c')", **ts);
- return number;
-}
-static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
- PyErr_Format(PyExc_ValueError,
- "Unexpected format string character: '%c'", ch);
-}
-static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
- switch (ch) {
- case 'c': return "'char'";
- case 'b': return "'signed char'";
- case 'B': return "'unsigned char'";
- case 'h': return "'short'";
- case 'H': return "'unsigned short'";
- case 'i': return "'int'";
- case 'I': return "'unsigned int'";
- case 'l': return "'long'";
- case 'L': return "'unsigned long'";
- case 'q': return "'long long'";
- case 'Q': return "'unsigned long long'";
- case 'f': return (is_complex ? "'complex float'" : "'float'");
- case 'd': return (is_complex ? "'complex double'" : "'double'");
- case 'g': return (is_complex ? "'complex long double'" : "'long double'");
- case 'T': return "a struct";
- case 'O': return "Python object";
- case 'P': return "a pointer";
- case 's': case 'p': return "a string";
- case 0: return "end";
- default: return "unparseable format string";
- }
-}
-static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
- switch (ch) {
- case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return 2;
- case 'i': case 'I': case 'l': case 'L': return 4;
- case 'q': case 'Q': return 8;
- case 'f': return (is_complex ? 8 : 4);
- case 'd': return (is_complex ? 16 : 8);
- case 'g': {
- PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
- return 0;
- }
- case 'O': case 'P': return sizeof(void*);
- default:
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
-}
-static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
- switch (ch) {
- case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return sizeof(short);
- case 'i': case 'I': return sizeof(int);
- case 'l': case 'L': return sizeof(long);
- #ifdef HAVE_LONG_LONG
- case 'q': case 'Q': return sizeof(PY_LONG_LONG);
- #endif
- case 'f': return sizeof(float) * (is_complex ? 2 : 1);
- case 'd': return sizeof(double) * (is_complex ? 2 : 1);
- case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
- case 'O': case 'P': return sizeof(void*);
- default: {
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
- }
-}
-typedef struct { char c; short x; } __Pyx_st_short;
-typedef struct { char c; int x; } __Pyx_st_int;
-typedef struct { char c; long x; } __Pyx_st_long;
-typedef struct { char c; float x; } __Pyx_st_float;
-typedef struct { char c; double x; } __Pyx_st_double;
-typedef struct { char c; long double x; } __Pyx_st_longdouble;
-typedef struct { char c; void *x; } __Pyx_st_void_p;
-#ifdef HAVE_LONG_LONG
-typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
-#endif
-static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
- switch (ch) {
- case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
- case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
- case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
-#ifdef HAVE_LONG_LONG
- case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
-#endif
- case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
- case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
- case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
- case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
- default:
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
-}
-/* These are for computing the padding at the end of the struct to align
- on the first member of the struct. This will probably the same as above,
- but we don't have any guarantees.
- */
-typedef struct { short x; char c; } __Pyx_pad_short;
-typedef struct { int x; char c; } __Pyx_pad_int;
-typedef struct { long x; char c; } __Pyx_pad_long;
-typedef struct { float x; char c; } __Pyx_pad_float;
-typedef struct { double x; char c; } __Pyx_pad_double;
-typedef struct { long double x; char c; } __Pyx_pad_longdouble;
-typedef struct { void *x; char c; } __Pyx_pad_void_p;
-#ifdef HAVE_LONG_LONG
-typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
-#endif
-static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
- switch (ch) {
- case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
- case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
- case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
- case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
-#ifdef HAVE_LONG_LONG
- case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
-#endif
- case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
- case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
- case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
- case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
- default:
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
-}
-static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
- switch (ch) {
- case 'c':
- return 'H';
- case 'b': case 'h': case 'i':
- case 'l': case 'q': case 's': case 'p':
- return 'I';
- case 'B': case 'H': case 'I': case 'L': case 'Q':
- return 'U';
- case 'f': case 'd': case 'g':
- return (is_complex ? 'C' : 'R');
- case 'O':
- return 'O';
- case 'P':
- return 'P';
- default: {
- __Pyx_BufFmt_RaiseUnexpectedChar(ch);
- return 0;
- }
- }
-}
-static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
- if (ctx->head == NULL || ctx->head->field == &ctx->root) {
- const char* expected;
- const char* quote;
- if (ctx->head == NULL) {
- expected = "end";
- quote = "";
- } else {
- expected = ctx->head->field->type->name;
- quote = "'";
- }
- PyErr_Format(PyExc_ValueError,
- "Buffer dtype mismatch, expected %s%s%s but got %s",
- quote, expected, quote,
- __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
- } else {
- __Pyx_StructField* field = ctx->head->field;
- __Pyx_StructField* parent = (ctx->head - 1)->field;
- PyErr_Format(PyExc_ValueError,
- "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
- field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
- parent->type->name, field->name);
- }
-}
-static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
- char group;
- size_t size, offset, arraysize = 1;
- if (ctx->enc_type == 0) return 0;
- if (ctx->head->field->type->arraysize[0]) {
- int i, ndim = 0;
- if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
- ctx->is_valid_array = ctx->head->field->type->ndim == 1;
- ndim = 1;
- if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
- PyErr_Format(PyExc_ValueError,
- "Expected a dimension of size %zu, got %zu",
- ctx->head->field->type->arraysize[0], ctx->enc_count);
- return -1;
- }
- }
- if (!ctx->is_valid_array) {
- PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
- ctx->head->field->type->ndim, ndim);
- return -1;
- }
- for (i = 0; i < ctx->head->field->type->ndim; i++) {
- arraysize *= ctx->head->field->type->arraysize[i];
- }
- ctx->is_valid_array = 0;
- ctx->enc_count = 1;
- }
- group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
- do {
- __Pyx_StructField* field = ctx->head->field;
- __Pyx_TypeInfo* type = field->type;
- if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
- size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
- } else {
- size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
- }
- if (ctx->enc_packmode == '@') {
- size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
- size_t align_mod_offset;
- if (align_at == 0) return -1;
- align_mod_offset = ctx->fmt_offset % align_at;
- if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
- if (ctx->struct_alignment == 0)
- ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
- ctx->is_complex);
- }
- if (type->size != size || type->typegroup != group) {
- if (type->typegroup == 'C' && type->fields != NULL) {
- size_t parent_offset = ctx->head->parent_offset + field->offset;
- ++ctx->head;
- ctx->head->field = type->fields;
- ctx->head->parent_offset = parent_offset;
- continue;
- }
- if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
- } else {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return -1;
- }
- }
- offset = ctx->head->parent_offset + field->offset;
- if (ctx->fmt_offset != offset) {
- PyErr_Format(PyExc_ValueError,
- "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
- (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
- return -1;
- }
- ctx->fmt_offset += size;
- if (arraysize)
- ctx->fmt_offset += (arraysize - 1) * size;
- --ctx->enc_count; /* Consume from buffer string */
- while (1) {
- if (field == &ctx->root) {
- ctx->head = NULL;
- if (ctx->enc_count != 0) {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return -1;
- }
- break; /* breaks both loops as ctx->enc_count == 0 */
- }
- ctx->head->field = ++field;
- if (field->type == NULL) {
- --ctx->head;
- field = ctx->head->field;
- continue;
- } else if (field->type->typegroup == 'S') {
- size_t parent_offset = ctx->head->parent_offset + field->offset;
- if (field->type->fields->type == NULL) continue; /* empty struct */
- field = field->type->fields;
- ++ctx->head;
- ctx->head->field = field;
- ctx->head->parent_offset = parent_offset;
- break;
- } else {
- break;
- }
- }
- } while (ctx->enc_count);
- ctx->enc_type = 0;
- ctx->is_complex = 0;
- return 0;
-}
-static CYTHON_INLINE PyObject *
-__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
-{
- const char *ts = *tsp;
- int i = 0, number;
- int ndim = ctx->head->field->type->ndim;
-;
- ++ts;
- if (ctx->new_count != 1) {
- PyErr_SetString(PyExc_ValueError,
- "Cannot handle repeated arrays in format string");
- return NULL;
- }
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- while (*ts && *ts != ')') {
- if (isspace(*ts))
- continue;
- number = __Pyx_BufFmt_ExpectNumber(&ts);
- if (number == -1) return NULL;
- if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
- return PyErr_Format(PyExc_ValueError,
- "Expected a dimension of size %zu, got %d",
- ctx->head->field->type->arraysize[i], number);
- if (*ts != ',' && *ts != ')')
- return PyErr_Format(PyExc_ValueError,
- "Expected a comma in format string, got '%c'", *ts);
- if (*ts == ',') ts++;
- i++;
- }
- if (i != ndim)
- return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
- ctx->head->field->type->ndim, i);
- if (!*ts) {
- PyErr_SetString(PyExc_ValueError,
- "Unexpected end of format string, expected ')'");
- return NULL;
- }
- ctx->is_valid_array = 1;
- ctx->new_count = 1;
- *tsp = ++ts;
- return Py_None;
-}
-static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
- int got_Z = 0;
- while (1) {
- switch(*ts) {
- case 0:
- if (ctx->enc_type != 0 && ctx->head == NULL) {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return NULL;
- }
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- if (ctx->head != NULL) {
- __Pyx_BufFmt_RaiseExpected(ctx);
- return NULL;
- }
- return ts;
- case ' ':
- case 10:
- case 13:
- ++ts;
- break;
- case '<':
- if (!__Pyx_IsLittleEndian()) {
- PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
- return NULL;
- }
- ctx->new_packmode = '=';
- ++ts;
- break;
- case '>':
- case '!':
- if (__Pyx_IsLittleEndian()) {
- PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
- return NULL;
- }
- ctx->new_packmode = '=';
- ++ts;
- break;
- case '=':
- case '@':
- case '^':
- ctx->new_packmode = *ts++;
- break;
- case 'T': /* substruct */
- {
- const char* ts_after_sub;
- size_t i, struct_count = ctx->new_count;
- size_t struct_alignment = ctx->struct_alignment;
- ctx->new_count = 1;
- ++ts;
- if (*ts != '{') {
- PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
- return NULL;
- }
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->enc_type = 0; /* Erase processed last struct element */
- ctx->enc_count = 0;
- ctx->struct_alignment = 0;
- ++ts;
- ts_after_sub = ts;
- for (i = 0; i != struct_count; ++i) {
- ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
- if (!ts_after_sub) return NULL;
- }
- ts = ts_after_sub;
- if (struct_alignment) ctx->struct_alignment = struct_alignment;
- }
- break;
- case '}': /* end of substruct; either repeat or move on */
- {
- size_t alignment = ctx->struct_alignment;
- ++ts;
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->enc_type = 0; /* Erase processed last struct element */
- if (alignment && ctx->fmt_offset % alignment) {
- ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
- }
- }
- return ts;
- case 'x':
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->fmt_offset += ctx->new_count;
- ctx->new_count = 1;
- ctx->enc_count = 0;
- ctx->enc_type = 0;
- ctx->enc_packmode = ctx->new_packmode;
- ++ts;
- break;
- case 'Z':
- got_Z = 1;
- ++ts;
- if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
- __Pyx_BufFmt_RaiseUnexpectedChar('Z');
- return NULL;
- } /* fall through */
- case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
- case 'l': case 'L': case 'q': case 'Q':
- case 'f': case 'd': case 'g':
- case 'O': case 's': case 'p':
- if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
- ctx->enc_packmode == ctx->new_packmode) {
- ctx->enc_count += ctx->new_count;
- } else {
- if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
- ctx->enc_count = ctx->new_count;
- ctx->enc_packmode = ctx->new_packmode;
- ctx->enc_type = *ts;
- ctx->is_complex = got_Z;
- }
- ++ts;
- ctx->new_count = 1;
- got_Z = 0;
- break;
- case ':':
- ++ts;
- while(*ts != ':') ++ts;
- ++ts;
- break;
- case '(':
- if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
- break;
- default:
- {
- int number = __Pyx_BufFmt_ExpectNumber(&ts);
- if (number == -1) return NULL;
- ctx->new_count = (size_t)number;
- }
- }
- }
-}
-static CYTHON_INLINE void __Pyx_ZeroBuffer(Py_buffer* buf) {
- buf->buf = NULL;
- buf->obj = NULL;
- buf->strides = __Pyx_zeros;
- buf->shape = __Pyx_zeros;
- buf->suboffsets = __Pyx_minusones;
-}
-static CYTHON_INLINE int __Pyx_GetBufferAndValidate(
- Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
- int nd, int cast, __Pyx_BufFmt_StackElem* stack)
-{
- if (obj == Py_None || obj == NULL) {
- __Pyx_ZeroBuffer(buf);
- return 0;
- }
- buf->buf = NULL;
- if (__Pyx_GetBuffer(obj, buf, flags) == -1) goto fail;
- if (buf->ndim != nd) {
- PyErr_Format(PyExc_ValueError,
- "Buffer has wrong number of dimensions (expected %d, got %d)",
- nd, buf->ndim);
- goto fail;
- }
- if (!cast) {
- __Pyx_BufFmt_Context ctx;
- __Pyx_BufFmt_Init(&ctx, stack, dtype);
- if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
- }
- if ((unsigned)buf->itemsize != dtype->size) {
- PyErr_Format(PyExc_ValueError,
- "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
- buf->itemsize, (buf->itemsize > 1) ? "s" : "",
- dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
- goto fail;
- }
- if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
- return 0;
-fail:;
- __Pyx_ZeroBuffer(buf);
- return -1;
-}
-static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
- if (info->buf == NULL) return;
- if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
- __Pyx_ReleaseBuffer(info);
-}
-
-static int
-__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
- int ndim,
- __Pyx_memviewslice *memviewslice,
- int memview_is_new_reference)
-{
- __Pyx_RefNannyDeclarations
- int i, retval=-1;
- Py_buffer *buf = &memview->view;
- __Pyx_RefNannySetupContext("init_memviewslice", 0);
- if (!buf) {
- PyErr_SetString(PyExc_ValueError,
- "buf is NULL.");
- goto fail;
- } else if (memviewslice->memview || memviewslice->data) {
- PyErr_SetString(PyExc_ValueError,
- "memviewslice is already initialized!");
- goto fail;
- }
- if (buf->strides) {
- for (i = 0; i < ndim; i++) {
- memviewslice->strides[i] = buf->strides[i];
- }
- } else {
- Py_ssize_t stride = buf->itemsize;
- for (i = ndim - 1; i >= 0; i--) {
- memviewslice->strides[i] = stride;
- stride *= buf->shape[i];
- }
- }
- for (i = 0; i < ndim; i++) {
- memviewslice->shape[i] = buf->shape[i];
- if (buf->suboffsets) {
- memviewslice->suboffsets[i] = buf->suboffsets[i];
- } else {
- memviewslice->suboffsets[i] = -1;
- }
- }
- memviewslice->memview = memview;
- memviewslice->data = (char *)buf->buf;
- if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
- Py_INCREF(memview);
- }
- retval = 0;
- goto no_fail;
-fail:
- memviewslice->memview = 0;
- memviewslice->data = 0;
- retval = -1;
-no_fail:
- __Pyx_RefNannyFinishContext();
- return retval;
-}
-static CYTHON_INLINE void __pyx_fatalerror(const char *fmt, ...) {
- va_list vargs;
- char msg[200];
- va_start(vargs, fmt);
-#ifdef HAVE_STDARG_PROTOTYPES
- va_start(vargs, fmt);
-#else
- va_start(vargs);
-#endif
- vsnprintf(msg, 200, fmt, vargs);
- Py_FatalError(msg);
- va_end(vargs);
-}
-static CYTHON_INLINE int
-__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
- PyThread_type_lock lock)
-{
- int result;
- PyThread_acquire_lock(lock, 1);
- result = (*acquisition_count)++;
- PyThread_release_lock(lock);
- return result;
-}
-static CYTHON_INLINE int
-__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
- PyThread_type_lock lock)
-{
- int result;
- PyThread_acquire_lock(lock, 1);
- result = (*acquisition_count)--;
- PyThread_release_lock(lock);
- return result;
-}
-static CYTHON_INLINE void
-__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
-{
- int first_time;
- struct __pyx_memoryview_obj *memview = memslice->memview;
- if (!memview || (PyObject *) memview == Py_None)
- return; /* allow uninitialized memoryview assignment */
- if (__pyx_get_slice_count(memview) < 0)
- __pyx_fatalerror("Acquisition count is %d (line %d)",
- __pyx_get_slice_count(memview), lineno);
- first_time = __pyx_add_acquisition_count(memview) == 0;
- if (first_time) {
- if (have_gil) {
- Py_INCREF((PyObject *) memview);
- } else {
- PyGILState_STATE _gilstate = PyGILState_Ensure();
- Py_INCREF((PyObject *) memview);
- PyGILState_Release(_gilstate);
- }
- }
-}
-static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
- int have_gil, int lineno) {
- int last_time;
- struct __pyx_memoryview_obj *memview = memslice->memview;
- if (!memview ) {
- return;
- } else if ((PyObject *) memview == Py_None) {
- memslice->memview = NULL;
- return;
- }
- if (__pyx_get_slice_count(memview) <= 0)
- __pyx_fatalerror("Acquisition count is %d (line %d)",
- __pyx_get_slice_count(memview), lineno);
- last_time = __pyx_sub_acquisition_count(memview) == 1;
- memslice->data = NULL;
- if (last_time) {
- if (have_gil) {
- Py_CLEAR(memslice->memview);
- } else {
- PyGILState_STATE _gilstate = PyGILState_Ensure();
- Py_CLEAR(memslice->memview);
- PyGILState_Release(_gilstate);
- }
- } else {
- memslice->memview = NULL;
- }
-}
-
-static void __Pyx_RaiseArgtupleInvalid(
- const char* func_name,
- int exact,
- Py_ssize_t num_min,
- Py_ssize_t num_max,
- Py_ssize_t num_found)
-{
- Py_ssize_t num_expected;
- const char *more_or_less;
- if (num_found < num_min) {
- num_expected = num_min;
- more_or_less = "at least";
- } else {
- num_expected = num_max;
- more_or_less = "at most";
- }
- if (exact) {
- more_or_less = "exactly";
- }
- PyErr_Format(PyExc_TypeError,
- "%s() takes %s %" CYTHON_FORMAT_SSIZE_T "d positional argument%s (%" CYTHON_FORMAT_SSIZE_T "d given)",
- func_name, more_or_less, num_expected,
- (num_expected == 1) ? "" : "s", num_found);
-}
-
-static void __Pyx_RaiseDoubleKeywordsError(
- const char* func_name,
- PyObject* kw_name)
-{
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION >= 3
- "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
- #else
- "%s() got multiple values for keyword argument '%s'", func_name,
- PyString_AsString(kw_name));
- #endif
-}
-
-static int __Pyx_ParseOptionalKeywords(
- PyObject *kwds,
- PyObject **argnames[],
- PyObject *kwds2,
- PyObject *values[],
- Py_ssize_t num_pos_args,
- const char* function_name)
-{
- PyObject *key = 0, *value = 0;
- Py_ssize_t pos = 0;
- PyObject*** name;
- PyObject*** first_kw_arg = argnames + num_pos_args;
- while (PyDict_Next(kwds, &pos, &key, &value)) {
- name = first_kw_arg;
- while (*name && (**name != key)) name++;
- if (*name) {
- values[name-argnames] = value;
- continue;
- }
- name = first_kw_arg;
- #if PY_MAJOR_VERSION < 3
- if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
- while (*name) {
- if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
- && _PyString_Eq(**name, key)) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- if ((**argname == key) || (
- (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
- && _PyString_Eq(**argname, key))) {
- goto arg_passed_twice;
- }
- argname++;
- }
- }
- } else
- #endif
- if (likely(PyUnicode_Check(key))) {
- while (*name) {
- int cmp = (**name == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**name, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) {
- values[name-argnames] = value;
- break;
- }
- name++;
- }
- if (*name) continue;
- else {
- PyObject*** argname = argnames;
- while (argname != first_kw_arg) {
- int cmp = (**argname == key) ? 0 :
- #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
- (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
- #endif
- PyUnicode_Compare(**argname, key);
- if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
- if (cmp == 0) goto arg_passed_twice;
- argname++;
- }
- }
- } else
- goto invalid_keyword_type;
- if (kwds2) {
- if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
- } else {
- goto invalid_keyword;
- }
- }
- return 0;
-arg_passed_twice:
- __Pyx_RaiseDoubleKeywordsError(function_name, key);
- goto bad;
-invalid_keyword_type:
- PyErr_Format(PyExc_TypeError,
- "%s() keywords must be strings", function_name);
- goto bad;
-invalid_keyword:
- PyErr_Format(PyExc_TypeError,
- #if PY_MAJOR_VERSION < 3
- "%s() got an unexpected keyword argument '%s'",
- function_name, PyString_AsString(key));
- #else
- "%s() got an unexpected keyword argument '%U'",
- function_name, key);
- #endif
-bad:
- return -1;
-}
-
-static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
- if (unlikely(!type)) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (likely(PyObject_TypeCheck(obj, type)))
- return 1;
- PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
- Py_TYPE(obj)->tp_name, type->tp_name);
- return 0;
-}
-
-static CYTHON_INLINE int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
- int r;
- if (!j) return -1;
- r = PyObject_SetItem(o, j, v);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
- if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
- PyObject* old = PyList_GET_ITEM(o, n);
- Py_INCREF(v);
- PyList_SET_ITEM(o, n, v);
- Py_DECREF(old);
- return 1;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_ass_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- return -1;
- }
- }
- return m->sq_ass_item(o, i, v);
- }
- }
-#else
-#if CYTHON_COMPILING_IN_PYPY
- if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
-#else
- if (is_list || PySequence_Check(o)) {
-#endif
- return PySequence_SetItem(o, i, v);
- }
-#endif
- return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
- PyObject *r;
- if (!j) return NULL;
- r = PyObject_GetItem(o, j);
- Py_DECREF(j);
- return r;
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
- PyObject *r = PyList_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
- int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, i);
- Py_INCREF(r);
- return r;
- }
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-#else
- return PySequence_GetItem(o, i);
-#endif
-}
-static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
- int is_list, int wraparound, int boundscheck) {
-#if CYTHON_COMPILING_IN_CPYTHON
- if (is_list || PyList_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
- if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
- PyObject *r = PyList_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- }
- else if (PyTuple_CheckExact(o)) {
- Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
- if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
- PyObject *r = PyTuple_GET_ITEM(o, n);
- Py_INCREF(r);
- return r;
- }
- } else {
- PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
- if (likely(m && m->sq_item)) {
- if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
- Py_ssize_t l = m->sq_length(o);
- if (likely(l >= 0)) {
- i += l;
- } else {
- if (PyErr_ExceptionMatches(PyExc_OverflowError))
- PyErr_Clear();
- else
- return NULL;
- }
- }
- return m->sq_item(o, i);
- }
- }
-#else
- if (is_list || PySequence_Check(o)) {
- return PySequence_GetItem(o, i);
- }
-#endif
- return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
-}
-
-static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- tmp_type = tstate->curexc_type;
- tmp_value = tstate->curexc_value;
- tmp_tb = tstate->curexc_traceback;
- tstate->curexc_type = type;
- tstate->curexc_value = value;
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_Restore(type, value, tb);
-#endif
-}
-static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- *type = tstate->curexc_type;
- *value = tstate->curexc_value;
- *tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(type, value, tb);
-#endif
-}
-
-#if PY_MAJOR_VERSION < 3
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
- CYTHON_UNUSED PyObject *cause) {
- Py_XINCREF(type);
- if (!value || value == Py_None)
- value = NULL;
- else
- Py_INCREF(value);
- if (!tb || tb == Py_None)
- tb = NULL;
- else {
- Py_INCREF(tb);
- if (!PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto raise_error;
- }
- }
- #if PY_VERSION_HEX < 0x02050000
- if (PyClass_Check(type)) {
- #else
- if (PyType_Check(type)) {
- #endif
-#if CYTHON_COMPILING_IN_PYPY
- if (!value) {
- Py_INCREF(Py_None);
- value = Py_None;
- }
-#endif
- PyErr_NormalizeException(&type, &value, &tb);
- } else {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto raise_error;
- }
- value = type;
- #if PY_VERSION_HEX < 0x02050000
- if (PyInstance_Check(type)) {
- type = (PyObject*) ((PyInstanceObject*)type)->in_class;
- Py_INCREF(type);
- } else {
- type = 0;
- PyErr_SetString(PyExc_TypeError,
- "raise: exception must be an old-style class or instance");
- goto raise_error;
- }
- #else
- type = (PyObject*) Py_TYPE(type);
- Py_INCREF(type);
- if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto raise_error;
- }
- #endif
- }
- __Pyx_ErrRestore(type, value, tb);
- return;
-raise_error:
- Py_XDECREF(value);
- Py_XDECREF(type);
- Py_XDECREF(tb);
- return;
-}
-#else /* Python 3+ */
-static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
- PyObject* owned_instance = NULL;
- if (tb == Py_None) {
- tb = 0;
- } else if (tb && !PyTraceBack_Check(tb)) {
- PyErr_SetString(PyExc_TypeError,
- "raise: arg 3 must be a traceback or None");
- goto bad;
- }
- if (value == Py_None)
- value = 0;
- if (PyExceptionInstance_Check(type)) {
- if (value) {
- PyErr_SetString(PyExc_TypeError,
- "instance exception may not have a separate value");
- goto bad;
- }
- value = type;
- type = (PyObject*) Py_TYPE(value);
- } else if (PyExceptionClass_Check(type)) {
- PyObject *args;
- if (!value)
- args = PyTuple_New(0);
- else if (PyTuple_Check(value)) {
- Py_INCREF(value);
- args = value;
- } else
- args = PyTuple_Pack(1, value);
- if (!args)
- goto bad;
- owned_instance = PyEval_CallObject(type, args);
- Py_DECREF(args);
- if (!owned_instance)
- goto bad;
- value = owned_instance;
- if (!PyExceptionInstance_Check(value)) {
- PyErr_Format(PyExc_TypeError,
- "calling %R should have returned an instance of "
- "BaseException, not %R",
- type, Py_TYPE(value));
- goto bad;
- }
- } else {
- PyErr_SetString(PyExc_TypeError,
- "raise: exception class must be a subclass of BaseException");
- goto bad;
- }
-#if PY_VERSION_HEX >= 0x03030000
- if (cause) {
-#else
- if (cause && cause != Py_None) {
-#endif
- PyObject *fixed_cause;
- if (cause == Py_None) {
- fixed_cause = NULL;
- } else if (PyExceptionClass_Check(cause)) {
- fixed_cause = PyObject_CallObject(cause, NULL);
- if (fixed_cause == NULL)
- goto bad;
- } else if (PyExceptionInstance_Check(cause)) {
- fixed_cause = cause;
- Py_INCREF(fixed_cause);
- } else {
- PyErr_SetString(PyExc_TypeError,
- "exception causes must derive from "
- "BaseException");
- goto bad;
- }
- PyException_SetCause(value, fixed_cause);
- }
- PyErr_SetObject(type, value);
- if (tb) {
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* tmp_tb = tstate->curexc_traceback;
- if (tb != tmp_tb) {
- Py_INCREF(tb);
- tstate->curexc_traceback = tb;
- Py_XDECREF(tmp_tb);
- }
- }
-bad:
- Py_XDECREF(owned_instance);
- return;
-}
-#endif
-
-static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
- PyErr_Format(PyExc_ValueError,
- "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
- PyErr_Format(PyExc_ValueError,
- "need more than %" CYTHON_FORMAT_SSIZE_T "d value%s to unpack",
- index, (index == 1) ? "" : "s");
-}
-
-static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
- PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
-}
-
-static CYTHON_INLINE int __Pyx_IterFinish(void) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- PyObject* exc_type = tstate->curexc_type;
- if (unlikely(exc_type)) {
- if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
- PyObject *exc_value, *exc_tb;
- exc_value = tstate->curexc_value;
- exc_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
- Py_DECREF(exc_type);
- Py_XDECREF(exc_value);
- Py_XDECREF(exc_tb);
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#else
- if (unlikely(PyErr_Occurred())) {
- if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
- PyErr_Clear();
- return 0;
- } else {
- return -1;
- }
- }
- return 0;
-#endif
-}
-
-static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
- if (unlikely(retval)) {
- Py_DECREF(retval);
- __Pyx_RaiseTooManyValuesError(expected);
- return -1;
- } else {
- return __Pyx_IterFinish();
- }
- return 0;
-}
-
-static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
- const char *name, int exact)
-{
- if (!type) {
- PyErr_Format(PyExc_SystemError, "Missing type object");
- return 0;
- }
- if (none_allowed && obj == Py_None) return 1;
- else if (exact) {
- if (Py_TYPE(obj) == type) return 1;
- }
- else {
- if (PyObject_TypeCheck(obj, type)) return 1;
- }
- PyErr_Format(PyExc_TypeError,
- "Argument '%s' has incorrect type (expected %s, got %s)",
- name, type->tp_name, Py_TYPE(obj)->tp_name);
- return 0;
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
-#if CYTHON_COMPILING_IN_CPYTHON
-#if PY_MAJOR_VERSION >= 3
- if (likely(PyUnicode_Check(n)))
-#else
- if (likely(PyString_Check(n)))
-#endif
- return __Pyx_PyObject_GetAttrStr(o, n);
-#endif
- return PyObject_GetAttr(o, n);
-}
-
-static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
- PyObject *r = __Pyx_GetAttr(o, n);
- if (!r) {
- if (!PyErr_ExceptionMatches(PyExc_AttributeError))
- goto bad;
- PyErr_Clear();
- r = d;
- Py_INCREF(d);
- }
- return r;
-bad:
- return NULL;
-}
-
-static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
- Py_ssize_t q = a / b;
- Py_ssize_t r = a - q*b;
- q -= ((r != 0) & ((r ^ b) < 0));
- return q;
-}
-
-static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
-#if CYTHON_COMPILING_IN_PYPY
- return PyObject_RichCompareBool(s1, s2, equals);
-#else
- if (s1 == s2) {
- return (equals == Py_EQ);
- } else if (PyUnicode_CheckExact(s1) & PyUnicode_CheckExact(s2)) {
- #if CYTHON_PEP393_ENABLED
- if ((PyUnicode_READY(s1) < 0) || (PyUnicode_READY(s2) < 0))
- return -1;
- if (PyUnicode_GET_LENGTH(s1) != PyUnicode_GET_LENGTH(s2)) {
- return (equals == Py_NE);
- } else if (PyUnicode_GET_LENGTH(s1) == 1) {
- Py_UCS4 ch1 = PyUnicode_READ_CHAR(s1, 0);
- Py_UCS4 ch2 = PyUnicode_READ_CHAR(s2, 0);
- return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
- #else
- if (PyUnicode_GET_SIZE(s1) != PyUnicode_GET_SIZE(s2)) {
- return (equals == Py_NE);
- } else if (PyUnicode_GET_SIZE(s1) == 1) {
- Py_UNICODE ch1 = PyUnicode_AS_UNICODE(s1)[0];
- Py_UNICODE ch2 = PyUnicode_AS_UNICODE(s2)[0];
- return (equals == Py_EQ) ? (ch1 == ch2) : (ch1 != ch2);
- #endif
- } else {
- int result = PyUnicode_Compare(s1, s2);
- if ((result == -1) && unlikely(PyErr_Occurred()))
- return -1;
- return (equals == Py_EQ) ? (result == 0) : (result != 0);
- }
- } else if ((s1 == Py_None) & PyUnicode_CheckExact(s2)) {
- return (equals == Py_NE);
- } else if ((s2 == Py_None) & PyUnicode_CheckExact(s1)) {
- return (equals == Py_NE);
- } else {
- int result;
- PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
- if (!py_result)
- return -1;
- result = __Pyx_PyObject_IsTrue(py_result);
- Py_DECREF(py_result);
- return result;
- }
-#endif
-}
-
-static CYTHON_INLINE PyObject* __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)) {
- Py_ssize_t length;
- if (unlikely((start < 0) | (stop < 0))) {
- length = strlen(cstring);
- if (start < 0) {
- start += length;
- if (start < 0)
- start = 0;
- }
- if (stop < 0)
- stop += length;
- }
- length = stop - start;
- if (unlikely(length <= 0))
- return PyUnicode_FromUnicode(NULL, 0);
- cstring += start;
- if (decode_func) {
- return decode_func(cstring, length, errors);
- } else {
- return PyUnicode_Decode(cstring, length, encoding, errors);
- }
-}
-
-static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
- PyObject *local_type, *local_value, *local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- local_type = tstate->curexc_type;
- local_value = tstate->curexc_value;
- local_tb = tstate->curexc_traceback;
- tstate->curexc_type = 0;
- tstate->curexc_value = 0;
- tstate->curexc_traceback = 0;
-#else
- PyErr_Fetch(&local_type, &local_value, &local_tb);
-#endif
- PyErr_NormalizeException(&local_type, &local_value, &local_tb);
-#if CYTHON_COMPILING_IN_CPYTHON
- if (unlikely(tstate->curexc_type))
-#else
- if (unlikely(PyErr_Occurred()))
-#endif
- goto bad;
- #if PY_MAJOR_VERSION >= 3
- if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
- goto bad;
- #endif
- Py_INCREF(local_type);
- Py_INCREF(local_value);
- Py_INCREF(local_tb);
- *type = local_type;
- *value = local_value;
- *tb = local_tb;
-#if CYTHON_COMPILING_IN_CPYTHON
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = local_type;
- tstate->exc_value = local_value;
- tstate->exc_traceback = local_tb;
- /* Make sure tstate is in a consistent state when we XDECREF
- these objects (DECREF may run arbitrary code). */
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(local_type, local_value, local_tb);
-#endif
- return 0;
-bad:
- *type = 0;
- *value = 0;
- *tb = 0;
- Py_XDECREF(local_type);
- Py_XDECREF(local_value);
- Py_XDECREF(local_tb);
- return -1;
-}
-
-static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
- PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
-}
-
-static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
- long q = a / b;
- long r = a - q*b;
- q -= ((r != 0) & ((r ^ b) < 0));
- return q;
-}
-
-static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
- CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename) {
- PyObject *old_exc, *old_val, *old_tb;
- PyObject *ctx;
- __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
- #if PY_MAJOR_VERSION < 3
- ctx = PyString_FromString(name);
- #else
- ctx = PyUnicode_FromString(name);
- #endif
- __Pyx_ErrRestore(old_exc, old_val, old_tb);
- if (!ctx) {
- PyErr_WriteUnraisable(Py_None);
- } else {
- PyErr_WriteUnraisable(ctx);
- Py_DECREF(ctx);
- }
-}
-
-static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION==3&&PY_MINOR_VERSION==0)
- PyObject *ob = PyCapsule_New(vtable, 0, 0);
-#else
- PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
-#endif
- if (!ob)
- goto bad;
- if (PyDict_SetItem(dict, __pyx_n_s____pyx_vtable__, ob) < 0)
- goto bad;
- Py_DECREF(ob);
- return 0;
-bad:
- Py_XDECREF(ob);
- return -1;
-}
-
-#if PY_MAJOR_VERSION < 3
-static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
- #if PY_VERSION_HEX >= 0x02060000
- if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
- #endif
- if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
- if (PyObject_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
- if (PyObject_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
- #if PY_VERSION_HEX < 0x02060000
- if (obj->ob_type->tp_dict) {
- PyObject *getbuffer_cobj = PyObject_GetItem(
- obj->ob_type->tp_dict, __pyx_n_s____pyx_getbuffer);
- if (getbuffer_cobj) {
- getbufferproc func = (getbufferproc) PyCObject_AsVoidPtr(getbuffer_cobj);
- Py_DECREF(getbuffer_cobj);
- if (!func)
- goto fail;
- return func(obj, view, flags);
- } else {
- PyErr_Clear();
- }
- }
- #endif
- PyErr_Format(PyExc_TypeError, "'%100s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
- return -1;
-}
-static void __Pyx_ReleaseBuffer(Py_buffer *view) {
- PyObject *obj = view->obj;
- if (!obj) return;
- #if PY_VERSION_HEX >= 0x02060000
- if (PyObject_CheckBuffer(obj)) {
- PyBuffer_Release(view);
- return;
- }
- #endif
- if (PyObject_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) { __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view); return; }
- #if PY_VERSION_HEX < 0x02060000
- if (obj->ob_type->tp_dict) {
- PyObject *releasebuffer_cobj = PyObject_GetItem(
- obj->ob_type->tp_dict, __pyx_n_s____pyx_releasebuffer);
- if (releasebuffer_cobj) {
- releasebufferproc func = (releasebufferproc) PyCObject_AsVoidPtr(releasebuffer_cobj);
- Py_DECREF(releasebuffer_cobj);
- if (!func)
- goto fail;
- func(obj, view);
- return;
- } else {
- PyErr_Clear();
- }
- }
- #endif
- goto nofail;
-#if PY_VERSION_HEX < 0x02060000
-fail:
-#endif
- PyErr_WriteUnraisable(obj);
-nofail:
- Py_DECREF(obj);
- view->obj = NULL;
-}
-#endif /* PY_MAJOR_VERSION < 3 */
-
-
- static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
- PyObject *empty_list = 0;
- PyObject *module = 0;
- PyObject *global_dict = 0;
- PyObject *empty_dict = 0;
- PyObject *list;
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_import;
- py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s____import__);
- if (!py_import)
- goto bad;
- #endif
- if (from_list)
- list = from_list;
- else {
- empty_list = PyList_New(0);
- if (!empty_list)
- goto bad;
- list = empty_list;
- }
- global_dict = PyModule_GetDict(__pyx_m);
- if (!global_dict)
- goto bad;
- empty_dict = PyDict_New();
- if (!empty_dict)
- goto bad;
- #if PY_VERSION_HEX >= 0x02050000
- {
- #if PY_MAJOR_VERSION >= 3
- if (level == -1) {
- if (strchr(__Pyx_MODULE_NAME, '.')) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(1);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, 1);
- #endif
- if (!module) {
- if (!PyErr_ExceptionMatches(PyExc_ImportError))
- goto bad;
- PyErr_Clear();
- }
- }
- level = 0; /* try absolute import on failure */
- }
- #endif
- if (!module) {
- #if PY_VERSION_HEX < 0x03030000
- PyObject *py_level = PyInt_FromLong(level);
- if (!py_level)
- goto bad;
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, py_level, NULL);
- Py_DECREF(py_level);
- #else
- module = PyImport_ImportModuleLevelObject(
- name, global_dict, empty_dict, list, level);
- #endif
- }
- }
- #else
- if (level>0) {
- PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
- goto bad;
- }
- module = PyObject_CallFunctionObjArgs(py_import,
- name, global_dict, empty_dict, list, NULL);
- #endif
-bad:
- #if PY_VERSION_HEX < 0x03030000
- Py_XDECREF(py_import);
- #endif
- Py_XDECREF(empty_list);
- Py_XDECREF(empty_dict);
- return module;
-}
-
-static PyObject *__pyx_memview_get_double(const char *itemp) {
- return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
-}
-static int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
- double value = __pyx_PyFloat_AsDouble(obj);
- if ((value == (double)-1) && PyErr_Occurred())
- return 0;
- *(double *) itemp = value;
- return 1;
-}
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
- return ::std::complex< float >(x, y);
- }
- #else
- static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
- return x + y*(__pyx_t_float_complex)_Complex_I;
- }
- #endif
-#else
- static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
- __pyx_t_float_complex z;
- z.real = x;
- z.imag = y;
- return z;
- }
-#endif
-
-#if CYTHON_CCOMPLEX
-#else
- static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- return (a.real == b.real) && (a.imag == b.imag);
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- z.real = a.real + b.real;
- z.imag = a.imag + b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- z.real = a.real - b.real;
- z.imag = a.imag - b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- z.real = a.real * b.real - a.imag * b.imag;
- z.imag = a.real * b.imag + a.imag * b.real;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- float denom = b.real * b.real + b.imag * b.imag;
- z.real = (a.real * b.real + a.imag * b.imag) / denom;
- z.imag = (a.imag * b.real - a.real * b.imag) / denom;
- return z;
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
- __pyx_t_float_complex z;
- z.real = -a.real;
- z.imag = -a.imag;
- return z;
- }
- static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
- return (a.real == 0) && (a.imag == 0);
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
- __pyx_t_float_complex z;
- z.real = a.real;
- z.imag = -a.imag;
- return z;
- }
- #if 1
- static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
- #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
- return sqrtf(z.real*z.real + z.imag*z.imag);
- #else
- return hypotf(z.real, z.imag);
- #endif
- }
- static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
- __pyx_t_float_complex z;
- float r, lnr, theta, z_r, z_theta;
- if (b.imag == 0 && b.real == (int)b.real) {
- if (b.real < 0) {
- float denom = a.real * a.real + a.imag * a.imag;
- a.real = a.real / denom;
- a.imag = -a.imag / denom;
- b.real = -b.real;
- }
- switch ((int)b.real) {
- case 0:
- z.real = 1;
- z.imag = 0;
- return z;
- case 1:
- return a;
- case 2:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(a, a);
- case 3:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, a);
- case 4:
- z = __Pyx_c_prodf(a, a);
- return __Pyx_c_prodf(z, z);
- }
- }
- if (a.imag == 0) {
- if (a.real == 0) {
- return a;
- }
- r = a.real;
- theta = 0;
- } else {
- r = __Pyx_c_absf(a);
- theta = atan2f(a.imag, a.real);
- }
- lnr = logf(r);
- z_r = expf(lnr * b.real - theta * b.imag);
- z_theta = theta * b.real + lnr * b.imag;
- z.real = z_r * cosf(z_theta);
- z.imag = z_r * sinf(z_theta);
- return z;
- }
- #endif
-#endif
-
-#if CYTHON_CCOMPLEX
- #ifdef __cplusplus
- static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
- return ::std::complex< double >(x, y);
- }
- #else
- static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
- return x + y*(__pyx_t_double_complex)_Complex_I;
- }
- #endif
-#else
- static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
- __pyx_t_double_complex z;
- z.real = x;
- z.imag = y;
- return z;
- }
-#endif
-
-#if CYTHON_CCOMPLEX
-#else
- static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- return (a.real == b.real) && (a.imag == b.imag);
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- z.real = a.real + b.real;
- z.imag = a.imag + b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- z.real = a.real - b.real;
- z.imag = a.imag - b.imag;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- z.real = a.real * b.real - a.imag * b.imag;
- z.imag = a.real * b.imag + a.imag * b.real;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- double denom = b.real * b.real + b.imag * b.imag;
- z.real = (a.real * b.real + a.imag * b.imag) / denom;
- z.imag = (a.imag * b.real - a.real * b.imag) / denom;
- return z;
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
- __pyx_t_double_complex z;
- z.real = -a.real;
- z.imag = -a.imag;
- return z;
- }
- static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
- return (a.real == 0) && (a.imag == 0);
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
- __pyx_t_double_complex z;
- z.real = a.real;
- z.imag = -a.imag;
- return z;
- }
- #if 1
- static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
- #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
- return sqrt(z.real*z.real + z.imag*z.imag);
- #else
- return hypot(z.real, z.imag);
- #endif
- }
- static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
- __pyx_t_double_complex z;
- double r, lnr, theta, z_r, z_theta;
- if (b.imag == 0 && b.real == (int)b.real) {
- if (b.real < 0) {
- double denom = a.real * a.real + a.imag * a.imag;
- a.real = a.real / denom;
- a.imag = -a.imag / denom;
- b.real = -b.real;
- }
- switch ((int)b.real) {
- case 0:
- z.real = 1;
- z.imag = 0;
- return z;
- case 1:
- return a;
- case 2:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(a, a);
- case 3:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, a);
- case 4:
- z = __Pyx_c_prod(a, a);
- return __Pyx_c_prod(z, z);
- }
- }
- if (a.imag == 0) {
- if (a.real == 0) {
- return a;
- }
- r = a.real;
- theta = 0;
- } else {
- r = __Pyx_c_abs(a);
- theta = atan2(a.imag, a.real);
- }
- lnr = log(r);
- z_r = exp(lnr * b.real - theta * b.imag);
- z_theta = theta * b.real + lnr * b.imag;
- z.real = z_r * cos(z_theta);
- z.imag = z_r * sin(z_theta);
- return z;
- }
- #endif
-#endif
-
-static int
-__pyx_memviewslice_is_contig(const __Pyx_memviewslice *mvs,
- char order, int ndim)
-{
- int i, index, step, start;
- Py_ssize_t itemsize = mvs->memview->view.itemsize;
- if (order == 'F') {
- step = 1;
- start = 0;
- } else {
- step = -1;
- start = ndim - 1;
- }
- for (i = 0; i < ndim; i++) {
- index = start + step * i;
- if (mvs->suboffsets[index] >= 0 || mvs->strides[index] != itemsize)
- return 0;
- itemsize *= mvs->shape[index];
- }
- return 1;
-}
-
-static void
-__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
- void **out_start, void **out_end,
- int ndim, size_t itemsize)
-{
- char *start, *end;
- int i;
- start = end = slice->data;
- for (i = 0; i < ndim; i++) {
- Py_ssize_t stride = slice->strides[i];
- Py_ssize_t extent = slice->shape[i];
- if (extent == 0) {
- *out_start = *out_end = start;
- return;
- } else {
- if (stride > 0)
- end += stride * (extent - 1);
- else
- start += stride * (extent - 1);
- }
- }
- *out_start = start;
- *out_end = end + itemsize;
-}
-static int
-__pyx_slices_overlap(__Pyx_memviewslice *slice1,
- __Pyx_memviewslice *slice2,
- int ndim, size_t itemsize)
-{
- void *start1, *end1, *start2, *end2;
- __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
- __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
- return (start1 < end2) && (start2 < end1);
-}
-
-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)
-{
- __Pyx_RefNannyDeclarations
- int i;
- __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
- struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
- Py_buffer *buf = &from_memview->view;
- PyObject *shape_tuple = NULL;
- PyObject *temp_int = NULL;
- struct __pyx_array_obj *array_obj = NULL;
- struct __pyx_memoryview_obj *memview_obj = NULL;
- __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
- for (i = 0; i < ndim; i++) {
- if (from_mvs->suboffsets[i] >= 0) {
- PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
- "indirect dimensions (axis %d)", i);
- goto fail;
- }
- }
- shape_tuple = PyTuple_New(ndim);
- if (unlikely(!shape_tuple)) {
- goto fail;
- }
- __Pyx_GOTREF(shape_tuple);
- for(i = 0; i < ndim; i++) {
- temp_int = PyInt_FromLong(from_mvs->shape[i]);
- if(unlikely(!temp_int)) {
- goto fail;
- } else {
- PyTuple_SET_ITEM(shape_tuple, i, temp_int);
- temp_int = NULL;
- }
- }
- array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
- if (unlikely(!array_obj)) {
- goto fail;
- }
- __Pyx_GOTREF(array_obj);
- memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
- (PyObject *) array_obj, contig_flag,
- dtype_is_object,
- from_mvs->memview->typeinfo);
- if (unlikely(!memview_obj))
- goto fail;
- if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
- goto fail;
- if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
- dtype_is_object) < 0))
- goto fail;
- goto no_fail;
-fail:
- __Pyx_XDECREF(new_mvs.memview);
- new_mvs.memview = NULL;
- new_mvs.data = NULL;
-no_fail:
- __Pyx_XDECREF(shape_tuple);
- __Pyx_XDECREF(temp_int);
- __Pyx_XDECREF(array_obj);
- __Pyx_RefNannyFinishContext();
- return new_mvs;
-}
-
-static CYTHON_INLINE PyObject *
-__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
-{
- PyObject *cobj;
-#if PY_VERSION_HEX >= 0x02070000 && !(PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION == 0)
- cobj = PyCapsule_New(p, sig, NULL);
-#else
- cobj = PyCObject_FromVoidPtr(p, NULL);
-#endif
- return cobj;
-}
-
-static CYTHON_INLINE void __Pyx_ExceptionSave(PyObject **type, PyObject **value, PyObject **tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyThreadState *tstate = PyThreadState_GET();
- *type = tstate->exc_type;
- *value = tstate->exc_value;
- *tb = tstate->exc_traceback;
- Py_XINCREF(*type);
- Py_XINCREF(*value);
- Py_XINCREF(*tb);
-#else
- PyErr_GetExcInfo(type, value, tb);
-#endif
-}
-static void __Pyx_ExceptionReset(PyObject *type, PyObject *value, PyObject *tb) {
-#if CYTHON_COMPILING_IN_CPYTHON
- PyObject *tmp_type, *tmp_value, *tmp_tb;
- PyThreadState *tstate = PyThreadState_GET();
- tmp_type = tstate->exc_type;
- tmp_value = tstate->exc_value;
- tmp_tb = tstate->exc_traceback;
- tstate->exc_type = type;
- tstate->exc_value = value;
- tstate->exc_traceback = tb;
- Py_XDECREF(tmp_type);
- Py_XDECREF(tmp_value);
- Py_XDECREF(tmp_tb);
-#else
- PyErr_SetExcInfo(type, value, tb);
-#endif
-}
-
-static CYTHON_INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
- const unsigned char neg_one = (unsigned char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned char" :
- "value too large to convert to unsigned char");
- }
- return (unsigned char)-1;
- }
- return (unsigned char)val;
- }
- return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
- const unsigned short neg_one = (unsigned short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned short" :
- "value too large to convert to unsigned short");
- }
- return (unsigned short)-1;
- }
- return (unsigned short)val;
- }
- return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
- const unsigned int neg_one = (unsigned int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(unsigned int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(unsigned int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to unsigned int" :
- "value too large to convert to unsigned int");
- }
- return (unsigned int)-1;
- }
- return (unsigned int)val;
- }
- return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
-}
-
-static CYTHON_INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
- const char neg_one = (char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to char" :
- "value too large to convert to char");
- }
- return (char)-1;
- }
- return (char)val;
- }
- return (char)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
- const short neg_one = (short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to short" :
- "value too large to convert to short");
- }
- return (short)-1;
- }
- return (short)val;
- }
- return (short)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
- const int neg_one = (int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to int" :
- "value too large to convert to int");
- }
- return (int)-1;
- }
- return (int)val;
- }
- return (int)__Pyx_PyInt_AsLong(x);
-}
-
-static CYTHON_INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
- const signed char neg_one = (signed char)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed char) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed char)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed char" :
- "value too large to convert to signed char");
- }
- return (signed char)-1;
- }
- return (signed char)val;
- }
- return (signed char)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
- const signed short neg_one = (signed short)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed short) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed short)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed short" :
- "value too large to convert to signed short");
- }
- return (signed short)-1;
- }
- return (signed short)val;
- }
- return (signed short)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
- const signed int neg_one = (signed int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(signed int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(signed int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to signed int" :
- "value too large to convert to signed int");
- }
- return (signed int)-1;
- }
- return (signed int)val;
- }
- return (signed int)__Pyx_PyInt_AsSignedLong(x);
-}
-
-static CYTHON_INLINE int __Pyx_PyInt_AsLongDouble(PyObject* x) {
- const int neg_one = (int)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
- if (sizeof(int) < sizeof(long)) {
- long val = __Pyx_PyInt_AsLong(x);
- if (unlikely(val != (long)(int)val)) {
- if (!unlikely(val == -1 && PyErr_Occurred())) {
- PyErr_SetString(PyExc_OverflowError,
- (is_unsigned && unlikely(val < 0)) ?
- "can't convert negative value to int" :
- "value too large to convert to int");
- }
- return (int)-1;
- }
- return (int)val;
- }
- return (int)__Pyx_PyInt_AsLong(x);
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
- const unsigned long neg_one = (unsigned long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return (unsigned long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (unsigned long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned long");
- return (unsigned long)-1;
- }
- return (unsigned long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(unsigned long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(unsigned long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (unsigned long)PyLong_AsLong(x);
- }
- } else {
- unsigned long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned long)-1;
- val = __Pyx_PyInt_AsUnsignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
- const unsigned PY_LONG_LONG neg_one = (unsigned PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return (unsigned PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to unsigned PY_LONG_LONG");
- return (unsigned PY_LONG_LONG)-1;
- }
- return (unsigned PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(unsigned PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(unsigned PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (unsigned PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- unsigned PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (unsigned PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
- const long neg_one = (long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return (long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to long");
- return (long)-1;
- }
- return (long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (long)PyLong_AsLong(x);
- }
- } else {
- long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (long)-1;
- val = __Pyx_PyInt_AsLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
- const PY_LONG_LONG neg_one = (PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return (PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to PY_LONG_LONG");
- return (PY_LONG_LONG)-1;
- }
- return (PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
- const signed long neg_one = (signed long)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return (signed long)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (signed long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed long");
- return (signed long)-1;
- }
- return (signed long)PyLong_AsUnsignedLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed long)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(signed long) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(signed long) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (signed long)PyLong_AsLong(x);
- }
- } else {
- signed long val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed long)-1;
- val = __Pyx_PyInt_AsSignedLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
-#include "longintrepr.h"
-#endif
-#endif
-static CYTHON_INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
- const signed PY_LONG_LONG neg_one = (signed PY_LONG_LONG)-1, const_zero = 0;
- const int is_unsigned = neg_one > const_zero;
-#if PY_MAJOR_VERSION < 3
- if (likely(PyInt_Check(x))) {
- long val = PyInt_AS_LONG(x);
- if (is_unsigned && unlikely(val < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return (signed PY_LONG_LONG)val;
- } else
-#endif
- if (likely(PyLong_Check(x))) {
- if (is_unsigned) {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return (signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- if (unlikely(Py_SIZE(x) < 0)) {
- PyErr_SetString(PyExc_OverflowError,
- "can't convert negative value to signed PY_LONG_LONG");
- return (signed PY_LONG_LONG)-1;
- }
- return (signed PY_LONG_LONG)PyLong_AsUnsignedLongLong(x);
- } else {
-#if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
-#if CYTHON_USE_PYLONG_INTERNALS
- if (sizeof(digit) <= sizeof(signed PY_LONG_LONG)) {
- switch (Py_SIZE(x)) {
- case 0: return 0;
- case 1: return +(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- case -1: return -(signed PY_LONG_LONG) ((PyLongObject*)x)->ob_digit[0];
- }
- }
-#endif
-#endif
- return (signed PY_LONG_LONG)PyLong_AsLongLong(x);
- }
- } else {
- signed PY_LONG_LONG val;
- PyObject *tmp = __Pyx_PyNumber_Int(x);
- if (!tmp) return (signed PY_LONG_LONG)-1;
- val = __Pyx_PyInt_AsSignedLongLong(tmp);
- Py_DECREF(tmp);
- return val;
- }
-}
-
-static int
-__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
-{
- int i;
- if (!a || !b)
- return 0;
- if (a == b)
- return 1;
- if (a->size != b->size || a->typegroup != b->typegroup ||
- a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
- if (a->typegroup == 'H' || b->typegroup == 'H') {
- return a->size == b->size;
- } else {
- return 0;
- }
- }
- if (a->ndim) {
- for (i = 0; i < a->ndim; i++)
- if (a->arraysize[i] != b->arraysize[i])
- return 0;
- }
- if (a->typegroup == 'S') {
- if (a->flags != b->flags)
- return 0;
- if (a->fields || b->fields) {
- if (!(a->fields && b->fields))
- return 0;
- for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
- __Pyx_StructField *field_a = a->fields + i;
- __Pyx_StructField *field_b = b->fields + i;
- if (field_a->offset != field_b->offset ||
- !__pyx_typeinfo_cmp(field_a->type, field_b->type))
- return 0;
- }
- return !a->fields[i].type && !b->fields[i].type;
- }
- }
- return 1;
-}
-
-static int
-__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
-{
- if (buf->shape[dim] <= 1)
- return 1;
- if (buf->strides) {
- if (spec & __Pyx_MEMVIEW_CONTIG) {
- if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
- if (buf->strides[dim] != sizeof(void *)) {
- PyErr_Format(PyExc_ValueError,
- "Buffer is not indirectly contiguous "
- "in dimension %d.", dim);
- goto fail;
- }
- } else if (buf->strides[dim] != buf->itemsize) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer and memoryview are not contiguous "
- "in the same dimension.");
- goto fail;
- }
- }
- if (spec & __Pyx_MEMVIEW_FOLLOW) {
- Py_ssize_t stride = buf->strides[dim];
- if (stride < 0)
- stride = -stride;
- if (stride < buf->itemsize) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer and memoryview are not contiguous "
- "in the same dimension.");
- goto fail;
- }
- }
- } else {
- if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
- PyErr_Format(PyExc_ValueError,
- "C-contiguous buffer is not contiguous in "
- "dimension %d", dim);
- goto fail;
- } else if (spec & (__Pyx_MEMVIEW_PTR)) {
- PyErr_Format(PyExc_ValueError,
- "C-contiguous buffer is not indirect in "
- "dimension %d", dim);
- goto fail;
- } else if (buf->suboffsets) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer exposes suboffsets but no strides");
- goto fail;
- }
- }
- return 1;
-fail:
- return 0;
-}
-static int
-__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
-{
- if (spec & __Pyx_MEMVIEW_DIRECT) {
- if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
- PyErr_Format(PyExc_ValueError,
- "Buffer not compatible with direct access "
- "in dimension %d.", dim);
- goto fail;
- }
- }
- if (spec & __Pyx_MEMVIEW_PTR) {
- if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
- PyErr_Format(PyExc_ValueError,
- "Buffer is not indirectly accessisble "
- "in dimension %d.", dim);
- goto fail;
- }
- }
- return 1;
-fail:
- return 0;
-}
-static int
-__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
-{
- int i;
- if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
- Py_ssize_t stride = 1;
- for (i = 0; i < ndim; i++) {
- if (stride * buf->itemsize != buf->strides[i] &&
- buf->shape[i] > 1)
- {
- PyErr_SetString(PyExc_ValueError,
- "Buffer not fortran contiguous.");
- goto fail;
- }
- stride = stride * buf->shape[i];
- }
- } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
- Py_ssize_t stride = 1;
- for (i = ndim - 1; i >- 1; i--) {
- if (stride * buf->itemsize != buf->strides[i] &&
- buf->shape[i] > 1) {
- PyErr_SetString(PyExc_ValueError,
- "Buffer not C contiguous.");
- goto fail;
- }
- stride = stride * buf->shape[i];
- }
- }
- return 1;
-fail:
- return 0;
-}
-static int __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)
-{
- struct __pyx_memoryview_obj *memview, *new_memview;
- __Pyx_RefNannyDeclarations
- Py_buffer *buf;
- int i, spec = 0, retval = -1;
- __Pyx_BufFmt_Context ctx;
- int from_memoryview = __pyx_memoryview_check(original_obj);
- __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
- if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
- original_obj)->typeinfo)) {
- memview = (struct __pyx_memoryview_obj *) original_obj;
- new_memview = NULL;
- } else {
- memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
- original_obj, buf_flags, 0, dtype);
- new_memview = memview;
- if (unlikely(!memview))
- goto fail;
- }
- buf = &memview->view;
- if (buf->ndim != ndim) {
- PyErr_Format(PyExc_ValueError,
- "Buffer has wrong number of dimensions (expected %d, got %d)",
- ndim, buf->ndim);
- goto fail;
- }
- if (new_memview) {
- __Pyx_BufFmt_Init(&ctx, stack, dtype);
- if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
- }
- if ((unsigned) buf->itemsize != dtype->size) {
- PyErr_Format(PyExc_ValueError,
- "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
- "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
- buf->itemsize,
- (buf->itemsize > 1) ? "s" : "",
- dtype->name,
- dtype->size,
- (dtype->size > 1) ? "s" : "");
- goto fail;
- }
- for (i = 0; i < ndim; i++) {
- spec = axes_specs[i];
- if (!__pyx_check_strides(buf, i, ndim, spec))
- goto fail;
- if (!__pyx_check_suboffsets(buf, i, ndim, spec))
- goto fail;
- }
- if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
- goto fail;
- if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
- new_memview != NULL) == -1)) {
- goto fail;
- }
- retval = 0;
- goto no_fail;
-fail:
- Py_XDECREF(new_memview);
- retval = -1;
-no_fail:
- __Pyx_RefNannyFinishContext();
- return retval;
-}
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj) {
- __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_BufFmt_StackElem stack[1];
- int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
- int retcode;
- if (obj == Py_None) {
- result.memview = (struct __pyx_memoryview_obj *) Py_None;
- return result;
- }
- retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
- PyBUF_RECORDS, 1,
- &__Pyx_TypeInfo_double, stack,
- &result, obj);
- if (unlikely(retcode == -1))
- goto __pyx_fail;
- return result;
-__pyx_fail:
- result.memview = NULL;
- result.data = NULL;
- return result;
-}
-
-static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj) {
- __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
- __Pyx_BufFmt_StackElem stack[1];
- int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
- int retcode;
- if (obj == Py_None) {
- result.memview = (struct __pyx_memoryview_obj *) Py_None;
- return result;
- }
- retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
- PyBUF_RECORDS, 1,
- &__Pyx_TypeInfo_int, stack,
- &result, obj);
- if (unlikely(retcode == -1))
- goto __pyx_fail;
- return result;
-__pyx_fail:
- result.memview = NULL;
- result.data = NULL;
- return result;
-}
-
-static int __Pyx_check_binary_version(void) {
- char ctversion[4], rtversion[4];
- PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
- PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
- if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
- char message[200];
- PyOS_snprintf(message, sizeof(message),
- "compiletime version %s of module '%.100s' "
- "does not match runtime version %s",
- ctversion, __Pyx_MODULE_NAME, rtversion);
- #if PY_VERSION_HEX < 0x02050000
- return PyErr_Warn(NULL, message);
- #else
- return PyErr_WarnEx(NULL, message, 1);
- #endif
- }
- return 0;
-}
-
-#ifndef __PYX_HAVE_RT_ImportModule
-#define __PYX_HAVE_RT_ImportModule
-static PyObject *__Pyx_ImportModule(const char *name) {
- PyObject *py_name = 0;
- PyObject *py_module = 0;
- py_name = __Pyx_PyIdentifier_FromString(name);
- if (!py_name)
- goto bad;
- py_module = PyImport_Import(py_name);
- Py_DECREF(py_name);
- return py_module;
-bad:
- Py_XDECREF(py_name);
- return 0;
-}
-#endif
-
-#ifndef __PYX_HAVE_RT_ImportType
-#define __PYX_HAVE_RT_ImportType
-static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
- size_t size, int strict)
-{
- PyObject *py_module = 0;
- PyObject *result = 0;
- PyObject *py_name = 0;
- char warning[200];
- Py_ssize_t basicsize;
-#ifdef Py_LIMITED_API
- PyObject *py_basicsize;
-#endif
- py_module = __Pyx_ImportModule(module_name);
- if (!py_module)
- goto bad;
- py_name = __Pyx_PyIdentifier_FromString(class_name);
- if (!py_name)
- goto bad;
- result = PyObject_GetAttr(py_module, py_name);
- Py_DECREF(py_name);
- py_name = 0;
- Py_DECREF(py_module);
- py_module = 0;
- if (!result)
- goto bad;
- if (!PyType_Check(result)) {
- PyErr_Format(PyExc_TypeError,
- "%s.%s is not a type object",
- module_name, class_name);
- goto bad;
- }
-#ifndef Py_LIMITED_API
- basicsize = ((PyTypeObject *)result)->tp_basicsize;
-#else
- py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
- if (!py_basicsize)
- goto bad;
- basicsize = PyLong_AsSsize_t(py_basicsize);
- Py_DECREF(py_basicsize);
- py_basicsize = 0;
- if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
- goto bad;
-#endif
- if (!strict && (size_t)basicsize > size) {
- PyOS_snprintf(warning, sizeof(warning),
- "%s.%s size changed, may indicate binary incompatibility",
- module_name, class_name);
- #if PY_VERSION_HEX < 0x02050000
- if (PyErr_Warn(NULL, warning) < 0) goto bad;
- #else
- if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
- #endif
- }
- else if ((size_t)basicsize != size) {
- PyErr_Format(PyExc_ValueError,
- "%s.%s has the wrong size, try recompiling",
- module_name, class_name);
- goto bad;
- }
- return (PyTypeObject *)result;
-bad:
- Py_XDECREF(py_module);
- Py_XDECREF(result);
- return NULL;
-}
-#endif
-
-static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
- int start = 0, mid = 0, end = count - 1;
- if (end >= 0 && code_line > entries[end].code_line) {
- return count;
- }
- while (start < end) {
- mid = (start + end) / 2;
- if (code_line < entries[mid].code_line) {
- end = mid;
- } else if (code_line > entries[mid].code_line) {
- start = mid + 1;
- } else {
- return mid;
- }
- }
- if (code_line <= entries[mid].code_line) {
- return mid;
- } else {
- return mid + 1;
- }
-}
-static PyCodeObject *__pyx_find_code_object(int code_line) {
- PyCodeObject* code_object;
- int pos;
- if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
- return NULL;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
- return NULL;
- }
- code_object = __pyx_code_cache.entries[pos].code_object;
- Py_INCREF(code_object);
- return code_object;
-}
-static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
- int pos, i;
- __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
- if (unlikely(!code_line)) {
- return;
- }
- if (unlikely(!entries)) {
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
- if (likely(entries)) {
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = 64;
- __pyx_code_cache.count = 1;
- entries[0].code_line = code_line;
- entries[0].code_object = code_object;
- Py_INCREF(code_object);
- }
- return;
- }
- pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
- if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
- PyCodeObject* tmp = entries[pos].code_object;
- entries[pos].code_object = code_object;
- Py_DECREF(tmp);
- return;
- }
- if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
- int new_max = __pyx_code_cache.max_count + 64;
- entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
- __pyx_code_cache.entries, new_max*sizeof(__Pyx_CodeObjectCacheEntry));
- if (unlikely(!entries)) {
- return;
- }
- __pyx_code_cache.entries = entries;
- __pyx_code_cache.max_count = new_max;
- }
- for (i=__pyx_code_cache.count; i>pos; i--) {
- entries[i] = entries[i-1];
- }
- entries[pos].code_line = code_line;
- entries[pos].code_object = code_object;
- __pyx_code_cache.count++;
- Py_INCREF(code_object);
-}
-
-#include "compile.h"
-#include "frameobject.h"
-#include "traceback.h"
-static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
- const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_srcfile = 0;
- PyObject *py_funcname = 0;
- #if PY_MAJOR_VERSION < 3
- py_srcfile = PyString_FromString(filename);
- #else
- py_srcfile = PyUnicode_FromString(filename);
- #endif
- if (!py_srcfile) goto bad;
- if (c_line) {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #else
- py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
- #endif
- }
- else {
- #if PY_MAJOR_VERSION < 3
- py_funcname = PyString_FromString(funcname);
- #else
- py_funcname = PyUnicode_FromString(funcname);
- #endif
- }
- if (!py_funcname) goto bad;
- py_code = __Pyx_PyCode_New(
- 0, /*int argcount,*/
- 0, /*int kwonlyargcount,*/
- 0, /*int nlocals,*/
- 0, /*int stacksize,*/
- 0, /*int flags,*/
- __pyx_empty_bytes, /*PyObject *code,*/
- __pyx_empty_tuple, /*PyObject *consts,*/
- __pyx_empty_tuple, /*PyObject *names,*/
- __pyx_empty_tuple, /*PyObject *varnames,*/
- __pyx_empty_tuple, /*PyObject *freevars,*/
- __pyx_empty_tuple, /*PyObject *cellvars,*/
- py_srcfile, /*PyObject *filename,*/
- py_funcname, /*PyObject *name,*/
- py_line, /*int firstlineno,*/
- __pyx_empty_bytes /*PyObject *lnotab*/
- );
- Py_DECREF(py_srcfile);
- Py_DECREF(py_funcname);
- return py_code;
-bad:
- Py_XDECREF(py_srcfile);
- Py_XDECREF(py_funcname);
- return NULL;
-}
-static void __Pyx_AddTraceback(const char *funcname, int c_line,
- int py_line, const char *filename) {
- PyCodeObject *py_code = 0;
- PyObject *py_globals = 0;
- PyFrameObject *py_frame = 0;
- py_code = __pyx_find_code_object(c_line ? c_line : py_line);
- if (!py_code) {
- py_code = __Pyx_CreateCodeObjectForTraceback(
- funcname, c_line, py_line, filename);
- if (!py_code) goto bad;
- __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
- }
- py_globals = PyModule_GetDict(__pyx_m);
- if (!py_globals) goto bad;
- py_frame = PyFrame_New(
- PyThreadState_GET(), /*PyThreadState *tstate,*/
- py_code, /*PyCodeObject *code,*/
- py_globals, /*PyObject *globals,*/
- 0 /*PyObject *locals*/
- );
- if (!py_frame) goto bad;
- py_frame->f_lineno = py_line;
- PyTraceBack_Here(py_frame);
-bad:
- Py_XDECREF(py_code);
- Py_XDECREF(py_frame);
-}
-
-static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
- while (t->p) {
- #if PY_MAJOR_VERSION < 3
- if (t->is_unicode) {
- *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
- } else if (t->intern) {
- *t->p = PyString_InternFromString(t->s);
- } else {
- *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
- }
- #else /* Python 3+ has unicode identifiers */
- if (t->is_unicode | t->is_str) {
- if (t->intern) {
- *t->p = PyUnicode_InternFromString(t->s);
- } else if (t->encoding) {
- *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
- } else {
- *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
- }
- } else {
- *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
- }
- #endif
- if (!*t->p)
- return -1;
- ++t;
- }
- return 0;
-}
-
-static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(char* c_str) {
- return __Pyx_PyUnicode_FromStringAndSize(c_str, strlen(c_str));
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
- Py_ssize_t ignore;
- return __Pyx_PyObject_AsStringAndSize(o, &ignore);
-}
-static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
- if (
-#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- __Pyx_sys_getdefaultencoding_not_ascii &&
-#endif
- PyUnicode_Check(o)) {
-#if PY_VERSION_HEX < 0x03030000
- char* defenc_c;
- PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
- if (!defenc) return NULL;
- defenc_c = PyBytes_AS_STRING(defenc);
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- {
- char* end = defenc_c + PyBytes_GET_SIZE(defenc);
- char* c;
- for (c = defenc_c; c < end; c++) {
- if ((unsigned char) (*c) >= 128) {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
- }
- }
-#endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
- *length = PyBytes_GET_SIZE(defenc);
- return defenc_c;
-#else /* PY_VERSION_HEX < 0x03030000 */
- if (PyUnicode_READY(o) == -1) return NULL;
-#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
- if (PyUnicode_IS_ASCII(o)) {
- *length = PyUnicode_GET_DATA_SIZE(o);
- return PyUnicode_AsUTF8(o);
- } else {
- PyUnicode_AsASCIIString(o);
- return NULL;
- }
-#else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
- return PyUnicode_AsUTF8AndSize(o, length);
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
-#endif /* PY_VERSION_HEX < 0x03030000 */
- } else
-#endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
- {
- char* result;
- int r = PyBytes_AsStringAndSize(o, &result, length);
- if (r < 0) {
- return NULL;
- } else {
- return result;
- }
- }
-}
-static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
- int is_true = x == Py_True;
- if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
- else return PyObject_IsTrue(x);
-}
-static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
- PyNumberMethods *m;
- const char *name = NULL;
- PyObject *res = NULL;
-#if PY_MAJOR_VERSION < 3
- if (PyInt_Check(x) || PyLong_Check(x))
-#else
- if (PyLong_Check(x))
-#endif
- return Py_INCREF(x), x;
- m = Py_TYPE(x)->tp_as_number;
-#if PY_MAJOR_VERSION < 3
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Int(x);
- }
- else if (m && m->nb_long) {
- name = "long";
- res = PyNumber_Long(x);
- }
-#else
- if (m && m->nb_int) {
- name = "int";
- res = PyNumber_Long(x);
- }
-#endif
- if (res) {
-#if PY_MAJOR_VERSION < 3
- if (!PyInt_Check(res) && !PyLong_Check(res)) {
-#else
- if (!PyLong_Check(res)) {
-#endif
- PyErr_Format(PyExc_TypeError,
- "__%s__ returned non-%s (type %.200s)",
- name, name, Py_TYPE(res)->tp_name);
- Py_DECREF(res);
- return NULL;
- }
- }
- else if (!PyErr_Occurred()) {
- PyErr_SetString(PyExc_TypeError,
- "an integer is required");
- }
- return res;
-}
-static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
- Py_ssize_t ival;
- PyObject* x = PyNumber_Index(b);
- if (!x) return -1;
- ival = PyInt_AsSsize_t(x);
- Py_DECREF(x);
- return ival;
-}
-static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
-#if PY_VERSION_HEX < 0x02050000
- if (ival <= LONG_MAX)
- return PyInt_FromLong((long)ival);
- else {
- unsigned char *bytes = (unsigned char *) &ival;
- int one = 1; int little = (int)*(unsigned char*)&one;
- return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
- }
-#else
- return PyInt_FromSize_t(ival);
-#endif
-}
-static CYTHON_INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
- unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
- if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
- if ((val != (unsigned PY_LONG_LONG)-1) || !PyErr_Occurred())
- PyErr_SetString(PyExc_OverflowError,
- "value too large to convert to size_t");
- return (size_t)-1;
- }
- return (size_t)val;
-}
-
-
-#endif /* Py_PYTHON_H */
diff --git a/PyMca5/PyMcaPhysics/xas/_xas/cython/default/_xas.c b/PyMca5/PyMcaPhysics/xas/_xas/cython/default/_xas.c
new file mode 100644
index 0000000..d673555
--- /dev/null
+++ b/PyMca5/PyMcaPhysics/xas/_xas/cython/default/_xas.c
@@ -0,0 +1,28349 @@
+/* Generated by Cython 0.28.3 */
+
+#define PY_SSIZE_T_CLEAN
+#include "Python.h"
+#ifndef Py_PYTHON_H
+ #error Python headers needed to compile C extensions, please install development version of Python.
+#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
+ #error Cython requires Python 2.6+ or Python 3.3+.
+#else
+#define CYTHON_ABI "0_28_3"
+#define CYTHON_FUTURE_DIVISION 0
+#include <stddef.h>
+#ifndef offsetof
+ #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
+#endif
+#if !defined(WIN32) && !defined(MS_WINDOWS)
+ #ifndef __stdcall
+ #define __stdcall
+ #endif
+ #ifndef __cdecl
+ #define __cdecl
+ #endif
+ #ifndef __fastcall
+ #define __fastcall
+ #endif
+#endif
+#ifndef DL_IMPORT
+ #define DL_IMPORT(t) t
+#endif
+#ifndef DL_EXPORT
+ #define DL_EXPORT(t) t
+#endif
+#define __PYX_COMMA ,
+#ifndef HAVE_LONG_LONG
+ #if PY_VERSION_HEX >= 0x02070000
+ #define HAVE_LONG_LONG
+ #endif
+#endif
+#ifndef PY_LONG_LONG
+ #define PY_LONG_LONG LONG_LONG
+#endif
+#ifndef Py_HUGE_VAL
+ #define Py_HUGE_VAL HUGE_VAL
+#endif
+#ifdef PYPY_VERSION
+ #define CYTHON_COMPILING_IN_PYPY 1
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #undef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 0
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #if PY_VERSION_HEX < 0x03050000
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #undef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 1
+ #undef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 0
+ #undef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 0
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+#elif defined(PYSTON_VERSION)
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 1
+ #define CYTHON_COMPILING_IN_CPYTHON 0
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #undef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 0
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #undef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 0
+ #undef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 0
+ #undef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT 0
+ #undef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE 0
+#else
+ #define CYTHON_COMPILING_IN_PYPY 0
+ #define CYTHON_COMPILING_IN_PYSTON 0
+ #define CYTHON_COMPILING_IN_CPYTHON 1
+ #ifndef CYTHON_USE_TYPE_SLOTS
+ #define CYTHON_USE_TYPE_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYTYPE_LOOKUP
+ #define CYTHON_USE_PYTYPE_LOOKUP 0
+ #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
+ #define CYTHON_USE_PYTYPE_LOOKUP 1
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ #undef CYTHON_USE_ASYNC_SLOTS
+ #define CYTHON_USE_ASYNC_SLOTS 0
+ #elif !defined(CYTHON_USE_ASYNC_SLOTS)
+ #define CYTHON_USE_ASYNC_SLOTS 1
+ #endif
+ #if PY_VERSION_HEX < 0x02070000
+ #undef CYTHON_USE_PYLONG_INTERNALS
+ #define CYTHON_USE_PYLONG_INTERNALS 0
+ #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
+ #define CYTHON_USE_PYLONG_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_PYLIST_INTERNALS
+ #define CYTHON_USE_PYLIST_INTERNALS 1
+ #endif
+ #ifndef CYTHON_USE_UNICODE_INTERNALS
+ #define CYTHON_USE_UNICODE_INTERNALS 1
+ #endif
+ #if PY_VERSION_HEX < 0x030300F0
+ #undef CYTHON_USE_UNICODE_WRITER
+ #define CYTHON_USE_UNICODE_WRITER 0
+ #elif !defined(CYTHON_USE_UNICODE_WRITER)
+ #define CYTHON_USE_UNICODE_WRITER 1
+ #endif
+ #ifndef CYTHON_AVOID_BORROWED_REFS
+ #define CYTHON_AVOID_BORROWED_REFS 0
+ #endif
+ #ifndef CYTHON_ASSUME_SAFE_MACROS
+ #define CYTHON_ASSUME_SAFE_MACROS 1
+ #endif
+ #ifndef CYTHON_UNPACK_METHODS
+ #define CYTHON_UNPACK_METHODS 1
+ #endif
+ #ifndef CYTHON_FAST_THREAD_STATE
+ #define CYTHON_FAST_THREAD_STATE 1
+ #endif
+ #ifndef CYTHON_FAST_PYCALL
+ #define CYTHON_FAST_PYCALL 1
+ #endif
+ #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
+ #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
+ #endif
+ #ifndef CYTHON_USE_TP_FINALIZE
+ #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
+ #endif
+#endif
+#if !defined(CYTHON_FAST_PYCCALL)
+#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
+#endif
+#if CYTHON_USE_PYLONG_INTERNALS
+ #include "longintrepr.h"
+ #undef SHIFT
+ #undef BASE
+ #undef MASK
+#endif
+#ifndef __has_attribute
+ #define __has_attribute(x) 0
+#endif
+#ifndef __has_cpp_attribute
+ #define __has_cpp_attribute(x) 0
+#endif
+#ifndef CYTHON_RESTRICT
+ #if defined(__GNUC__)
+ #define CYTHON_RESTRICT __restrict__
+ #elif defined(_MSC_VER) && _MSC_VER >= 1400
+ #define CYTHON_RESTRICT __restrict
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_RESTRICT restrict
+ #else
+ #define CYTHON_RESTRICT
+ #endif
+#endif
+#ifndef CYTHON_UNUSED
+# if defined(__GNUC__)
+# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
+# define CYTHON_UNUSED __attribute__ ((__unused__))
+# else
+# define CYTHON_UNUSED
+# endif
+#endif
+#ifndef CYTHON_MAYBE_UNUSED_VAR
+# if defined(__cplusplus)
+ template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
+# else
+# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
+# endif
+#endif
+#ifndef CYTHON_NCP_UNUSED
+# if CYTHON_COMPILING_IN_CPYTHON
+# define CYTHON_NCP_UNUSED
+# else
+# define CYTHON_NCP_UNUSED CYTHON_UNUSED
+# endif
+#endif
+#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
+#ifdef _MSC_VER
+ #ifndef _MSC_STDINT_H_
+ #if _MSC_VER < 1300
+ typedef unsigned char uint8_t;
+ typedef unsigned int uint32_t;
+ #else
+ typedef unsigned __int8 uint8_t;
+ typedef unsigned __int32 uint32_t;
+ #endif
+ #endif
+#else
+ #include <stdint.h>
+#endif
+#ifndef CYTHON_FALLTHROUGH
+ #if defined(__cplusplus) && __cplusplus >= 201103L
+ #if __has_cpp_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH [[fallthrough]]
+ #elif __has_cpp_attribute(clang::fallthrough)
+ #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
+ #elif __has_cpp_attribute(gnu::fallthrough)
+ #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
+ #endif
+ #endif
+ #ifndef CYTHON_FALLTHROUGH
+ #if __has_attribute(fallthrough)
+ #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
+ #else
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+ #if defined(__clang__ ) && defined(__apple_build_version__)
+ #if __apple_build_version__ < 7000000
+ #undef CYTHON_FALLTHROUGH
+ #define CYTHON_FALLTHROUGH
+ #endif
+ #endif
+#endif
+
+#ifndef CYTHON_INLINE
+ #if defined(__clang__)
+ #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
+ #elif defined(__GNUC__)
+ #define CYTHON_INLINE __inline__
+ #elif defined(_MSC_VER)
+ #define CYTHON_INLINE __inline
+ #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define CYTHON_INLINE inline
+ #else
+ #define CYTHON_INLINE
+ #endif
+#endif
+
+#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
+ #define Py_OptimizeFlag 0
+#endif
+#define __PYX_BUILD_PY_SSIZE_T "n"
+#define CYTHON_FORMAT_SSIZE_T "z"
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyClass_Type
+#else
+ #define __Pyx_BUILTIN_MODULE_NAME "builtins"
+ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
+ PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
+ #define __Pyx_DefaultClassType PyType_Type
+#endif
+#ifndef Py_TPFLAGS_CHECKTYPES
+ #define Py_TPFLAGS_CHECKTYPES 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_INDEX
+ #define Py_TPFLAGS_HAVE_INDEX 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
+ #define Py_TPFLAGS_HAVE_NEWBUFFER 0
+#endif
+#ifndef Py_TPFLAGS_HAVE_FINALIZE
+ #define Py_TPFLAGS_HAVE_FINALIZE 0
+#endif
+#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
+ #ifndef METH_FASTCALL
+ #define METH_FASTCALL 0x80
+ #endif
+ typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
+ typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
+ Py_ssize_t nargs, PyObject *kwnames);
+#else
+ #define __Pyx_PyCFunctionFast _PyCFunctionFast
+ #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
+#endif
+#if CYTHON_FAST_PYCCALL
+#define __Pyx_PyFastCFunction_Check(func)\
+ ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
+#else
+#define __Pyx_PyFastCFunction_Check(func) 0
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
+ #define PyObject_Malloc(s) PyMem_Malloc(s)
+ #define PyObject_Free(p) PyMem_Free(p)
+ #define PyObject_Realloc(p) PyMem_Realloc(p)
+#endif
+#if CYTHON_COMPILING_IN_PYSTON
+ #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
+#else
+ #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
+ #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
+#endif
+#if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#elif PY_VERSION_HEX >= 0x03060000
+ #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
+#elif PY_VERSION_HEX >= 0x03000000
+ #define __Pyx_PyThreadState_Current PyThreadState_GET()
+#else
+ #define __Pyx_PyThreadState_Current _PyThreadState_Current
+#endif
+#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
+#include "pythread.h"
+#define Py_tss_NEEDS_INIT 0
+typedef int Py_tss_t;
+static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
+ *key = PyThread_create_key();
+ return 0; // PyThread_create_key reports success always
+}
+static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
+ Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
+ *key = Py_tss_NEEDS_INIT;
+ return key;
+}
+static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
+ PyObject_Free(key);
+}
+static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
+ return *key != Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
+ PyThread_delete_key(*key);
+ *key = Py_tss_NEEDS_INIT;
+}
+static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
+ return PyThread_set_key_value(*key, value);
+}
+static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
+ return PyThread_get_key_value(*key);
+}
+#endif // TSS (Thread Specific Storage) API
+#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
+#define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
+#else
+#define __Pyx_PyDict_NewPresized(n) PyDict_New()
+#endif
+#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
+#else
+ #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
+ #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
+#define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
+#else
+#define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
+#endif
+#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
+ #define CYTHON_PEP393_ENABLED 1
+ #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
+ 0 : _PyUnicode_Ready((PyObject *)(op)))
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
+ #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
+ #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
+ #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
+#else
+ #define CYTHON_PEP393_ENABLED 0
+ #define PyUnicode_1BYTE_KIND 1
+ #define PyUnicode_2BYTE_KIND 2
+ #define PyUnicode_4BYTE_KIND 4
+ #define __Pyx_PyUnicode_READY(op) (0)
+ #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
+ #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
+ #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
+ #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
+ #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
+ #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
+ #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
+ #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
+#endif
+#if CYTHON_COMPILING_IN_PYPY
+ #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
+#else
+ #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
+ #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
+ PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
+ #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
+ #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
+#endif
+#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
+ #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
+#endif
+#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
+#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
+#else
+ #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
+#endif
+#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
+ #define PyObject_ASCII(o) PyObject_Repr(o)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBaseString_Type PyUnicode_Type
+ #define PyStringObject PyUnicodeObject
+ #define PyString_Type PyUnicode_Type
+ #define PyString_Check PyUnicode_Check
+ #define PyString_CheckExact PyUnicode_CheckExact
+ #define PyObject_Unicode PyObject_Str
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
+ #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
+#else
+ #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
+ #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
+#endif
+#ifndef PySet_CheckExact
+ #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
+#endif
+#if CYTHON_ASSUME_SAFE_MACROS
+ #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
+#else
+ #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyIntObject PyLongObject
+ #define PyInt_Type PyLong_Type
+ #define PyInt_Check(op) PyLong_Check(op)
+ #define PyInt_CheckExact(op) PyLong_CheckExact(op)
+ #define PyInt_FromString PyLong_FromString
+ #define PyInt_FromUnicode PyLong_FromUnicode
+ #define PyInt_FromLong PyLong_FromLong
+ #define PyInt_FromSize_t PyLong_FromSize_t
+ #define PyInt_FromSsize_t PyLong_FromSsize_t
+ #define PyInt_AsLong PyLong_AsLong
+ #define PyInt_AS_LONG PyLong_AS_LONG
+ #define PyInt_AsSsize_t PyLong_AsSsize_t
+ #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
+ #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
+ #define PyNumber_Int PyNumber_Long
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define PyBoolObject PyLongObject
+#endif
+#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
+ #ifndef PyUnicode_InternFromString
+ #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
+ #endif
+#endif
+#if PY_VERSION_HEX < 0x030200A4
+ typedef long Py_hash_t;
+ #define __Pyx_PyInt_FromHash_t PyInt_FromLong
+ #define __Pyx_PyInt_AsHash_t PyInt_AsLong
+#else
+ #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
+ #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
+#endif
+#if PY_MAJOR_VERSION >= 3
+ #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
+#else
+ #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
+#endif
+#if CYTHON_USE_ASYNC_SLOTS
+ #if PY_VERSION_HEX >= 0x030500B1
+ #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
+ #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
+ #else
+ #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
+ #endif
+#else
+ #define __Pyx_PyType_AsAsync(obj) NULL
+#endif
+#ifndef __Pyx_PyAsyncMethodsStruct
+ typedef struct {
+ unaryfunc am_await;
+ unaryfunc am_aiter;
+ unaryfunc am_anext;
+ } __Pyx_PyAsyncMethodsStruct;
+#endif
+
+#if defined(WIN32) || defined(MS_WINDOWS)
+ #define _USE_MATH_DEFINES
+#endif
+#include <math.h>
+#ifdef NAN
+#define __PYX_NAN() ((float) NAN)
+#else
+static CYTHON_INLINE float __PYX_NAN() {
+ float value;
+ memset(&value, 0xFF, sizeof(value));
+ return value;
+}
+#endif
+#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
+#define __Pyx_truncl trunc
+#else
+#define __Pyx_truncl truncl
+#endif
+
+
+#define __PYX_ERR(f_index, lineno, Ln_error) \
+{ \
+ __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
+}
+
+#ifndef __PYX_EXTERN_C
+ #ifdef __cplusplus
+ #define __PYX_EXTERN_C extern "C"
+ #else
+ #define __PYX_EXTERN_C extern
+ #endif
+#endif
+
+#define __PYX_HAVE__PyMca5__PyMcaPhysics__xas___xas
+#define __PYX_HAVE_API__PyMca5__PyMcaPhysics__xas___xas
+/* Early includes */
+#include <string.h>
+#include <stdio.h>
+#include "numpy/arrayobject.h"
+#include "numpy/ufuncobject.h"
+#include "polspl.h"
+#include "bessel0.h"
+#include "pythread.h"
+#include <stdlib.h>
+#include "pystate.h"
+#ifdef _OPENMP
+#include <omp.h>
+#endif /* _OPENMP */
+
+#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
+#define CYTHON_WITHOUT_ASSERTIONS
+#endif
+
+typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
+ const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
+
+#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
+#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
+#define __PYX_DEFAULT_STRING_ENCODING ""
+#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
+#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#define __Pyx_uchar_cast(c) ((unsigned char)c)
+#define __Pyx_long_cast(x) ((long)x)
+#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
+ (sizeof(type) < sizeof(Py_ssize_t)) ||\
+ (sizeof(type) > sizeof(Py_ssize_t) &&\
+ likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX) &&\
+ (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
+ v == (type)PY_SSIZE_T_MIN))) ||\
+ (sizeof(type) == sizeof(Py_ssize_t) &&\
+ (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
+ v == (type)PY_SSIZE_T_MAX))) )
+#if defined (__cplusplus) && __cplusplus >= 201103L
+ #include <cstdlib>
+ #define __Pyx_sst_abs(value) std::abs(value)
+#elif SIZEOF_INT >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) abs(value)
+#elif SIZEOF_LONG >= SIZEOF_SIZE_T
+ #define __Pyx_sst_abs(value) labs(value)
+#elif defined (_MSC_VER)
+ #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
+#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+ #define __Pyx_sst_abs(value) llabs(value)
+#elif defined (__GNUC__)
+ #define __Pyx_sst_abs(value) __builtin_llabs(value)
+#else
+ #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
+#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
+#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
+#define __Pyx_PyBytes_FromString PyBytes_FromString
+#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
+#else
+ #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
+ #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
+#endif
+#define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
+#define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
+#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
+#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
+#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
+#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
+#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
+static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
+ const Py_UNICODE *u_end = u;
+ while (*u_end++) ;
+ return (size_t)(u_end - u - 1);
+}
+#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
+#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
+#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
+#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
+#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
+#define __Pyx_PySequence_Tuple(obj)\
+ (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
+#if CYTHON_ASSUME_SAFE_MACROS
+#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
+#else
+#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
+#endif
+#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
+#else
+#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
+#endif
+#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+static int __Pyx_sys_getdefaultencoding_not_ascii;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ PyObject* ascii_chars_u = NULL;
+ PyObject* ascii_chars_b = NULL;
+ const char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ if (strcmp(default_encoding_c, "ascii") == 0) {
+ __Pyx_sys_getdefaultencoding_not_ascii = 0;
+ } else {
+ char ascii_chars[128];
+ int c;
+ for (c = 0; c < 128; c++) {
+ ascii_chars[c] = c;
+ }
+ __Pyx_sys_getdefaultencoding_not_ascii = 1;
+ ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
+ if (!ascii_chars_u) goto bad;
+ ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
+ if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
+ PyErr_Format(
+ PyExc_ValueError,
+ "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
+ default_encoding_c);
+ goto bad;
+ }
+ Py_DECREF(ascii_chars_u);
+ Py_DECREF(ascii_chars_b);
+ }
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ Py_XDECREF(ascii_chars_u);
+ Py_XDECREF(ascii_chars_b);
+ return -1;
+}
+#endif
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
+#else
+#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
+#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+static char* __PYX_DEFAULT_STRING_ENCODING;
+static int __Pyx_init_sys_getdefaultencoding_params(void) {
+ PyObject* sys;
+ PyObject* default_encoding = NULL;
+ char* default_encoding_c;
+ sys = PyImport_ImportModule("sys");
+ if (!sys) goto bad;
+ default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
+ Py_DECREF(sys);
+ if (!default_encoding) goto bad;
+ default_encoding_c = PyBytes_AsString(default_encoding);
+ if (!default_encoding_c) goto bad;
+ __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
+ if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
+ strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
+ Py_DECREF(default_encoding);
+ return 0;
+bad:
+ Py_XDECREF(default_encoding);
+ return -1;
+}
+#endif
+#endif
+
+
+/* Test for GCC > 2.95 */
+#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
+ #define likely(x) __builtin_expect(!!(x), 1)
+ #define unlikely(x) __builtin_expect(!!(x), 0)
+#else /* !__GNUC__ or GCC < 2.95 */
+ #define likely(x) (x)
+ #define unlikely(x) (x)
+#endif /* __GNUC__ */
+static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
+
+static PyObject *__pyx_m = NULL;
+static PyObject *__pyx_d;
+static PyObject *__pyx_b;
+static PyObject *__pyx_cython_runtime = NULL;
+static PyObject *__pyx_empty_tuple;
+static PyObject *__pyx_empty_bytes;
+static PyObject *__pyx_empty_unicode;
+static int __pyx_lineno;
+static int __pyx_clineno = 0;
+static const char * __pyx_cfilenm= __FILE__;
+static const char *__pyx_filename;
+
+/* Header.proto */
+#if !defined(CYTHON_CCOMPLEX)
+ #if defined(__cplusplus)
+ #define CYTHON_CCOMPLEX 1
+ #elif defined(_Complex_I)
+ #define CYTHON_CCOMPLEX 1
+ #else
+ #define CYTHON_CCOMPLEX 0
+ #endif
+#endif
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #include <complex>
+ #else
+ #include <complex.h>
+ #endif
+#endif
+#if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
+ #undef _Complex_I
+ #define _Complex_I 1.0fj
+#endif
+
+
+static const char *__pyx_f[] = {
+ "PyMca5\\PyMcaPhysics\\xas\\_xas\\cython\\_xas.pyx",
+ "__init__.pxd",
+ "stringsource",
+ "type.pxd",
+};
+/* MemviewSliceStruct.proto */
+struct __pyx_memoryview_obj;
+typedef struct {
+ struct __pyx_memoryview_obj *memview;
+ char *data;
+ Py_ssize_t shape[8];
+ Py_ssize_t strides[8];
+ Py_ssize_t suboffsets[8];
+} __Pyx_memviewslice;
+#define __Pyx_MemoryView_Len(m) (m.shape[0])
+
+/* Atomics.proto */
+#include <pythread.h>
+#ifndef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 1
+#endif
+#define __pyx_atomic_int_type int
+#if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
+ (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
+ !defined(__i386__)
+ #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
+ #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using GNU atomics"
+ #endif
+#elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
+ #include <Windows.h>
+ #undef __pyx_atomic_int_type
+ #define __pyx_atomic_int_type LONG
+ #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #pragma message ("Using MSVC atomics")
+ #endif
+#elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
+ #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
+ #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Using Intel atomics"
+ #endif
+#else
+ #undef CYTHON_ATOMICS
+ #define CYTHON_ATOMICS 0
+ #ifdef __PYX_DEBUG_ATOMICS
+ #warning "Not using atomics"
+ #endif
+#endif
+typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
+#if CYTHON_ATOMICS
+ #define __pyx_add_acquisition_count(memview)\
+ __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview)\
+ __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
+#else
+ #define __pyx_add_acquisition_count(memview)\
+ __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+ #define __pyx_sub_acquisition_count(memview)\
+ __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
+#endif
+
+/* BufferFormatStructs.proto */
+#define IS_UNSIGNED(type) (((type) -1) > 0)
+struct __Pyx_StructField_;
+#define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
+typedef struct {
+ const char* name;
+ struct __Pyx_StructField_* fields;
+ size_t size;
+ size_t arraysize[8];
+ int ndim;
+ char typegroup;
+ char is_unsigned;
+ int flags;
+} __Pyx_TypeInfo;
+typedef struct __Pyx_StructField_ {
+ __Pyx_TypeInfo* type;
+ const char* name;
+ size_t offset;
+} __Pyx_StructField;
+typedef struct {
+ __Pyx_StructField* field;
+ size_t parent_offset;
+} __Pyx_BufFmt_StackElem;
+typedef struct {
+ __Pyx_StructField root;
+ __Pyx_BufFmt_StackElem* head;
+ size_t fmt_offset;
+ size_t new_count, enc_count;
+ size_t struct_alignment;
+ int is_complex;
+ char enc_type;
+ char new_packmode;
+ char enc_packmode;
+ char is_valid_array;
+} __Pyx_BufFmt_Context;
+
+/* ForceInitThreads.proto */
+#ifndef __PYX_FORCE_INIT_THREADS
+ #define __PYX_FORCE_INIT_THREADS 0
+#endif
+
+/* NoFastGil.proto */
+#define __Pyx_PyGILState_Ensure PyGILState_Ensure
+#define __Pyx_PyGILState_Release PyGILState_Release
+#define __Pyx_FastGIL_Remember()
+#define __Pyx_FastGIL_Forget()
+#define __Pyx_FastGilFuncInit()
+
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":730
+ * # in Cython to enable them only on the right systems.
+ *
+ * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ */
+typedef npy_int8 __pyx_t_5numpy_int8_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":731
+ *
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t
+ */
+typedef npy_int16 __pyx_t_5numpy_int16_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":732
+ * ctypedef npy_int8 int8_t
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_int64 int64_t
+ * #ctypedef npy_int96 int96_t
+ */
+typedef npy_int32 __pyx_t_5numpy_int32_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":733
+ * ctypedef npy_int16 int16_t
+ * ctypedef npy_int32 int32_t
+ * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_int96 int96_t
+ * #ctypedef npy_int128 int128_t
+ */
+typedef npy_int64 __pyx_t_5numpy_int64_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":737
+ * #ctypedef npy_int128 int128_t
+ *
+ * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ */
+typedef npy_uint8 __pyx_t_5numpy_uint8_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":738
+ *
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t
+ */
+typedef npy_uint16 __pyx_t_5numpy_uint16_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":739
+ * ctypedef npy_uint8 uint8_t
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uint64 uint64_t
+ * #ctypedef npy_uint96 uint96_t
+ */
+typedef npy_uint32 __pyx_t_5numpy_uint32_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":740
+ * ctypedef npy_uint16 uint16_t
+ * ctypedef npy_uint32 uint32_t
+ * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_uint96 uint96_t
+ * #ctypedef npy_uint128 uint128_t
+ */
+typedef npy_uint64 __pyx_t_5numpy_uint64_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":744
+ * #ctypedef npy_uint128 uint128_t
+ *
+ * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
+ * ctypedef npy_float64 float64_t
+ * #ctypedef npy_float80 float80_t
+ */
+typedef npy_float32 __pyx_t_5numpy_float32_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":745
+ *
+ * ctypedef npy_float32 float32_t
+ * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
+ * #ctypedef npy_float80 float80_t
+ * #ctypedef npy_float128 float128_t
+ */
+typedef npy_float64 __pyx_t_5numpy_float64_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":754
+ * # The int types are mapped a bit surprising --
+ * # numpy.int corresponds to 'l' and numpy.long to 'q'
+ * ctypedef npy_long int_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t
+ */
+typedef npy_long __pyx_t_5numpy_int_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":755
+ * # numpy.int corresponds to 'l' and numpy.long to 'q'
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longlong longlong_t
+ *
+ */
+typedef npy_longlong __pyx_t_5numpy_long_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":756
+ * ctypedef npy_long int_t
+ * ctypedef npy_longlong long_t
+ * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_ulong uint_t
+ */
+typedef npy_longlong __pyx_t_5numpy_longlong_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":758
+ * ctypedef npy_longlong longlong_t
+ *
+ * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t
+ */
+typedef npy_ulong __pyx_t_5numpy_uint_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":759
+ *
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":760
+ * ctypedef npy_ulong uint_t
+ * ctypedef npy_ulonglong ulong_t
+ * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_intp intp_t
+ */
+typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":762
+ * ctypedef npy_ulonglong ulonglong_t
+ *
+ * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
+ * ctypedef npy_uintp uintp_t
+ *
+ */
+typedef npy_intp __pyx_t_5numpy_intp_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":763
+ *
+ * ctypedef npy_intp intp_t
+ * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_double float_t
+ */
+typedef npy_uintp __pyx_t_5numpy_uintp_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":765
+ * ctypedef npy_uintp uintp_t
+ *
+ * ctypedef npy_double float_t # <<<<<<<<<<<<<<
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t
+ */
+typedef npy_double __pyx_t_5numpy_float_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":766
+ *
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t # <<<<<<<<<<<<<<
+ * ctypedef npy_longdouble longdouble_t
+ *
+ */
+typedef npy_double __pyx_t_5numpy_double_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":767
+ * ctypedef npy_double float_t
+ * ctypedef npy_double double_t
+ * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cfloat cfloat_t
+ */
+typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
+/* Declarations.proto */
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< float > __pyx_t_float_complex;
+ #else
+ typedef float _Complex __pyx_t_float_complex;
+ #endif
+#else
+ typedef struct { float real, imag; } __pyx_t_float_complex;
+#endif
+static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
+
+/* Declarations.proto */
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ typedef ::std::complex< double > __pyx_t_double_complex;
+ #else
+ typedef double _Complex __pyx_t_double_complex;
+ #endif
+#else
+ typedef struct { double real, imag; } __pyx_t_double_complex;
+#endif
+static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
+
+
+/*--- Type declarations ---*/
+struct __pyx_array_obj;
+struct __pyx_MemviewEnum_obj;
+struct __pyx_memoryview_obj;
+struct __pyx_memoryviewslice_obj;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":769
+ * ctypedef npy_longdouble longdouble_t
+ *
+ * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t
+ */
+typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":770
+ *
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ */
+typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":771
+ * ctypedef npy_cfloat cfloat_t
+ * ctypedef npy_cdouble cdouble_t
+ * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
+ *
+ * ctypedef npy_cdouble complex_t
+ */
+typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":773
+ * ctypedef npy_clongdouble clongdouble_t
+ *
+ * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ */
+typedef npy_cdouble __pyx_t_5numpy_complex_t;
+
+/* "View.MemoryView":104
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+struct __pyx_array_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_array *__pyx_vtab;
+ char *data;
+ Py_ssize_t len;
+ char *format;
+ int ndim;
+ Py_ssize_t *_shape;
+ Py_ssize_t *_strides;
+ Py_ssize_t itemsize;
+ PyObject *mode;
+ PyObject *_format;
+ void (*callback_free_data)(void *);
+ int free_data;
+ int dtype_is_object;
+};
+
+
+/* "View.MemoryView":278
+ *
+ * @cname('__pyx_MemviewEnum')
+ * cdef class Enum(object): # <<<<<<<<<<<<<<
+ * cdef object name
+ * def __init__(self, name):
+ */
+struct __pyx_MemviewEnum_obj {
+ PyObject_HEAD
+ PyObject *name;
+};
+
+
+/* "View.MemoryView":329
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+struct __pyx_memoryview_obj {
+ PyObject_HEAD
+ struct __pyx_vtabstruct_memoryview *__pyx_vtab;
+ PyObject *obj;
+ PyObject *_size;
+ PyObject *_array_interface;
+ PyThread_type_lock lock;
+ __pyx_atomic_int acquisition_count[2];
+ __pyx_atomic_int *acquisition_count_aligned_p;
+ Py_buffer view;
+ int flags;
+ int dtype_is_object;
+ __Pyx_TypeInfo *typeinfo;
+};
+
+
+/* "View.MemoryView":960
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+struct __pyx_memoryviewslice_obj {
+ struct __pyx_memoryview_obj __pyx_base;
+ __Pyx_memviewslice from_slice;
+ PyObject *from_object;
+ PyObject *(*to_object_func)(char *);
+ int (*to_dtype_func)(char *, PyObject *);
+};
+
+
+
+/* "View.MemoryView":104
+ *
+ * @cname("__pyx_array")
+ * cdef class array: # <<<<<<<<<<<<<<
+ *
+ * cdef:
+ */
+
+struct __pyx_vtabstruct_array {
+ PyObject *(*get_memview)(struct __pyx_array_obj *);
+};
+static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
+
+
+/* "View.MemoryView":329
+ *
+ * @cname('__pyx_memoryview')
+ * cdef class memoryview(object): # <<<<<<<<<<<<<<
+ *
+ * cdef object obj
+ */
+
+struct __pyx_vtabstruct_memoryview {
+ char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
+ PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
+ PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
+ PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
+};
+static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
+
+
+/* "View.MemoryView":960
+ *
+ * @cname('__pyx_memoryviewslice')
+ * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
+ * "Internal class for passing memoryview slices to Python"
+ *
+ */
+
+struct __pyx_vtabstruct__memoryviewslice {
+ struct __pyx_vtabstruct_memoryview __pyx_base;
+};
+static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
+
+/* --- Runtime support code (head) --- */
+/* Refnanny.proto */
+#ifndef CYTHON_REFNANNY
+ #define CYTHON_REFNANNY 0
+#endif
+#if CYTHON_REFNANNY
+ typedef struct {
+ void (*INCREF)(void*, PyObject*, int);
+ void (*DECREF)(void*, PyObject*, int);
+ void (*GOTREF)(void*, PyObject*, int);
+ void (*GIVEREF)(void*, PyObject*, int);
+ void* (*SetupContext)(const char*, int, const char*);
+ void (*FinishContext)(void**);
+ } __Pyx_RefNannyAPIStruct;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
+ static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
+ #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
+#ifdef WITH_THREAD
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ if (acquire_gil) {\
+ PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ PyGILState_Release(__pyx_gilstate_save);\
+ } else {\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
+ }
+#else
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)\
+ __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
+#endif
+ #define __Pyx_RefNannyFinishContext()\
+ __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
+ #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
+ #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
+ #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
+ #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
+ #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
+#else
+ #define __Pyx_RefNannyDeclarations
+ #define __Pyx_RefNannySetupContext(name, acquire_gil)
+ #define __Pyx_RefNannyFinishContext()
+ #define __Pyx_INCREF(r) Py_INCREF(r)
+ #define __Pyx_DECREF(r) Py_DECREF(r)
+ #define __Pyx_GOTREF(r)
+ #define __Pyx_GIVEREF(r)
+ #define __Pyx_XINCREF(r) Py_XINCREF(r)
+ #define __Pyx_XDECREF(r) Py_XDECREF(r)
+ #define __Pyx_XGOTREF(r)
+ #define __Pyx_XGIVEREF(r)
+#endif
+#define __Pyx_XDECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_XDECREF(tmp);\
+ } while (0)
+#define __Pyx_DECREF_SET(r, v) do {\
+ PyObject *tmp = (PyObject *) r;\
+ r = v; __Pyx_DECREF(tmp);\
+ } while (0)
+#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
+#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
+
+/* PyObjectGetAttrStr.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
+#endif
+
+/* GetBuiltinName.proto */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name);
+
+/* GetAttr.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
+
+/* HasAttr.proto */
+static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
+
+/* GetModuleGlobalName.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
+
+/* PyCFunctionFastCall.proto */
+#if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
+#else
+#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
+#endif
+
+/* PyFunctionFastCall.proto */
+#if CYTHON_FAST_PYCALL
+#define __Pyx_PyFunction_FastCall(func, args, nargs)\
+ __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
+#else
+#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
+#endif
+#endif
+
+/* PyObjectCall.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
+#else
+#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
+#endif
+
+/* PyObjectCallMethO.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
+#endif
+
+/* PyObjectCallOneArg.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
+
+/* BufferIndexError.proto */
+static void __Pyx_RaiseBufferIndexError(int axis);
+
+/* MemviewSliceInit.proto */
+#define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
+#define __Pyx_MEMVIEW_DIRECT 1
+#define __Pyx_MEMVIEW_PTR 2
+#define __Pyx_MEMVIEW_FULL 4
+#define __Pyx_MEMVIEW_CONTIG 8
+#define __Pyx_MEMVIEW_STRIDED 16
+#define __Pyx_MEMVIEW_FOLLOW 32
+#define __Pyx_IS_C_CONTIG 1
+#define __Pyx_IS_F_CONTIG 2
+static int __Pyx_init_memviewslice(
+ struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference);
+static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
+ __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
+#define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
+#define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
+#define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
+#define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
+static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
+
+/* RaiseArgTupleInvalid.proto */
+static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
+ Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
+
+/* RaiseDoubleKeywords.proto */
+static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
+
+/* ParseKeywords.proto */
+static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
+ PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
+ const char* function_name);
+
+/* ExtTypeTest.proto */
+static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
+
+/* IsLittleEndian.proto */
+static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
+
+/* BufferFormatCheck.proto */
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
+static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type);
+
+/* BufferGetAndValidate.proto */
+#define __Pyx_GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack)\
+ ((obj == Py_None || obj == NULL) ?\
+ (__Pyx_ZeroBuffer(buf), 0) :\
+ __Pyx__GetBufferAndValidate(buf, obj, dtype, flags, nd, cast, stack))
+static int __Pyx__GetBufferAndValidate(Py_buffer* buf, PyObject* obj,
+ __Pyx_TypeInfo* dtype, int flags, int nd, int cast, __Pyx_BufFmt_StackElem* stack);
+static void __Pyx_ZeroBuffer(Py_buffer* buf);
+static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info);
+static Py_ssize_t __Pyx_minusones[] = { -1, -1, -1, -1, -1, -1, -1, -1 };
+static Py_ssize_t __Pyx_zeros[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+
+/* SetItemInt.proto */
+#define __Pyx_SetItemInt(o, i, v, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_SetItemInt_Fast(o, (Py_ssize_t)i, v, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list assignment index out of range"), -1) :\
+ __Pyx_SetItemInt_Generic(o, to_py_func(i), v)))
+static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v);
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v,
+ int is_list, int wraparound, int boundscheck);
+
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
+#endif
+
+/* GetItemInt.proto */
+#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
+ (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
+ __Pyx_GetItemInt_Generic(o, to_py_func(i))))
+#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
+ (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
+ __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
+ (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ int wraparound, int boundscheck);
+static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
+ int is_list, int wraparound, int boundscheck);
+
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
+ (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
+#endif
+
+/* ObjectGetItem.proto */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
+#else
+#define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
+#endif
+
+/* PyIntBinop.proto */
+#if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
+#else
+#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
+ PyObject_RichCompare(op1, op2, Py_EQ)
+ #endif
+
+/* PyThreadStateGet.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
+#define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
+#define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
+#else
+#define __Pyx_PyThreadState_declare
+#define __Pyx_PyThreadState_assign
+#define __Pyx_PyErr_Occurred() PyErr_Occurred()
+#endif
+
+/* PyErrFetchRestore.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
+#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
+#else
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#endif
+#else
+#define __Pyx_PyErr_Clear() PyErr_Clear()
+#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
+#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
+#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
+#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
+#endif
+
+/* RaiseException.proto */
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
+
+/* DictGetItem.proto */
+#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
+#define __Pyx_PyObject_Dict_GetItem(obj, name)\
+ (likely(PyDict_CheckExact(obj)) ?\
+ __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
+#else
+#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
+#define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
+#endif
+
+/* RaiseTooManyValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
+
+/* RaiseNeedMoreValuesToUnpack.proto */
+static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
+
+/* RaiseNoneIterError.proto */
+static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
+
+/* SaveResetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
+#else
+#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
+#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
+#endif
+
+/* PyErrExceptionMatches.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
+#else
+#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
+#endif
+
+/* GetException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* ArgTypeTest.proto */
+#define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
+ ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
+ __Pyx__ArgTypeTest(obj, type, name, exact))
+static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
+
+/* IncludeStringH.proto */
+#include <string.h>
+
+/* BytesEquals.proto */
+static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
+
+/* UnicodeEquals.proto */
+static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
+
+/* StrEquals.proto */
+#if PY_MAJOR_VERSION >= 3
+#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
+#else
+#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
+#endif
+
+/* None.proto */
+static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
+
+/* UnaryNegOverflows.proto */
+#define UNARY_NEG_WOULD_OVERFLOW(x)\
+ (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
+
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
+/* decode_c_string_utf16.proto */
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = 0;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = -1;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
+ int byteorder = 1;
+ return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
+}
+
+/* decode_c_string.proto */
+static CYTHON_INLINE PyObject* __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));
+
+/* GetAttr3.proto */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
+
+/* SwapException.proto */
+#if CYTHON_FAST_THREAD_STATE
+#define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
+#endif
+
+/* Import.proto */
+static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
+
+/* FastTypeChecks.proto */
+#if CYTHON_COMPILING_IN_CPYTHON
+#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
+#else
+#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
+#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
+#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
+#endif
+#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
+
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+/* ListCompAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
+static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len)) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
+#endif
+
+/* ListExtend.proto */
+static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject* none = _PyList_Extend((PyListObject*)L, v);
+ if (unlikely(!none))
+ return -1;
+ Py_DECREF(none);
+ return 0;
+#else
+ return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
+#endif
+}
+
+/* ListAppend.proto */
+#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
+static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
+ PyListObject* L = (PyListObject*) list;
+ Py_ssize_t len = Py_SIZE(list);
+ if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
+ Py_INCREF(x);
+ PyList_SET_ITEM(list, len, x);
+ Py_SIZE(list) = len+1;
+ return 0;
+ }
+ return PyList_Append(list, x);
+}
+#else
+#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
+#endif
+
+/* None.proto */
+static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
+
+/* None.proto */
+static CYTHON_INLINE long __Pyx_div_long(long, long);
+
+/* WriteUnraisableException.proto */
+static void __Pyx_WriteUnraisable(const char *name, int clineno,
+ int lineno, const char *filename,
+ int full_traceback, int nogil);
+
+/* ImportFrom.proto */
+static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
+
+/* PyObject_GenericGetAttrNoDict.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
+#endif
+
+/* PyObject_GenericGetAttr.proto */
+#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
+#else
+#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
+#endif
+
+/* SetVTable.proto */
+static int __Pyx_SetVtable(PyObject *dict, void *vtable);
+
+/* SetupReduce.proto */
+static int __Pyx_setup_reduce(PyObject* type_obj);
+
+/* CLineInTraceback.proto */
+#ifdef CYTHON_CLINE_IN_TRACEBACK
+#define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
+#else
+static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
+#endif
+
+/* CodeObjectCache.proto */
+typedef struct {
+ PyCodeObject* code_object;
+ int code_line;
+} __Pyx_CodeObjectCacheEntry;
+struct __Pyx_CodeObjectCache {
+ int count;
+ int max_count;
+ __Pyx_CodeObjectCacheEntry* entries;
+};
+static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
+static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
+static PyCodeObject *__pyx_find_code_object(int code_line);
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
+
+/* AddTraceback.proto */
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename);
+
+#if PY_MAJOR_VERSION < 3
+ static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
+ static void __Pyx_ReleaseBuffer(Py_buffer *view);
+#else
+ #define __Pyx_GetBuffer PyObject_GetBuffer
+ #define __Pyx_ReleaseBuffer PyBuffer_Release
+#endif
+
+
+/* BufferStructDeclare.proto */
+typedef struct {
+ Py_ssize_t shape, strides, suboffsets;
+} __Pyx_Buf_DimInfo;
+typedef struct {
+ size_t refcount;
+ Py_buffer pybuffer;
+} __Pyx_Buffer;
+typedef struct {
+ __Pyx_Buffer *rcbuffer;
+ char *data;
+ __Pyx_Buf_DimInfo diminfo[8];
+} __Pyx_LocalBuf_ND;
+
+/* MemviewSliceIsContig.proto */
+static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
+
+/* OverlappingSlices.proto */
+static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize);
+
+/* Capsule.proto */
+static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
+
+/* MemviewDtypeToObject.proto */
+static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
+
+/* RealImag.proto */
+#if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ #define __Pyx_CREAL(z) ((z).real())
+ #define __Pyx_CIMAG(z) ((z).imag())
+ #else
+ #define __Pyx_CREAL(z) (__real__(z))
+ #define __Pyx_CIMAG(z) (__imag__(z))
+ #endif
+#else
+ #define __Pyx_CREAL(z) ((z).real)
+ #define __Pyx_CIMAG(z) ((z).imag)
+#endif
+#if defined(__cplusplus) && CYTHON_CCOMPLEX\
+ && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
+ #define __Pyx_SET_CREAL(z,x) ((z).real(x))
+ #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
+#else
+ #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
+ #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
+#endif
+
+/* Arithmetic.proto */
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq_float(a, b) ((a)==(b))
+ #define __Pyx_c_sum_float(a, b) ((a)+(b))
+ #define __Pyx_c_diff_float(a, b) ((a)-(b))
+ #define __Pyx_c_prod_float(a, b) ((a)*(b))
+ #define __Pyx_c_quot_float(a, b) ((a)/(b))
+ #define __Pyx_c_neg_float(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
+ #define __Pyx_c_conj_float(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs_float(z) (::std::abs(z))
+ #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero_float(z) ((z)==0)
+ #define __Pyx_c_conj_float(z) (conjf(z))
+ #if 1
+ #define __Pyx_c_abs_float(z) (cabsf(z))
+ #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
+ #endif
+#endif
+
+/* Arithmetic.proto */
+#if CYTHON_CCOMPLEX
+ #define __Pyx_c_eq_double(a, b) ((a)==(b))
+ #define __Pyx_c_sum_double(a, b) ((a)+(b))
+ #define __Pyx_c_diff_double(a, b) ((a)-(b))
+ #define __Pyx_c_prod_double(a, b) ((a)*(b))
+ #define __Pyx_c_quot_double(a, b) ((a)/(b))
+ #define __Pyx_c_neg_double(a) (-(a))
+ #ifdef __cplusplus
+ #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
+ #define __Pyx_c_conj_double(z) (::std::conj(z))
+ #if 1
+ #define __Pyx_c_abs_double(z) (::std::abs(z))
+ #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
+ #endif
+ #else
+ #define __Pyx_c_is_zero_double(z) ((z)==0)
+ #define __Pyx_c_conj_double(z) (conj(z))
+ #if 1
+ #define __Pyx_c_abs_double(z) (cabs(z))
+ #define __Pyx_c_pow_double(a, b) (cpow(a, b))
+ #endif
+ #endif
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
+ #endif
+#endif
+
+/* CIntToPy.proto */
+static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
+
+/* MemviewSliceCopyTemplate.proto */
+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);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
+
+/* CIntFromPy.proto */
+static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
+
+/* TypeInfoCompare.proto */
+static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
+
+/* MemviewSliceValidateAndInit.proto */
+static int __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);
+
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
+
+/* ObjectToMemviewSlice.proto */
+static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *, int writable_flag);
+
+/* CheckBinaryVersion.proto */
+static int __Pyx_check_binary_version(void);
+
+/* PyIdentifierFromString.proto */
+#if !defined(__Pyx_PyIdentifier_FromString)
+#if PY_MAJOR_VERSION < 3
+ #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
+#else
+ #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
+#endif
+#endif
+
+/* ModuleImport.proto */
+static PyObject *__Pyx_ImportModule(const char *name);
+
+/* TypeImport.proto */
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
+
+/* InitStrings.proto */
+static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
+
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
+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*/
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
+
+/* Module declarations from 'cython.view' */
+
+/* Module declarations from 'cython' */
+
+/* Module declarations from 'cpython.buffer' */
+
+/* Module declarations from 'libc.string' */
+
+/* Module declarations from 'libc.stdio' */
+
+/* Module declarations from '__builtin__' */
+
+/* Module declarations from 'cpython.type' */
+static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
+
+/* Module declarations from 'cpython' */
+
+/* Module declarations from 'cpython.object' */
+
+/* Module declarations from 'cpython.ref' */
+
+/* Module declarations from 'cpython.mem' */
+
+/* Module declarations from 'numpy' */
+
+/* Module declarations from 'numpy' */
+static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
+static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
+static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
+static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
+static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
+
+/* Module declarations from 'polspl' */
+
+/* Module declarations from 'bessel0' */
+
+/* Module declarations from 'PyMca5.PyMcaPhysics.xas._xas' */
+static PyTypeObject *__pyx_array_type = 0;
+static PyTypeObject *__pyx_MemviewEnum_type = 0;
+static PyTypeObject *__pyx_memoryview_type = 0;
+static PyTypeObject *__pyx_memoryviewslice_type = 0;
+static PyObject *generic = 0;
+static PyObject *strided = 0;
+static PyObject *indirect = 0;
+static PyObject *contiguous = 0;
+static PyObject *indirect_contiguous = 0;
+static int __pyx_memoryview_thread_locks_used;
+static PyThread_type_lock __pyx_memoryview_thread_locks[8];
+static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
+static void *__pyx_align_pointer(void *, size_t); /*proto*/
+static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
+static PyObject *_unellipsify(PyObject *, int); /*proto*/
+static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
+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*/
+static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
+static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
+static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
+static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
+static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
+static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
+static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
+static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
+static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
+static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
+static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
+static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
+static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
+static __Pyx_TypeInfo __Pyx_TypeInfo_int = { "int", NULL, sizeof(int), { 0 }, 0, IS_UNSIGNED(int) ? 'U' : 'I', IS_UNSIGNED(int), 0 };
+#define __Pyx_MODULE_NAME "PyMca5.PyMcaPhysics.xas._xas"
+extern int __pyx_module_is_main_PyMca5__PyMcaPhysics__xas___xas;
+int __pyx_module_is_main_PyMca5__PyMcaPhysics__xas___xas = 0;
+
+/* Implementation of 'PyMca5.PyMcaPhysics.xas._xas' */
+static PyObject *__pyx_builtin_range;
+static PyObject *__pyx_builtin_ValueError;
+static PyObject *__pyx_builtin_RuntimeError;
+static PyObject *__pyx_builtin_ImportError;
+static PyObject *__pyx_builtin_MemoryError;
+static PyObject *__pyx_builtin_enumerate;
+static PyObject *__pyx_builtin_TypeError;
+static PyObject *__pyx_builtin_Ellipsis;
+static PyObject *__pyx_builtin_id;
+static PyObject *__pyx_builtin_IndexError;
+static const char __pyx_k_O[] = "O";
+static const char __pyx_k_a[] = "a";
+static const char __pyx_k_c[] = "c";
+static const char __pyx_k_i[] = "i";
+static const char __pyx_k_j[] = "j";
+static const char __pyx_k_k[] = "k";
+static const char __pyx_k_m[] = "m";
+static const char __pyx_k_n[] = "n";
+static const char __pyx_k_t[] = "t";
+static const char __pyx_k_w[] = "w";
+static const char __pyx_k_x[] = "x";
+static const char __pyx_k_y[] = "y";
+static const char __pyx_k_df[] = "df";
+static const char __pyx_k_i1[] = "i1";
+static const char __pyx_k_id[] = "id";
+static const char __pyx_k_ik[] = "ik";
+static const char __pyx_k_j0[] = "j0";
+static const char __pyx_k_n1[] = "n1";
+static const char __pyx_k_nc[] = "nc";
+static const char __pyx_k_ni[] = "ni";
+static const char __pyx_k_nk[] = "nk";
+static const char __pyx_k_nr[] = "nr";
+static const char __pyx_k_ns[] = "ns";
+static const char __pyx_k_xh[] = "xh";
+static const char __pyx_k_xk[] = "xk";
+static const char __pyx_k_xl[] = "xl";
+static const char __pyx_k_abs[] = "abs";
+static const char __pyx_k_c_c[] = "c_c";
+static const char __pyx_k_c_w[] = "c_w";
+static const char __pyx_k_c_x[] = "c_x";
+static const char __pyx_k_c_y[] = "c_y";
+static const char __pyx_k_ibl[] = "ibl";
+static const char __pyx_k_len[] = "__len__";
+static const char __pyx_k_nbs[] = "nbs";
+static const char __pyx_k_new[] = "__new__";
+static const char __pyx_k_ni1[] = "ni1";
+static const char __pyx_k_nm1[] = "nm1";
+static const char __pyx_k_ns1[] = "ns1";
+static const char __pyx_k_obj[] = "obj";
+static const char __pyx_k_xh0[] = "xh0";
+static const char __pyx_k_xk0[] = "xk0";
+static const char __pyx_k_xl0[] = "xl0";
+static const char __pyx_k_base[] = "base";
+static const char __pyx_k_c_nc[] = "c_nc";
+static const char __pyx_k_c_nr[] = "c_nr";
+static const char __pyx_k_c_xh[] = "c_xh";
+static const char __pyx_k_c_xl[] = "c_xl";
+static const char __pyx_k_copy[] = "copy";
+static const char __pyx_k_dict[] = "__dict__";
+static const char __pyx_k_main[] = "__main__";
+static const char __pyx_k_mode[] = "mode";
+static const char __pyx_k_name[] = "name";
+static const char __pyx_k_ncol[] = "ncol";
+static const char __pyx_k_ndim[] = "ndim";
+static const char __pyx_k_npts[] = "npts";
+static const char __pyx_k_pack[] = "pack";
+static const char __pyx_k_size[] = "size";
+static const char __pyx_k_step[] = "step";
+static const char __pyx_k_stop[] = "stop";
+static const char __pyx_k_test[] = "__test__";
+static const char __pyx_k_ASCII[] = "ASCII";
+static const char __pyx_k_array[] = "array";
+static const char __pyx_k_class[] = "__class__";
+static const char __pyx_k_dtype[] = "dtype";
+static const char __pyx_k_error[] = "error";
+static const char __pyx_k_flags[] = "flags";
+static const char __pyx_k_int32[] = "int32";
+static const char __pyx_k_numpy[] = "numpy";
+static const char __pyx_k_power[] = "power";
+static const char __pyx_k_range[] = "range";
+static const char __pyx_k_shape[] = "shape";
+static const char __pyx_k_start[] = "start";
+static const char __pyx_k_zeros[] = "zeros";
+static const char __pyx_k_c_npts[] = "c_npts";
+static const char __pyx_k_encode[] = "encode";
+static const char __pyx_k_format[] = "format";
+static const char __pyx_k_import[] = "__import__";
+static const char __pyx_k_name_2[] = "__name__";
+static const char __pyx_k_ne_idl[] = "ne_idl";
+static const char __pyx_k_pickle[] = "pickle";
+static const char __pyx_k_polspl[] = "polspl";
+static const char __pyx_k_reduce[] = "__reduce__";
+static const char __pyx_k_result[] = "result";
+static const char __pyx_k_struct[] = "struct";
+static const char __pyx_k_unpack[] = "unpack";
+static const char __pyx_k_update[] = "update";
+static const char __pyx_k_c_sizeC[] = "c_sizeC";
+static const char __pyx_k_float64[] = "float64";
+static const char __pyx_k_fortran[] = "fortran";
+static const char __pyx_k_memview[] = "memview";
+static const char __pyx_k_polspl2[] = "polspl2";
+static const char __pyx_k_Ellipsis[] = "Ellipsis";
+static const char __pyx_k_getstate[] = "__getstate__";
+static const char __pyx_k_itemsize[] = "itemsize";
+static const char __pyx_k_pyx_type[] = "__pyx_type";
+static const char __pyx_k_setstate[] = "__setstate__";
+static const char __pyx_k_TypeError[] = "TypeError";
+static const char __pyx_k_enumerate[] = "enumerate";
+static const char __pyx_k_pyx_state[] = "__pyx_state";
+static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
+static const char __pyx_k_IndexError[] = "IndexError";
+static const char __pyx_k_ValueError[] = "ValueError";
+static const char __pyx_k_buffer_xh0[] = "buffer_xh0";
+static const char __pyx_k_buffer_xl0[] = "buffer_xl0";
+static const char __pyx_k_pyx_result[] = "__pyx_result";
+static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
+static const char __pyx_k_ImportError[] = "ImportError";
+static const char __pyx_k_MemoryError[] = "MemoryError";
+static const char __pyx_k_PickleError[] = "PickleError";
+static const char __pyx_k_RuntimeError[] = "RuntimeError";
+static const char __pyx_k_besselSingle[] = "_besselSingle";
+static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
+static const char __pyx_k_stringsource[] = "stringsource";
+static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
+static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
+static const char __pyx_k_besselMultiple[] = "_besselMultiple";
+static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
+static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
+static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
+static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
+static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
+static const char __pyx_k_ascontiguousarray[] = "ascontiguousarray";
+static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
+static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
+static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
+static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
+static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
+static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
+static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
+static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
+static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
+static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
+static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
+static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
+static const char __pyx_k_PyMca5_PyMcaPhysics_xas__xas[] = "PyMca5.PyMcaPhysics.xas._xas";
+static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
+static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
+static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
+static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
+static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
+static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
+static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
+static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
+static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
+static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
+static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
+static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
+static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
+static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
+static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
+static const char __pyx_k_PyMca5_PyMcaPhysics_xas__xas_cyt[] = "PyMca5\\PyMcaPhysics\\xas\\_xas\\cython\\_xas.pyx";
+static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
+static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
+static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
+static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
+static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
+static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
+static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
+static PyObject *__pyx_n_s_ASCII;
+static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
+static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
+static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
+static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
+static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
+static PyObject *__pyx_n_s_Ellipsis;
+static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
+static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
+static PyObject *__pyx_n_s_ImportError;
+static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
+static PyObject *__pyx_n_s_IndexError;
+static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
+static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
+static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
+static PyObject *__pyx_n_s_MemoryError;
+static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
+static PyObject *__pyx_kp_s_MemoryView_of_r_object;
+static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
+static PyObject *__pyx_n_b_O;
+static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
+static PyObject *__pyx_n_s_PickleError;
+static PyObject *__pyx_n_s_PyMca5_PyMcaPhysics_xas__xas;
+static PyObject *__pyx_kp_s_PyMca5_PyMcaPhysics_xas__xas_cyt;
+static PyObject *__pyx_n_s_RuntimeError;
+static PyObject *__pyx_n_s_TypeError;
+static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
+static PyObject *__pyx_n_s_ValueError;
+static PyObject *__pyx_n_s_View_MemoryView;
+static PyObject *__pyx_n_s_a;
+static PyObject *__pyx_n_s_abs;
+static PyObject *__pyx_n_s_allocate_buffer;
+static PyObject *__pyx_n_s_array;
+static PyObject *__pyx_n_s_ascontiguousarray;
+static PyObject *__pyx_n_s_base;
+static PyObject *__pyx_n_s_besselMultiple;
+static PyObject *__pyx_n_s_besselSingle;
+static PyObject *__pyx_n_s_buffer_xh0;
+static PyObject *__pyx_n_s_buffer_xl0;
+static PyObject *__pyx_n_s_c;
+static PyObject *__pyx_n_u_c;
+static PyObject *__pyx_n_s_c_c;
+static PyObject *__pyx_n_s_c_nc;
+static PyObject *__pyx_n_s_c_npts;
+static PyObject *__pyx_n_s_c_nr;
+static PyObject *__pyx_n_s_c_sizeC;
+static PyObject *__pyx_n_s_c_w;
+static PyObject *__pyx_n_s_c_x;
+static PyObject *__pyx_n_s_c_xh;
+static PyObject *__pyx_n_s_c_xl;
+static PyObject *__pyx_n_s_c_y;
+static PyObject *__pyx_n_s_class;
+static PyObject *__pyx_n_s_cline_in_traceback;
+static PyObject *__pyx_kp_s_contiguous_and_direct;
+static PyObject *__pyx_kp_s_contiguous_and_indirect;
+static PyObject *__pyx_n_s_copy;
+static PyObject *__pyx_n_s_df;
+static PyObject *__pyx_n_s_dict;
+static PyObject *__pyx_n_s_dtype;
+static PyObject *__pyx_n_s_dtype_is_object;
+static PyObject *__pyx_n_s_encode;
+static PyObject *__pyx_n_s_enumerate;
+static PyObject *__pyx_n_s_error;
+static PyObject *__pyx_n_s_flags;
+static PyObject *__pyx_n_s_float64;
+static PyObject *__pyx_n_s_format;
+static PyObject *__pyx_n_s_fortran;
+static PyObject *__pyx_n_u_fortran;
+static PyObject *__pyx_n_s_getstate;
+static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
+static PyObject *__pyx_n_s_i;
+static PyObject *__pyx_n_s_i1;
+static PyObject *__pyx_n_s_ibl;
+static PyObject *__pyx_n_s_id;
+static PyObject *__pyx_n_s_ik;
+static PyObject *__pyx_n_s_import;
+static PyObject *__pyx_n_s_int32;
+static PyObject *__pyx_n_s_itemsize;
+static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
+static PyObject *__pyx_n_s_j;
+static PyObject *__pyx_n_s_j0;
+static PyObject *__pyx_n_s_k;
+static PyObject *__pyx_n_s_len;
+static PyObject *__pyx_n_s_m;
+static PyObject *__pyx_n_s_main;
+static PyObject *__pyx_n_s_memview;
+static PyObject *__pyx_n_s_mode;
+static PyObject *__pyx_n_s_n;
+static PyObject *__pyx_n_s_n1;
+static PyObject *__pyx_n_s_name;
+static PyObject *__pyx_n_s_name_2;
+static PyObject *__pyx_n_s_nbs;
+static PyObject *__pyx_n_s_nc;
+static PyObject *__pyx_n_s_ncol;
+static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
+static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
+static PyObject *__pyx_n_s_ndim;
+static PyObject *__pyx_n_s_ne_idl;
+static PyObject *__pyx_n_s_new;
+static PyObject *__pyx_n_s_ni;
+static PyObject *__pyx_n_s_ni1;
+static PyObject *__pyx_n_s_nk;
+static PyObject *__pyx_n_s_nm1;
+static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
+static PyObject *__pyx_n_s_npts;
+static PyObject *__pyx_n_s_nr;
+static PyObject *__pyx_n_s_ns;
+static PyObject *__pyx_n_s_ns1;
+static PyObject *__pyx_n_s_numpy;
+static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
+static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
+static PyObject *__pyx_n_s_obj;
+static PyObject *__pyx_n_s_pack;
+static PyObject *__pyx_n_s_pickle;
+static PyObject *__pyx_n_s_polspl;
+static PyObject *__pyx_n_s_polspl2;
+static PyObject *__pyx_n_s_power;
+static PyObject *__pyx_n_s_pyx_PickleError;
+static PyObject *__pyx_n_s_pyx_checksum;
+static PyObject *__pyx_n_s_pyx_getbuffer;
+static PyObject *__pyx_n_s_pyx_result;
+static PyObject *__pyx_n_s_pyx_state;
+static PyObject *__pyx_n_s_pyx_type;
+static PyObject *__pyx_n_s_pyx_unpickle_Enum;
+static PyObject *__pyx_n_s_pyx_vtable;
+static PyObject *__pyx_n_s_range;
+static PyObject *__pyx_n_s_reduce;
+static PyObject *__pyx_n_s_reduce_cython;
+static PyObject *__pyx_n_s_reduce_ex;
+static PyObject *__pyx_n_s_result;
+static PyObject *__pyx_n_s_setstate;
+static PyObject *__pyx_n_s_setstate_cython;
+static PyObject *__pyx_n_s_shape;
+static PyObject *__pyx_n_s_size;
+static PyObject *__pyx_n_s_start;
+static PyObject *__pyx_n_s_step;
+static PyObject *__pyx_n_s_stop;
+static PyObject *__pyx_kp_s_strided_and_direct;
+static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
+static PyObject *__pyx_kp_s_strided_and_indirect;
+static PyObject *__pyx_kp_s_stringsource;
+static PyObject *__pyx_n_s_struct;
+static PyObject *__pyx_n_s_t;
+static PyObject *__pyx_n_s_test;
+static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
+static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
+static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
+static PyObject *__pyx_n_s_unpack;
+static PyObject *__pyx_n_s_update;
+static PyObject *__pyx_n_s_w;
+static PyObject *__pyx_n_s_x;
+static PyObject *__pyx_n_s_xh;
+static PyObject *__pyx_n_s_xh0;
+static PyObject *__pyx_n_s_xk;
+static PyObject *__pyx_n_s_xk0;
+static PyObject *__pyx_n_s_xl;
+static PyObject *__pyx_n_s_xl0;
+static PyObject *__pyx_n_s_y;
+static PyObject *__pyx_n_s_zeros;
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_j0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_2_besselMultiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_4_besselSingle(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x); /* proto */
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_6polspl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl, PyObject *__pyx_v_xh, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc); /* proto */
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_8polspl2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl0, PyObject *__pyx_v_xh0, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc); /* proto */
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
+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 */
+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 */
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
+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 */
+static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
+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 */
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
+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 */
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
+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 */
+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 */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
+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 */
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
+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 */
+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 */
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
+static PyObject *__pyx_float_1_0;
+static PyObject *__pyx_float_neg_1_;
+static PyObject *__pyx_int_0;
+static PyObject *__pyx_int_1;
+static PyObject *__pyx_int_2;
+static PyObject *__pyx_int_10;
+static PyObject *__pyx_int_11;
+static PyObject *__pyx_int_26;
+static PyObject *__pyx_int_36;
+static PyObject *__pyx_int_37;
+static PyObject *__pyx_int_184977713;
+static PyObject *__pyx_int_neg_1;
+static PyObject *__pyx_tuple_;
+static PyObject *__pyx_tuple__2;
+static PyObject *__pyx_tuple__3;
+static PyObject *__pyx_tuple__4;
+static PyObject *__pyx_tuple__5;
+static PyObject *__pyx_tuple__6;
+static PyObject *__pyx_tuple__7;
+static PyObject *__pyx_tuple__8;
+static PyObject *__pyx_tuple__9;
+static PyObject *__pyx_slice__33;
+static PyObject *__pyx_slice__34;
+static PyObject *__pyx_slice__35;
+static PyObject *__pyx_tuple__10;
+static PyObject *__pyx_tuple__11;
+static PyObject *__pyx_tuple__12;
+static PyObject *__pyx_tuple__13;
+static PyObject *__pyx_tuple__14;
+static PyObject *__pyx_tuple__15;
+static PyObject *__pyx_tuple__16;
+static PyObject *__pyx_tuple__17;
+static PyObject *__pyx_tuple__18;
+static PyObject *__pyx_tuple__19;
+static PyObject *__pyx_tuple__20;
+static PyObject *__pyx_tuple__21;
+static PyObject *__pyx_tuple__22;
+static PyObject *__pyx_tuple__23;
+static PyObject *__pyx_tuple__24;
+static PyObject *__pyx_tuple__25;
+static PyObject *__pyx_tuple__26;
+static PyObject *__pyx_tuple__27;
+static PyObject *__pyx_tuple__28;
+static PyObject *__pyx_tuple__29;
+static PyObject *__pyx_tuple__30;
+static PyObject *__pyx_tuple__31;
+static PyObject *__pyx_tuple__32;
+static PyObject *__pyx_tuple__36;
+static PyObject *__pyx_tuple__37;
+static PyObject *__pyx_tuple__38;
+static PyObject *__pyx_tuple__39;
+static PyObject *__pyx_tuple__41;
+static PyObject *__pyx_tuple__43;
+static PyObject *__pyx_tuple__45;
+static PyObject *__pyx_tuple__47;
+static PyObject *__pyx_tuple__49;
+static PyObject *__pyx_tuple__50;
+static PyObject *__pyx_tuple__51;
+static PyObject *__pyx_tuple__52;
+static PyObject *__pyx_tuple__53;
+static PyObject *__pyx_tuple__54;
+static PyObject *__pyx_codeobj__40;
+static PyObject *__pyx_codeobj__42;
+static PyObject *__pyx_codeobj__44;
+static PyObject *__pyx_codeobj__46;
+static PyObject *__pyx_codeobj__48;
+static PyObject *__pyx_codeobj__55;
+/* Late includes */
+
+/* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":35
+ * from bessel0 cimport j0Single, j0Multiple
+ *
+ * def j0(x): # <<<<<<<<<<<<<<
+ * if hasattr(x, "__len__"):
+ * return _besselMultiple(x)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0 = {"j0", (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0, METH_O, 0};
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0(PyObject *__pyx_self, PyObject *__pyx_v_x) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("j0 (wrapper)", 0);
+ __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_j0(__pyx_self, ((PyObject *)__pyx_v_x));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_j0(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ __Pyx_RefNannySetupContext("j0", 0);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":36
+ *
+ * def j0(x):
+ * if hasattr(x, "__len__"): # <<<<<<<<<<<<<<
+ * return _besselMultiple(x)
+ * else:
+ */
+ __pyx_t_1 = __Pyx_HasAttr(__pyx_v_x, __pyx_n_s_len); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 36, __pyx_L1_error)
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":37
+ * def j0(x):
+ * if hasattr(x, "__len__"):
+ * return _besselMultiple(x) # <<<<<<<<<<<<<<
+ * else:
+ * return _besselSingle(x)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_besselMultiple); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_x);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 37, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":36
+ *
+ * def j0(x):
+ * if hasattr(x, "__len__"): # <<<<<<<<<<<<<<
+ * return _besselMultiple(x)
+ * else:
+ */
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":39
+ * return _besselMultiple(x)
+ * else:
+ * return _besselSingle(x) # <<<<<<<<<<<<<<
+ *
+ * def _besselMultiple(x):
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_besselSingle); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 39, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_x); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_x};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 39, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_x);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 39, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":35
+ * from bessel0 cimport j0Single, j0Multiple
+ *
+ * def j0(x): # <<<<<<<<<<<<<<
+ * if hasattr(x, "__len__"):
+ * return _besselMultiple(x)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.j0", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":41
+ * return _besselSingle(x)
+ *
+ * def _besselMultiple(x): # <<<<<<<<<<<<<<
+ * result = numpy.array(x, copy=True, dtype=numpy.float64)
+ * cdef double[:] c_x = result
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple = {"_besselMultiple", (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple, METH_O, 0};
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple(PyObject *__pyx_self, PyObject *__pyx_v_x) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_besselMultiple (wrapper)", 0);
+ __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_2_besselMultiple(__pyx_self, ((PyObject *)__pyx_v_x));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_2_besselMultiple(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
+ PyObject *__pyx_v_result = NULL;
+ __Pyx_memviewslice __pyx_v_c_x = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_c_npts;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ __Pyx_RefNannySetupContext("_besselMultiple", 0);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":42
+ *
+ * def _besselMultiple(x):
+ * result = numpy.array(x, copy=True, dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double[:] c_x = result
+ * cdef int c_npts = c_x.size
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_array); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_x);
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_copy, Py_True) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_5) < 0) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 42, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":43
+ * def _besselMultiple(x):
+ * result = numpy.array(x, copy=True, dtype=numpy.float64)
+ * cdef double[:] c_x = result # <<<<<<<<<<<<<<
+ * cdef int c_npts = c_x.size
+ * j0Multiple(&c_x[0], c_npts)
+ */
+ __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_result, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(0, 43, __pyx_L1_error)
+ __pyx_v_c_x = __pyx_t_6;
+ __pyx_t_6.memview = NULL;
+ __pyx_t_6.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":44
+ * result = numpy.array(x, copy=True, dtype=numpy.float64)
+ * cdef double[:] c_x = result
+ * cdef int c_npts = c_x.size # <<<<<<<<<<<<<<
+ * j0Multiple(&c_x[0], c_npts)
+ * return result
+ */
+ __pyx_t_5 = __pyx_memoryview_fromslice(__pyx_v_c_x, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 44, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 44, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 44, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_c_npts = __pyx_t_7;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":45
+ * cdef double[:] c_x = result
+ * cdef int c_npts = c_x.size
+ * j0Multiple(&c_x[0], c_npts) # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_t_8 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_8 < 0) {
+ __pyx_t_8 += __pyx_v_c_x.shape[0];
+ if (unlikely(__pyx_t_8 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_8 >= __pyx_v_c_x.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 45, __pyx_L1_error)
+ }
+ j0Multiple((&(*((double *) ( /* dim=0 */ (__pyx_v_c_x.data + __pyx_t_8 * __pyx_v_c_x.strides[0]) )))), __pyx_v_c_npts);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":46
+ * cdef int c_npts = c_x.size
+ * j0Multiple(&c_x[0], c_npts)
+ * return result # <<<<<<<<<<<<<<
+ *
+ * def _besselSingle(double x):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":41
+ * return _besselSingle(x)
+ *
+ * def _besselMultiple(x): # <<<<<<<<<<<<<<
+ * result = numpy.array(x, copy=True, dtype=numpy.float64)
+ * cdef double[:] c_x = result
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas._besselMultiple", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_result);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_x, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":48
+ * return result
+ *
+ * def _besselSingle(double x): # <<<<<<<<<<<<<<
+ * return j0Single(x)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle(PyObject *__pyx_self, PyObject *__pyx_arg_x); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle = {"_besselSingle", (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle, METH_O, 0};
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle(PyObject *__pyx_self, PyObject *__pyx_arg_x) {
+ double __pyx_v_x;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("_besselSingle (wrapper)", 0);
+ assert(__pyx_arg_x); {
+ __pyx_v_x = __pyx_PyFloat_AsDouble(__pyx_arg_x); if (unlikely((__pyx_v_x == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 48, __pyx_L3_error)
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas._besselSingle", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_4_besselSingle(__pyx_self, ((double)__pyx_v_x));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_4_besselSingle(CYTHON_UNUSED PyObject *__pyx_self, double __pyx_v_x) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("_besselSingle", 0);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":49
+ *
+ * def _besselSingle(double x):
+ * return j0Single(x) # <<<<<<<<<<<<<<
+ *
+ * def polspl(x, y, w, npts, xl, xh, nr, nc):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyFloat_FromDouble(j0Single(__pyx_v_x)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 49, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":48
+ * return result
+ *
+ * def _besselSingle(double x): # <<<<<<<<<<<<<<
+ * return j0Single(x)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas._besselSingle", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":51
+ * return j0Single(x)
+ *
+ * def polspl(x, y, w, npts, xl, xh, nr, nc): # <<<<<<<<<<<<<<
+ * c = numpy.zeros((36,), dtype=numpy.float64)
+ * cdef double[:] c_c = c
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl = {"polspl", (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_x = 0;
+ PyObject *__pyx_v_y = 0;
+ PyObject *__pyx_v_w = 0;
+ PyObject *__pyx_v_npts = 0;
+ PyObject *__pyx_v_xl = 0;
+ PyObject *__pyx_v_xh = 0;
+ PyObject *__pyx_v_nr = 0;
+ PyObject *__pyx_v_nc = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("polspl (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_npts,&__pyx_n_s_xl,&__pyx_n_s_xh,&__pyx_n_s_nr,&__pyx_n_s_nc,0};
+ PyObject* values[8] = {0,0,0,0,0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 1); __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 2); __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_npts)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 3); __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xl)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 4); __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 5:
+ if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xh)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 5); __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 6:
+ if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 6); __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 7:
+ if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, 7); __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polspl") < 0)) __PYX_ERR(0, 51, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ }
+ __pyx_v_x = values[0];
+ __pyx_v_y = values[1];
+ __pyx_v_w = values[2];
+ __pyx_v_npts = values[3];
+ __pyx_v_xl = values[4];
+ __pyx_v_xh = values[5];
+ __pyx_v_nr = values[6];
+ __pyx_v_nc = values[7];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("polspl", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 51, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_6polspl(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_npts, __pyx_v_xl, __pyx_v_xh, __pyx_v_nr, __pyx_v_nc);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_6polspl(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl, PyObject *__pyx_v_xh, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc) {
+ PyObject *__pyx_v_c = NULL;
+ __Pyx_memviewslice __pyx_v_c_c = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_c_x = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_c_y = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_c_w = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_c_npts;
+ __Pyx_memviewslice __pyx_v_c_xl = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_memviewslice __pyx_v_c_xh = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_c_nr;
+ __Pyx_memviewslice __pyx_v_c_nc = { 0, 0, { 0 }, { 0 }, { 0 } };
+ int __pyx_v_c_sizeC;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_memviewslice __pyx_t_5 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ __Pyx_memviewslice __pyx_t_8 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_9;
+ Py_ssize_t __pyx_t_10;
+ Py_ssize_t __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ Py_ssize_t __pyx_t_13;
+ Py_ssize_t __pyx_t_14;
+ Py_ssize_t __pyx_t_15;
+ __Pyx_RefNannySetupContext("polspl", 0);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":52
+ *
+ * def polspl(x, y, w, npts, xl, xh, nr, nc):
+ * c = numpy.zeros((36,), dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double[:] c_c = c
+ * cdef double[:] c_x = numpy.ascontiguousarray(x,
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_tuple__2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_c = __pyx_t_4;
+ __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":53
+ * def polspl(x, y, w, npts, xl, xh, nr, nc):
+ * c = numpy.zeros((36,), dtype=numpy.float64)
+ * cdef double[:] c_c = c # <<<<<<<<<<<<<<
+ * cdef double[:] c_x = numpy.ascontiguousarray(x,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_v_c, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 53, __pyx_L1_error)
+ __pyx_v_c_c = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":54
+ * c = numpy.zeros((36,), dtype=numpy.float64)
+ * cdef double[:] c_c = c
+ * cdef double[:] c_x = numpy.ascontiguousarray(x, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef double[:] c_y = numpy.ascontiguousarray(y,
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_x);
+ __Pyx_GIVEREF(__pyx_v_x);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_x);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":55
+ * cdef double[:] c_c = c
+ * cdef double[:] c_x = numpy.ascontiguousarray(x,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double[:] c_y = numpy.ascontiguousarray(y,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 55, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":54
+ * c = numpy.zeros((36,), dtype=numpy.float64)
+ * cdef double[:] c_c = c
+ * cdef double[:] c_x = numpy.ascontiguousarray(x, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef double[:] c_y = numpy.ascontiguousarray(y,
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 54, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 54, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_c_x = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":56
+ * cdef double[:] c_x = numpy.ascontiguousarray(x,
+ * dtype=numpy.float64)
+ * cdef double[:] c_y = numpy.ascontiguousarray(y, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef double[:] c_w = numpy.ascontiguousarray(w,
+ */
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 56, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 56, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_y);
+ __Pyx_GIVEREF(__pyx_v_y);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_y);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":57
+ * dtype=numpy.float64)
+ * cdef double[:] c_y = numpy.ascontiguousarray(y,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double[:] c_w = numpy.ascontiguousarray(w,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_4 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 57, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 57, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_float64); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 57, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_dtype, __pyx_t_3) < 0) __PYX_ERR(0, 57, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":56
+ * cdef double[:] c_x = numpy.ascontiguousarray(x,
+ * dtype=numpy.float64)
+ * cdef double[:] c_y = numpy.ascontiguousarray(y, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef double[:] c_w = numpy.ascontiguousarray(w,
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 56, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_3, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 56, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_c_y = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":58
+ * cdef double[:] c_y = numpy.ascontiguousarray(y,
+ * dtype=numpy.float64)
+ * cdef double[:] c_w = numpy.ascontiguousarray(w, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int c_npts = npts
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 58, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 58, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_w);
+ __Pyx_GIVEREF(__pyx_v_w);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_w);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":59
+ * dtype=numpy.float64)
+ * cdef double[:] c_w = numpy.ascontiguousarray(w,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef int c_npts = npts
+ * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
+ */
+ __pyx_t_6 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 59, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 59, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 59, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_dtype, __pyx_t_1) < 0) __PYX_ERR(0, 59, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":58
+ * cdef double[:] c_y = numpy.ascontiguousarray(y,
+ * dtype=numpy.float64)
+ * cdef double[:] c_w = numpy.ascontiguousarray(w, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int c_npts = npts
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 58, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 58, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_c_w = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":60
+ * cdef double[:] c_w = numpy.ascontiguousarray(w,
+ * dtype=numpy.float64)
+ * cdef int c_npts = npts # <<<<<<<<<<<<<<
+ * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_npts); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 60, __pyx_L1_error)
+ __pyx_v_c_npts = __pyx_t_7;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":61
+ * dtype=numpy.float64)
+ * cdef int c_npts = npts
+ * cdef double[:] c_xl = numpy.ascontiguousarray(xl, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_xl);
+ __Pyx_GIVEREF(__pyx_v_xl);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_xl);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":62
+ * cdef int c_npts = npts
+ * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
+ * dtype=numpy.float64)
+ */
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_float64); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_dtype, __pyx_t_2) < 0) __PYX_ERR(0, 62, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":61
+ * dtype=numpy.float64)
+ * cdef int c_npts = npts
+ * cdef double[:] c_xl = numpy.ascontiguousarray(xl, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 61, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_c_xl = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":63
+ * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
+ * dtype=numpy.float64)
+ * cdef double[:] c_xh = numpy.ascontiguousarray(xh, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int c_nr = nr
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 63, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 63, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_xh);
+ __Pyx_GIVEREF(__pyx_v_xh);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_xh);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":64
+ * dtype=numpy.float64)
+ * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
+ * dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef int c_nr = nr
+ * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 64, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, __pyx_t_4) < 0) __PYX_ERR(0, 64, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":63
+ * cdef double[:] c_xl = numpy.ascontiguousarray(xl,
+ * dtype=numpy.float64)
+ * cdef double[:] c_xh = numpy.ascontiguousarray(xh, # <<<<<<<<<<<<<<
+ * dtype=numpy.float64)
+ * cdef int c_nr = nr
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 63, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_5 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_5.memview)) __PYX_ERR(0, 63, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_v_c_xh = __pyx_t_5;
+ __pyx_t_5.memview = NULL;
+ __pyx_t_5.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":65
+ * cdef double[:] c_xh = numpy.ascontiguousarray(xh,
+ * dtype=numpy.float64)
+ * cdef int c_nr = nr # <<<<<<<<<<<<<<
+ * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
+ * dtype=numpy.int32)
+ */
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_v_nr); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 65, __pyx_L1_error)
+ __pyx_v_c_nr = __pyx_t_7;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":66
+ * dtype=numpy.float64)
+ * cdef int c_nr = nr
+ * cdef int[:] c_nc = numpy.ascontiguousarray(nc, # <<<<<<<<<<<<<<
+ * dtype=numpy.int32)
+ * cdef int c_sizeC = c_c.size
+ */
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_nc);
+ __Pyx_GIVEREF(__pyx_v_nc);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nc);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":67
+ * cdef int c_nr = nr
+ * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
+ * dtype=numpy.int32) # <<<<<<<<<<<<<<
+ * cdef int c_sizeC = c_c.size
+ * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
+ */
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_int32); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 67, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, __pyx_t_6) < 0) __PYX_ERR(0, 67, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":66
+ * dtype=numpy.float64)
+ * cdef int c_nr = nr
+ * cdef int[:] c_nc = numpy.ascontiguousarray(nc, # <<<<<<<<<<<<<<
+ * dtype=numpy.int32)
+ * cdef int c_sizeC = c_c.size
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 66, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_8 = __Pyx_PyObject_to_MemoryviewSlice_ds_int(__pyx_t_6, PyBUF_WRITABLE); if (unlikely(!__pyx_t_8.memview)) __PYX_ERR(0, 66, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_c_nc = __pyx_t_8;
+ __pyx_t_8.memview = NULL;
+ __pyx_t_8.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":68
+ * cdef int[:] c_nc = numpy.ascontiguousarray(nc,
+ * dtype=numpy.int32)
+ * cdef int c_sizeC = c_c.size # <<<<<<<<<<<<<<
+ * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
+ * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC)
+ */
+ __pyx_t_6 = __pyx_memoryview_fromslice(__pyx_v_c_c, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_size); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 68, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_7 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_7 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 68, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_c_sizeC = __pyx_t_7;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":69
+ * dtype=numpy.int32)
+ * cdef int c_sizeC = c_c.size
+ * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \ # <<<<<<<<<<<<<<
+ * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC)
+ * return c
+ */
+ __pyx_t_9 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_9 < 0) {
+ __pyx_t_9 += __pyx_v_c_x.shape[0];
+ if (unlikely(__pyx_t_9 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_9 >= __pyx_v_c_x.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 69, __pyx_L1_error)
+ }
+ __pyx_t_10 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_10 < 0) {
+ __pyx_t_10 += __pyx_v_c_y.shape[0];
+ if (unlikely(__pyx_t_10 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_10 >= __pyx_v_c_y.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 69, __pyx_L1_error)
+ }
+ __pyx_t_11 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_11 < 0) {
+ __pyx_t_11 += __pyx_v_c_w.shape[0];
+ if (unlikely(__pyx_t_11 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_11 >= __pyx_v_c_w.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 69, __pyx_L1_error)
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":70
+ * cdef int c_sizeC = c_c.size
+ * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
+ * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC) # <<<<<<<<<<<<<<
+ * return c
+ *
+ */
+ __pyx_t_12 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_12 < 0) {
+ __pyx_t_12 += __pyx_v_c_xl.shape[0];
+ if (unlikely(__pyx_t_12 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_12 >= __pyx_v_c_xl.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 70, __pyx_L1_error)
+ }
+ __pyx_t_13 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_13 < 0) {
+ __pyx_t_13 += __pyx_v_c_xh.shape[0];
+ if (unlikely(__pyx_t_13 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_13 >= __pyx_v_c_xh.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 70, __pyx_L1_error)
+ }
+ __pyx_t_14 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_14 < 0) {
+ __pyx_t_14 += __pyx_v_c_nc.shape[0];
+ if (unlikely(__pyx_t_14 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_14 >= __pyx_v_c_nc.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 70, __pyx_L1_error)
+ }
+ __pyx_t_15 = 0;
+ __pyx_t_7 = -1;
+ if (__pyx_t_15 < 0) {
+ __pyx_t_15 += __pyx_v_c_c.shape[0];
+ if (unlikely(__pyx_t_15 < 0)) __pyx_t_7 = 0;
+ } else if (unlikely(__pyx_t_15 >= __pyx_v_c_c.shape[0])) __pyx_t_7 = 0;
+ if (unlikely(__pyx_t_7 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_7);
+ __PYX_ERR(0, 70, __pyx_L1_error)
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":69
+ * dtype=numpy.int32)
+ * cdef int c_sizeC = c_c.size
+ * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \ # <<<<<<<<<<<<<<
+ * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC)
+ * return c
+ */
+ polspl((&(*((double *) ( /* dim=0 */ (__pyx_v_c_x.data + __pyx_t_9 * __pyx_v_c_x.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_c_y.data + __pyx_t_10 * __pyx_v_c_y.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_c_w.data + __pyx_t_11 * __pyx_v_c_w.strides[0]) )))), __pyx_v_c_npts, (&(*((double *) ( /* dim=0 */ (__pyx_v_c_xl.data + __pyx_t_12 * __pyx_v_c_xl.strides[0]) )))), (&(*((double *) ( /* dim=0 */ (__pyx_v_c_xh.data + __pyx_t_13 * __pyx_v_c_xh.strides[0]) )))), (&(*((int *) ( /* dim=0 */ (__pyx_v_c_nc.data + __pyx_t_14 * __pyx_v_c_nc.strides[0]) )))), __pyx_v_c_nr, (&(*((double *) ( /* dim=0 */ (__pyx_v_c_c.data + __pyx_t_15 * __pyx_v_c_c.strides[0]) )))), __pyx_v_c_sizeC);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":71
+ * _polspl(&c_x[0], &c_y[0], &c_w[0], c_npts, \
+ * &c_xl[0], &c_xh[0], &c_nc[0], c_nr, &c_c[0], c_sizeC)
+ * return c # <<<<<<<<<<<<<<
+ *
+ * def polspl2(x,y,w,npts,xl0,xh0,nr,nc):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_c);
+ __pyx_r = __pyx_v_c;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":51
+ * return j0Single(x)
+ *
+ * def polspl(x, y, w, npts, xl, xh, nr, nc): # <<<<<<<<<<<<<<
+ * c = numpy.zeros((36,), dtype=numpy.float64)
+ * cdef double[:] c_c = c
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_5, 1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_8, 1);
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_c);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_c, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_x, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_y, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_w, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_xl, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_xh, 1);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_c_nc, 1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":73
+ * return c
+ *
+ * def polspl2(x,y,w,npts,xl0,xh0,nr,nc): # <<<<<<<<<<<<<<
+ *
+ * # ;
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2 = {"polspl2", (PyCFunction)__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_x = 0;
+ PyObject *__pyx_v_y = 0;
+ PyObject *__pyx_v_w = 0;
+ PyObject *__pyx_v_npts = 0;
+ PyObject *__pyx_v_xl0 = 0;
+ PyObject *__pyx_v_xh0 = 0;
+ PyObject *__pyx_v_nr = 0;
+ PyObject *__pyx_v_nc = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("polspl2 (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_w,&__pyx_n_s_npts,&__pyx_n_s_xl0,&__pyx_n_s_xh0,&__pyx_n_s_nr,&__pyx_n_s_nc,0};
+ PyObject* values[8] = {0,0,0,0,0,0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 8: values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ CYTHON_FALLTHROUGH;
+ case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ CYTHON_FALLTHROUGH;
+ case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ CYTHON_FALLTHROUGH;
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 1); __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_w)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 2); __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (likely((values[3] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_npts)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 3); __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (likely((values[4] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xl0)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 4); __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 5:
+ if (likely((values[5] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_xh0)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 5); __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 6:
+ if (likely((values[6] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nr)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 6); __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 7:
+ if (likely((values[7] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nc)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, 7); __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "polspl2") < 0)) __PYX_ERR(0, 73, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 8) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
+ values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
+ values[7] = PyTuple_GET_ITEM(__pyx_args, 7);
+ }
+ __pyx_v_x = values[0];
+ __pyx_v_y = values[1];
+ __pyx_v_w = values[2];
+ __pyx_v_npts = values[3];
+ __pyx_v_xl0 = values[4];
+ __pyx_v_xh0 = values[5];
+ __pyx_v_nr = values[6];
+ __pyx_v_nc = values[7];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("polspl2", 1, 8, 8, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 73, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_8polspl2(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_w, __pyx_v_npts, __pyx_v_xl0, __pyx_v_xh0, __pyx_v_nr, __pyx_v_nc);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_6PyMca5_12PyMcaPhysics_3xas_4_xas_8polspl2(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, PyObject *__pyx_v_w, PyObject *__pyx_v_npts, PyObject *__pyx_v_xl0, PyObject *__pyx_v_xh0, PyObject *__pyx_v_nr, PyObject *__pyx_v_nc) {
+ PyArrayObject *__pyx_v_buffer_xl0 = 0;
+ double *__pyx_v_xl;
+ PyArrayObject *__pyx_v_buffer_xh0 = 0;
+ double *__pyx_v_xh;
+ PyObject *__pyx_v_df = NULL;
+ PyObject *__pyx_v_a = NULL;
+ PyObject *__pyx_v_nbs = NULL;
+ __Pyx_memviewslice __pyx_v_xk0 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ double *__pyx_v_xk;
+ PyObject *__pyx_v_c = NULL;
+ int __pyx_v_j;
+ int __pyx_v_i;
+ PyObject *__pyx_v_ne_idl = NULL;
+ PyObject *__pyx_v_n = NULL;
+ int __pyx_v_k;
+ int __pyx_v_ibl;
+ int __pyx_v_ns;
+ int __pyx_v_ns1;
+ PyObject *__pyx_v_t = NULL;
+ PyObject *__pyx_v_n1 = NULL;
+ PyObject *__pyx_v_ncol = NULL;
+ PyObject *__pyx_v_nk = NULL;
+ PyObject *__pyx_v_ik = NULL;
+ PyObject *__pyx_v_i1 = NULL;
+ PyObject *__pyx_v_nm1 = NULL;
+ int __pyx_v_m;
+ PyObject *__pyx_v_ni = NULL;
+ PyObject *__pyx_v_ni1 = NULL;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_buffer_xh0;
+ __Pyx_Buffer __pyx_pybuffer_buffer_xh0;
+ __Pyx_LocalBuf_ND __pyx_pybuffernd_buffer_xl0;
+ __Pyx_Buffer __pyx_pybuffer_buffer_xl0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyArrayObject *__pyx_t_7 = NULL;
+ PyArrayObject *__pyx_t_8 = NULL;
+ __Pyx_memviewslice __pyx_t_9 = { 0, 0, { 0 }, { 0 }, { 0 } };
+ Py_ssize_t __pyx_t_10;
+ long __pyx_t_11;
+ long __pyx_t_12;
+ long __pyx_t_13;
+ int __pyx_t_14;
+ double __pyx_t_15;
+ Py_ssize_t __pyx_t_16;
+ int __pyx_t_17;
+ long __pyx_t_18;
+ int __pyx_t_19;
+ long __pyx_t_20;
+ long __pyx_t_21;
+ int __pyx_t_22;
+ long __pyx_t_23;
+ long __pyx_t_24;
+ int __pyx_t_25;
+ PyObject *(*__pyx_t_26)(PyObject *);
+ Py_ssize_t __pyx_t_27;
+ PyObject *__pyx_t_28 = NULL;
+ PyObject *__pyx_t_29 = NULL;
+ PyObject *__pyx_t_30 = NULL;
+ __Pyx_RefNannySetupContext("polspl2", 0);
+ __pyx_pybuffer_buffer_xl0.pybuffer.buf = NULL;
+ __pyx_pybuffer_buffer_xl0.refcount = 0;
+ __pyx_pybuffernd_buffer_xl0.data = NULL;
+ __pyx_pybuffernd_buffer_xl0.rcbuffer = &__pyx_pybuffer_buffer_xl0;
+ __pyx_pybuffer_buffer_xh0.pybuffer.buf = NULL;
+ __pyx_pybuffer_buffer_xh0.refcount = 0;
+ __pyx_pybuffernd_buffer_xh0.data = NULL;
+ __pyx_pybuffernd_buffer_xh0.rcbuffer = &__pyx_pybuffer_buffer_xh0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":80
+ *
+ * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xl0 = \
+ * numpy.ascontiguousarray(xl0, numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double * xl = <double *> buffer_xl0.data
+ * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = NULL;
+ __pyx_t_5 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ __pyx_t_5 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_xl0, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_v_xl0, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (__pyx_t_2) {
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_xl0);
+ __Pyx_GIVEREF(__pyx_v_xl0);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_5, __pyx_v_xl0);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_5, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 80, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 80, __pyx_L1_error)
+ __pyx_t_7 = ((PyArrayObject *)__pyx_t_1);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer, (PyObject*)__pyx_t_7, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_buffer_xl0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer.buf = NULL;
+ __PYX_ERR(0, 79, __pyx_L1_error)
+ } else {__pyx_pybuffernd_buffer_xl0.diminfo[0].strides = __pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer_xl0.diminfo[0].shape = __pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_7 = 0;
+ __pyx_v_buffer_xl0 = ((PyArrayObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":81
+ * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xl0 = \
+ * numpy.ascontiguousarray(xl0, numpy.float64)
+ * cdef double * xl = <double *> buffer_xl0.data # <<<<<<<<<<<<<<
+ * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
+ * numpy.ascontiguousarray(xh0, numpy.float64)
+ */
+ __pyx_v_xl = ((double *)__pyx_v_buffer_xl0->data);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":83
+ * cdef double * xl = <double *> buffer_xl0.data
+ * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
+ * numpy.ascontiguousarray(xh0, numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double * xh = <double *> buffer_xh0.data
+ * df = numpy.zeros(26)
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_ascontiguousarray); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_float64); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = NULL;
+ __pyx_t_5 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_3)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_5 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_xh0, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_xh0, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_5, 2+__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_2 = PyTuple_New(2+__pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (__pyx_t_3) {
+ __Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
+ }
+ __Pyx_INCREF(__pyx_v_xh0);
+ __Pyx_GIVEREF(__pyx_v_xh0);
+ PyTuple_SET_ITEM(__pyx_t_2, 0+__pyx_t_5, __pyx_v_xh0);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 1+__pyx_t_5, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 83, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))))) __PYX_ERR(0, 83, __pyx_L1_error)
+ __pyx_t_8 = ((PyArrayObject *)__pyx_t_1);
+ {
+ __Pyx_BufFmt_StackElem __pyx_stack[1];
+ if (unlikely(__Pyx_GetBufferAndValidate(&__pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer, (PyObject*)__pyx_t_8, &__Pyx_TypeInfo_double, PyBUF_FORMAT| PyBUF_C_CONTIGUOUS, 1, 0, __pyx_stack) == -1)) {
+ __pyx_v_buffer_xh0 = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None); __pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer.buf = NULL;
+ __PYX_ERR(0, 82, __pyx_L1_error)
+ } else {__pyx_pybuffernd_buffer_xh0.diminfo[0].strides = __pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer.strides[0]; __pyx_pybuffernd_buffer_xh0.diminfo[0].shape = __pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer.shape[0];
+ }
+ }
+ __pyx_t_8 = 0;
+ __pyx_v_buffer_xh0 = ((PyArrayObject *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":84
+ * cdef numpy.ndarray[double, ndim=1, mode='c'] buffer_xh0 = \
+ * numpy.ascontiguousarray(xh0, numpy.float64)
+ * cdef double * xh = <double *> buffer_xh0.data # <<<<<<<<<<<<<<
+ * df = numpy.zeros(26)
+ * a = numpy.zeros((36,37))
+ */
+ __pyx_v_xh = ((double *)__pyx_v_buffer_xh0->data);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":85
+ * numpy.ascontiguousarray(xh0, numpy.float64)
+ * cdef double * xh = <double *> buffer_xh0.data
+ * df = numpy.zeros(26) # <<<<<<<<<<<<<<
+ * a = numpy.zeros((36,37))
+ * nbs = numpy.zeros(11,dtype=int)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 85, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 85, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_df = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":86
+ * cdef double * xh = <double *> buffer_xh0.data
+ * df = numpy.zeros(26)
+ * a = numpy.zeros((36,37)) # <<<<<<<<<<<<<<
+ * nbs = numpy.zeros(11,dtype=int)
+ * cdef double[:] xk0 = numpy.zeros(10)
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_a = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":87
+ * df = numpy.zeros(26)
+ * a = numpy.zeros((36,37))
+ * nbs = numpy.zeros(11,dtype=int) # <<<<<<<<<<<<<<
+ * cdef double[:] xk0 = numpy.zeros(10)
+ * cdef double * xk = &xk0[0]
+ */
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_zeros); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 87, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 87, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_t_1, __pyx_n_s_dtype, ((PyObject *)(&PyInt_Type))) < 0) __PYX_ERR(0, 87, __pyx_L1_error)
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__6, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 87, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_nbs = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":88
+ * a = numpy.zeros((36,37))
+ * nbs = numpy.zeros(11,dtype=int)
+ * cdef double[:] xk0 = numpy.zeros(10) # <<<<<<<<<<<<<<
+ * cdef double * xk = &xk0[0]
+ * c = numpy.zeros(36)
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_9 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_2, PyBUF_WRITABLE); if (unlikely(!__pyx_t_9.memview)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_xk0 = __pyx_t_9;
+ __pyx_t_9.memview = NULL;
+ __pyx_t_9.data = NULL;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":89
+ * nbs = numpy.zeros(11,dtype=int)
+ * cdef double[:] xk0 = numpy.zeros(10)
+ * cdef double * xk = &xk0[0] # <<<<<<<<<<<<<<
+ * c = numpy.zeros(36)
+ * cdef int j=0
+ */
+ __pyx_t_10 = 0;
+ __pyx_t_5 = -1;
+ if (__pyx_t_10 < 0) {
+ __pyx_t_10 += __pyx_v_xk0.shape[0];
+ if (unlikely(__pyx_t_10 < 0)) __pyx_t_5 = 0;
+ } else if (unlikely(__pyx_t_10 >= __pyx_v_xk0.shape[0])) __pyx_t_5 = 0;
+ if (unlikely(__pyx_t_5 != -1)) {
+ __Pyx_RaiseBufferIndexError(__pyx_t_5);
+ __PYX_ERR(0, 89, __pyx_L1_error)
+ }
+ __pyx_v_xk = (&(*((double *) ( /* dim=0 */ (__pyx_v_xk0.data + __pyx_t_10 * __pyx_v_xk0.strides[0]) ))));
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":90
+ * cdef double[:] xk0 = numpy.zeros(10)
+ * cdef double * xk = &xk0[0]
+ * c = numpy.zeros(36) # <<<<<<<<<<<<<<
+ * cdef int j=0
+ * cdef int i=0
+ */
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 90, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 90, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_c = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":91
+ * cdef double * xk = &xk0[0]
+ * c = numpy.zeros(36)
+ * cdef int j=0 # <<<<<<<<<<<<<<
+ * cdef int i=0
+ * ne_idl=0
+ */
+ __pyx_v_j = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":92
+ * c = numpy.zeros(36)
+ * cdef int j=0
+ * cdef int i=0 # <<<<<<<<<<<<<<
+ * ne_idl=0
+ * n = 0
+ */
+ __pyx_v_i = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":93
+ * cdef int j=0
+ * cdef int i=0
+ * ne_idl=0 # <<<<<<<<<<<<<<
+ * n = 0
+ * cdef int k = 0
+ */
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_v_ne_idl = __pyx_int_0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":94
+ * cdef int i=0
+ * ne_idl=0
+ * n = 0 # <<<<<<<<<<<<<<
+ * cdef int k = 0
+ * cdef int ibl = 0
+ */
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_v_n = __pyx_int_0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":95
+ * ne_idl=0
+ * n = 0
+ * cdef int k = 0 # <<<<<<<<<<<<<<
+ * cdef int ibl = 0
+ * cdef int ns = 0
+ */
+ __pyx_v_k = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":96
+ * n = 0
+ * cdef int k = 0
+ * cdef int ibl = 0 # <<<<<<<<<<<<<<
+ * cdef int ns = 0
+ * cdef int ns1 = 0
+ */
+ __pyx_v_ibl = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":97
+ * cdef int k = 0
+ * cdef int ibl = 0
+ * cdef int ns = 0 # <<<<<<<<<<<<<<
+ * cdef int ns1 = 0
+ *
+ */
+ __pyx_v_ns = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":98
+ * cdef int ibl = 0
+ * cdef int ns = 0
+ * cdef int ns1 = 0 # <<<<<<<<<<<<<<
+ *
+ * nbs[1]=1
+ */
+ __pyx_v_ns1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":100
+ * cdef int ns1 = 0
+ *
+ * nbs[1]=1 # <<<<<<<<<<<<<<
+ * for i in range(1,nr+1):
+ * n=n+int(nc[i])
+ */
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_nbs, 1, __pyx_int_1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1) < 0)) __PYX_ERR(0, 100, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":101
+ *
+ * nbs[1]=1
+ * for i in range(1,nr+1): # <<<<<<<<<<<<<<
+ * n=n+int(nc[i])
+ * nbs[i+1]=n+1
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_nr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 101, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":102
+ * nbs[1]=1
+ * for i in range(1,nr+1):
+ * n=n+int(nc[i]) # <<<<<<<<<<<<<<
+ * nbs[i+1]=n+1
+ * if xl[i] < xh[i]:
+ */
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nc, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyNumber_Int(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyNumber_Add(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 102, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":103
+ * for i in range(1,nr+1):
+ * n=n+int(nc[i])
+ * nbs[i+1]=n+1 # <<<<<<<<<<<<<<
+ * if xl[i] < xh[i]:
+ * pass
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 103, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_13 = (__pyx_v_i + 1);
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_nbs, __pyx_t_13, __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1) < 0)) __PYX_ERR(0, 103, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":104
+ * n=n+int(nc[i])
+ * nbs[i+1]=n+1
+ * if xl[i] < xh[i]: # <<<<<<<<<<<<<<
+ * pass
+ * else:
+ */
+ __pyx_t_14 = (((__pyx_v_xl[__pyx_v_i]) < (__pyx_v_xh[__pyx_v_i])) != 0);
+ if (__pyx_t_14) {
+ goto __pyx_L5;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":107
+ * pass
+ * else:
+ * t=xl[i] # <<<<<<<<<<<<<<
+ * xl[i]=xh[i]
+ * xh[i]=t
+ */
+ /*else*/ {
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xl[__pyx_v_i])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 107, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":108
+ * else:
+ * t=xl[i]
+ * xl[i]=xh[i] # <<<<<<<<<<<<<<
+ * xh[i]=t
+ *
+ */
+ (__pyx_v_xl[__pyx_v_i]) = (__pyx_v_xh[__pyx_v_i]);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":109
+ * t=xl[i]
+ * xl[i]=xh[i]
+ * xh[i]=t # <<<<<<<<<<<<<<
+ *
+ * n=n+2*(nr-1)
+ */
+ __pyx_t_15 = __pyx_PyFloat_AsDouble(__pyx_v_t); if (unlikely((__pyx_t_15 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 109, __pyx_L1_error)
+ (__pyx_v_xh[__pyx_v_i]) = __pyx_t_15;
+ }
+ __pyx_L5:;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":111
+ * xh[i]=t
+ *
+ * n=n+2*(nr-1) # <<<<<<<<<<<<<<
+ * n1=n+1
+ * xl[nr+1]=0.
+ */
+ __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_nr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyNumber_Multiply(__pyx_int_2, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 111, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyNumber_Add(__pyx_v_n, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 111, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_n, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":112
+ *
+ * n=n+2*(nr-1)
+ * n1=n+1 # <<<<<<<<<<<<<<
+ * xl[nr+1]=0.
+ * xh[nr+1]=0.
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 112, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_n1 = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":113
+ * n=n+2*(nr-1)
+ * n1=n+1
+ * xl[nr+1]=0. # <<<<<<<<<<<<<<
+ * xh[nr+1]=0.
+ *
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_nr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 113, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ (__pyx_v_xl[__pyx_t_16]) = 0.;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":114
+ * n1=n+1
+ * xl[nr+1]=0.
+ * xh[nr+1]=0. # <<<<<<<<<<<<<<
+ *
+ * # this loop ...
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_nr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 114, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_t_2); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ (__pyx_v_xh[__pyx_t_16]) = 0.;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":117
+ *
+ * # this loop ...
+ * for ibl in range(1,nr+1): # <<<<<<<<<<<<<<
+ * xk[ibl]=.5*(xh[ibl]+xl[ibl+1])
+ * if (xl[ibl] > xl[ibl+1]):
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_nr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_ibl = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":118
+ * # this loop ...
+ * for ibl in range(1,nr+1):
+ * xk[ibl]=.5*(xh[ibl]+xl[ibl+1]) # <<<<<<<<<<<<<<
+ * if (xl[ibl] > xl[ibl+1]):
+ * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
+ */
+ (__pyx_v_xk[__pyx_v_ibl]) = (.5 * ((__pyx_v_xh[__pyx_v_ibl]) + (__pyx_v_xl[(__pyx_v_ibl + 1)])));
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":119
+ * for ibl in range(1,nr+1):
+ * xk[ibl]=.5*(xh[ibl]+xl[ibl+1])
+ * if (xl[ibl] > xl[ibl+1]): # <<<<<<<<<<<<<<
+ * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
+ * ns=nbs[ibl]
+ */
+ __pyx_t_14 = (((__pyx_v_xl[__pyx_v_ibl]) > (__pyx_v_xl[(__pyx_v_ibl + 1)])) != 0);
+ if (__pyx_t_14) {
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":120
+ * xk[ibl]=.5*(xh[ibl]+xl[ibl+1])
+ * if (xl[ibl] > xl[ibl+1]):
+ * xk[ibl]=.5*(xl[ibl]+xh[ibl+1]) # <<<<<<<<<<<<<<
+ * ns=nbs[ibl]
+ * ne_idl=nbs[ibl+1]-1
+ */
+ (__pyx_v_xk[__pyx_v_ibl]) = (.5 * ((__pyx_v_xl[__pyx_v_ibl]) + (__pyx_v_xh[(__pyx_v_ibl + 1)])));
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":119
+ * for ibl in range(1,nr+1):
+ * xk[ibl]=.5*(xh[ibl]+xl[ibl+1])
+ * if (xl[ibl] > xl[ibl+1]): # <<<<<<<<<<<<<<
+ * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
+ * ns=nbs[ibl]
+ */
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":121
+ * if (xl[ibl] > xl[ibl+1]):
+ * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
+ * ns=nbs[ibl] # <<<<<<<<<<<<<<
+ * ne_idl=nbs[ibl+1]-1
+ * for i in range(1, npts+1):
+ */
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nbs, __pyx_v_ibl, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_17 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_17 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_ns = __pyx_t_17;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":122
+ * xk[ibl]=.5*(xl[ibl]+xh[ibl+1])
+ * ns=nbs[ibl]
+ * ne_idl=nbs[ibl+1]-1 # <<<<<<<<<<<<<<
+ * for i in range(1, npts+1):
+ * if((x[i] < xl[ibl]) or (x[i] > xh[ibl])):
+ */
+ __pyx_t_13 = (__pyx_v_ibl + 1);
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_nbs, __pyx_t_13, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ne_idl, __pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":123
+ * ns=nbs[ibl]
+ * ne_idl=nbs[ibl+1]-1
+ * for i in range(1, npts+1): # <<<<<<<<<<<<<<
+ * if((x[i] < xl[ibl]) or (x[i] > xh[ibl])):
+ * pass
+ */
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_npts, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 123, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 123, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_18 = __pyx_t_13;
+ for (__pyx_t_17 = 1; __pyx_t_17 < __pyx_t_18; __pyx_t_17+=1) {
+ __pyx_v_i = __pyx_t_17;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":124
+ * ne_idl=nbs[ibl+1]-1
+ * for i in range(1, npts+1):
+ * if((x[i] < xl[ibl]) or (x[i] > xh[ibl])): # <<<<<<<<<<<<<<
+ * pass
+ * else:
+ */
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xl[__pyx_v_ibl])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LT); __Pyx_XGOTREF(__pyx_t_6); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (!__pyx_t_19) {
+ } else {
+ __pyx_t_14 = __pyx_t_19;
+ goto __pyx_L12_bool_binop_done;
+ }
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xh[__pyx_v_ibl])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_6, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_19 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_19 < 0)) __PYX_ERR(0, 124, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_14 = __pyx_t_19;
+ __pyx_L12_bool_binop_done:;
+ if (__pyx_t_14) {
+ goto __pyx_L11;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":127
+ * pass
+ * else:
+ * df[ns]=1.0 # <<<<<<<<<<<<<<
+ * ns1=ns+1
+ * for j in range(ns1,ne_idl+1):
+ */
+ /*else*/ {
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_df, __pyx_v_ns, __pyx_float_1_0, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 127, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":128
+ * else:
+ * df[ns]=1.0
+ * ns1=ns+1 # <<<<<<<<<<<<<<
+ * for j in range(ns1,ne_idl+1):
+ * df[j]=df[j-1]*x[i]
+ */
+ __pyx_v_ns1 = (__pyx_v_ns + 1);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":129
+ * df[ns]=1.0
+ * ns1=ns+1
+ * for j in range(ns1,ne_idl+1): # <<<<<<<<<<<<<<
+ * df[j]=df[j-1]*x[i]
+ * for j in range(ns,ne_idl+1):
+ */
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_ne_idl, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 129, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_20 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 129, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_21 = __pyx_t_20;
+ for (__pyx_t_22 = __pyx_v_ns1; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+ __pyx_v_j = __pyx_t_22;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":130
+ * ns1=ns+1
+ * for j in range(ns1,ne_idl+1):
+ * df[j]=df[j-1]*x[i] # <<<<<<<<<<<<<<
+ * for j in range(ns,ne_idl+1):
+ * for k in range(j,ne_idl+1):
+ */
+ __pyx_t_23 = (__pyx_v_j - 1);
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_df, __pyx_t_23, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 130, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_x, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 130, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 130, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (unlikely(__Pyx_SetItemInt(__pyx_v_df, __pyx_v_j, __pyx_t_6, int, 1, __Pyx_PyInt_From_int, 0, 1, 1) < 0)) __PYX_ERR(0, 130, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":131
+ * for j in range(ns1,ne_idl+1):
+ * df[j]=df[j-1]*x[i]
+ * for j in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
+ * for k in range(j,ne_idl+1):
+ * a[j,k]=a[j,k]+df[j]*df[k]*w[i]
+ */
+ __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_ne_idl, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_20 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 131, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_21 = __pyx_t_20;
+ for (__pyx_t_22 = __pyx_v_ns; __pyx_t_22 < __pyx_t_21; __pyx_t_22+=1) {
+ __pyx_v_j = __pyx_t_22;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":132
+ * df[j]=df[j-1]*x[i]
+ * for j in range(ns,ne_idl+1):
+ * for k in range(j,ne_idl+1): # <<<<<<<<<<<<<<
+ * a[j,k]=a[j,k]+df[j]*df[k]*w[i]
+ * a[j,n1]=a[j,n1]+df[j]*y[i]*w[i]
+ */
+ __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_ne_idl, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_23 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_23 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 132, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_24 = __pyx_t_23;
+ for (__pyx_t_25 = __pyx_v_j; __pyx_t_25 < __pyx_t_24; __pyx_t_25+=1) {
+ __pyx_v_k = __pyx_t_25;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":133
+ * for j in range(ns,ne_idl+1):
+ * for k in range(j,ne_idl+1):
+ * a[j,k]=a[j,k]+df[j]*df[k]*w[i] # <<<<<<<<<<<<<<
+ * a[j,n1]=a[j,n1]+df[j]*y[i]*w[i]
+ * # ... has to be faster
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
+ __pyx_t_6 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_df, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_df, __pyx_v_k, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_GetItemInt(__pyx_v_w, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_4, __pyx_t_6) < 0)) __PYX_ERR(0, 133, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":134
+ * for k in range(j,ne_idl+1):
+ * a[j,k]=a[j,k]+df[j]*df[k]*w[i]
+ * a[j,n1]=a[j,n1]+df[j]*y[i]*w[i] # <<<<<<<<<<<<<<
+ * # ... has to be faster
+ *
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_n1);
+ __Pyx_GIVEREF(__pyx_v_n1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_n1);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_GetItemInt(__pyx_v_df, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_y, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_GetItemInt(__pyx_v_w, __pyx_v_i, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyNumber_Add(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
+ __Pyx_INCREF(__pyx_v_n1);
+ __Pyx_GIVEREF(__pyx_v_n1);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_n1);
+ __pyx_t_4 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_6, __pyx_t_2) < 0)) __PYX_ERR(0, 134, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ }
+ __pyx_L11:;
+ }
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":137
+ * # ... has to be faster
+ *
+ * ncol=nbs[nr+1]-1 # <<<<<<<<<<<<<<
+ * nk=nr-1
+ *
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_nr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_nbs, __pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_6, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 137, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_v_ncol = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":138
+ *
+ * ncol=nbs[nr+1]-1
+ * nk=nr-1 # <<<<<<<<<<<<<<
+ *
+ * if (nk == 0):
+ */
+ __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_v_nr, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_nk = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":140
+ * nk=nr-1
+ *
+ * if (nk == 0): # <<<<<<<<<<<<<<
+ * pass
+ * else:
+ */
+ __pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_v_nk, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 140, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (__pyx_t_14) {
+ goto __pyx_L20;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":143
+ * pass
+ * else:
+ * for ik in range(1,nk+1): # <<<<<<<<<<<<<<
+ * ncol=ncol+1
+ * ns=nbs[ik]
+ */
+ /*else*/ {
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_nk, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_int_1);
+ __Pyx_GIVEREF(__pyx_int_1);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (likely(PyList_CheckExact(__pyx_t_2)) || PyTuple_CheckExact(__pyx_t_2)) {
+ __pyx_t_6 = __pyx_t_2; __Pyx_INCREF(__pyx_t_6); __pyx_t_16 = 0;
+ __pyx_t_26 = NULL;
+ } else {
+ __pyx_t_16 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_26 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_26)) __PYX_ERR(0, 143, __pyx_L1_error)
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ for (;;) {
+ if (likely(!__pyx_t_26)) {
+ if (likely(PyList_CheckExact(__pyx_t_6))) {
+ if (__pyx_t_16 >= PyList_GET_SIZE(__pyx_t_6)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_2 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
+ #else
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ #endif
+ } else {
+ if (__pyx_t_16 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_16); __Pyx_INCREF(__pyx_t_2); __pyx_t_16++; if (unlikely(0 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
+ #else
+ __pyx_t_2 = PySequence_ITEM(__pyx_t_6, __pyx_t_16); __pyx_t_16++; if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 143, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ #endif
+ }
+ } else {
+ __pyx_t_2 = __pyx_t_26(__pyx_t_6);
+ if (unlikely(!__pyx_t_2)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(0, 143, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_2);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_ik, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":144
+ * else:
+ * for ik in range(1,nk+1):
+ * ncol=ncol+1 # <<<<<<<<<<<<<<
+ * ns=nbs[ik]
+ * ne_idl=nbs[ik+1]-1
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_ncol, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 144, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF_SET(__pyx_v_ncol, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":145
+ * for ik in range(1,nk+1):
+ * ncol=ncol+1
+ * ns=nbs[ik] # <<<<<<<<<<<<<<
+ * ne_idl=nbs[ik+1]-1
+ * a[ns,ncol]=-1.
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_v_nbs, __pyx_v_ik); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 145, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_2); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 145, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v_ns = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":146
+ * ncol=ncol+1
+ * ns=nbs[ik]
+ * ne_idl=nbs[ik+1]-1 # <<<<<<<<<<<<<<
+ * a[ns,ncol]=-1.
+ * ns=ns+1
+ */
+ __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_v_ik, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_nbs, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_SubtractObjC(__pyx_t_4, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 146, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ne_idl, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":147
+ * ns=nbs[ik]
+ * ne_idl=nbs[ik+1]-1
+ * a[ns,ncol]=-1. # <<<<<<<<<<<<<<
+ * ns=ns+1
+ * for i in range(ns,ne_idl+1):
+ */
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ncol);
+ __pyx_t_2 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_4, __pyx_float_neg_1_) < 0)) __PYX_ERR(0, 147, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":148
+ * ne_idl=nbs[ik+1]-1
+ * a[ns,ncol]=-1.
+ * ns=ns+1 # <<<<<<<<<<<<<<
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ */
+ __pyx_v_ns = (__pyx_v_ns + 1);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":149
+ * a[ns,ncol]=-1.
+ * ns=ns+1
+ * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ * ncol=ncol+1
+ */
+ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_ne_idl, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = __pyx_v_ns; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":150
+ * ns=ns+1
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=a[i-1,ncol]*xk[ik] # <<<<<<<<<<<<<<
+ * ncol=ncol+1
+ * a[ns,ncol]=-1.
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_ncol);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_27 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error)
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_27])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_1 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ncol);
+ __pyx_t_2 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_4, __pyx_t_1) < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":151
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ * ncol=ncol+1 # <<<<<<<<<<<<<<
+ * a[ns,ncol]=-1.
+ * ns=ns+1
+ */
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_ncol, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 151, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF_SET(__pyx_v_ncol, __pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":152
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ * ncol=ncol+1
+ * a[ns,ncol]=-1. # <<<<<<<<<<<<<<
+ * ns=ns+1
+ * if (ns > ne_idl):
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ncol);
+ __pyx_t_1 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_4, __pyx_float_neg_1_) < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":153
+ * ncol=ncol+1
+ * a[ns,ncol]=-1.
+ * ns=ns+1 # <<<<<<<<<<<<<<
+ * if (ns > ne_idl):
+ * pass
+ */
+ __pyx_v_ns = (__pyx_v_ns + 1);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":154
+ * a[ns,ncol]=-1.
+ * ns=ns+1
+ * if (ns > ne_idl): # <<<<<<<<<<<<<<
+ * pass
+ * else:
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyObject_RichCompare(__pyx_t_4, __pyx_v_ne_idl, Py_GT); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 154, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 154, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ if (__pyx_t_14) {
+ goto __pyx_L25;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":157
+ * pass
+ * else:
+ * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
+ * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1))
+ * ncol=ncol-1
+ */
+ /*else*/ {
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_ne_idl, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_1); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = __pyx_v_ns; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":158
+ * else:
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1)) # <<<<<<<<<<<<<<
+ * ncol=ncol-1
+ * ns=nbs[ik+1]
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_long(((__pyx_v_ns - __pyx_v_i) - 2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_power); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_27 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
+ __pyx_t_2 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_27])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_28 = __Pyx_PyInt_From_long(((__pyx_v_i - __pyx_v_ns) + 1)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_28);
+ __pyx_t_29 = NULL;
+ __pyx_t_17 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_29)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_29);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ __pyx_t_17 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_29, __pyx_t_2, __pyx_t_28};
+ __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_29, __pyx_t_2, __pyx_t_28};
+ __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_30 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ if (__pyx_t_29) {
+ __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_29); __pyx_t_29 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_30, 0+__pyx_t_17, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_28);
+ PyTuple_SET_ITEM(__pyx_t_30, 1+__pyx_t_17, __pyx_t_28);
+ __pyx_t_2 = 0;
+ __pyx_t_28 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_30, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ncol);
+ __pyx_t_4 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_1, __pyx_t_3) < 0)) __PYX_ERR(0, 158, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ }
+ __pyx_L25:;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":159
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1))
+ * ncol=ncol-1 # <<<<<<<<<<<<<<
+ * ns=nbs[ik+1]
+ * ne_idl=nbs[ik+2]-1
+ */
+ __pyx_t_3 = __Pyx_PyInt_SubtractObjC(__pyx_v_ncol, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF_SET(__pyx_v_ncol, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":160
+ * a[i,ncol]=(ns-i-2)*numpy.power(xk[ik],(i-ns+1))
+ * ncol=ncol-1
+ * ns=nbs[ik+1] # <<<<<<<<<<<<<<
+ * ne_idl=nbs[ik+2]-1
+ * a[ns,ncol]=1.0
+ */
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_ik, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_nbs, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_v_ns = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":161
+ * ncol=ncol-1
+ * ns=nbs[ik+1]
+ * ne_idl=nbs[ik+2]-1 # <<<<<<<<<<<<<<
+ * a[ns,ncol]=1.0
+ * ns=ns+1
+ */
+ __pyx_t_1 = __Pyx_PyInt_AddObjC(__pyx_v_ik, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_nbs, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 161, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_ne_idl, __pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":162
+ * ns=nbs[ik+1]
+ * ne_idl=nbs[ik+2]-1
+ * a[ns,ncol]=1.0 # <<<<<<<<<<<<<<
+ * ns=ns+1
+ * for i in range(ns,ne_idl+1):
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ncol);
+ __pyx_t_1 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_3, __pyx_float_1_0) < 0)) __PYX_ERR(0, 162, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":163
+ * ne_idl=nbs[ik+2]-1
+ * a[ns,ncol]=1.0
+ * ns=ns+1 # <<<<<<<<<<<<<<
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ */
+ __pyx_v_ns = (__pyx_v_ns + 1);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":164
+ * a[ns,ncol]=1.0
+ * ns=ns+1
+ * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ * ncol=ncol+1
+ */
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_ne_idl, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 164, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = __pyx_v_ns; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":165
+ * ns=ns+1
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=a[i-1,ncol]*xk[ik] # <<<<<<<<<<<<<<
+ * ncol=ncol+1
+ * a[ns,ncol]=1.0
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ncol);
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_27 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 165, __pyx_L1_error)
+ __pyx_t_1 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_27])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ncol);
+ __pyx_t_1 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_3, __pyx_t_4) < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":166
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ * ncol=ncol+1 # <<<<<<<<<<<<<<
+ * a[ns,ncol]=1.0
+ * ns=ns+1
+ */
+ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_ncol, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF_SET(__pyx_v_ncol, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":167
+ * a[i,ncol]=a[i-1,ncol]*xk[ik]
+ * ncol=ncol+1
+ * a[ns,ncol]=1.0 # <<<<<<<<<<<<<<
+ * ns=ns+1
+ * if (ns > ne_idl):
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_ncol);
+ __pyx_t_4 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_3, __pyx_float_1_0) < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":168
+ * ncol=ncol+1
+ * a[ns,ncol]=1.0
+ * ns=ns+1 # <<<<<<<<<<<<<<
+ * if (ns > ne_idl):
+ * pass
+ */
+ __pyx_v_ns = (__pyx_v_ns + 1);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":169
+ * a[ns,ncol]=1.0
+ * ns=ns+1
+ * if (ns > ne_idl): # <<<<<<<<<<<<<<
+ * pass
+ * else:
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_ns); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 169, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_ne_idl, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 169, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_14) {
+ goto __pyx_L30;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":172
+ * pass
+ * else:
+ * for i in range(ns,ne_idl+1): # <<<<<<<<<<<<<<
+ * a[i,ncol]=(i-ns+2)*numpy.power(xk[ik],(i-ns+1))
+ *
+ */
+ /*else*/ {
+ __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_ne_idl, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 172, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = __pyx_v_ns; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":173
+ * else:
+ * for i in range(ns,ne_idl+1):
+ * a[i,ncol]=(i-ns+2)*numpy.power(xk[ik],(i-ns+1)) # <<<<<<<<<<<<<<
+ *
+ * for i in range(1,n+1):
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_long(((__pyx_v_i - __pyx_v_ns) + 2)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_30 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_power); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_27 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ik); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 173, __pyx_L1_error)
+ __pyx_t_1 = PyFloat_FromDouble((__pyx_v_xk[__pyx_t_27])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_28 = __Pyx_PyInt_From_long(((__pyx_v_i - __pyx_v_ns) + 1)); if (unlikely(!__pyx_t_28)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_28);
+ __pyx_t_2 = NULL;
+ __pyx_t_17 = 0;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_30))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_30);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_30);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_30, function);
+ __pyx_t_17 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_30)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_1, __pyx_t_28};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_30, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_30)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_2, __pyx_t_1, __pyx_t_28};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_30, __pyx_temp+1-__pyx_t_17, 2+__pyx_t_17); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_28); __pyx_t_28 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_29 = PyTuple_New(2+__pyx_t_17); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_29);
+ if (__pyx_t_2) {
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_29, 0+__pyx_t_17, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_28);
+ PyTuple_SET_ITEM(__pyx_t_29, 1+__pyx_t_17, __pyx_t_28);
+ __pyx_t_1 = 0;
+ __pyx_t_28 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_30, __pyx_t_29, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_30 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+ __Pyx_INCREF(__pyx_v_ncol);
+ __Pyx_GIVEREF(__pyx_v_ncol);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_ncol);
+ __pyx_t_3 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_4, __pyx_t_30) < 0)) __PYX_ERR(0, 173, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ }
+ }
+ __pyx_L30:;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":143
+ * pass
+ * else:
+ * for ik in range(1,nk+1): # <<<<<<<<<<<<<<
+ * ncol=ncol+1
+ * ns=nbs[ik]
+ */
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __pyx_L20:;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":175
+ * a[i,ncol]=(i-ns+2)*numpy.power(xk[ik],(i-ns+1))
+ *
+ * for i in range(1,n+1): # <<<<<<<<<<<<<<
+ * i1=i-1
+ * for j in range(1,i1+1):
+ */
+ __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 175, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":176
+ *
+ * for i in range(1,n+1):
+ * i1=i-1 # <<<<<<<<<<<<<<
+ * for j in range(1,i1+1):
+ * a[i,j]=a[j,i]
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 176, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_i1, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":177
+ * for i in range(1,n+1):
+ * i1=i-1
+ * for j in range(1,i1+1): # <<<<<<<<<<<<<<
+ * a[i,j]=a[j,i]
+ * nm1=n-1
+ */
+ __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_i1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 177, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_18 = __pyx_t_13;
+ for (__pyx_t_17 = 1; __pyx_t_17 < __pyx_t_18; __pyx_t_17+=1) {
+ __pyx_v_j = __pyx_t_17;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":178
+ * i1=i-1
+ * for j in range(1,i1+1):
+ * a[i,j]=a[j,i] # <<<<<<<<<<<<<<
+ * nm1=n-1
+ *
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_30);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_30);
+ __pyx_t_6 = 0;
+ __pyx_t_30 = 0;
+ __pyx_t_30 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
+ __pyx_t_4 = 0;
+ __pyx_t_6 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_3, __pyx_t_30) < 0)) __PYX_ERR(0, 178, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ }
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":179
+ * for j in range(1,i1+1):
+ * a[i,j]=a[j,i]
+ * nm1=n-1 # <<<<<<<<<<<<<<
+ *
+ * for i in range(1,nm1+1):
+ */
+ __pyx_t_30 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 179, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_v_nm1 = __pyx_t_30;
+ __pyx_t_30 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":181
+ * nm1=n-1
+ *
+ * for i in range(1,nm1+1): # <<<<<<<<<<<<<<
+ * i1=i+1
+ * m=i
+ */
+ __pyx_t_30 = __Pyx_PyInt_AddObjC(__pyx_v_nm1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 181, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_30); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":182
+ *
+ * for i in range(1,nm1+1):
+ * i1=i+1 # <<<<<<<<<<<<<<
+ * m=i
+ * t=numpy.abs(a[i,i])
+ */
+ __pyx_t_30 = __Pyx_PyInt_From_long((__pyx_v_i + 1)); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 182, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_XDECREF_SET(__pyx_v_i1, __pyx_t_30);
+ __pyx_t_30 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":183
+ * for i in range(1,nm1+1):
+ * i1=i+1
+ * m=i # <<<<<<<<<<<<<<
+ * t=numpy.abs(a[i,i])
+ * for j in range(i1,n+1):
+ */
+ __pyx_v_m = __pyx_v_i;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":184
+ * i1=i+1
+ * m=i
+ * t=numpy.abs(a[i,i]) # <<<<<<<<<<<<<<
+ * for j in range(i1,n+1):
+ * if (t >= numpy.abs(a[j,i])):
+ */
+ __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_29);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_4);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_29); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __pyx_t_29 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_29)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_29);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_29) {
+ __pyx_t_30 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_30);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
+ __pyx_t_30 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
+ __pyx_t_30 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_29); __pyx_t_29 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_30 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 184, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_30);
+ __pyx_t_30 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":185
+ * m=i
+ * t=numpy.abs(a[i,i])
+ * for j in range(i1,n+1): # <<<<<<<<<<<<<<
+ * if (t >= numpy.abs(a[j,i])):
+ * pass
+ */
+ __pyx_t_30 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 185, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_30); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_18 = __Pyx_PyInt_As_long(__pyx_v_i1); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 185, __pyx_L1_error)
+ __pyx_t_20 = __pyx_t_13;
+ for (__pyx_t_17 = __pyx_t_18; __pyx_t_17 < __pyx_t_20; __pyx_t_17+=1) {
+ __pyx_v_j = __pyx_t_17;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":186
+ * t=numpy.abs(a[i,i])
+ * for j in range(i1,n+1):
+ * if (t >= numpy.abs(a[j,i])): # <<<<<<<<<<<<<<
+ * pass
+ * else:
+ */
+ __pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_abs); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_29);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_4);
+ __pyx_t_6 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_29); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __pyx_t_29 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_29)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_29);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_29) {
+ __pyx_t_30 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_30);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
+ __pyx_t_30 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
+ __pyx_t_30 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_29); __pyx_t_29 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_30 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, NULL); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_30, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_14 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_14 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_14) {
+ goto __pyx_L41;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":189
+ * pass
+ * else:
+ * m=j # <<<<<<<<<<<<<<
+ * t=numpy.abs(a[j,i])
+ * if (m == i):
+ */
+ /*else*/ {
+ __pyx_v_m = __pyx_v_j;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":190
+ * else:
+ * m=j
+ * t=numpy.abs(a[j,i]) # <<<<<<<<<<<<<<
+ * if (m == i):
+ * pass
+ */
+ __pyx_t_30 = __Pyx_GetModuleGlobalName(__pyx_n_s_numpy); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_30, __pyx_n_s_abs); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_29 = PyTuple_New(2); if (unlikely(!__pyx_t_29)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_29);
+ __Pyx_GIVEREF(__pyx_t_30);
+ PyTuple_SET_ITEM(__pyx_t_29, 0, __pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_29, 1, __pyx_t_4);
+ __pyx_t_30 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_29); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __pyx_t_29 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_29 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_29)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_29);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ }
+ }
+ if (!__pyx_t_29) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_29, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_29); __pyx_t_29 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_30 = PyTuple_New(1+1); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_29); PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_29); __pyx_t_29 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_30, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_30, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_3);
+ __pyx_t_3 = 0;
+ }
+ __pyx_L41:;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":191
+ * m=j
+ * t=numpy.abs(a[j,i])
+ * if (m == i): # <<<<<<<<<<<<<<
+ * pass
+ * else:
+ */
+ __pyx_t_14 = ((__pyx_v_m == __pyx_v_i) != 0);
+ if (__pyx_t_14) {
+ goto __pyx_L42;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":194
+ * pass
+ * else:
+ * for j in range(1,n1+1): # <<<<<<<<<<<<<<
+ * t=a[i,j]
+ * a[i,j]=a[m,j]
+ */
+ /*else*/ {
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 194, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_20 = __pyx_t_13;
+ for (__pyx_t_17 = 1; __pyx_t_17 < __pyx_t_20; __pyx_t_17+=1) {
+ __pyx_v_j = __pyx_t_17;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":195
+ * else:
+ * for j in range(1,n1+1):
+ * t=a[i,j] # <<<<<<<<<<<<<<
+ * a[i,j]=a[m,j]
+ * a[m,j]=t
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_30 = PyTuple_New(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_30, 1, __pyx_t_6);
+ __pyx_t_3 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_30); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 195, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":196
+ * for j in range(1,n1+1):
+ * t=a[i,j]
+ * a[i,j]=a[m,j] # <<<<<<<<<<<<<<
+ * a[m,j]=t
+ * for j in range(i1,n+1):
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_30);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_30);
+ __pyx_t_6 = 0;
+ __pyx_t_30 = 0;
+ __pyx_t_30 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
+ __pyx_t_3 = 0;
+ __pyx_t_6 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_4, __pyx_t_30) < 0)) __PYX_ERR(0, 196, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":197
+ * t=a[i,j]
+ * a[i,j]=a[m,j]
+ * a[m,j]=t # <<<<<<<<<<<<<<
+ * for j in range(i1,n+1):
+ * t=a[j,i]/a[i,i]
+ */
+ __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_m); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 197, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 197, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 197, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_30);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
+ __pyx_t_30 = 0;
+ __pyx_t_4 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_6, __pyx_v_t) < 0)) __PYX_ERR(0, 197, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ }
+ __pyx_L42:;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":198
+ * a[i,j]=a[m,j]
+ * a[m,j]=t
+ * for j in range(i1,n+1): # <<<<<<<<<<<<<<
+ * t=a[j,i]/a[i,i]
+ * for k in range(i1,n1+1):
+ */
+ __pyx_t_6 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 198, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_6); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_20 = __Pyx_PyInt_As_long(__pyx_v_i1); if (unlikely((__pyx_t_20 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error)
+ __pyx_t_18 = __pyx_t_13;
+ for (__pyx_t_17 = __pyx_t_20; __pyx_t_17 < __pyx_t_18; __pyx_t_17+=1) {
+ __pyx_v_j = __pyx_t_17;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":199
+ * a[m,j]=t
+ * for j in range(i1,n+1):
+ * t=a[j,i]/a[i,i] # <<<<<<<<<<<<<<
+ * for k in range(i1,n1+1):
+ * a[j,k]=a[j,k]-t*a[i,k]
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_30 = PyTuple_New(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_30, 1, __pyx_t_4);
+ __pyx_t_6 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_30); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_30);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
+ __pyx_t_30 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 199, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":200
+ * for j in range(i1,n+1):
+ * t=a[j,i]/a[i,i]
+ * for k in range(i1,n1+1): # <<<<<<<<<<<<<<
+ * a[j,k]=a[j,k]-t*a[i,k]
+ * c[n]=a[n,n1]/a[n,n]
+ */
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_21 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_21 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_23 = __Pyx_PyInt_As_long(__pyx_v_i1); if (unlikely((__pyx_t_23 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L1_error)
+ __pyx_t_24 = __pyx_t_21;
+ for (__pyx_t_22 = __pyx_t_23; __pyx_t_22 < __pyx_t_24; __pyx_t_22+=1) {
+ __pyx_v_k = __pyx_t_22;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":201
+ * t=a[j,i]/a[i,i]
+ * for k in range(i1,n1+1):
+ * a[j,k]=a[j,k]-t*a[i,k] # <<<<<<<<<<<<<<
+ * c[n]=a[n,n1]/a[n,n]
+ * for i in range(1,nm1+1):
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
+ __pyx_t_3 = 0;
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_30 = PyTuple_New(2); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_30, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_30, 1, __pyx_t_3);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_30 = PyNumber_Multiply(__pyx_v_t, __pyx_t_3); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyNumber_Subtract(__pyx_t_6, __pyx_t_30); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_30); __pyx_t_30 = 0;
+ __pyx_t_30 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_30)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_30);
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_k); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_30);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_30);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
+ __pyx_t_30 = 0;
+ __pyx_t_6 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_a, __pyx_t_4, __pyx_t_3) < 0)) __PYX_ERR(0, 201, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ }
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":202
+ * for k in range(i1,n1+1):
+ * a[j,k]=a[j,k]-t*a[i,k]
+ * c[n]=a[n,n1]/a[n,n] # <<<<<<<<<<<<<<
+ * for i in range(1,nm1+1):
+ * ni=n-i
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_n);
+ __Pyx_GIVEREF(__pyx_v_n);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n);
+ __Pyx_INCREF(__pyx_v_n1);
+ __Pyx_GIVEREF(__pyx_v_n1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_n1);
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_n);
+ __Pyx_GIVEREF(__pyx_v_n);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_n);
+ __Pyx_INCREF(__pyx_v_n);
+ __Pyx_GIVEREF(__pyx_v_n);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_n);
+ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_c, __pyx_v_n, __pyx_t_3) < 0)) __PYX_ERR(0, 202, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":203
+ * a[j,k]=a[j,k]-t*a[i,k]
+ * c[n]=a[n,n1]/a[n,n]
+ * for i in range(1,nm1+1): # <<<<<<<<<<<<<<
+ * ni=n-i
+ * t=a[ni,n1]
+ */
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_nm1, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_11 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_11 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_12 = __pyx_t_11;
+ for (__pyx_t_5 = 1; __pyx_t_5 < __pyx_t_12; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":204
+ * c[n]=a[n,n1]/a[n,n]
+ * for i in range(1,nm1+1):
+ * ni=n-i # <<<<<<<<<<<<<<
+ * t=a[ni,n1]
+ * ni1=ni+1
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = PyNumber_Subtract(__pyx_v_n, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_ni, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":205
+ * for i in range(1,nm1+1):
+ * ni=n-i
+ * t=a[ni,n1] # <<<<<<<<<<<<<<
+ * ni1=ni+1
+ * for j in range(ni1,n+1):
+ */
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 205, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_ni);
+ __Pyx_GIVEREF(__pyx_v_ni);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ni);
+ __Pyx_INCREF(__pyx_v_n1);
+ __Pyx_GIVEREF(__pyx_v_n1);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_n1);
+ __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 205, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":206
+ * ni=n-i
+ * t=a[ni,n1]
+ * ni1=ni+1 # <<<<<<<<<<<<<<
+ * for j in range(ni1,n+1):
+ * t=t-c[j]*a[ni,j]
+ */
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_ni, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 206, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_XDECREF_SET(__pyx_v_ni1, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":207
+ * t=a[ni,n1]
+ * ni1=ni+1
+ * for j in range(ni1,n+1): # <<<<<<<<<<<<<<
+ * t=t-c[j]*a[ni,j]
+ * c[ni]=t/a[ni,ni]
+ */
+ __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 207, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_18 = __Pyx_PyInt_As_long(__pyx_v_ni1); if (unlikely((__pyx_t_18 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 207, __pyx_L1_error)
+ __pyx_t_20 = __pyx_t_13;
+ for (__pyx_t_17 = __pyx_t_18; __pyx_t_17 < __pyx_t_20; __pyx_t_17+=1) {
+ __pyx_v_j = __pyx_t_17;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":208
+ * ni1=ni+1
+ * for j in range(ni1,n+1):
+ * t=t-c[j]*a[ni,j] # <<<<<<<<<<<<<<
+ * c[ni]=t/a[ni,ni]
+ *
+ */
+ __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_c, __pyx_v_j, int, 1, __Pyx_PyInt_From_int, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_6 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_v_ni);
+ __Pyx_GIVEREF(__pyx_v_ni);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_ni);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = PyNumber_Subtract(__pyx_v_t, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF_SET(__pyx_v_t, __pyx_t_6);
+ __pyx_t_6 = 0;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":209
+ * for j in range(ni1,n+1):
+ * t=t-c[j]*a[ni,j]
+ * c[ni]=t/a[ni,ni] # <<<<<<<<<<<<<<
+ *
+ * return c
+ */
+ __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_INCREF(__pyx_v_ni);
+ __Pyx_GIVEREF(__pyx_v_ni);
+ PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_ni);
+ __Pyx_INCREF(__pyx_v_ni);
+ __Pyx_GIVEREF(__pyx_v_ni);
+ PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_ni);
+ __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_a, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_v_t, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (unlikely(PyObject_SetItem(__pyx_v_c, __pyx_v_ni, __pyx_t_6) < 0)) __PYX_ERR(0, 209, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":211
+ * c[ni]=t/a[ni,ni]
+ *
+ * return c # <<<<<<<<<<<<<<
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_c);
+ __pyx_r = __pyx_v_c;
+ goto __pyx_L0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":73
+ * return c
+ *
+ * def polspl2(x,y,w,npts,xl0,xh0,nr,nc): # <<<<<<<<<<<<<<
+ *
+ * # ;
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_6);
+ __PYX_XDEC_MEMVIEW(&__pyx_t_9, 1);
+ __Pyx_XDECREF(__pyx_t_28);
+ __Pyx_XDECREF(__pyx_t_29);
+ __Pyx_XDECREF(__pyx_t_30);
+ { PyObject *__pyx_type, *__pyx_value, *__pyx_tb;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&__pyx_type, &__pyx_value, &__pyx_tb);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer);
+ __Pyx_ErrRestore(__pyx_type, __pyx_value, __pyx_tb);}
+ __Pyx_AddTraceback("PyMca5.PyMcaPhysics.xas._xas.polspl2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ goto __pyx_L2;
+ __pyx_L0:;
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xh0.rcbuffer->pybuffer);
+ __Pyx_SafeReleaseBuffer(&__pyx_pybuffernd_buffer_xl0.rcbuffer->pybuffer);
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_buffer_xl0);
+ __Pyx_XDECREF((PyObject *)__pyx_v_buffer_xh0);
+ __Pyx_XDECREF(__pyx_v_df);
+ __Pyx_XDECREF(__pyx_v_a);
+ __Pyx_XDECREF(__pyx_v_nbs);
+ __PYX_XDEC_MEMVIEW(&__pyx_v_xk0, 1);
+ __Pyx_XDECREF(__pyx_v_c);
+ __Pyx_XDECREF(__pyx_v_ne_idl);
+ __Pyx_XDECREF(__pyx_v_n);
+ __Pyx_XDECREF(__pyx_v_t);
+ __Pyx_XDECREF(__pyx_v_n1);
+ __Pyx_XDECREF(__pyx_v_ncol);
+ __Pyx_XDECREF(__pyx_v_nk);
+ __Pyx_XDECREF(__pyx_v_ik);
+ __Pyx_XDECREF(__pyx_v_i1);
+ __Pyx_XDECREF(__pyx_v_nm1);
+ __Pyx_XDECREF(__pyx_v_ni);
+ __Pyx_XDECREF(__pyx_v_ni1);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":215
+ * # experimental exception made for __getbuffer__ and __releasebuffer__
+ * # -- the details of this may change.
+ * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
+ * # This implementation of getbuffer is geared towards Cython
+ * # requirements, and does not yet fulfill the PEP.
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_v_i;
+ int __pyx_v_ndim;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ int __pyx_v_t;
+ char *__pyx_v_f;
+ PyArray_Descr *__pyx_v_descr = 0;
+ int __pyx_v_offset;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ PyObject *__pyx_t_7 = NULL;
+ char *__pyx_t_8;
+ if (__pyx_v_info == NULL) {
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
+ return -1;
+ }
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":222
+ *
+ * cdef int i, ndim
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":223
+ * cdef int i, ndim
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ *
+ * ndim = PyArray_NDIM(self)
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":225
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ *
+ * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ */
+ __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":227
+ * ndim = PyArray_NDIM(self)
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous")
+ */
+ __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":228
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ */
+ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":227
+ * ndim = PyArray_NDIM(self)
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous")
+ */
+ if (unlikely(__pyx_t_1)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":229
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 229, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(1, 229, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":227
+ * ndim = PyArray_NDIM(self)
+ *
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ */
+ __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L7_bool_binop_done;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":232
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ */
+ __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L7_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ */
+ if (unlikely(__pyx_t_1)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":233
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
+ *
+ * info.buf = PyArray_DATA(self)
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(1, 233, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":231
+ * raise ValueError(u"ndarray is not C contiguous")
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":235
+ * raise ValueError(u"ndarray is not Fortran contiguous")
+ *
+ * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
+ * info.ndim = ndim
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":236
+ *
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * # Allocate new buffer for strides and shape info.
+ */
+ __pyx_v_info->ndim = __pyx_v_ndim;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":237
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ */
+ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":240
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ */
+ __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":241
+ * # This is allocated as one block, strides first.
+ * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
+ * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ */
+ __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":242
+ * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
+ * info.shape = info.strides + ndim
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ */
+ __pyx_t_4 = __pyx_v_ndim;
+ __pyx_t_5 = __pyx_t_4;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":243
+ * info.shape = info.strides + ndim
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ */
+ (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":244
+ * for i in range(ndim):
+ * info.strides[i] = PyArray_STRIDES(self)[i]
+ * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ */
+ (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":237
+ * info.buf = PyArray_DATA(self)
+ * info.ndim = ndim
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * # Allocate new buffer for strides and shape info.
+ * # This is allocated as one block, strides first.
+ */
+ goto __pyx_L9;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":246
+ * info.shape[i] = PyArray_DIMS(self)[i]
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ */
+ /*else*/ {
+ __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":247
+ * else:
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ */
+ __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
+ }
+ __pyx_L9:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":248
+ * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":249
+ * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
+ * info.readonly = not PyArray_ISWRITEABLE(self)
+ *
+ */
+ __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":250
+ * info.suboffsets = NULL
+ * info.itemsize = PyArray_ITEMSIZE(self)
+ * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
+ *
+ * cdef int t
+ */
+ __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":253
+ *
+ * cdef int t
+ * cdef char* f = NULL # <<<<<<<<<<<<<<
+ * cdef dtype descr = self.descr
+ * cdef int offset
+ */
+ __pyx_v_f = NULL;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":254
+ * cdef int t
+ * cdef char* f = NULL
+ * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
+ * cdef int offset
+ *
+ */
+ __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":257
+ * cdef int offset
+ *
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(descr):
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
+ * info.obj = self
+ *
+ * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
+ __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":260
+ *
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num # <<<<<<<<<<<<<<
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ */
+ __pyx_t_4 = __pyx_v_descr->type_num;
+ __pyx_v_t = __pyx_t_4;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":261
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
+ if (!__pyx_t_2) {
+ goto __pyx_L15_next_or;
+ } else {
+ }
+ __pyx_t_2 = (__pyx_v_little_endian != 0);
+ if (!__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_L15_next_or:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":262
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b"
+ */
+ __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L14_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":261
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ if (unlikely(__pyx_t_1)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":263
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(1, 263, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":261
+ * if not PyDataType_HASFIELDS(descr):
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":264
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ */
+ switch (__pyx_v_t) {
+ case NPY_BYTE:
+ __pyx_v_f = ((char *)"b");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":265
+ * raise ValueError(u"Non-native byte order not supported")
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ */
+ case NPY_UBYTE:
+ __pyx_v_f = ((char *)"B");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":266
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ */
+ case NPY_SHORT:
+ __pyx_v_f = ((char *)"h");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":267
+ * elif t == NPY_UBYTE: f = "B"
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ */
+ case NPY_USHORT:
+ __pyx_v_f = ((char *)"H");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":268
+ * elif t == NPY_SHORT: f = "h"
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ */
+ case NPY_INT:
+ __pyx_v_f = ((char *)"i");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":269
+ * elif t == NPY_USHORT: f = "H"
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ */
+ case NPY_UINT:
+ __pyx_v_f = ((char *)"I");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":270
+ * elif t == NPY_INT: f = "i"
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ */
+ case NPY_LONG:
+ __pyx_v_f = ((char *)"l");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":271
+ * elif t == NPY_UINT: f = "I"
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ */
+ case NPY_ULONG:
+ __pyx_v_f = ((char *)"L");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":272
+ * elif t == NPY_LONG: f = "l"
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ */
+ case NPY_LONGLONG:
+ __pyx_v_f = ((char *)"q");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":273
+ * elif t == NPY_ULONG: f = "L"
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ */
+ case NPY_ULONGLONG:
+ __pyx_v_f = ((char *)"Q");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":274
+ * elif t == NPY_LONGLONG: f = "q"
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ */
+ case NPY_FLOAT:
+ __pyx_v_f = ((char *)"f");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":275
+ * elif t == NPY_ULONGLONG: f = "Q"
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ */
+ case NPY_DOUBLE:
+ __pyx_v_f = ((char *)"d");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":276
+ * elif t == NPY_FLOAT: f = "f"
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ */
+ case NPY_LONGDOUBLE:
+ __pyx_v_f = ((char *)"g");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":277
+ * elif t == NPY_DOUBLE: f = "d"
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ */
+ case NPY_CFLOAT:
+ __pyx_v_f = ((char *)"Zf");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":278
+ * elif t == NPY_LONGDOUBLE: f = "g"
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O"
+ */
+ case NPY_CDOUBLE:
+ __pyx_v_f = ((char *)"Zd");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":279
+ * elif t == NPY_CFLOAT: f = "Zf"
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ */
+ case NPY_CLONGDOUBLE:
+ __pyx_v_f = ((char *)"Zg");
+ break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":280
+ * elif t == NPY_CDOUBLE: f = "Zd"
+ * elif t == NPY_CLONGDOUBLE: f = "Zg"
+ * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ case NPY_OBJECT:
+ __pyx_v_f = ((char *)"O");
+ break;
+ default:
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":282
+ * elif t == NPY_OBJECT: f = "O"
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
+ * info.format = f
+ * return
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 282, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(1, 282, __pyx_L1_error)
+ break;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":283
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f # <<<<<<<<<<<<<<
+ * return
+ * else:
+ */
+ __pyx_v_info->format = __pyx_v_f;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":284
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * info.format = f
+ * return # <<<<<<<<<<<<<<
+ * else:
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":259
+ * info.obj = self
+ *
+ * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
+ * t = descr.type_num
+ * if ((descr.byteorder == c'>' and little_endian) or
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":286
+ * return
+ * else:
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ */
+ /*else*/ {
+ __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":287
+ * else:
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
+ * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1,
+ */
+ (__pyx_v_info->format[0]) = '^';
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":288
+ * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0 # <<<<<<<<<<<<<<
+ * f = _util_dtypestring(descr, info.format + 1,
+ * info.format + _buffer_format_string_len,
+ */
+ __pyx_v_offset = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":289
+ * info.format[0] = c'^' # Native data types, manual alignment
+ * offset = 0
+ * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ */
+ __pyx_t_8 = __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_8 == ((char *)NULL))) __PYX_ERR(1, 289, __pyx_L1_error)
+ __pyx_v_f = __pyx_t_8;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":292
+ * info.format + _buffer_format_string_len,
+ * &offset)
+ * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ */
+ (__pyx_v_f[0]) = '\x00';
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":215
+ * # experimental exception made for __getbuffer__ and __releasebuffer__
+ * # -- the details of this may change.
+ * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
+ * # This implementation of getbuffer is geared towards Cython
+ * # requirements, and does not yet fulfill the PEP.
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ __pyx_L2:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_descr);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":294
+ * f[0] = c'\0' # Terminate format string
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
+static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
+ __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__releasebuffer__", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":295
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":296
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format) # <<<<<<<<<<<<<<
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * PyObject_Free(info.strides)
+ */
+ PyObject_Free(__pyx_v_info->format);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":295
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info):
+ * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":297
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.strides)
+ * # info.shape was stored after info.strides in the same block
+ */
+ __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":298
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t):
+ * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
+ * # info.shape was stored after info.strides in the same block
+ *
+ */
+ PyObject_Free(__pyx_v_info->strides);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":297
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
+ * PyObject_Free(info.strides)
+ * # info.shape was stored after info.strides in the same block
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":294
+ * f[0] = c'\0' # Terminate format string
+ *
+ * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
+ * if PyArray_HASFIELDS(self):
+ * PyObject_Free(info.format)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":775
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":776
+ *
+ * cdef inline object PyArray_MultiIterNew1(a):
+ * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 776, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":775
+ * ctypedef npy_cdouble complex_t
+ *
+ * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":778
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":779
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b):
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 779, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":778
+ * return PyArray_MultiIterNew(1, <void*>a)
+ *
+ * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":781
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":782
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c):
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(1, 782, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":781
+ * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
+ *
+ * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":784
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ */
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":785
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(1, 785, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":784
+ * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
+ *
+ * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":787
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ */
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":788
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(1, 788, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":787
+ * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
+ *
+ * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":790
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
+ * if PyDataType_HASSUBARRAY(d):
+ * return <tuple>d.subarray.shape
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":791
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
+ * return <tuple>d.subarray.shape
+ * else:
+ */
+ __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":792
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ * if PyDataType_HASSUBARRAY(d):
+ * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
+ * else:
+ * return ()
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
+ __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":791
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d):
+ * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
+ * return <tuple>d.subarray.shape
+ * else:
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":794
+ * return <tuple>d.subarray.shape
+ * else:
+ * return () # <<<<<<<<<<<<<<
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_empty_tuple);
+ __pyx_r = __pyx_empty_tuple;
+ goto __pyx_L0;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":790
+ * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
+ *
+ * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
+ * if PyDataType_HASSUBARRAY(d):
+ * return <tuple>d.subarray.shape
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":796
+ * return ()
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
+ * # Recursive utility function used in __getbuffer__ to get format
+ * # string. The new location in the format string is returned.
+ */
+
+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) {
+ PyArray_Descr *__pyx_v_child = 0;
+ int __pyx_v_endian_detector;
+ int __pyx_v_little_endian;
+ PyObject *__pyx_v_fields = 0;
+ PyObject *__pyx_v_childname = NULL;
+ PyObject *__pyx_v_new_offset = NULL;
+ PyObject *__pyx_v_t = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ int __pyx_t_7;
+ long __pyx_t_8;
+ char *__pyx_t_9;
+ __Pyx_RefNannySetupContext("_util_dtypestring", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":801
+ *
+ * cdef dtype child
+ * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
+ * cdef tuple fields
+ */
+ __pyx_v_endian_detector = 1;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":802
+ * cdef dtype child
+ * cdef int endian_detector = 1
+ * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
+ * cdef tuple fields
+ *
+ */
+ __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":805
+ * cdef tuple fields
+ *
+ * for childname in descr.names: # <<<<<<<<<<<<<<
+ * fields = descr.fields[childname]
+ * child, new_offset = fields
+ */
+ if (unlikely(__pyx_v_descr->names == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+ __PYX_ERR(1, 805, __pyx_L1_error)
+ }
+ __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
+ for (;;) {
+ if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(1, 805, __pyx_L1_error)
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 805, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":806
+ *
+ * for childname in descr.names:
+ * fields = descr.fields[childname] # <<<<<<<<<<<<<<
+ * child, new_offset = fields
+ *
+ */
+ if (unlikely(__pyx_v_descr->fields == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(1, 806, __pyx_L1_error)
+ }
+ __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 806, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ 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(1, 806, __pyx_L1_error)
+ __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
+ __pyx_t_3 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":807
+ * for childname in descr.names:
+ * fields = descr.fields[childname]
+ * child, new_offset = fields # <<<<<<<<<<<<<<
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ */
+ if (likely(__pyx_v_fields != Py_None)) {
+ PyObject* sequence = __pyx_v_fields;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(1, 807, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 807, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 807, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ #endif
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(1, 807, __pyx_L1_error)
+ }
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(1, 807, __pyx_L1_error)
+ __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
+ __pyx_t_3 = 0;
+ __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":809
+ * child, new_offset = fields
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 809, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 809, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 809, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
+ if (unlikely(__pyx_t_6)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":810
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
+ *
+ * if ((child.byteorder == c'>' and little_endian) or
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 810, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(1, 810, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":809
+ * child, new_offset = fields
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":812
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
+ if (!__pyx_t_7) {
+ goto __pyx_L8_next_or;
+ } else {
+ }
+ __pyx_t_7 = (__pyx_v_little_endian != 0);
+ if (!__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_L8_next_or:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":813
+ *
+ * if ((child.byteorder == c'>' and little_endian) or
+ * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
+ * raise ValueError(u"Non-native byte order not supported")
+ * # One could encode it in the format string and have Cython
+ */
+ __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
+ if (__pyx_t_7) {
+ } else {
+ __pyx_t_6 = __pyx_t_7;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
+ __pyx_t_6 = __pyx_t_7;
+ __pyx_L7_bool_binop_done:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":812
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ if (unlikely(__pyx_t_6)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":814
+ * if ((child.byteorder == c'>' and little_endian) or
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * # One could encode it in the format string and have Cython
+ * # complain instead, BUT: < and > in format strings also imply
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 814, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(1, 814, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":812
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
+ *
+ * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported")
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":824
+ *
+ * # Output padding bytes
+ * while offset[0] < new_offset: # <<<<<<<<<<<<<<
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ */
+ while (1) {
+ __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 824, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 824, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 824, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (!__pyx_t_6) break;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":825
+ * # Output padding bytes
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
+ * f += 1
+ * offset[0] += 1
+ */
+ (__pyx_v_f[0]) = 0x78;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":826
+ * while offset[0] < new_offset:
+ * f[0] = 120 # "x"; pad byte
+ * f += 1 # <<<<<<<<<<<<<<
+ * offset[0] += 1
+ *
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":827
+ * f[0] = 120 # "x"; pad byte
+ * f += 1
+ * offset[0] += 1 # <<<<<<<<<<<<<<
+ *
+ * offset[0] += child.itemsize
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":829
+ * offset[0] += 1
+ *
+ * offset[0] += child.itemsize # <<<<<<<<<<<<<<
+ *
+ * if not PyDataType_HASFIELDS(child):
+ */
+ __pyx_t_8 = 0;
+ (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":831
+ * offset[0] += child.itemsize
+ *
+ * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
+ * t = child.type_num
+ * if end - f < 5:
+ */
+ __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
+ if (__pyx_t_6) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":832
+ *
+ * if not PyDataType_HASFIELDS(child):
+ * t = child.type_num # <<<<<<<<<<<<<<
+ * if end - f < 5:
+ * raise RuntimeError(u"Format string allocated too short.")
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 832, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
+ * if not PyDataType_HASFIELDS(child):
+ * t = child.type_num
+ * if end - f < 5: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short.")
+ *
+ */
+ __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
+ if (unlikely(__pyx_t_6)) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":834
+ * t = child.type_num
+ * if end - f < 5:
+ * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ */
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 834, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(1, 834, __pyx_L1_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":833
+ * if not PyDataType_HASFIELDS(child):
+ * t = child.type_num
+ * if end - f < 5: # <<<<<<<<<<<<<<
+ * raise RuntimeError(u"Format string allocated too short.")
+ *
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":837
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 837, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 837, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 837, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 98;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":838
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ * if t == NPY_BYTE: f[0] = 98 #"b"
+ * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 838, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 838, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 838, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 66;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":839
+ * if t == NPY_BYTE: f[0] = 98 #"b"
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 839, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 839, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 839, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x68;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":840
+ * elif t == NPY_UBYTE: f[0] = 66 #"B"
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 840, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 840, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 840, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 72;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":841
+ * elif t == NPY_SHORT: f[0] = 104 #"h"
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 841, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 841, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 841, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x69;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":842
+ * elif t == NPY_USHORT: f[0] = 72 #"H"
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 842, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 842, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 842, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 73;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":843
+ * elif t == NPY_INT: f[0] = 105 #"i"
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 843, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 843, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 843, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x6C;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":844
+ * elif t == NPY_UINT: f[0] = 73 #"I"
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 844, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 844, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 844, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 76;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":845
+ * elif t == NPY_LONG: f[0] = 108 #"l"
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 845, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 845, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 845, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x71;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":846
+ * elif t == NPY_ULONG: f[0] = 76 #"L"
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 846, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 846, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 846, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 81;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":847
+ * elif t == NPY_LONGLONG: f[0] = 113 #"q"
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 847, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 847, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 847, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x66;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":848
+ * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 848, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 848, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 848, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x64;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":849
+ * elif t == NPY_FLOAT: f[0] = 102 #"f"
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 849, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 849, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 849, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 0x67;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":850
+ * elif t == NPY_DOUBLE: f[0] = 100 #"d"
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 850, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 850, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 850, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 0x66;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":851
+ * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 851, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 851, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 851, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 0x64;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":852
+ * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ * else:
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 852, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(1, 852, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 852, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ if (__pyx_t_6) {
+ (__pyx_v_f[0]) = 90;
+ (__pyx_v_f[1]) = 0x67;
+ __pyx_v_f = (__pyx_v_f + 1);
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":853
+ * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
+ * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
+ * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ */
+ __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 853, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __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(1, 853, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(1, 853, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ if (likely(__pyx_t_6)) {
+ (__pyx_v_f[0]) = 79;
+ goto __pyx_L15;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":855
+ * elif t == NPY_OBJECT: f[0] = 79 #"O"
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
+ * f += 1
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 855, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 855, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(1, 855, __pyx_L1_error)
+ }
+ __pyx_L15:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":856
+ * else:
+ * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
+ * f += 1 # <<<<<<<<<<<<<<
+ * else:
+ * # Cython ignores struct boundary information ("T{...}"),
+ */
+ __pyx_v_f = (__pyx_v_f + 1);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":831
+ * offset[0] += child.itemsize
+ *
+ * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
+ * t = child.type_num
+ * if end - f < 5:
+ */
+ goto __pyx_L13;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":860
+ * # Cython ignores struct boundary information ("T{...}"),
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
+ * return f
+ *
+ */
+ /*else*/ {
+ __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(1, 860, __pyx_L1_error)
+ __pyx_v_f = __pyx_t_9;
+ }
+ __pyx_L13:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":805
+ * cdef tuple fields
+ *
+ * for childname in descr.names: # <<<<<<<<<<<<<<
+ * fields = descr.fields[childname]
+ * child, new_offset = fields
+ */
+ }
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":861
+ * # so don't output it
+ * f = _util_dtypestring(child, f, end, offset)
+ * return f # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_f;
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":796
+ * return ()
+ *
+ * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
+ * # Recursive utility function used in __getbuffer__ to get format
+ * # string. The new location in the format string is returned.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_child);
+ __Pyx_XDECREF(__pyx_v_fields);
+ __Pyx_XDECREF(__pyx_v_childname);
+ __Pyx_XDECREF(__pyx_v_new_offset);
+ __Pyx_XDECREF(__pyx_v_t);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
+ PyObject *__pyx_v_baseptr;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("set_array_base", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":979
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_base == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":980
+ * cdef PyObject* baseptr
+ * if base is None:
+ * baseptr = NULL # <<<<<<<<<<<<<<
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ */
+ __pyx_v_baseptr = NULL;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":979
+ * cdef inline void set_array_base(ndarray arr, object base):
+ * cdef PyObject* baseptr
+ * if base is None: # <<<<<<<<<<<<<<
+ * baseptr = NULL
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":982
+ * baseptr = NULL
+ * else:
+ * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ */
+ /*else*/ {
+ Py_INCREF(__pyx_v_base);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":983
+ * else:
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr
+ */
+ __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
+ }
+ __pyx_L3:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":984
+ * Py_INCREF(base) # important to do this before decref below!
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
+ * arr.base = baseptr
+ *
+ */
+ Py_XDECREF(__pyx_v_arr->base);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":985
+ * baseptr = <PyObject*>base
+ * Py_XDECREF(arr.base)
+ * arr.base = baseptr # <<<<<<<<<<<<<<
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ */
+ __pyx_v_arr->base = __pyx_v_baseptr;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":977
+ *
+ *
+ * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
+ * cdef PyObject* baseptr
+ * if base is None:
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":987
+ * arr.base = baseptr
+ *
+ * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
+ * if arr.base is NULL:
+ * return None
+ */
+
+static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("get_array_base", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":988
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL: # <<<<<<<<<<<<<<
+ * return None
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":989
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL:
+ * return None # <<<<<<<<<<<<<<
+ * else:
+ * return <object>arr.base
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":988
+ *
+ * cdef inline object get_array_base(ndarray arr):
+ * if arr.base is NULL: # <<<<<<<<<<<<<<
+ * return None
+ * else:
+ */
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":991
+ * return None
+ * else:
+ * return <object>arr.base # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
+ __pyx_r = ((PyObject *)__pyx_v_arr->base);
+ goto __pyx_L0;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":987
+ * arr.base = baseptr
+ *
+ * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
+ * if arr.base is NULL:
+ * return None
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":996
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_array", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":998
+ * cdef inline int import_array() except -1:
+ * try:
+ * _import_array() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import")
+ */
+ __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 998, __pyx_L3_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L8_try_end;
+ __pyx_L3_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":999
+ * try:
+ * _import_array()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 999, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1000, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1000, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":997
+ * # Cython code.
+ * cdef inline int import_array() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_array()
+ * except Exception:
+ */
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L8_try_end:;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":996
+ * # Versions of the import_* functions which are more suitable for
+ * # Cython code.
+ * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_array()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1002
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_umath", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1003
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1004
+ * cdef inline int import_umath() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1004, __pyx_L3_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1003
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L8_try_end;
+ __pyx_L3_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1005
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1005, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1006
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1006, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1006, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1003
+ *
+ * cdef inline int import_umath() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L8_try_end:;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1002
+ * raise ImportError("numpy.core.multiarray failed to import")
+ *
+ * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1008
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ __Pyx_RefNannySetupContext("import_ufunc", 0);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1009
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ /*try:*/ {
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1010
+ * cdef inline int import_ufunc() except -1:
+ * try:
+ * _import_umath() # <<<<<<<<<<<<<<
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(1, 1010, __pyx_L3_error)
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1009
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ goto __pyx_L8_try_end;
+ __pyx_L3_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1011
+ * try:
+ * _import_umath()
+ * except Exception: # <<<<<<<<<<<<<<
+ * raise ImportError("numpy.core.umath failed to import")
+ */
+ __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
+ if (__pyx_t_4) {
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(1, 1011, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1012
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 1012, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_Raise(__pyx_t_8, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __PYX_ERR(1, 1012, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1009
+ *
+ * cdef inline int import_ufunc() except -1:
+ * try: # <<<<<<<<<<<<<<
+ * _import_umath()
+ * except Exception:
+ */
+ __Pyx_XGIVEREF(__pyx_t_1);
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
+ goto __pyx_L1_error;
+ __pyx_L8_try_end:;
+ }
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1008
+ * raise ImportError("numpy.core.umath failed to import")
+ *
+ * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
+ * try:
+ * _import_umath()
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":121
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_shape = 0;
+ Py_ssize_t __pyx_v_itemsize;
+ PyObject *__pyx_v_format = 0;
+ PyObject *__pyx_v_mode = 0;
+ int __pyx_v_allocate_buffer;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ 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};
+ PyObject* values[5] = {0,0,0,0,0};
+ values[3] = ((PyObject *)__pyx_n_s_c);
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(2, 121, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(2, 121, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
+ if (value) { values[3] = value; kw_args--; }
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
+ if (value) { values[4] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 121, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
+ CYTHON_FALLTHROUGH;
+ case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
+ CYTHON_FALLTHROUGH;
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_shape = ((PyObject*)values[0]);
+ __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 121, __pyx_L3_error)
+ __pyx_v_format = values[2];
+ __pyx_v_mode = values[3];
+ if (values[4]) {
+ __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 122, __pyx_L3_error)
+ } else {
+
+ /* "View.MemoryView":122
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
+ * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
+ *
+ * cdef int idx
+ */
+ __pyx_v_allocate_buffer = ((int)1);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 121, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(2, 121, __pyx_L1_error)
+ if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
+ PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(2, 121, __pyx_L1_error)
+ }
+ __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);
+
+ /* "View.MemoryView":121
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_dim;
+ PyObject **__pyx_v_p;
+ char __pyx_v_order;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ int __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ Py_ssize_t __pyx_t_11;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+ __Pyx_INCREF(__pyx_v_format);
+
+ /* "View.MemoryView":128
+ * cdef PyObject **p
+ *
+ * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
+ * self.itemsize = itemsize
+ *
+ */
+ if (unlikely(__pyx_v_shape == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(2, 128, __pyx_L1_error)
+ }
+ __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(2, 128, __pyx_L1_error)
+ __pyx_v_self->ndim = ((int)__pyx_t_1);
+
+ /* "View.MemoryView":129
+ *
+ * self.ndim = <int> len(shape)
+ * self.itemsize = itemsize # <<<<<<<<<<<<<<
+ *
+ * if not self.ndim:
+ */
+ __pyx_v_self->itemsize = __pyx_v_itemsize;
+
+ /* "View.MemoryView":131
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":132
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(2, 132, __pyx_L1_error)
+
+ /* "View.MemoryView":131
+ * self.itemsize = itemsize
+ *
+ * if not self.ndim: # <<<<<<<<<<<<<<
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ */
+ }
+
+ /* "View.MemoryView":134
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":135
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(format, bytes):
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(2, 135, __pyx_L1_error)
+
+ /* "View.MemoryView":134
+ * raise ValueError("Empty shape tuple for cython.array")
+ *
+ * if itemsize <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ */
+ }
+
+ /* "View.MemoryView":137
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
+ __pyx_t_2 = PyBytes_Check(__pyx_v_format);
+ __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":138
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":137
+ * raise ValueError("itemsize <= 0 for cython.array")
+ *
+ * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ */
+ }
+
+ /* "View.MemoryView":139
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
+ * self.format = self._format
+ *
+ */
+ 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(2, 139, __pyx_L1_error)
+ __pyx_t_5 = __pyx_v_format;
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_v_self->_format);
+ __Pyx_DECREF(__pyx_v_self->_format);
+ __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":140
+ * format = format.encode('ASCII')
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ if (unlikely(__pyx_v_self->_format == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
+ __PYX_ERR(2, 140, __pyx_L1_error)
+ }
+ __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(2, 140, __pyx_L1_error)
+ __pyx_v_self->format = __pyx_t_6;
+
+ /* "View.MemoryView":143
+ *
+ *
+ * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
+ * self._strides = self._shape + self.ndim
+ *
+ */
+ __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
+
+ /* "View.MemoryView":144
+ *
+ * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
+ * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
+ *
+ * if not self._shape:
+ */
+ __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
+
+ /* "View.MemoryView":146
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":147
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 147, __pyx_L1_error)
+
+ /* "View.MemoryView":146
+ * self._strides = self._shape + self.ndim
+ *
+ * if not self._shape: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate shape and strides.")
+ *
+ */
+ }
+
+ /* "View.MemoryView":150
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ __pyx_t_7 = 0;
+ __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
+ for (;;) {
+ if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(2, 150, __pyx_L1_error)
+ #else
+ __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 150, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ #endif
+ __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 150, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_dim = __pyx_t_8;
+ __pyx_v_idx = __pyx_t_7;
+ __pyx_t_7 = (__pyx_t_7 + 1);
+
+ /* "View.MemoryView":151
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
+ __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":152
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
+ * self._shape[idx] = dim
+ *
+ */
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_9);
+ PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
+ __pyx_t_3 = 0;
+ __pyx_t_9 = 0;
+ __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 152, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(2, 152, __pyx_L1_error)
+
+ /* "View.MemoryView":151
+ *
+ * for idx, dim in enumerate(shape):
+ * if dim <= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim
+ */
+ }
+
+ /* "View.MemoryView":153
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ * self._shape[idx] = dim # <<<<<<<<<<<<<<
+ *
+ * cdef char order
+ */
+ (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
+
+ /* "View.MemoryView":150
+ *
+ *
+ * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
+ * if dim <= 0:
+ * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
+ */
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+
+ /* "View.MemoryView":156
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 156, __pyx_L1_error)
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":157
+ * cdef char order
+ * if mode == 'fortran':
+ * order = b'F' # <<<<<<<<<<<<<<
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ */
+ __pyx_v_order = 'F';
+
+ /* "View.MemoryView":158
+ * if mode == 'fortran':
+ * order = b'F'
+ * self.mode = u'fortran' # <<<<<<<<<<<<<<
+ * elif mode == 'c':
+ * order = b'C'
+ */
+ __Pyx_INCREF(__pyx_n_u_fortran);
+ __Pyx_GIVEREF(__pyx_n_u_fortran);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_fortran;
+
+ /* "View.MemoryView":156
+ *
+ * cdef char order
+ * if mode == 'fortran': # <<<<<<<<<<<<<<
+ * order = b'F'
+ * self.mode = u'fortran'
+ */
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":159
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
+ __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(2, 159, __pyx_L1_error)
+ if (likely(__pyx_t_4)) {
+
+ /* "View.MemoryView":160
+ * self.mode = u'fortran'
+ * elif mode == 'c':
+ * order = b'C' # <<<<<<<<<<<<<<
+ * self.mode = u'c'
+ * else:
+ */
+ __pyx_v_order = 'C';
+
+ /* "View.MemoryView":161
+ * elif mode == 'c':
+ * order = b'C'
+ * self.mode = u'c' # <<<<<<<<<<<<<<
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ */
+ __Pyx_INCREF(__pyx_n_u_c);
+ __Pyx_GIVEREF(__pyx_n_u_c);
+ __Pyx_GOTREF(__pyx_v_self->mode);
+ __Pyx_DECREF(__pyx_v_self->mode);
+ __pyx_v_self->mode = __pyx_n_u_c;
+
+ /* "View.MemoryView":159
+ * order = b'F'
+ * self.mode = u'fortran'
+ * elif mode == 'c': # <<<<<<<<<<<<<<
+ * order = b'C'
+ * self.mode = u'c'
+ */
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":163
+ * self.mode = u'c'
+ * else:
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides,
+ */
+ /*else*/ {
+ __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 163, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 163, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(2, 163, __pyx_L1_error)
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":165
+ * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
+ *
+ * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
+ * itemsize, self.ndim, order)
+ *
+ */
+ __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);
+
+ /* "View.MemoryView":168
+ * itemsize, self.ndim, order)
+ *
+ * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer:
+ */
+ __pyx_v_self->free_data = __pyx_v_allocate_buffer;
+
+ /* "View.MemoryView":169
+ *
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
+ * if allocate_buffer:
+ *
+ */
+ __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(2, 169, __pyx_L1_error)
+ __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 169, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __pyx_v_self->dtype_is_object = __pyx_t_4;
+
+ /* "View.MemoryView":170
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":173
+ *
+ *
+ * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.")
+ */
+ __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
+
+ /* "View.MemoryView":174
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
+ __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":175
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(2, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_10);
+ __Pyx_Raise(__pyx_t_10, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+ __PYX_ERR(2, 175, __pyx_L1_error)
+
+ /* "View.MemoryView":174
+ *
+ * self.data = <char *>malloc(self.len)
+ * if not self.data: # <<<<<<<<<<<<<<
+ * raise MemoryError("unable to allocate array data.")
+ *
+ */
+ }
+
+ /* "View.MemoryView":177
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
+ __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":178
+ *
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data # <<<<<<<<<<<<<<
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ */
+ __pyx_v_p = ((PyObject **)__pyx_v_self->data);
+
+ /* "View.MemoryView":179
+ * if self.dtype_is_object:
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
+ * p[i] = Py_None
+ * Py_INCREF(Py_None)
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+ __PYX_ERR(2, 179, __pyx_L1_error)
+ }
+ 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))) {
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ __PYX_ERR(2, 179, __pyx_L1_error)
+ }
+ __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
+ __pyx_t_8 = __pyx_t_1;
+ for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
+ __pyx_v_i = __pyx_t_11;
+
+ /* "View.MemoryView":180
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ (__pyx_v_p[__pyx_v_i]) = Py_None;
+
+ /* "View.MemoryView":181
+ * for i in range(self.len / itemsize):
+ * p[i] = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ Py_INCREF(Py_None);
+ }
+
+ /* "View.MemoryView":177
+ * raise MemoryError("unable to allocate array data.")
+ *
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * p = <PyObject **> self.data
+ * for i in range(self.len / itemsize):
+ */
+ }
+
+ /* "View.MemoryView":170
+ * self.free_data = allocate_buffer
+ * self.dtype_is_object = format == b'O'
+ * if allocate_buffer: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ }
+
+ /* "View.MemoryView":121
+ * cdef bint dtype_is_object
+ *
+ * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
+ * mode="c", bint allocate_buffer=True):
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_format);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":184
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_v_bufmode;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ char *__pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ if (__pyx_v_info == NULL) {
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
+ return -1;
+ }
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+
+ /* "View.MemoryView":185
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1 # <<<<<<<<<<<<<<
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = -1;
+
+ /* "View.MemoryView":186
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ */
+ __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 186, __pyx_L1_error)
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":187
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ */
+ __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":186
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * cdef int bufmode = -1
+ * if self.mode == u"c": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":188
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ */
+ __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 188, __pyx_L1_error)
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":189
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ */
+ __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
+
+ /* "View.MemoryView":188
+ * if self.mode == u"c":
+ * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ */
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":190
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ */
+ __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":191
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(2, 191, __pyx_L1_error)
+
+ /* "View.MemoryView":190
+ * elif self.mode == u"fortran":
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode): # <<<<<<<<<<<<<<
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ */
+ }
+
+ /* "View.MemoryView":192
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data # <<<<<<<<<<<<<<
+ * info.len = self.len
+ * info.ndim = self.ndim
+ */
+ __pyx_t_4 = __pyx_v_self->data;
+ __pyx_v_info->buf = __pyx_t_4;
+
+ /* "View.MemoryView":193
+ * raise ValueError("Can only create a buffer that is contiguous in memory.")
+ * info.buf = self.data
+ * info.len = self.len # <<<<<<<<<<<<<<
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ */
+ __pyx_t_5 = __pyx_v_self->len;
+ __pyx_v_info->len = __pyx_t_5;
+
+ /* "View.MemoryView":194
+ * info.buf = self.data
+ * info.len = self.len
+ * info.ndim = self.ndim # <<<<<<<<<<<<<<
+ * info.shape = self._shape
+ * info.strides = self._strides
+ */
+ __pyx_t_6 = __pyx_v_self->ndim;
+ __pyx_v_info->ndim = __pyx_t_6;
+
+ /* "View.MemoryView":195
+ * info.len = self.len
+ * info.ndim = self.ndim
+ * info.shape = self._shape # <<<<<<<<<<<<<<
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ */
+ __pyx_t_7 = __pyx_v_self->_shape;
+ __pyx_v_info->shape = __pyx_t_7;
+
+ /* "View.MemoryView":196
+ * info.ndim = self.ndim
+ * info.shape = self._shape
+ * info.strides = self._strides # <<<<<<<<<<<<<<
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ */
+ __pyx_t_7 = __pyx_v_self->_strides;
+ __pyx_v_info->strides = __pyx_t_7;
+
+ /* "View.MemoryView":197
+ * info.shape = self._shape
+ * info.strides = self._strides
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ * info.itemsize = self.itemsize
+ * info.readonly = 0
+ */
+ __pyx_v_info->suboffsets = NULL;
+
+ /* "View.MemoryView":198
+ * info.strides = self._strides
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
+ * info.readonly = 0
+ *
+ */
+ __pyx_t_5 = __pyx_v_self->itemsize;
+ __pyx_v_info->itemsize = __pyx_t_5;
+
+ /* "View.MemoryView":199
+ * info.suboffsets = NULL
+ * info.itemsize = self.itemsize
+ * info.readonly = 0 # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ __pyx_v_info->readonly = 0;
+
+ /* "View.MemoryView":201
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":202
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->format;
+ __pyx_v_info->format = __pyx_t_4;
+
+ /* "View.MemoryView":201
+ * info.readonly = 0
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.format
+ * else:
+ */
+ goto __pyx_L5;
+ }
+
+ /* "View.MemoryView":204
+ * info.format = self.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.obj = self
+ */
+ /*else*/ {
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":206
+ * info.format = NULL
+ *
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":184
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * cdef int bufmode = -1
+ * if self.mode == u"c":
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":210
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+/* Python wrapper */
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":211
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
+ __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":212
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ */
+ __pyx_v_self->callback_free_data(__pyx_v_self->data);
+
+ /* "View.MemoryView":211
+ *
+ * def __dealloc__(array self):
+ * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":213
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ * elif self.free_data: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape,
+ */
+ __pyx_t_1 = (__pyx_v_self->free_data != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":214
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":215
+ * elif self.free_data:
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
+
+ /* "View.MemoryView":214
+ * self.callback_free_data(self.data)
+ * elif self.free_data:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ */
+ }
+
+ /* "View.MemoryView":217
+ * refcount_objects_in_slice(self.data, self._shape,
+ * self._strides, self.ndim, False)
+ * free(self.data) # <<<<<<<<<<<<<<
+ * PyObject_Free(self._shape)
+ *
+ */
+ free(__pyx_v_self->data);
+
+ /* "View.MemoryView":213
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ * elif self.free_data: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * refcount_objects_in_slice(self.data, self._shape,
+ */
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":218
+ * self._strides, self.ndim, False)
+ * free(self.data)
+ * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ PyObject_Free(__pyx_v_self->_shape);
+
+ /* "View.MemoryView":210
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
+ *
+ * def __dealloc__(array self): # <<<<<<<<<<<<<<
+ * if self.callback_free_data != NULL:
+ * self.callback_free_data(self.data)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":221
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":222
+ * @property
+ * def memview(self):
+ * return self.get_memview() # <<<<<<<<<<<<<<
+ *
+ * @cname('get_memview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 222, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":221
+ *
+ * @property
+ * def memview(self): # <<<<<<<<<<<<<<
+ * return self.get_memview()
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":225
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("get_memview", 0);
+
+ /* "View.MemoryView":226
+ * @cname('get_memview')
+ * cdef get_memview(self):
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ */
+ __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
+
+ /* "View.MemoryView":227
+ * cdef get_memview(self):
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 227, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":225
+ *
+ * @cname('get_memview')
+ * cdef get_memview(self): # <<<<<<<<<<<<<<
+ * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
+ * return memoryview(self, flags, self.dtype_is_object)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":229
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * return self._shape[0]
+ *
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "View.MemoryView":230
+ *
+ * def __len__(self):
+ * return self._shape[0] # <<<<<<<<<<<<<<
+ *
+ * def __getattr__(self, attr):
+ */
+ __pyx_r = (__pyx_v_self->_shape[0]);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":229
+ * return memoryview(self, flags, self.dtype_is_object)
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * return self._shape[0]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":232
+ * return self._shape[0]
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
+static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__getattr__", 0);
+
+ /* "View.MemoryView":233
+ *
+ * def __getattr__(self, attr):
+ * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
+ *
+ * def __getitem__(self, item):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":232
+ * return self._shape[0]
+ *
+ * def __getattr__(self, attr): # <<<<<<<<<<<<<<
+ * return getattr(self.memview, attr)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":235
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
+static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":236
+ *
+ * def __getitem__(self, item):
+ * return self.memview[item] # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(self, item, value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 236, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":235
+ * return getattr(self.memview, attr)
+ *
+ * def __getitem__(self, item): # <<<<<<<<<<<<<<
+ * return self.memview[item]
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":238
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+/* Python wrapper */
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+
+ /* "View.MemoryView":239
+ *
+ * def __setitem__(self, item, value):
+ * self.memview[item] = value # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 239, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(2, 239, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":238
+ * return self.memview[item]
+ *
+ * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
+ * self.memview[item] = value
+ *
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(2, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(2, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":243
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+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) {
+ struct __pyx_array_obj *__pyx_v_result = 0;
+ struct __pyx_array_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("array_cwrapper", 0);
+
+ /* "View.MemoryView":247
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":248
+ *
+ * if buf == NULL:
+ * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ */
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_INCREF(__pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 248, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "View.MemoryView":247
+ * cdef array result
+ *
+ * if buf == NULL: # <<<<<<<<<<<<<<
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":250
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ /*else*/ {
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __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(2, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_v_shape);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
+ __pyx_t_4 = 0;
+ __pyx_t_5 = 0;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":251
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False) # <<<<<<<<<<<<<<
+ * result.data = buf
+ *
+ */
+ __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 251, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(2, 251, __pyx_L1_error)
+
+ /* "View.MemoryView":250
+ * result = array(shape, itemsize, format, mode.decode('ASCII'))
+ * else:
+ * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
+ * allocate_buffer=False)
+ * result.data = buf
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":252
+ * result = array(shape, itemsize, format, mode.decode('ASCII'),
+ * allocate_buffer=False)
+ * result.data = buf # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->data = __pyx_v_buf;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":254
+ * result.data = buf
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":243
+ *
+ * @cname("__pyx_array_new")
+ * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
+ * char *mode, char *buf):
+ * cdef array result
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":280
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+/* Python wrapper */
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_name = 0;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
+ PyObject* values[1] = {0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(2, 280, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ }
+ __pyx_v_name = values[0];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 280, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__init__", 0);
+
+ /* "View.MemoryView":281
+ * cdef object name
+ * def __init__(self, name):
+ * self.name = name # <<<<<<<<<<<<<<
+ * def __repr__(self):
+ * return self.name
+ */
+ __Pyx_INCREF(__pyx_v_name);
+ __Pyx_GIVEREF(__pyx_v_name);
+ __Pyx_GOTREF(__pyx_v_self->name);
+ __Pyx_DECREF(__pyx_v_self->name);
+ __pyx_v_self->name = __pyx_v_name;
+
+ /* "View.MemoryView":280
+ * cdef class Enum(object):
+ * cdef object name
+ * def __init__(self, name): # <<<<<<<<<<<<<<
+ * self.name = name
+ * def __repr__(self):
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":282
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":283
+ * self.name = name
+ * def __repr__(self):
+ * return self.name # <<<<<<<<<<<<<<
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __pyx_r = __pyx_v_self->name;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":282
+ * def __init__(self, name):
+ * self.name = name
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return self.name
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef bint use_setstate
+ * state = (self.name,)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
+ int __pyx_v_use_setstate;
+ PyObject *__pyx_v_state = NULL;
+ PyObject *__pyx_v__dict = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * cdef bint use_setstate
+ * state = (self.name,) # <<<<<<<<<<<<<<
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v_self->name);
+ __Pyx_GIVEREF(__pyx_v_self->name);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
+ __pyx_v_state = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":4
+ * cdef bint use_setstate
+ * state = (self.name,)
+ * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
+ * if _dict is not None:
+ * state += (_dict,)
+ */
+ __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v__dict = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":5
+ * state = (self.name,)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ __pyx_t_2 = (__pyx_v__dict != Py_None);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":6
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None:
+ * state += (_dict,) # <<<<<<<<<<<<<<
+ * use_setstate = True
+ * else:
+ */
+ __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(__pyx_v__dict);
+ __Pyx_GIVEREF(__pyx_v__dict);
+ PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
+ __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 6, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
+ __pyx_t_4 = 0;
+
+ /* "(tree fragment)":7
+ * if _dict is not None:
+ * state += (_dict,)
+ * use_setstate = True # <<<<<<<<<<<<<<
+ * else:
+ * use_setstate = self.name is not None
+ */
+ __pyx_v_use_setstate = 1;
+
+ /* "(tree fragment)":5
+ * state = (self.name,)
+ * _dict = getattr(self, '__dict__', None)
+ * if _dict is not None: # <<<<<<<<<<<<<<
+ * state += (_dict,)
+ * use_setstate = True
+ */
+ goto __pyx_L3;
+ }
+
+ /* "(tree fragment)":9
+ * use_setstate = True
+ * else:
+ * use_setstate = self.name is not None # <<<<<<<<<<<<<<
+ * if use_setstate:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ */
+ /*else*/ {
+ __pyx_t_3 = (__pyx_v_self->name != Py_None);
+ __pyx_v_use_setstate = __pyx_t_3;
+ }
+ __pyx_L3:;
+
+ /* "(tree fragment)":10
+ * else:
+ * use_setstate = self.name is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ * else:
+ */
+ __pyx_t_3 = (__pyx_v_use_setstate != 0);
+ if (__pyx_t_3) {
+
+ /* "(tree fragment)":11
+ * use_setstate = self.name is not None
+ * if use_setstate:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_184977713);
+ __Pyx_GIVEREF(__pyx_int_184977713);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
+ __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 11, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":10
+ * else:
+ * use_setstate = self.name is not None
+ * if use_setstate: # <<<<<<<<<<<<<<
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ * else:
+ */
+ }
+
+ /* "(tree fragment)":13
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
+ __Pyx_INCREF(__pyx_int_184977713);
+ __Pyx_GIVEREF(__pyx_int_184977713);
+ PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
+ __Pyx_INCREF(__pyx_v_state);
+ __Pyx_GIVEREF(__pyx_v_state);
+ PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
+ __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 13, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_5);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
+ __pyx_t_5 = 0;
+ __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * cdef bint use_setstate
+ * state = (self.name,)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_state);
+ __Pyx_XDECREF(__pyx_v__dict);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":14
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":15
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ * def __setstate_cython__(self, __pyx_state):
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
+ */
+ 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(2, 15, __pyx_L1_error)
+ __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 15, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":14
+ * else:
+ * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(self, __pyx_state)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":297
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
+ Py_intptr_t __pyx_v_aligned_p;
+ size_t __pyx_v_offset;
+ void *__pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":299
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil:
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
+ * cdef size_t offset
+ *
+ */
+ __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
+
+ /* "View.MemoryView":303
+ *
+ * with cython.cdivision(True):
+ * offset = aligned_p % alignment # <<<<<<<<<<<<<<
+ *
+ * if offset > 0:
+ */
+ __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
+
+ /* "View.MemoryView":305
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":306
+ *
+ * if offset > 0:
+ * aligned_p += alignment - offset # <<<<<<<<<<<<<<
+ *
+ * return <void *> aligned_p
+ */
+ __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
+
+ /* "View.MemoryView":305
+ * offset = aligned_p % alignment
+ *
+ * if offset > 0: # <<<<<<<<<<<<<<
+ * aligned_p += alignment - offset
+ *
+ */
+ }
+
+ /* "View.MemoryView":308
+ * aligned_p += alignment - offset
+ *
+ * return <void *> aligned_p # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = ((void *)__pyx_v_aligned_p);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":297
+ *
+ * @cname('__pyx_align_pointer')
+ * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
+ * "Align pointer memory on a given boundary"
+ * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":344
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v_obj = 0;
+ int __pyx_v_flags;
+ int __pyx_v_dtype_is_object;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(2, 344, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (kw_args > 0) {
+ PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
+ if (value) { values[2] = value; kw_args--; }
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(2, 344, __pyx_L3_error)
+ }
+ } else {
+ switch (PyTuple_GET_SIZE(__pyx_args)) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ }
+ __pyx_v_obj = values[0];
+ __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 344, __pyx_L3_error)
+ if (values[2]) {
+ __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 344, __pyx_L3_error)
+ } else {
+ __pyx_v_dtype_is_object = ((int)0);
+ }
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 344, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return -1;
+ __pyx_L4_argument_unpacking_done:;
+ __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);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("__cinit__", 0);
+
+ /* "View.MemoryView":345
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj # <<<<<<<<<<<<<<
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ */
+ __Pyx_INCREF(__pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ __Pyx_GOTREF(__pyx_v_self->obj);
+ __Pyx_DECREF(__pyx_v_self->obj);
+ __pyx_v_self->obj = __pyx_v_obj;
+
+ /* "View.MemoryView":346
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
+ * self.obj = obj
+ * self.flags = flags # <<<<<<<<<<<<<<
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ */
+ __pyx_v_self->flags = __pyx_v_flags;
+
+ /* "View.MemoryView":347
+ * self.obj = obj
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ */
+ __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (!__pyx_t_3) {
+ } else {
+ __pyx_t_1 = __pyx_t_3;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_3 = (__pyx_v_obj != Py_None);
+ __pyx_t_2 = (__pyx_t_3 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":348
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ */
+ __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 348, __pyx_L1_error)
+
+ /* "View.MemoryView":349
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":350
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
+
+ /* "View.MemoryView":351
+ * if <PyObject *> self.view.obj == NULL:
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * global __pyx_memoryview_thread_locks_used
+ */
+ Py_INCREF(Py_None);
+
+ /* "View.MemoryView":349
+ * if type(self) is memoryview or obj is not None:
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &self.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ }
+
+ /* "View.MemoryView":347
+ * self.obj = obj
+ * self.flags = flags
+ * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_GetBuffer(obj, &self.view, flags)
+ * if <PyObject *> self.view.obj == NULL:
+ */
+ }
+
+ /* "View.MemoryView":354
+ *
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":355
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ */
+ __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+
+ /* "View.MemoryView":356
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
+
+ /* "View.MemoryView":354
+ *
+ * global __pyx_memoryview_thread_locks_used
+ * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ */
+ }
+
+ /* "View.MemoryView":357
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":358
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
+ * if self.lock is NULL:
+ * raise MemoryError
+ */
+ __pyx_v_self->lock = PyThread_allocate_lock();
+
+ /* "View.MemoryView":359
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":360
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ PyErr_NoMemory(); __PYX_ERR(2, 360, __pyx_L1_error)
+
+ /* "View.MemoryView":359
+ * if self.lock is NULL:
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ *
+ */
+ }
+
+ /* "View.MemoryView":357
+ * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
+ * __pyx_memoryview_thread_locks_used += 1
+ * if self.lock is NULL: # <<<<<<<<<<<<<<
+ * self.lock = PyThread_allocate_lock()
+ * if self.lock is NULL:
+ */
+ }
+
+ /* "View.MemoryView":362
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":363
+ *
+ * if flags & PyBUF_FORMAT:
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
+ * else:
+ * self.dtype_is_object = dtype_is_object
+ */
+ __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_self->dtype_is_object = __pyx_t_1;
+
+ /* "View.MemoryView":362
+ * raise MemoryError
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ */
+ goto __pyx_L10;
+ }
+
+ /* "View.MemoryView":365
+ * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
+ * else:
+ * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ */
+ /*else*/ {
+ __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
+ }
+ __pyx_L10:;
+
+ /* "View.MemoryView":367
+ * self.dtype_is_object = dtype_is_object
+ *
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL
+ */
+ __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
+
+ /* "View.MemoryView":369
+ * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
+ * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
+ * self.typeinfo = NULL # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(memoryview self):
+ */
+ __pyx_v_self->typeinfo = NULL;
+
+ /* "View.MemoryView":344
+ * cdef __Pyx_TypeInfo *typeinfo
+ *
+ * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
+ * self.obj = obj
+ * self.flags = flags
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":371
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+/* Python wrapper */
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ int __pyx_v_i;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyThread_type_lock __pyx_t_6;
+ PyThread_type_lock __pyx_t_7;
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":372
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->obj != Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":373
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
+ *
+ * cdef int i
+ */
+ __Pyx_ReleaseBuffer((&__pyx_v_self->view));
+
+ /* "View.MemoryView":372
+ *
+ * def __dealloc__(memoryview self):
+ * if self.obj is not None: # <<<<<<<<<<<<<<
+ * __Pyx_ReleaseBuffer(&self.view)
+ *
+ */
+ }
+
+ /* "View.MemoryView":377
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
+ __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":378
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ */
+ __pyx_t_3 = __pyx_memoryview_thread_locks_used;
+ __pyx_t_4 = __pyx_t_3;
+ for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
+ __pyx_v_i = __pyx_t_5;
+
+ /* "View.MemoryView":379
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":380
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ */
+ __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
+
+ /* "View.MemoryView":381
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":383
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
+ * break
+ * else:
+ */
+ __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
+ __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
+
+ /* "View.MemoryView":382
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break
+ */
+ (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
+ (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
+
+ /* "View.MemoryView":381
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ */
+ }
+
+ /* "View.MemoryView":384
+ * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
+ * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
+ * break # <<<<<<<<<<<<<<
+ * else:
+ * PyThread_free_lock(self.lock)
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":379
+ * if self.lock != NULL:
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
+ * __pyx_memoryview_thread_locks_used -= 1
+ * if i != __pyx_memoryview_thread_locks_used:
+ */
+ }
+ }
+ /*else*/ {
+
+ /* "View.MemoryView":386
+ * break
+ * else:
+ * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ */
+ PyThread_free_lock(__pyx_v_self->lock);
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":377
+ * cdef int i
+ * global __pyx_memoryview_thread_locks_used
+ * if self.lock != NULL: # <<<<<<<<<<<<<<
+ * for i in range(__pyx_memoryview_thread_locks_used):
+ * if __pyx_memoryview_thread_locks[i] is self.lock:
+ */
+ }
+
+ /* "View.MemoryView":371
+ * self.typeinfo = NULL
+ *
+ * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
+ * if self.obj is not None:
+ * __Pyx_ReleaseBuffer(&self.view)
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":388
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ Py_ssize_t __pyx_v_dim;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_v_idx = NULL;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t __pyx_t_3;
+ PyObject *(*__pyx_t_4)(PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ Py_ssize_t __pyx_t_6;
+ char *__pyx_t_7;
+ __Pyx_RefNannySetupContext("get_item_pointer", 0);
+
+ /* "View.MemoryView":390
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL:
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim, idx in enumerate(index):
+ */
+ __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
+
+ /* "View.MemoryView":392
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ __pyx_t_1 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
+ __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
+ __pyx_t_4 = NULL;
+ } else {
+ __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 392, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 392, __pyx_L1_error)
+ }
+ for (;;) {
+ if (likely(!__pyx_t_4)) {
+ if (likely(PyList_CheckExact(__pyx_t_2))) {
+ if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(2, 392, __pyx_L1_error)
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 392, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ } else {
+ if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(2, 392, __pyx_L1_error)
+ #else
+ __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 392, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ }
+ } else {
+ __pyx_t_5 = __pyx_t_4(__pyx_t_2);
+ if (unlikely(!__pyx_t_5)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(2, 392, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_5);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
+ __pyx_t_5 = 0;
+ __pyx_v_dim = __pyx_t_1;
+ __pyx_t_1 = (__pyx_t_1 + 1);
+
+ /* "View.MemoryView":393
+ *
+ * for dim, idx in enumerate(index):
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
+ *
+ * return itemp
+ */
+ __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 393, __pyx_L1_error)
+ __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(2, 393, __pyx_L1_error)
+ __pyx_v_itemp = __pyx_t_7;
+
+ /* "View.MemoryView":392
+ * cdef char *itemp = <char *> self.view.buf
+ *
+ * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ */
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":395
+ * itemp = pybuffer_index(&self.view, itemp, idx, dim)
+ *
+ * return itemp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_itemp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":388
+ * PyThread_free_lock(self.lock)
+ *
+ * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dim
+ * cdef char *itemp = <char *> self.view.buf
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":398
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
+static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_indices = NULL;
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ char *__pyx_t_6;
+ __Pyx_RefNannySetupContext("__getitem__", 0);
+
+ /* "View.MemoryView":399
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+ __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":400
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis:
+ * return self # <<<<<<<<<<<<<<
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __pyx_r = ((PyObject *)__pyx_v_self);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":399
+ *
+ * def __getitem__(memoryview self, object index):
+ * if index is Ellipsis: # <<<<<<<<<<<<<<
+ * return self
+ *
+ */
+ }
+
+ /* "View.MemoryView":402
+ * return self
+ *
+ * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef char *itemp
+ */
+ __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 402, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (likely(__pyx_t_3 != Py_None)) {
+ PyObject* sequence = __pyx_t_3;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(2, 402, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ #else
+ __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 402, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 402, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ #endif
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 402, __pyx_L1_error)
+ }
+ __pyx_v_have_slices = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_v_indices = __pyx_t_5;
+ __pyx_t_5 = 0;
+
+ /* "View.MemoryView":405
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
+ __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(2, 405, __pyx_L1_error)
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":406
+ * cdef char *itemp
+ * if have_slices:
+ * return memview_slice(self, indices) # <<<<<<<<<<<<<<
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 406, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":405
+ *
+ * cdef char *itemp
+ * if have_slices: # <<<<<<<<<<<<<<
+ * return memview_slice(self, indices)
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":408
+ * return memview_slice(self, indices)
+ * else:
+ * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
+ * return self.convert_item_to_object(itemp)
+ *
+ */
+ /*else*/ {
+ __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(2, 408, __pyx_L1_error)
+ __pyx_v_itemp = __pyx_t_6;
+
+ /* "View.MemoryView":409
+ * else:
+ * itemp = self.get_item_pointer(indices)
+ * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(2, 409, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":398
+ *
+ *
+ * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
+ * if index is Ellipsis:
+ * return self
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_indices);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":411
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview")
+ */
+
+/* Python wrapper */
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
+static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_v_have_slices = NULL;
+ PyObject *__pyx_v_obj = NULL;
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_RefNannySetupContext("__setitem__", 0);
+ __Pyx_INCREF(__pyx_v_index);
+
+ /* "View.MemoryView":412
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly: # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot assign to read-only memoryview")
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":413
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(2, 413, __pyx_L1_error)
+
+ /* "View.MemoryView":412
+ *
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly: # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot assign to read-only memoryview")
+ *
+ */
+ }
+
+ /* "View.MemoryView":415
+ * raise TypeError("Cannot assign to read-only memoryview")
+ *
+ * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * if have_slices:
+ */
+ __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (likely(__pyx_t_2 != Py_None)) {
+ PyObject* sequence = __pyx_t_2;
+ Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
+ if (unlikely(size != 2)) {
+ if (size > 2) __Pyx_RaiseTooManyValuesError(2);
+ else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
+ __PYX_ERR(2, 415, __pyx_L1_error)
+ }
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
+ __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_4);
+ #else
+ __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 415, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ #endif
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ } else {
+ __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(2, 415, __pyx_L1_error)
+ }
+ __pyx_v_have_slices = __pyx_t_3;
+ __pyx_t_3 = 0;
+ __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "View.MemoryView":417
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 417, __pyx_L1_error)
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":418
+ *
+ * if have_slices:
+ * obj = self.is_slice(value) # <<<<<<<<<<<<<<
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj)
+ */
+ __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(2, 418, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_v_obj = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":419
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 419, __pyx_L1_error)
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":420
+ * obj = self.is_slice(value)
+ * if obj:
+ * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 420, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __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(2, 420, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+
+ /* "View.MemoryView":419
+ * if have_slices:
+ * obj = self.is_slice(value)
+ * if obj: # <<<<<<<<<<<<<<
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ */
+ goto __pyx_L5;
+ }
+
+ /* "View.MemoryView":422
+ * self.setitem_slice_assignment(self[index], obj)
+ * else:
+ * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
+ * else:
+ * self.setitem_indexed(index, value)
+ */
+ /*else*/ {
+ __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 422, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(2, 422, __pyx_L1_error)
+ __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(2, 422, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":417
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ *
+ * if have_slices: # <<<<<<<<<<<<<<
+ * obj = self.is_slice(value)
+ * if obj:
+ */
+ goto __pyx_L4;
+ }
+
+ /* "View.MemoryView":424
+ * self.setitem_slice_assign_scalar(self[index], value)
+ * else:
+ * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
+ *
+ * cdef is_slice(self, obj):
+ */
+ /*else*/ {
+ __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(2, 424, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":411
+ * return self.convert_item_to_object(itemp)
+ *
+ * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview")
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_have_slices);
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":426
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ int __pyx_t_9;
+ __Pyx_RefNannySetupContext("is_slice", 0);
+ __Pyx_INCREF(__pyx_v_obj);
+
+ /* "View.MemoryView":427
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":428
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_5);
+ /*try:*/ {
+
+ /* "View.MemoryView":429
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 429, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":430
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object) # <<<<<<<<<<<<<<
+ * except TypeError:
+ * return None
+ */
+ __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 430, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_7);
+
+ /* "View.MemoryView":429
+ * if not isinstance(obj, memoryview):
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
+ * self.dtype_is_object)
+ * except TypeError:
+ */
+ __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 429, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_INCREF(__pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_v_obj);
+ PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_7);
+ PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
+ __pyx_t_6 = 0;
+ __pyx_t_7 = 0;
+ __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 429, __pyx_L4_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":428
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ }
+ __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ goto __pyx_L9_try_end;
+ __pyx_L4_error:;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":431
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ * except TypeError: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
+ if (__pyx_t_9) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(2, 431, __pyx_L6_except_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_GOTREF(__pyx_t_8);
+ __Pyx_GOTREF(__pyx_t_6);
+
+ /* "View.MemoryView":432
+ * self.dtype_is_object)
+ * except TypeError:
+ * return None # <<<<<<<<<<<<<<
+ *
+ * return obj
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ goto __pyx_L7_except_return;
+ }
+ goto __pyx_L6_except_error;
+ __pyx_L6_except_error:;
+
+ /* "View.MemoryView":428
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview):
+ * try: # <<<<<<<<<<<<<<
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ * self.dtype_is_object)
+ */
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L1_error;
+ __pyx_L7_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_XGIVEREF(__pyx_t_5);
+ __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
+ goto __pyx_L0;
+ __pyx_L9_try_end:;
+ }
+
+ /* "View.MemoryView":427
+ *
+ * cdef is_slice(self, obj):
+ * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
+ * try:
+ * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
+ */
+ }
+
+ /* "View.MemoryView":434
+ * return None
+ *
+ * return obj # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assignment(self, dst, src):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_obj);
+ __pyx_r = __pyx_v_obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":426
+ * self.setitem_indexed(index, value)
+ *
+ * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
+ * if not isinstance(obj, memoryview):
+ * try:
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_obj);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":436
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
+ __Pyx_memviewslice __pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_src_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
+
+ /* "View.MemoryView":440
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(2, 440, __pyx_L1_error)
+
+ /* "View.MemoryView":441
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(2, 441, __pyx_L1_error)
+
+ /* "View.MemoryView":442
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 442, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 442, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 442, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 442, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":440
+ * cdef __Pyx_memviewslice src_slice
+ *
+ * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
+ * get_slice_from_memview(dst, &dst_slice)[0],
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ */
+ __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(2, 440, __pyx_L1_error)
+
+ /* "View.MemoryView":436
+ * return obj
+ *
+ * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice dst_slice
+ * cdef __Pyx_memviewslice src_slice
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":444
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+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) {
+ int __pyx_v_array[0x80];
+ void *__pyx_v_tmp;
+ void *__pyx_v_item;
+ __Pyx_memviewslice *__pyx_v_dst_slice;
+ __Pyx_memviewslice __pyx_v_tmp_slice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ char const *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ PyObject *__pyx_t_10 = NULL;
+ PyObject *__pyx_t_11 = NULL;
+ __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
+
+ /* "View.MemoryView":446
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
+ * cdef int array[128]
+ * cdef void *tmp = NULL # <<<<<<<<<<<<<<
+ * cdef void *item
+ *
+ */
+ __pyx_v_tmp = NULL;
+
+ /* "View.MemoryView":451
+ * cdef __Pyx_memviewslice *dst_slice
+ * cdef __Pyx_memviewslice tmp_slice
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ */
+ __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
+
+ /* "View.MemoryView":453
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
+ *
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ */
+ __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":454
+ *
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
+ * if tmp == NULL:
+ * raise MemoryError
+ */
+ __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
+
+ /* "View.MemoryView":455
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
+ __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":456
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ * raise MemoryError # <<<<<<<<<<<<<<
+ * item = tmp
+ * else:
+ */
+ PyErr_NoMemory(); __PYX_ERR(2, 456, __pyx_L1_error)
+
+ /* "View.MemoryView":455
+ * if <size_t>self.view.itemsize > sizeof(array):
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL: # <<<<<<<<<<<<<<
+ * raise MemoryError
+ * item = tmp
+ */
+ }
+
+ /* "View.MemoryView":457
+ * if tmp == NULL:
+ * raise MemoryError
+ * item = tmp # <<<<<<<<<<<<<<
+ * else:
+ * item = <void *> array
+ */
+ __pyx_v_item = __pyx_v_tmp;
+
+ /* "View.MemoryView":453
+ * dst_slice = get_slice_from_memview(dst, &tmp_slice)
+ *
+ * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
+ * tmp = PyMem_Malloc(self.view.itemsize)
+ * if tmp == NULL:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":459
+ * item = tmp
+ * else:
+ * item = <void *> array # <<<<<<<<<<<<<<
+ *
+ * try:
+ */
+ /*else*/ {
+ __pyx_v_item = ((void *)__pyx_v_array);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":461
+ * item = <void *> array
+ *
+ * try: # <<<<<<<<<<<<<<
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value
+ */
+ /*try:*/ {
+
+ /* "View.MemoryView":462
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
+ __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":463
+ * try:
+ * if self.dtype_is_object:
+ * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
+ * else:
+ * self.assign_item_from_object(<char *> item, value)
+ */
+ (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
+
+ /* "View.MemoryView":462
+ *
+ * try:
+ * if self.dtype_is_object: # <<<<<<<<<<<<<<
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ */
+ goto __pyx_L8;
+ }
+
+ /* "View.MemoryView":465
+ * (<PyObject **> item)[0] = <PyObject *> value
+ * else:
+ * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ /*else*/ {
+ __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(2, 465, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":469
+ *
+ *
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":470
+ *
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ * item, self.dtype_is_object)
+ */
+ __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 470, __pyx_L6_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":469
+ *
+ *
+ * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
+ */
+ }
+
+ /* "View.MemoryView":471
+ * if self.view.suboffsets != NULL:
+ * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
+ * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
+ * item, self.dtype_is_object)
+ * finally:
+ */
+ __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);
+ }
+
+ /* "View.MemoryView":474
+ * item, self.dtype_is_object)
+ * finally:
+ * PyMem_Free(tmp) # <<<<<<<<<<<<<<
+ *
+ * cdef setitem_indexed(self, index, value):
+ */
+ /*finally:*/ {
+ /*normal exit:*/{
+ PyMem_Free(__pyx_v_tmp);
+ goto __pyx_L7;
+ }
+ __pyx_L6_error:;
+ /*exception exit:*/{
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
+ 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);
+ __Pyx_XGOTREF(__pyx_t_6);
+ __Pyx_XGOTREF(__pyx_t_7);
+ __Pyx_XGOTREF(__pyx_t_8);
+ __Pyx_XGOTREF(__pyx_t_9);
+ __Pyx_XGOTREF(__pyx_t_10);
+ __Pyx_XGOTREF(__pyx_t_11);
+ __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
+ {
+ PyMem_Free(__pyx_v_tmp);
+ }
+ if (PY_MAJOR_VERSION >= 3) {
+ __Pyx_XGIVEREF(__pyx_t_9);
+ __Pyx_XGIVEREF(__pyx_t_10);
+ __Pyx_XGIVEREF(__pyx_t_11);
+ __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
+ }
+ __Pyx_XGIVEREF(__pyx_t_6);
+ __Pyx_XGIVEREF(__pyx_t_7);
+ __Pyx_XGIVEREF(__pyx_t_8);
+ __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
+ __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
+ __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
+ goto __pyx_L1_error;
+ }
+ __pyx_L7:;
+ }
+
+ /* "View.MemoryView":444
+ * src.ndim, dst.ndim, self.dtype_is_object)
+ *
+ * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
+ * cdef int array[128]
+ * cdef void *tmp = NULL
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":476
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
+ char *__pyx_v_itemp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ char *__pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("setitem_indexed", 0);
+
+ /* "View.MemoryView":477
+ *
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
+ * self.assign_item_from_object(itemp, value)
+ *
+ */
+ __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(2, 477, __pyx_L1_error)
+ __pyx_v_itemp = __pyx_t_1;
+
+ /* "View.MemoryView":478
+ * cdef setitem_indexed(self, index, value):
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __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(2, 478, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":476
+ * PyMem_Free(tmp)
+ *
+ * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
+ * cdef char *itemp = self.get_item_pointer(index)
+ * self.assign_item_from_object(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":480
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_v_struct = NULL;
+ PyObject *__pyx_v_bytesitem = 0;
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ int __pyx_t_8;
+ PyObject *__pyx_t_9 = NULL;
+ size_t __pyx_t_10;
+ int __pyx_t_11;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":483
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef bytes bytesitem
+ *
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 483, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":486
+ * cdef bytes bytesitem
+ *
+ * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ */
+ __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 486, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":487
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
+ __Pyx_XGOTREF(__pyx_t_2);
+ __Pyx_XGOTREF(__pyx_t_3);
+ __Pyx_XGOTREF(__pyx_t_4);
+ /*try:*/ {
+
+ /* "View.MemoryView":488
+ * bytesitem = itemp[:self.view.itemsize]
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object")
+ */
+ __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = NULL;
+ __pyx_t_8 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
+ __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
+ if (likely(__pyx_t_7)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
+ __Pyx_INCREF(__pyx_t_7);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_5, function);
+ __pyx_t_8 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __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(2, 488, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
+ __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(2, 488, __pyx_L3_error)
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ if (__pyx_t_7) {
+ __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
+ __Pyx_INCREF(__pyx_v_bytesitem);
+ __Pyx_GIVEREF(__pyx_v_bytesitem);
+ PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 488, __pyx_L3_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __pyx_v_result = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":487
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ }
+
+ /* "View.MemoryView":492
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
+ /*else:*/ {
+ __pyx_t_10 = strlen(__pyx_v_self->view.format);
+ __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
+ if (__pyx_t_11) {
+
+ /* "View.MemoryView":493
+ * else:
+ * if len(self.view.format) == 1:
+ * return result[0] # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(2, 493, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L6_except_return;
+
+ /* "View.MemoryView":492
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
+ * return result[0]
+ * return result
+ */
+ }
+
+ /* "View.MemoryView":494
+ * if len(self.view.format) == 1:
+ * return result[0]
+ * return result # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_result);
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L6_except_return;
+ }
+ __pyx_L3_error:;
+ __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":489
+ * try:
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error: # <<<<<<<<<<<<<<
+ * raise ValueError("Unable to convert item to object")
+ * else:
+ */
+ __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 489, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
+ __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
+ if (__pyx_t_8) {
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(2, 489, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GOTREF(__pyx_t_1);
+
+ /* "View.MemoryView":490
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 490, __pyx_L5_except_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_Raise(__pyx_t_6, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __PYX_ERR(2, 490, __pyx_L5_except_error)
+ }
+ goto __pyx_L5_except_error;
+ __pyx_L5_except_error:;
+
+ /* "View.MemoryView":487
+ *
+ * bytesitem = itemp[:self.view.itemsize]
+ * try: # <<<<<<<<<<<<<<
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ */
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L1_error;
+ __pyx_L6_except_return:;
+ __Pyx_XGIVEREF(__pyx_t_2);
+ __Pyx_XGIVEREF(__pyx_t_3);
+ __Pyx_XGIVEREF(__pyx_t_4);
+ __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":480
+ * self.assign_item_from_object(itemp, value)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesitem);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":496
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_v_struct = NULL;
+ char __pyx_v_c;
+ PyObject *__pyx_v_bytesvalue = 0;
+ Py_ssize_t __pyx_v_i;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ PyObject *__pyx_t_8 = NULL;
+ Py_ssize_t __pyx_t_9;
+ PyObject *__pyx_t_10 = NULL;
+ char *__pyx_t_11;
+ char *__pyx_t_12;
+ char *__pyx_t_13;
+ char *__pyx_t_14;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":499
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ * import struct # <<<<<<<<<<<<<<
+ * cdef char c
+ * cdef bytes bytesvalue
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 499, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_v_struct = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":504
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
+ __pyx_t_2 = PyTuple_Check(__pyx_v_value);
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ if (__pyx_t_3) {
+
+ /* "View.MemoryView":505
+ *
+ * if isinstance(value, tuple):
+ * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value)
+ */
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 505, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ 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(2, 505, __pyx_L1_error)
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+
+ /* "View.MemoryView":504
+ * cdef Py_ssize_t i
+ *
+ * if isinstance(value, tuple): # <<<<<<<<<<<<<<
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":507
+ * bytesvalue = struct.pack(self.view.format, *value)
+ * else:
+ * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
+ *
+ * for i, c in enumerate(bytesvalue):
+ */
+ /*else*/ {
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_5 = NULL;
+ __pyx_t_7 = 0;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_6, function);
+ __pyx_t_7 = 1;
+ }
+ }
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __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(2, 507, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
+ PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
+ __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(2, 507, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_8);
+ if (__pyx_t_5) {
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ }
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
+ __Pyx_INCREF(__pyx_v_value);
+ __Pyx_GIVEREF(__pyx_v_value);
+ PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
+ __pyx_t_1 = 0;
+ __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 507, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
+ }
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ 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(2, 507, __pyx_L1_error)
+ __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
+ __pyx_t_4 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":509
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_9 = 0;
+ if (unlikely(__pyx_v_bytesvalue == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
+ __PYX_ERR(2, 509, __pyx_L1_error)
+ }
+ __Pyx_INCREF(__pyx_v_bytesvalue);
+ __pyx_t_10 = __pyx_v_bytesvalue;
+ __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
+ __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
+ for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
+ __pyx_t_11 = __pyx_t_14;
+ __pyx_v_c = (__pyx_t_11[0]);
+
+ /* "View.MemoryView":510
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ __pyx_v_i = __pyx_t_9;
+
+ /* "View.MemoryView":509
+ * bytesvalue = struct.pack(self.view.format, value)
+ *
+ * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
+ * itemp[i] = c
+ *
+ */
+ __pyx_t_9 = (__pyx_t_9 + 1);
+
+ /* "View.MemoryView":510
+ *
+ * for i, c in enumerate(bytesvalue):
+ * itemp[i] = c # <<<<<<<<<<<<<<
+ *
+ * @cname('getbuffer')
+ */
+ (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
+ }
+ __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
+
+ /* "View.MemoryView":496
+ * return result
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * """Only used if instantiated manually by the user, or if Cython doesn't
+ * know how to convert the type"""
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_10);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_struct);
+ __Pyx_XDECREF(__pyx_v_bytesvalue);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":513
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ */
+
+/* Python wrapper */
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
+static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
+ __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));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ char *__pyx_t_5;
+ void *__pyx_t_6;
+ int __pyx_t_7;
+ Py_ssize_t __pyx_t_8;
+ if (__pyx_v_info == NULL) {
+ PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
+ return -1;
+ }
+ __Pyx_RefNannySetupContext("__getbuffer__", 0);
+ __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(__pyx_v_info->obj);
+
+ /* "View.MemoryView":514
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L4_bool_binop_done:;
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":515
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 515, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(2, 515, __pyx_L1_error)
+
+ /* "View.MemoryView":514
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ */
+ }
+
+ /* "View.MemoryView":517
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":518
+ *
+ * if flags & PyBUF_STRIDES:
+ * info.shape = self.view.shape # <<<<<<<<<<<<<<
+ * else:
+ * info.shape = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->view.shape;
+ __pyx_v_info->shape = __pyx_t_4;
+
+ /* "View.MemoryView":517
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.shape = self.view.shape
+ * else:
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":520
+ * info.shape = self.view.shape
+ * else:
+ * info.shape = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ /*else*/ {
+ __pyx_v_info->shape = NULL;
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":522
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":523
+ *
+ * if flags & PyBUF_STRIDES:
+ * info.strides = self.view.strides # <<<<<<<<<<<<<<
+ * else:
+ * info.strides = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->view.strides;
+ __pyx_v_info->strides = __pyx_t_4;
+
+ /* "View.MemoryView":522
+ * info.shape = NULL
+ *
+ * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
+ * info.strides = self.view.strides
+ * else:
+ */
+ goto __pyx_L7;
+ }
+
+ /* "View.MemoryView":525
+ * info.strides = self.view.strides
+ * else:
+ * info.strides = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_INDIRECT:
+ */
+ /*else*/ {
+ __pyx_v_info->strides = NULL;
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":527
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":528
+ *
+ * if flags & PyBUF_INDIRECT:
+ * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
+ * else:
+ * info.suboffsets = NULL
+ */
+ __pyx_t_4 = __pyx_v_self->view.suboffsets;
+ __pyx_v_info->suboffsets = __pyx_t_4;
+
+ /* "View.MemoryView":527
+ * info.strides = NULL
+ *
+ * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ */
+ goto __pyx_L8;
+ }
+
+ /* "View.MemoryView":530
+ * info.suboffsets = self.view.suboffsets
+ * else:
+ * info.suboffsets = NULL # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_FORMAT:
+ */
+ /*else*/ {
+ __pyx_v_info->suboffsets = NULL;
+ }
+ __pyx_L8:;
+
+ /* "View.MemoryView":532
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":533
+ *
+ * if flags & PyBUF_FORMAT:
+ * info.format = self.view.format # <<<<<<<<<<<<<<
+ * else:
+ * info.format = NULL
+ */
+ __pyx_t_5 = __pyx_v_self->view.format;
+ __pyx_v_info->format = __pyx_t_5;
+
+ /* "View.MemoryView":532
+ * info.suboffsets = NULL
+ *
+ * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
+ * info.format = self.view.format
+ * else:
+ */
+ goto __pyx_L9;
+ }
+
+ /* "View.MemoryView":535
+ * info.format = self.view.format
+ * else:
+ * info.format = NULL # <<<<<<<<<<<<<<
+ *
+ * info.buf = self.view.buf
+ */
+ /*else*/ {
+ __pyx_v_info->format = NULL;
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":537
+ * info.format = NULL
+ *
+ * info.buf = self.view.buf # <<<<<<<<<<<<<<
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ */
+ __pyx_t_6 = __pyx_v_self->view.buf;
+ __pyx_v_info->buf = __pyx_t_6;
+
+ /* "View.MemoryView":538
+ *
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ */
+ __pyx_t_7 = __pyx_v_self->view.ndim;
+ __pyx_v_info->ndim = __pyx_t_7;
+
+ /* "View.MemoryView":539
+ * info.buf = self.view.buf
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
+ * info.len = self.view.len
+ * info.readonly = self.view.readonly
+ */
+ __pyx_t_8 = __pyx_v_self->view.itemsize;
+ __pyx_v_info->itemsize = __pyx_t_8;
+
+ /* "View.MemoryView":540
+ * info.ndim = self.view.ndim
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len # <<<<<<<<<<<<<<
+ * info.readonly = self.view.readonly
+ * info.obj = self
+ */
+ __pyx_t_8 = __pyx_v_self->view.len;
+ __pyx_v_info->len = __pyx_t_8;
+
+ /* "View.MemoryView":541
+ * info.itemsize = self.view.itemsize
+ * info.len = self.view.len
+ * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
+ * info.obj = self
+ *
+ */
+ __pyx_t_1 = __pyx_v_self->view.readonly;
+ __pyx_v_info->readonly = __pyx_t_1;
+
+ /* "View.MemoryView":542
+ * info.len = self.view.len
+ * info.readonly = self.view.readonly
+ * info.obj = self # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_INCREF(((PyObject *)__pyx_v_self));
+ __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj);
+ __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
+
+ /* "View.MemoryView":513
+ *
+ * @cname('getbuffer')
+ * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview")
+ */
+
+ /* function exit code */
+ __pyx_r = 0;
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ if (__pyx_v_info->obj != NULL) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ goto __pyx_L2;
+ __pyx_L0:;
+ if (__pyx_v_info->obj == Py_None) {
+ __Pyx_GOTREF(__pyx_v_info->obj);
+ __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
+ }
+ __pyx_L2:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":548
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":549
+ * @property
+ * def T(self):
+ * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
+ * transpose_memslice(&result.from_slice)
+ * return result
+ */
+ __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 549, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(2, 549, __pyx_L1_error)
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":550
+ * def T(self):
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 550, __pyx_L1_error)
+
+ /* "View.MemoryView":551
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":548
+ *
+ * @property
+ * def T(self): # <<<<<<<<<<<<<<
+ * cdef _memoryviewslice result = memoryview_copy(self)
+ * transpose_memslice(&result.from_slice)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":554
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":555
+ * @property
+ * def base(self):
+ * return self.obj # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->obj);
+ __pyx_r = __pyx_v_self->obj;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":554
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.obj
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":558
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_length;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":559
+ * @property
+ * def shape(self):
+ * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
+ __pyx_t_2 = __pyx_t_4;
+ __pyx_v_length = (__pyx_t_2[0]);
+ __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(2, 559, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 559, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":558
+ *
+ * @property
+ * def shape(self): # <<<<<<<<<<<<<<
+ * return tuple([length for length in self.view.shape[:self.view.ndim]])
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":562
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_stride;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":563
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":565
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
+ */
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(2, 565, __pyx_L1_error)
+
+ /* "View.MemoryView":563
+ * @property
+ * def strides(self):
+ * if self.view.strides == NULL: # <<<<<<<<<<<<<<
+ *
+ * raise ValueError("Buffer view does not expose strides")
+ */
+ }
+
+ /* "View.MemoryView":567
+ * raise ValueError("Buffer view does not expose strides")
+ *
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_v_stride = (__pyx_t_3[0]);
+ __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(2, 567, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 567, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_6;
+ __pyx_t_6 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":562
+ *
+ * @property
+ * def strides(self): # <<<<<<<<<<<<<<
+ * if self.view.strides == NULL:
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":570
+ *
+ * @property
+ * def suboffsets(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":571
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":572
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 572, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__30, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 572, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":571
+ * @property
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
+ * return (-1,) * self.view.ndim
+ *
+ */
+ }
+
+ /* "View.MemoryView":574
+ * return (-1,) * self.view.ndim
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 574, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
+ for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
+ __pyx_t_4 = __pyx_t_6;
+ __pyx_v_suboffset = (__pyx_t_4[0]);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(2, 574, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ }
+ __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 574, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":570
+ *
+ * @property
+ * def suboffsets(self): # <<<<<<<<<<<<<<
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":577
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":578
+ * @property
+ * def ndim(self):
+ * return self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 578, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":577
+ *
+ * @property
+ * def ndim(self): # <<<<<<<<<<<<<<
+ * return self.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":581
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":582
+ * @property
+ * def itemsize(self):
+ * return self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 582, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":581
+ *
+ * @property
+ * def itemsize(self): # <<<<<<<<<<<<<<
+ * return self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":585
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":586
+ * @property
+ * def nbytes(self):
+ * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 586, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 586, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 586, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_3;
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":585
+ *
+ * @property
+ * def nbytes(self): # <<<<<<<<<<<<<<
+ * return self.size * self.view.itemsize
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":589
+ *
+ * @property
+ * def size(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_v_result = NULL;
+ PyObject *__pyx_v_length = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ Py_ssize_t *__pyx_t_4;
+ Py_ssize_t *__pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":590
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
+ __pyx_t_1 = (__pyx_v_self->_size == Py_None);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":591
+ * def size(self):
+ * if self._size is None:
+ * result = 1 # <<<<<<<<<<<<<<
+ *
+ * for length in self.view.shape[:self.view.ndim]:
+ */
+ __Pyx_INCREF(__pyx_int_1);
+ __pyx_v_result = __pyx_int_1;
+
+ /* "View.MemoryView":593
+ * result = 1
+ *
+ * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
+ * result *= length
+ *
+ */
+ __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
+ for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
+ __pyx_t_3 = __pyx_t_5;
+ __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 593, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
+ __pyx_t_6 = 0;
+
+ /* "View.MemoryView":594
+ *
+ * for length in self.view.shape[:self.view.ndim]:
+ * result *= length # <<<<<<<<<<<<<<
+ *
+ * self._size = result
+ */
+ __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 594, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
+ __pyx_t_6 = 0;
+ }
+
+ /* "View.MemoryView":596
+ * result *= length
+ *
+ * self._size = result # <<<<<<<<<<<<<<
+ *
+ * return self._size
+ */
+ __Pyx_INCREF(__pyx_v_result);
+ __Pyx_GIVEREF(__pyx_v_result);
+ __Pyx_GOTREF(__pyx_v_self->_size);
+ __Pyx_DECREF(__pyx_v_self->_size);
+ __pyx_v_self->_size = __pyx_v_result;
+
+ /* "View.MemoryView":590
+ * @property
+ * def size(self):
+ * if self._size is None: # <<<<<<<<<<<<<<
+ * result = 1
+ *
+ */
+ }
+
+ /* "View.MemoryView":598
+ * self._size = result
+ *
+ * return self._size # <<<<<<<<<<<<<<
+ *
+ * def __len__(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->_size);
+ __pyx_r = __pyx_v_self->_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":589
+ *
+ * @property
+ * def size(self): # <<<<<<<<<<<<<<
+ * if self._size is None:
+ * result = 1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":600
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+/* Python wrapper */
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
+static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ Py_ssize_t __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("__len__", 0);
+
+ /* "View.MemoryView":601
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
+ __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":602
+ * def __len__(self):
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0] # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ __pyx_r = (__pyx_v_self->view.shape[0]);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":601
+ *
+ * def __len__(self):
+ * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
+ * return self.view.shape[0]
+ *
+ */
+ }
+
+ /* "View.MemoryView":604
+ * return self.view.shape[0]
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * def __repr__(self):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":600
+ * return self._size
+ *
+ * def __len__(self): # <<<<<<<<<<<<<<
+ * if self.view.ndim >= 1:
+ * return self.view.shape[0]
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":606
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("__repr__", 0);
+
+ /* "View.MemoryView":607
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+
+ /* "View.MemoryView":608
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self)) # <<<<<<<<<<<<<<
+ *
+ * def __str__(self):
+ */
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 608, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+
+ /* "View.MemoryView":607
+ *
+ * def __repr__(self):
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
+ * id(self))
+ *
+ */
+ __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __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(2, 607, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":606
+ * return 0
+ *
+ * def __repr__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
+ * id(self))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":610
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("__str__", 0);
+
+ /* "View.MemoryView":611
+ *
+ * def __str__(self):
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
+ __pyx_t_1 = 0;
+ __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 611, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":610
+ * id(self))
+ *
+ * def __str__(self): # <<<<<<<<<<<<<<
+ * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":614
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("is_c_contig", 0);
+
+ /* "View.MemoryView":617
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":618
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def is_f_contig(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(2, 618, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":614
+ *
+ *
+ * def is_c_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":620
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice *__pyx_v_mslice;
+ __Pyx_memviewslice __pyx_v_tmp;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("is_f_contig", 0);
+
+ /* "View.MemoryView":623
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
+ *
+ */
+ __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
+
+ /* "View.MemoryView":624
+ * cdef __Pyx_memviewslice tmp
+ * mslice = get_slice_from_memview(self, &tmp)
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
+ *
+ * def copy(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __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(2, 624, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":620
+ * return slice_is_contig(mslice[0], 'C', self.view.ndim)
+ *
+ * def is_f_contig(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice *mslice
+ * cdef __Pyx_memviewslice tmp
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":626
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_mslice;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("copy", 0);
+
+ /* "View.MemoryView":628
+ * def copy(self):
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &mslice)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
+
+ /* "View.MemoryView":630
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ *
+ * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
+
+ /* "View.MemoryView":631
+ *
+ * slice_copy(self, &mslice)
+ * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_C_CONTIGUOUS,
+ */
+ __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(2, 631, __pyx_L1_error)
+ __pyx_v_mslice = __pyx_t_1;
+
+ /* "View.MemoryView":636
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
+ *
+ * def copy_fortran(self):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 636, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":626
+ * return slice_is_contig(mslice[0], 'F', self.view.ndim)
+ *
+ * def copy(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice mslice
+ * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":638
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
+ __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ int __pyx_v_flags;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_memviewslice __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("copy_fortran", 0);
+
+ /* "View.MemoryView":640
+ * def copy_fortran(self):
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
+ *
+ * slice_copy(self, &src)
+ */
+ __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
+
+ /* "View.MemoryView":642
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ *
+ * slice_copy(self, &src) # <<<<<<<<<<<<<<
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
+ * self.view.itemsize,
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
+
+ /* "View.MemoryView":643
+ *
+ * slice_copy(self, &src)
+ * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
+ * self.view.itemsize,
+ * flags|PyBUF_F_CONTIGUOUS,
+ */
+ __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(2, 643, __pyx_L1_error)
+ __pyx_v_dst = __pyx_t_1;
+
+ /* "View.MemoryView":648
+ * self.dtype_is_object)
+ *
+ * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 648, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":638
+ * return memoryview_copy_from_slice(self, &mslice)
+ *
+ * def copy_fortran(self): # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice src, dst
+ * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(2, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(2, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":652
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
+ struct __pyx_memoryview_obj *__pyx_v_result = 0;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
+
+ /* "View.MemoryView":653
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
+ * result.typeinfo = typeinfo
+ * return result
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_o);
+ __Pyx_GIVEREF(__pyx_v_o);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 653, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":654
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
+ * return result
+ *
+ */
+ __pyx_v_result->typeinfo = __pyx_v_typeinfo;
+
+ /* "View.MemoryView":655
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_check')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":652
+ *
+ * @cname('__pyx_memoryview_new')
+ * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
+ * cdef memoryview result = memoryview(o, flags, dtype_is_object)
+ * result.typeinfo = typeinfo
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":658
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ __Pyx_RefNannySetupContext("memoryview_check", 0);
+
+ /* "View.MemoryView":659
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o):
+ * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
+ *
+ * cdef tuple _unellipsify(object index, int ndim):
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
+ __pyx_r = __pyx_t_1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":658
+ *
+ * @cname('__pyx_memoryview_check')
+ * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
+ * return isinstance(o, memoryview)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":661
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
+ PyObject *__pyx_v_tup = NULL;
+ PyObject *__pyx_v_result = NULL;
+ int __pyx_v_have_slices;
+ int __pyx_v_seen_ellipsis;
+ CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
+ PyObject *__pyx_v_item = NULL;
+ Py_ssize_t __pyx_v_nslices;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ Py_ssize_t __pyx_t_5;
+ PyObject *(*__pyx_t_6)(PyObject *);
+ PyObject *__pyx_t_7 = NULL;
+ Py_ssize_t __pyx_t_8;
+ int __pyx_t_9;
+ int __pyx_t_10;
+ PyObject *__pyx_t_11 = NULL;
+ __Pyx_RefNannySetupContext("_unellipsify", 0);
+
+ /* "View.MemoryView":666
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
+ __pyx_t_1 = PyTuple_Check(__pyx_v_index);
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":667
+ * """
+ * if not isinstance(index, tuple):
+ * tup = (index,) # <<<<<<<<<<<<<<
+ * else:
+ * tup = index
+ */
+ __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 667, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_index);
+ __Pyx_GIVEREF(__pyx_v_index);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
+ __pyx_v_tup = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":666
+ * full slices.
+ * """
+ * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
+ * tup = (index,)
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":669
+ * tup = (index,)
+ * else:
+ * tup = index # <<<<<<<<<<<<<<
+ *
+ * result = []
+ */
+ /*else*/ {
+ __Pyx_INCREF(__pyx_v_index);
+ __pyx_v_tup = __pyx_v_index;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":671
+ * tup = index
+ *
+ * result = [] # <<<<<<<<<<<<<<
+ * have_slices = False
+ * seen_ellipsis = False
+ */
+ __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 671, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_v_result = ((PyObject*)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":672
+ *
+ * result = []
+ * have_slices = False # <<<<<<<<<<<<<<
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ */
+ __pyx_v_have_slices = 0;
+
+ /* "View.MemoryView":673
+ * result = []
+ * have_slices = False
+ * seen_ellipsis = False # <<<<<<<<<<<<<<
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ */
+ __pyx_v_seen_ellipsis = 0;
+
+ /* "View.MemoryView":674
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ __Pyx_INCREF(__pyx_int_0);
+ __pyx_t_3 = __pyx_int_0;
+ if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
+ __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
+ __pyx_t_6 = NULL;
+ } else {
+ __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 674, __pyx_L1_error)
+ }
+ for (;;) {
+ if (likely(!__pyx_t_6)) {
+ if (likely(PyList_CheckExact(__pyx_t_4))) {
+ if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(2, 674, __pyx_L1_error)
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ #endif
+ } else {
+ if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(2, 674, __pyx_L1_error)
+ #else
+ __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ #endif
+ }
+ } else {
+ __pyx_t_7 = __pyx_t_6(__pyx_t_4);
+ if (unlikely(!__pyx_t_7)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(2, 674, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_7);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
+ __pyx_t_7 = 0;
+ __Pyx_INCREF(__pyx_t_3);
+ __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
+ __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 674, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_3);
+ __pyx_t_3 = __pyx_t_7;
+ __pyx_t_7 = 0;
+
+ /* "View.MemoryView":675
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ */
+ __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":676
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True
+ */
+ __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":677
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(2, 677, __pyx_L1_error)
+ __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(2, 677, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__33);
+ __Pyx_GIVEREF(__pyx_slice__33);
+ PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__33);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 677, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+
+ /* "View.MemoryView":678
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True # <<<<<<<<<<<<<<
+ * else:
+ * result.append(slice(None))
+ */
+ __pyx_v_seen_ellipsis = 1;
+
+ /* "View.MemoryView":676
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis:
+ * if not seen_ellipsis: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ * seen_ellipsis = True
+ */
+ goto __pyx_L7;
+ }
+
+ /* "View.MemoryView":680
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__34); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 680, __pyx_L1_error)
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":681
+ * else:
+ * result.append(slice(None))
+ * have_slices = True # <<<<<<<<<<<<<<
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ */
+ __pyx_v_have_slices = 1;
+
+ /* "View.MemoryView":675
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup):
+ * if item is Ellipsis: # <<<<<<<<<<<<<<
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1))
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":683
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
+ /*else*/ {
+ __pyx_t_2 = PySlice_Check(__pyx_v_item);
+ __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
+ if (__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
+ __pyx_t_1 = __pyx_t_10;
+ __pyx_L9_bool_binop_done:;
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":684
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item):
+ * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ */
+ __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 684, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 684, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_Raise(__pyx_t_11, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
+ __PYX_ERR(2, 684, __pyx_L1_error)
+
+ /* "View.MemoryView":683
+ * have_slices = True
+ * else:
+ * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ */
+ }
+
+ /* "View.MemoryView":686
+ * raise TypeError("Cannot index with type '%s'" % type(item))
+ *
+ * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
+ * result.append(item)
+ *
+ */
+ __pyx_t_10 = (__pyx_v_have_slices != 0);
+ if (!__pyx_t_10) {
+ } else {
+ __pyx_t_1 = __pyx_t_10;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = PySlice_Check(__pyx_v_item);
+ __pyx_t_2 = (__pyx_t_10 != 0);
+ __pyx_t_1 = __pyx_t_2;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_have_slices = __pyx_t_1;
+
+ /* "View.MemoryView":687
+ *
+ * have_slices = have_slices or isinstance(item, slice)
+ * result.append(item) # <<<<<<<<<<<<<<
+ *
+ * nslices = ndim - len(result)
+ */
+ __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 687, __pyx_L1_error)
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":674
+ * have_slices = False
+ * seen_ellipsis = False
+ * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ */
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":689
+ * result.append(item)
+ *
+ * nslices = ndim - len(result) # <<<<<<<<<<<<<<
+ * if nslices:
+ * result.extend([slice(None)] * nslices)
+ */
+ __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(2, 689, __pyx_L1_error)
+ __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
+
+ /* "View.MemoryView":690
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_nslices != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":691
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 691, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ { Py_ssize_t __pyx_temp;
+ for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
+ __Pyx_INCREF(__pyx_slice__35);
+ __Pyx_GIVEREF(__pyx_slice__35);
+ PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__35);
+ }
+ }
+ __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(2, 691, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":690
+ *
+ * nslices = ndim - len(result)
+ * if nslices: # <<<<<<<<<<<<<<
+ * result.extend([slice(None)] * nslices)
+ *
+ */
+ }
+
+ /* "View.MemoryView":693
+ * result.extend([slice(None)] * nslices)
+ *
+ * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ */
+ __Pyx_XDECREF(__pyx_r);
+ if (!__pyx_v_have_slices) {
+ } else {
+ __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ goto __pyx_L14_bool_binop_done;
+ }
+ __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_3 = __pyx_t_4;
+ __pyx_t_4 = 0;
+ __pyx_L14_bool_binop_done:;
+ __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(2, 693, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_11);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
+ __pyx_t_3 = 0;
+ __pyx_t_4 = 0;
+ __pyx_r = ((PyObject*)__pyx_t_11);
+ __pyx_t_11 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":661
+ * return isinstance(o, memoryview)
+ *
+ * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
+ * """
+ * Replace all ellipses with full slices and fill incomplete indices with
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_11);
+ __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v_tup);
+ __Pyx_XDECREF(__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_idx);
+ __Pyx_XDECREF(__pyx_v_item);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":695
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+
+static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t *__pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ Py_ssize_t *__pyx_t_3;
+ int __pyx_t_4;
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
+
+ /* "View.MemoryView":696
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * raise ValueError("Indirect dimensions not supported")
+ */
+ __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
+ for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_v_suboffset = (__pyx_t_1[0]);
+
+ /* "View.MemoryView":697
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
+ __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
+ if (unlikely(__pyx_t_4)) {
+
+ /* "View.MemoryView":698
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 698, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_Raise(__pyx_t_5, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __PYX_ERR(2, 698, __pyx_L1_error)
+
+ /* "View.MemoryView":697
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * raise ValueError("Indirect dimensions not supported")
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":695
+ * return have_slices or nslices, tuple(result)
+ *
+ * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":705
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
+ int __pyx_v_new_ndim;
+ int __pyx_v_suboffset_dim;
+ int __pyx_v_dim;
+ __Pyx_memviewslice __pyx_v_src;
+ __Pyx_memviewslice __pyx_v_dst;
+ __Pyx_memviewslice *__pyx_v_p_src;
+ struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
+ __Pyx_memviewslice *__pyx_v_p_dst;
+ int *__pyx_v_p_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;
+ PyObject *__pyx_v_index = NULL;
+ struct __pyx_memoryview_obj *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ char *__pyx_t_5;
+ int __pyx_t_6;
+ Py_ssize_t __pyx_t_7;
+ PyObject *(*__pyx_t_8)(PyObject *);
+ PyObject *__pyx_t_9 = NULL;
+ Py_ssize_t __pyx_t_10;
+ int __pyx_t_11;
+ Py_ssize_t __pyx_t_12;
+ __Pyx_RefNannySetupContext("memview_slice", 0);
+
+ /* "View.MemoryView":706
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices):
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
+ * cdef bint negative_step
+ * cdef __Pyx_memviewslice src, dst
+ */
+ __pyx_v_new_ndim = 0;
+ __pyx_v_suboffset_dim = -1;
+
+ /* "View.MemoryView":713
+ *
+ *
+ * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
+ *
+ * cdef _memoryviewslice memviewsliceobj
+ */
+ (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
+
+ /* "View.MemoryView":717
+ * cdef _memoryviewslice memviewsliceobj
+ *
+ * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ #ifndef CYTHON_WITHOUT_ASSERTIONS
+ if (unlikely(!Py_OptimizeFlag)) {
+ if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
+ PyErr_SetNone(PyExc_AssertionError);
+ __PYX_ERR(2, 717, __pyx_L1_error)
+ }
+ }
+ #endif
+
+ /* "View.MemoryView":719
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":720
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview # <<<<<<<<<<<<<<
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 720, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":721
+ * if isinstance(memview, _memoryviewslice):
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, &src)
+ */
+ __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
+
+ /* "View.MemoryView":719
+ * assert memview.view.ndim > 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * memviewsliceobj = memview
+ * p_src = &memviewsliceobj.from_slice
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":723
+ * p_src = &memviewsliceobj.from_slice
+ * else:
+ * slice_copy(memview, &src) # <<<<<<<<<<<<<<
+ * p_src = &src
+ *
+ */
+ /*else*/ {
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
+
+ /* "View.MemoryView":724
+ * else:
+ * slice_copy(memview, &src)
+ * p_src = &src # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_p_src = (&__pyx_v_src);
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":730
+ *
+ *
+ * dst.memview = p_src.memview # <<<<<<<<<<<<<<
+ * dst.data = p_src.data
+ *
+ */
+ __pyx_t_4 = __pyx_v_p_src->memview;
+ __pyx_v_dst.memview = __pyx_t_4;
+
+ /* "View.MemoryView":731
+ *
+ * dst.memview = p_src.memview
+ * dst.data = p_src.data # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_5 = __pyx_v_p_src->data;
+ __pyx_v_dst.data = __pyx_t_5;
+
+ /* "View.MemoryView":736
+ *
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
+ * cdef int *p_suboffset_dim = &suboffset_dim
+ * cdef Py_ssize_t start, stop, step
+ */
+ __pyx_v_p_dst = (&__pyx_v_dst);
+
+ /* "View.MemoryView":737
+ *
+ * cdef __Pyx_memviewslice *p_dst = &dst
+ * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t start, stop, step
+ * cdef bint have_start, have_stop, have_step
+ */
+ __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
+
+ /* "View.MemoryView":741
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ __pyx_t_6 = 0;
+ if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
+ __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
+ __pyx_t_8 = NULL;
+ } else {
+ __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 741, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(2, 741, __pyx_L1_error)
+ }
+ for (;;) {
+ if (likely(!__pyx_t_8)) {
+ if (likely(PyList_CheckExact(__pyx_t_3))) {
+ if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(2, 741, __pyx_L1_error)
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 741, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ #endif
+ } else {
+ if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
+ #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ __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(2, 741, __pyx_L1_error)
+ #else
+ __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 741, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ #endif
+ }
+ } else {
+ __pyx_t_9 = __pyx_t_8(__pyx_t_3);
+ if (unlikely(!__pyx_t_9)) {
+ PyObject* exc_type = PyErr_Occurred();
+ if (exc_type) {
+ if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
+ else __PYX_ERR(2, 741, __pyx_L1_error)
+ }
+ break;
+ }
+ __Pyx_GOTREF(__pyx_t_9);
+ }
+ __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
+ __pyx_t_9 = 0;
+ __pyx_v_dim = __pyx_t_6;
+ __pyx_t_6 = (__pyx_t_6 + 1);
+
+ /* "View.MemoryView":742
+ *
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
+ * slice_memviewslice(
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ */
+ __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":746
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ */
+ __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 746, __pyx_L1_error)
+
+ /* "View.MemoryView":743
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index):
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __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(2, 743, __pyx_L1_error)
+
+ /* "View.MemoryView":742
+ *
+ * for dim, index in enumerate(indices):
+ * if PyIndex_Check(index): # <<<<<<<<<<<<<<
+ * slice_memviewslice(
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":749
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
+ __pyx_t_2 = (__pyx_v_index == Py_None);
+ __pyx_t_1 = (__pyx_t_2 != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":750
+ * False)
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ */
+ (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
+
+ /* "View.MemoryView":751
+ * elif index is None:
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1
+ */
+ (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
+
+ /* "View.MemoryView":752
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
+ * new_ndim += 1
+ * else:
+ */
+ (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
+
+ /* "View.MemoryView":753
+ * p_dst.strides[new_ndim] = 0
+ * p_dst.suboffsets[new_ndim] = -1
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = index.start or 0
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+
+ /* "View.MemoryView":749
+ * 0, 0, 0, # have_{start,stop,step}
+ * False)
+ * elif index is None: # <<<<<<<<<<<<<<
+ * p_dst.shape[new_ndim] = 1
+ * p_dst.strides[new_ndim] = 0
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":755
+ * new_ndim += 1
+ * else:
+ * start = index.start or 0 # <<<<<<<<<<<<<<
+ * stop = index.stop or 0
+ * step = index.step or 0
+ */
+ /*else*/ {
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 755, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 755, __pyx_L1_error)
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 755, __pyx_L1_error)
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L7_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L7_bool_binop_done:;
+ __pyx_v_start = __pyx_t_10;
+
+ /* "View.MemoryView":756
+ * else:
+ * start = index.start or 0
+ * stop = index.stop or 0 # <<<<<<<<<<<<<<
+ * step = index.step or 0
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 756, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 756, __pyx_L1_error)
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 756, __pyx_L1_error)
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L9_bool_binop_done:;
+ __pyx_v_stop = __pyx_t_10;
+
+ /* "View.MemoryView":757
+ * start = index.start or 0
+ * stop = index.stop or 0
+ * step = index.step or 0 # <<<<<<<<<<<<<<
+ *
+ * have_start = index.start is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 757, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(2, 757, __pyx_L1_error)
+ if (!__pyx_t_1) {
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ } else {
+ __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 757, __pyx_L1_error)
+ __pyx_t_10 = __pyx_t_12;
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ goto __pyx_L11_bool_binop_done;
+ }
+ __pyx_t_10 = 0;
+ __pyx_L11_bool_binop_done:;
+ __pyx_v_step = __pyx_t_10;
+
+ /* "View.MemoryView":759
+ * step = index.step or 0
+ *
+ * have_start = index.start is not None # <<<<<<<<<<<<<<
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 759, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_start = __pyx_t_1;
+
+ /* "View.MemoryView":760
+ *
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None # <<<<<<<<<<<<<<
+ * have_step = index.step is not None
+ *
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 760, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_stop = __pyx_t_1;
+
+ /* "View.MemoryView":761
+ * have_start = index.start is not None
+ * have_stop = index.stop is not None
+ * have_step = index.step is not None # <<<<<<<<<<<<<<
+ *
+ * slice_memviewslice(
+ */
+ __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 761, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __pyx_t_1 = (__pyx_t_9 != Py_None);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ __pyx_v_have_step = __pyx_t_1;
+
+ /* "View.MemoryView":763
+ * have_step = index.step is not None
+ *
+ * slice_memviewslice( # <<<<<<<<<<<<<<
+ * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
+ * dim, new_ndim, p_suboffset_dim,
+ */
+ __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(2, 763, __pyx_L1_error)
+
+ /* "View.MemoryView":769
+ * have_start, have_stop, have_step,
+ * True)
+ * new_ndim += 1 # <<<<<<<<<<<<<<
+ *
+ * if isinstance(memview, _memoryviewslice):
+ */
+ __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":741
+ * cdef bint have_start, have_stop, have_step
+ *
+ * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
+ * if PyIndex_Check(index):
+ * slice_memviewslice(
+ */
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "View.MemoryView":771
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":772
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":773
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 773, __pyx_L1_error) }
+
+ /* "View.MemoryView":774
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ * else:
+ */
+ if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(2, 774, __pyx_L1_error) }
+
+ /* "View.MemoryView":772
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
+ * memviewsliceobj.to_object_func,
+ * memviewsliceobj.to_dtype_func,
+ */
+ __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(2, 772, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 772, __pyx_L1_error)
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":771
+ * new_ndim += 1
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * return memoryview_fromslice(dst, new_ndim,
+ * memviewsliceobj.to_object_func,
+ */
+ }
+
+ /* "View.MemoryView":777
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ /*else*/ {
+ __Pyx_XDECREF(((PyObject *)__pyx_r));
+
+ /* "View.MemoryView":778
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __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(2, 777, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+
+ /* "View.MemoryView":777
+ * memview.dtype_is_object)
+ * else:
+ * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
+ * memview.dtype_is_object)
+ *
+ */
+ if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(2, 777, __pyx_L1_error)
+ __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":705
+ *
+ * @cname('__pyx_memview_slice')
+ * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
+ * cdef int new_ndim = 0, suboffset_dim = -1, dim
+ * cdef bint negative_step
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
+ __Pyx_XDECREF(__pyx_v_index);
+ __Pyx_XGIVEREF((PyObject *)__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":802
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+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) {
+ Py_ssize_t __pyx_v_new_shape;
+ int __pyx_v_negative_step;
+ int __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":822
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
+ __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":824
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
+ __pyx_t_1 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":825
+ *
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+
+ /* "View.MemoryView":824
+ * if not is_slice:
+ *
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if not 0 <= start < shape:
+ */
+ }
+
+ /* "View.MemoryView":826
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
+ __pyx_t_1 = (0 <= __pyx_v_start);
+ if (__pyx_t_1) {
+ __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
+ }
+ __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":827
+ * start += shape
+ * if not 0 <= start < shape:
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
+ * else:
+ *
+ */
+ __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(2, 827, __pyx_L1_error)
+
+ /* "View.MemoryView":826
+ * if start < 0:
+ * start += shape
+ * if not 0 <= start < shape: # <<<<<<<<<<<<<<
+ * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":822
+ * cdef bint negative_step
+ *
+ * if not is_slice: # <<<<<<<<<<<<<<
+ *
+ * if start < 0:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":830
+ * else:
+ *
+ * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
+ *
+ * if have_step and step == 0:
+ */
+ /*else*/ {
+ __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step < 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L6_bool_binop_done:;
+ __pyx_v_negative_step = __pyx_t_2;
+
+ /* "View.MemoryView":832
+ * negative_step = have_step != 0 and step < 0
+ *
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
+ *
+ */
+ __pyx_t_1 = (__pyx_v_have_step != 0);
+ if (__pyx_t_1) {
+ } else {
+ __pyx_t_2 = __pyx_t_1;
+ goto __pyx_L9_bool_binop_done;
+ }
+ __pyx_t_1 = ((__pyx_v_step == 0) != 0);
+ __pyx_t_2 = __pyx_t_1;
+ __pyx_L9_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":833
+ *
+ * if have_step and step == 0:
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __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(2, 833, __pyx_L1_error)
+
+ /* "View.MemoryView":832
+ * negative_step = have_step != 0 and step < 0
+ *
+ * if have_step and step == 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":836
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_start != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":837
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":838
+ * if have_start:
+ * if start < 0:
+ * start += shape # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
+
+ /* "View.MemoryView":839
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
+ __pyx_t_2 = ((__pyx_v_start < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":840
+ * start += shape
+ * if start < 0:
+ * start = 0 # <<<<<<<<<<<<<<
+ * elif start >= shape:
+ * if negative_step:
+ */
+ __pyx_v_start = 0;
+
+ /* "View.MemoryView":839
+ * if start < 0:
+ * start += shape
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start = 0
+ * elif start >= shape:
+ */
+ }
+
+ /* "View.MemoryView":837
+ *
+ * if have_start:
+ * if start < 0: # <<<<<<<<<<<<<<
+ * start += shape
+ * if start < 0:
+ */
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":841
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
+ __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":842
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":843
+ * elif start >= shape:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = shape
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":842
+ * start = 0
+ * elif start >= shape:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ goto __pyx_L14;
+ }
+
+ /* "View.MemoryView":845
+ * start = shape - 1
+ * else:
+ * start = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ /*else*/ {
+ __pyx_v_start = __pyx_v_shape;
+ }
+ __pyx_L14:;
+
+ /* "View.MemoryView":841
+ * if start < 0:
+ * start = 0
+ * elif start >= shape: # <<<<<<<<<<<<<<
+ * if negative_step:
+ * start = shape - 1
+ */
+ }
+ __pyx_L12:;
+
+ /* "View.MemoryView":836
+ *
+ *
+ * if have_start: # <<<<<<<<<<<<<<
+ * if start < 0:
+ * start += shape
+ */
+ goto __pyx_L11;
+ }
+
+ /* "View.MemoryView":847
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":848
+ * else:
+ * if negative_step:
+ * start = shape - 1 # <<<<<<<<<<<<<<
+ * else:
+ * start = 0
+ */
+ __pyx_v_start = (__pyx_v_shape - 1);
+
+ /* "View.MemoryView":847
+ * start = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * start = shape - 1
+ * else:
+ */
+ goto __pyx_L15;
+ }
+
+ /* "View.MemoryView":850
+ * start = shape - 1
+ * else:
+ * start = 0 # <<<<<<<<<<<<<<
+ *
+ * if have_stop:
+ */
+ /*else*/ {
+ __pyx_v_start = 0;
+ }
+ __pyx_L15:;
+ }
+ __pyx_L11:;
+
+ /* "View.MemoryView":852
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
+ __pyx_t_2 = (__pyx_v_have_stop != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":853
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":854
+ * if have_stop:
+ * if stop < 0:
+ * stop += shape # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop = 0
+ */
+ __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
+
+ /* "View.MemoryView":855
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
+ __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":856
+ * stop += shape
+ * if stop < 0:
+ * stop = 0 # <<<<<<<<<<<<<<
+ * elif stop > shape:
+ * stop = shape
+ */
+ __pyx_v_stop = 0;
+
+ /* "View.MemoryView":855
+ * if stop < 0:
+ * stop += shape
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop = 0
+ * elif stop > shape:
+ */
+ }
+
+ /* "View.MemoryView":853
+ *
+ * if have_stop:
+ * if stop < 0: # <<<<<<<<<<<<<<
+ * stop += shape
+ * if stop < 0:
+ */
+ goto __pyx_L17;
+ }
+
+ /* "View.MemoryView":857
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":858
+ * stop = 0
+ * elif stop > shape:
+ * stop = shape # <<<<<<<<<<<<<<
+ * else:
+ * if negative_step:
+ */
+ __pyx_v_stop = __pyx_v_shape;
+
+ /* "View.MemoryView":857
+ * if stop < 0:
+ * stop = 0
+ * elif stop > shape: # <<<<<<<<<<<<<<
+ * stop = shape
+ * else:
+ */
+ }
+ __pyx_L17:;
+
+ /* "View.MemoryView":852
+ * start = 0
+ *
+ * if have_stop: # <<<<<<<<<<<<<<
+ * if stop < 0:
+ * stop += shape
+ */
+ goto __pyx_L16;
+ }
+
+ /* "View.MemoryView":860
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
+ /*else*/ {
+ __pyx_t_2 = (__pyx_v_negative_step != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":861
+ * else:
+ * if negative_step:
+ * stop = -1 # <<<<<<<<<<<<<<
+ * else:
+ * stop = shape
+ */
+ __pyx_v_stop = -1L;
+
+ /* "View.MemoryView":860
+ * stop = shape
+ * else:
+ * if negative_step: # <<<<<<<<<<<<<<
+ * stop = -1
+ * else:
+ */
+ goto __pyx_L19;
+ }
+
+ /* "View.MemoryView":863
+ * stop = -1
+ * else:
+ * stop = shape # <<<<<<<<<<<<<<
+ *
+ * if not have_step:
+ */
+ /*else*/ {
+ __pyx_v_stop = __pyx_v_shape;
+ }
+ __pyx_L19:;
+ }
+ __pyx_L16:;
+
+ /* "View.MemoryView":865
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":866
+ *
+ * if not have_step:
+ * step = 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_step = 1;
+
+ /* "View.MemoryView":865
+ * stop = shape
+ *
+ * if not have_step: # <<<<<<<<<<<<<<
+ * step = 1
+ *
+ */
+ }
+
+ /* "View.MemoryView":870
+ *
+ * with cython.cdivision(True):
+ * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
+ *
+ * if (stop - start) - step * new_shape:
+ */
+ __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
+
+ /* "View.MemoryView":872
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":873
+ *
+ * if (stop - start) - step * new_shape:
+ * new_shape += 1 # <<<<<<<<<<<<<<
+ *
+ * if new_shape < 0:
+ */
+ __pyx_v_new_shape = (__pyx_v_new_shape + 1);
+
+ /* "View.MemoryView":872
+ * new_shape = (stop - start) // step
+ *
+ * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
+ * new_shape += 1
+ *
+ */
+ }
+
+ /* "View.MemoryView":875
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":876
+ *
+ * if new_shape < 0:
+ * new_shape = 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_new_shape = 0;
+
+ /* "View.MemoryView":875
+ * new_shape += 1
+ *
+ * if new_shape < 0: # <<<<<<<<<<<<<<
+ * new_shape = 0
+ *
+ */
+ }
+
+ /* "View.MemoryView":879
+ *
+ *
+ * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset
+ */
+ (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
+
+ /* "View.MemoryView":880
+ *
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
+ * dst.suboffsets[new_ndim] = suboffset
+ *
+ */
+ (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
+
+ /* "View.MemoryView":881
+ * dst.strides[new_ndim] = stride * step
+ * dst.shape[new_ndim] = new_shape
+ * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":884
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
+ __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":885
+ *
+ * if suboffset_dim[0] < 0:
+ * dst.data += start * stride # <<<<<<<<<<<<<<
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ */
+ __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
+
+ /* "View.MemoryView":884
+ *
+ *
+ * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
+ * dst.data += start * stride
+ * else:
+ */
+ goto __pyx_L23;
+ }
+
+ /* "View.MemoryView":887
+ * dst.data += start * stride
+ * else:
+ * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
+ *
+ * if suboffset >= 0:
+ */
+ /*else*/ {
+ __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
+ (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
+ }
+ __pyx_L23:;
+
+ /* "View.MemoryView":889
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":890
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
+ __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":891
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
+ __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":892
+ * if not is_slice:
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ */
+ __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":891
+ * if suboffset >= 0:
+ * if not is_slice:
+ * if new_ndim == 0: # <<<<<<<<<<<<<<
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ */
+ goto __pyx_L26;
+ }
+
+ /* "View.MemoryView":894
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
+ * "must be indexed and not sliced", dim)
+ * else:
+ */
+ /*else*/ {
+
+ /* "View.MemoryView":895
+ * else:
+ * _err_dim(IndexError, "All dimensions preceding dimension %d "
+ * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
+ * else:
+ * suboffset_dim[0] = new_ndim
+ */
+ __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(2, 894, __pyx_L1_error)
+ }
+ __pyx_L26:;
+
+ /* "View.MemoryView":890
+ *
+ * if suboffset >= 0:
+ * if not is_slice: # <<<<<<<<<<<<<<
+ * if new_ndim == 0:
+ * dst.data = (<char **> dst.data)[0] + suboffset
+ */
+ goto __pyx_L25;
+ }
+
+ /* "View.MemoryView":897
+ * "must be indexed and not sliced", dim)
+ * else:
+ * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
+ *
+ * return 0
+ */
+ /*else*/ {
+ (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
+ }
+ __pyx_L25:;
+
+ /* "View.MemoryView":889
+ * dst.suboffsets[suboffset_dim[0]] += start * stride
+ *
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * if not is_slice:
+ * if new_ndim == 0:
+ */
+ }
+
+ /* "View.MemoryView":899
+ * suboffset_dim[0] = new_ndim
+ *
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":802
+ *
+ * @cname('__pyx_memoryview_slice_memviewslice')
+ * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":905
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+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) {
+ Py_ssize_t __pyx_v_shape;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_suboffset;
+ Py_ssize_t __pyx_v_itemsize;
+ char *__pyx_v_resultp;
+ char *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ __Pyx_RefNannySetupContext("pybuffer_index", 0);
+
+ /* "View.MemoryView":907
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t itemsize = view.itemsize
+ * cdef char *resultp
+ */
+ __pyx_v_suboffset = -1L;
+
+ /* "View.MemoryView":908
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
+ * cdef char *resultp
+ *
+ */
+ __pyx_t_1 = __pyx_v_view->itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":911
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
+ __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":912
+ *
+ * if view.ndim == 0:
+ * shape = view.len / itemsize # <<<<<<<<<<<<<<
+ * stride = itemsize
+ * else:
+ */
+ if (unlikely(__pyx_v_itemsize == 0)) {
+ PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
+ __PYX_ERR(2, 912, __pyx_L1_error)
+ }
+ 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))) {
+ PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
+ __PYX_ERR(2, 912, __pyx_L1_error)
+ }
+ __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
+
+ /* "View.MemoryView":913
+ * if view.ndim == 0:
+ * shape = view.len / itemsize
+ * stride = itemsize # <<<<<<<<<<<<<<
+ * else:
+ * shape = view.shape[dim]
+ */
+ __pyx_v_stride = __pyx_v_itemsize;
+
+ /* "View.MemoryView":911
+ * cdef char *resultp
+ *
+ * if view.ndim == 0: # <<<<<<<<<<<<<<
+ * shape = view.len / itemsize
+ * stride = itemsize
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":915
+ * stride = itemsize
+ * else:
+ * shape = view.shape[dim] # <<<<<<<<<<<<<<
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ */
+ /*else*/ {
+ __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":916
+ * else:
+ * shape = view.shape[dim]
+ * stride = view.strides[dim] # <<<<<<<<<<<<<<
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim]
+ */
+ __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":917
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":918
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL:
+ * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
+ *
+ * if index < 0:
+ */
+ __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
+
+ /* "View.MemoryView":917
+ * shape = view.shape[dim]
+ * stride = view.strides[dim]
+ * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
+ * suboffset = view.suboffsets[dim]
+ *
+ */
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":920
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":921
+ *
+ * if index < 0:
+ * index += view.shape[dim] # <<<<<<<<<<<<<<
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ */
+ __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
+
+ /* "View.MemoryView":922
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index < 0) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":923
+ * index += view.shape[dim]
+ * if index < 0:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * if index >= shape:
+ */
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 923, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(2, 923, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 923, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(2, 923, __pyx_L1_error)
+
+ /* "View.MemoryView":922
+ * if index < 0:
+ * index += view.shape[dim]
+ * if index < 0: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":920
+ * suboffset = view.suboffsets[dim]
+ *
+ * if index < 0: # <<<<<<<<<<<<<<
+ * index += view.shape[dim]
+ * if index < 0:
+ */
+ }
+
+ /* "View.MemoryView":925
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * if index >= shape: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
+ if (unlikely(__pyx_t_2)) {
+
+ /* "View.MemoryView":926
+ *
+ * if index >= shape:
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
+ *
+ * resultp = bufp + index * stride
+ */
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 926, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __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(2, 926, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 926, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(2, 926, __pyx_L1_error)
+
+ /* "View.MemoryView":925
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * if index >= shape: # <<<<<<<<<<<<<<
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":928
+ * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
+ *
+ * resultp = bufp + index * stride # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset
+ */
+ __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
+
+ /* "View.MemoryView":929
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":930
+ * resultp = bufp + index * stride
+ * if suboffset >= 0:
+ * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
+ *
+ * return resultp
+ */
+ __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
+
+ /* "View.MemoryView":929
+ *
+ * resultp = bufp + index * stride
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ */
+ }
+
+ /* "View.MemoryView":932
+ * resultp = (<char **> resultp)[0] + suboffset
+ *
+ * return resultp # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_resultp;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":905
+ *
+ * @cname('__pyx_pybuffer_index')
+ * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
+ * Py_ssize_t dim) except NULL:
+ * cdef Py_ssize_t shape, stride, suboffset = -1
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":938
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
+ int __pyx_v_ndim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ int __pyx_v_i;
+ int __pyx_v_j;
+ int __pyx_r;
+ int __pyx_t_1;
+ Py_ssize_t *__pyx_t_2;
+ long __pyx_t_3;
+ long __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+ int __pyx_t_7;
+ int __pyx_t_8;
+ int __pyx_t_9;
+
+ /* "View.MemoryView":939
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
+ * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ */
+ __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
+ __pyx_v_ndim = __pyx_t_1;
+
+ /* "View.MemoryView":941
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t *strides = memslice.strides
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->shape;
+ __pyx_v_shape = __pyx_t_2;
+
+ /* "View.MemoryView":942
+ *
+ * cdef Py_ssize_t *shape = memslice.shape
+ * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = __pyx_v_memslice->strides;
+ __pyx_v_strides = __pyx_t_2;
+
+ /* "View.MemoryView":946
+ *
+ * cdef int i, j
+ * for i in range(ndim / 2): # <<<<<<<<<<<<<<
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ */
+ __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
+ __pyx_t_4 = __pyx_t_3;
+ for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":947
+ * cdef int i, j
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i # <<<<<<<<<<<<<<
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i]
+ */
+ __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
+
+ /* "View.MemoryView":948
+ * for i in range(ndim / 2):
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ */
+ __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
+ __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
+ (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
+ (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
+
+ /* "View.MemoryView":949
+ * j = ndim - 1 - i
+ * strides[i], strides[j] = strides[j], strides[i]
+ * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ */
+ __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
+ __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
+ (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
+ (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
+
+ /* "View.MemoryView":951
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ */
+ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (!__pyx_t_8) {
+ } else {
+ __pyx_t_7 = __pyx_t_8;
+ goto __pyx_L6_bool_binop_done;
+ }
+ __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
+ __pyx_t_7 = __pyx_t_8;
+ __pyx_L6_bool_binop_done:;
+ if (__pyx_t_7) {
+
+ /* "View.MemoryView":952
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
+ *
+ * return 1
+ */
+ __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(2, 952, __pyx_L1_error)
+
+ /* "View.MemoryView":951
+ * shape[i], shape[j] = shape[j], shape[i]
+ *
+ * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":954
+ * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
+ *
+ * return 1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = 1;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":938
+ *
+ * @cname('__pyx_memslice_transpose')
+ * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
+ * cdef int ndim = memslice.memview.view.ndim
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = 0;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":971
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+/* Python wrapper */
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
+static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
+ __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__dealloc__", 0);
+
+ /* "View.MemoryView":972
+ *
+ * def __dealloc__(self):
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ */
+ __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
+
+ /* "View.MemoryView":971
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * def __dealloc__(self): # <<<<<<<<<<<<<<
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":974
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ __Pyx_RefNannySetupContext("convert_item_to_object", 0);
+
+ /* "View.MemoryView":975
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":976
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp)
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 976, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":975
+ *
+ * cdef convert_item_to_object(self, char *itemp):
+ * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
+ * return self.to_object_func(itemp)
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":978
+ * return self.to_object_func(itemp)
+ * else:
+ * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ */
+ /*else*/ {
+ __Pyx_XDECREF(__pyx_r);
+ __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(2, 978, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_r = __pyx_t_2;
+ __pyx_t_2 = 0;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":974
+ * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
+ *
+ * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
+ * if self.to_object_func != NULL:
+ * return self.to_object_func(itemp)
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":980
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("assign_item_from_object", 0);
+
+ /* "View.MemoryView":981
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":982
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value)
+ */
+ __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(2, 982, __pyx_L1_error)
+
+ /* "View.MemoryView":981
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value):
+ * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
+ * self.to_dtype_func(itemp, value)
+ * else:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":984
+ * self.to_dtype_func(itemp, value)
+ * else:
+ * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
+ *
+ * @property
+ */
+ /*else*/ {
+ __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(2, 984, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":980
+ * return memoryview.convert_item_to_object(self, itemp)
+ *
+ * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
+ * if self.to_dtype_func != NULL:
+ * self.to_dtype_func(itemp, value)
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":987
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
+static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
+ __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__get__", 0);
+
+ /* "View.MemoryView":988
+ * @property
+ * def base(self):
+ * return self.from_object # <<<<<<<<<<<<<<
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v_self->from_object);
+ __pyx_r = __pyx_v_self->from_object;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":987
+ *
+ * @property
+ * def base(self): # <<<<<<<<<<<<<<
+ * return self.from_object
+ *
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__reduce_cython__", 0);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(2, 2, __pyx_L1_error)
+
+ /* "(tree fragment)":1
+ * def __reduce_cython__(self): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
+static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
+ __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("__setstate_cython__", 0);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(2, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":3
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":994
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+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) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
+ Py_ssize_t __pyx_v_suboffset;
+ PyObject *__pyx_v_length = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_TypeInfo *__pyx_t_4;
+ Py_buffer __pyx_t_5;
+ Py_ssize_t *__pyx_t_6;
+ Py_ssize_t *__pyx_t_7;
+ Py_ssize_t *__pyx_t_8;
+ Py_ssize_t __pyx_t_9;
+ __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
+
+ /* "View.MemoryView":1002
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1003
+ *
+ * if <PyObject *> memviewslice.memview == Py_None:
+ * return None # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1002
+ * cdef _memoryviewslice result
+ *
+ * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
+ * return None
+ *
+ */
+ }
+
+ /* "View.MemoryView":1008
+ *
+ *
+ * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ * result.from_slice = memviewslice
+ */
+ __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1008, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1008, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(Py_None);
+ __Pyx_GIVEREF(Py_None);
+ PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
+ __Pyx_INCREF(__pyx_int_0);
+ __Pyx_GIVEREF(__pyx_int_0);
+ PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
+ __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1008, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":1010
+ * result = _memoryviewslice(None, 0, dtype_is_object)
+ *
+ * result.from_slice = memviewslice # <<<<<<<<<<<<<<
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ */
+ __pyx_v_result->from_slice = __pyx_v_memviewslice;
+
+ /* "View.MemoryView":1011
+ *
+ * result.from_slice = memviewslice
+ * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ */
+ __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
+
+ /* "View.MemoryView":1013
+ * __PYX_INC_MEMVIEW(&memviewslice, 1)
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1013, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_2);
+ __Pyx_GOTREF(__pyx_v_result->from_object);
+ __Pyx_DECREF(__pyx_v_result->from_object);
+ __pyx_v_result->from_object = __pyx_t_2;
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":1014
+ *
+ * result.from_object = (<memoryview> memviewslice.memview).base
+ * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
+ *
+ * result.view = memviewslice.memview.view
+ */
+ __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
+ __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
+
+ /* "View.MemoryView":1016
+ * result.typeinfo = memviewslice.memview.typeinfo
+ *
+ * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ */
+ __pyx_t_5 = __pyx_v_memviewslice.memview->view;
+ __pyx_v_result->__pyx_base.view = __pyx_t_5;
+
+ /* "View.MemoryView":1017
+ *
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ */
+ __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
+
+ /* "View.MemoryView":1018
+ * result.view = memviewslice.memview.view
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim # <<<<<<<<<<<<<<
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None)
+ */
+ __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
+
+ /* "View.MemoryView":1019
+ * result.view.buf = <void *> memviewslice.data
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
+ * Py_INCREF(Py_None)
+ *
+ */
+ ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
+
+ /* "View.MemoryView":1020
+ * result.view.ndim = ndim
+ * (<__pyx_buffer *> &result.view).obj = Py_None
+ * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
+ */
+ Py_INCREF(Py_None);
+
+ /* "View.MemoryView":1022
+ * Py_INCREF(Py_None)
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
+ * result.flags = PyBUF_RECORDS
+ * else:
+ */
+ __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1023
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
+ * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
+ * else:
+ * result.flags = PyBUF_RECORDS_RO
+ */
+ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
+
+ /* "View.MemoryView":1022
+ * Py_INCREF(Py_None)
+ *
+ * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
+ * result.flags = PyBUF_RECORDS
+ * else:
+ */
+ goto __pyx_L4;
+ }
+
+ /* "View.MemoryView":1025
+ * result.flags = PyBUF_RECORDS
+ * else:
+ * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ */
+ /*else*/ {
+ __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":1027
+ * result.flags = PyBUF_RECORDS_RO
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides
+ *
+ */
+ __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
+
+ /* "View.MemoryView":1028
+ *
+ * result.view.shape = <Py_ssize_t *> result.from_slice.shape
+ * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
+
+ /* "View.MemoryView":1031
+ *
+ *
+ * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = NULL;
+
+ /* "View.MemoryView":1032
+ *
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ */
+ __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_v_suboffset = (__pyx_t_6[0]);
+
+ /* "View.MemoryView":1033
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1034
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
+
+ /* "View.MemoryView":1035
+ * if suboffset >= 0:
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break # <<<<<<<<<<<<<<
+ *
+ * result.view.len = result.view.itemsize
+ */
+ goto __pyx_L6_break;
+
+ /* "View.MemoryView":1033
+ * result.view.suboffsets = NULL
+ * for suboffset in result.from_slice.suboffsets[:ndim]:
+ * if suboffset >= 0: # <<<<<<<<<<<<<<
+ * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
+ * break
+ */
+ }
+ }
+ __pyx_L6_break:;
+
+ /* "View.MemoryView":1037
+ * break
+ *
+ * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length
+ */
+ __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
+
+ /* "View.MemoryView":1038
+ *
+ * result.view.len = result.view.itemsize
+ * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
+ * result.view.len *= length
+ *
+ */
+ __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
+ for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
+ __pyx_t_6 = __pyx_t_8;
+ __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1038, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
+ __pyx_t_2 = 0;
+
+ /* "View.MemoryView":1039
+ * result.view.len = result.view.itemsize
+ * for length in result.view.shape[:ndim]:
+ * result.view.len *= length # <<<<<<<<<<<<<<
+ *
+ * result.to_object_func = to_object_func
+ */
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1039, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1039, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(2, 1039, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
+ }
+
+ /* "View.MemoryView":1041
+ * result.view.len *= length
+ *
+ * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
+ * result.to_dtype_func = to_dtype_func
+ *
+ */
+ __pyx_v_result->to_object_func = __pyx_v_to_object_func;
+
+ /* "View.MemoryView":1042
+ *
+ * result.to_object_func = to_object_func
+ * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
+
+ /* "View.MemoryView":1044
+ * result.to_dtype_func = to_dtype_func
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(((PyObject *)__pyx_v_result));
+ __pyx_r = ((PyObject *)__pyx_v_result);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":994
+ *
+ * @cname('__pyx_memoryview_fromslice')
+ * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * object (*to_object_func)(char *),
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_result);
+ __Pyx_XDECREF(__pyx_v_length);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1047
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
+ struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
+ __Pyx_memviewslice *__pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *__pyx_t_3 = NULL;
+ __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
+
+ /* "View.MemoryView":1050
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1051
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview # <<<<<<<<<<<<<<
+ * return &obj.from_slice
+ * else:
+ */
+ if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(2, 1051, __pyx_L1_error)
+ __pyx_t_3 = ((PyObject *)__pyx_v_memview);
+ __Pyx_INCREF(__pyx_t_3);
+ __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1052
+ * if isinstance(memview, _memoryviewslice):
+ * obj = memview
+ * return &obj.from_slice # <<<<<<<<<<<<<<
+ * else:
+ * slice_copy(memview, mslice)
+ */
+ __pyx_r = (&__pyx_v_obj->from_slice);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1050
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * obj = memview
+ * return &obj.from_slice
+ */
+ }
+
+ /* "View.MemoryView":1054
+ * return &obj.from_slice
+ * else:
+ * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
+ * return mslice
+ *
+ */
+ /*else*/ {
+ __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
+
+ /* "View.MemoryView":1055
+ * else:
+ * slice_copy(memview, mslice)
+ * return mslice # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ */
+ __pyx_r = __pyx_v_mslice;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1047
+ *
+ * @cname('__pyx_memoryview_get_slice_from_memoryview')
+ * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *mslice):
+ * cdef _memoryviewslice obj
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XDECREF((PyObject *)__pyx_v_obj);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1058
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
+ int __pyx_v_dim;
+ Py_ssize_t *__pyx_v_shape;
+ Py_ssize_t *__pyx_v_strides;
+ Py_ssize_t *__pyx_v_suboffsets;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t *__pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ __Pyx_RefNannySetupContext("slice_copy", 0);
+
+ /* "View.MemoryView":1062
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ *
+ * shape = memview.view.shape # <<<<<<<<<<<<<<
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets
+ */
+ __pyx_t_1 = __pyx_v_memview->view.shape;
+ __pyx_v_shape = __pyx_t_1;
+
+ /* "View.MemoryView":1063
+ *
+ * shape = memview.view.shape
+ * strides = memview.view.strides # <<<<<<<<<<<<<<
+ * suboffsets = memview.view.suboffsets
+ *
+ */
+ __pyx_t_1 = __pyx_v_memview->view.strides;
+ __pyx_v_strides = __pyx_t_1;
+
+ /* "View.MemoryView":1064
+ * shape = memview.view.shape
+ * strides = memview.view.strides
+ * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ */
+ __pyx_t_1 = __pyx_v_memview->view.suboffsets;
+ __pyx_v_suboffsets = __pyx_t_1;
+
+ /* "View.MemoryView":1066
+ * suboffsets = memview.view.suboffsets
+ *
+ * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
+ * dst.data = <char *> memview.view.buf
+ *
+ */
+ __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
+
+ /* "View.MemoryView":1067
+ *
+ * dst.memview = <__pyx_memoryview *> memview
+ * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
+ *
+ * for dim in range(memview.view.ndim):
+ */
+ __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
+
+ /* "View.MemoryView":1069
+ * dst.data = <char *> memview.view.buf
+ *
+ * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ */
+ __pyx_t_2 = __pyx_v_memview->view.ndim;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_dim = __pyx_t_4;
+
+ /* "View.MemoryView":1070
+ *
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
+ * dst.strides[dim] = strides[dim]
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ */
+ (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
+
+ /* "View.MemoryView":1071
+ * for dim in range(memview.view.ndim):
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
+ *
+ */
+ (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
+
+ /* "View.MemoryView":1072
+ * dst.shape[dim] = shape[dim]
+ * dst.strides[dim] = strides[dim]
+ * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ */
+ if ((__pyx_v_suboffsets != 0)) {
+ __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
+ } else {
+ __pyx_t_5 = -1L;
+ }
+ (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
+ }
+
+ /* "View.MemoryView":1058
+ *
+ * @cname('__pyx_memoryview_slice_copy')
+ * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
+ * cdef int dim
+ * cdef (Py_ssize_t*) shape, strides, suboffsets
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1075
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
+ __Pyx_memviewslice __pyx_v_memviewslice;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ __Pyx_RefNannySetupContext("memoryview_copy", 0);
+
+ /* "View.MemoryView":1078
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
+ * return memoryview_copy_from_slice(memview, &memviewslice)
+ *
+ */
+ __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
+
+ /* "View.MemoryView":1079
+ * cdef __Pyx_memviewslice memviewslice
+ * slice_copy(memview, &memviewslice)
+ * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1079, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_r = __pyx_t_1;
+ __pyx_t_1 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1075
+ *
+ * @cname('__pyx_memoryview_copy_object')
+ * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
+ * "Create a new memoryview object"
+ * cdef __Pyx_memviewslice memviewslice
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1082
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
+ PyObject *(*__pyx_v_to_object_func)(char *);
+ int (*__pyx_v_to_dtype_func)(char *, PyObject *);
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ int __pyx_t_2;
+ PyObject *(*__pyx_t_3)(char *);
+ int (*__pyx_t_4)(char *, PyObject *);
+ PyObject *__pyx_t_5 = NULL;
+ __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
+
+ /* "View.MemoryView":1089
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ */
+ __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
+ __pyx_t_2 = (__pyx_t_1 != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1090
+ *
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ */
+ __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
+ __pyx_v_to_object_func = __pyx_t_3;
+
+ /* "View.MemoryView":1091
+ * if isinstance(memview, _memoryviewslice):
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
+ * else:
+ * to_object_func = NULL
+ */
+ __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
+ __pyx_v_to_dtype_func = __pyx_t_4;
+
+ /* "View.MemoryView":1089
+ * cdef int (*to_dtype_func)(char *, object) except 0
+ *
+ * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
+ * to_object_func = (<_memoryviewslice> memview).to_object_func
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1093
+ * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
+ * else:
+ * to_object_func = NULL # <<<<<<<<<<<<<<
+ * to_dtype_func = NULL
+ *
+ */
+ /*else*/ {
+ __pyx_v_to_object_func = NULL;
+
+ /* "View.MemoryView":1094
+ * else:
+ * to_object_func = NULL
+ * to_dtype_func = NULL # <<<<<<<<<<<<<<
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ */
+ __pyx_v_to_dtype_func = NULL;
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1096
+ * to_dtype_func = NULL
+ *
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object)
+ */
+ __Pyx_XDECREF(__pyx_r);
+
+ /* "View.MemoryView":1098
+ * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
+ * to_object_func, to_dtype_func,
+ * memview.dtype_is_object) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __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(2, 1096, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __pyx_r = __pyx_t_5;
+ __pyx_t_5 = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1082
+ *
+ * @cname('__pyx_memoryview_copy_object_from_slice')
+ * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
+ * """
+ * Create a new memoryview object from a given memoryview object and slice.
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1104
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1105
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1106
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0:
+ * return -arg # <<<<<<<<<<<<<<
+ * else:
+ * return arg
+ */
+ __pyx_r = (-__pyx_v_arg);
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1105
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
+ * if arg < 0: # <<<<<<<<<<<<<<
+ * return -arg
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":1108
+ * return -arg
+ * else:
+ * return arg # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_get_best_slice_order')
+ */
+ /*else*/ {
+ __pyx_r = __pyx_v_arg;
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1104
+ *
+ *
+ * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
+ * if arg < 0:
+ * return -arg
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1111
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_c_stride;
+ Py_ssize_t __pyx_v_f_stride;
+ char __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "View.MemoryView":1116
+ * """
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t f_stride = 0
+ *
+ */
+ __pyx_v_c_stride = 0;
+
+ /* "View.MemoryView":1117
+ * cdef int i
+ * cdef Py_ssize_t c_stride = 0
+ * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_f_stride = 0;
+
+ /* "View.MemoryView":1119
+ * cdef Py_ssize_t f_stride = 0
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1120
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1121
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1122
+ * if mslice.shape[i] > 1:
+ * c_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ goto __pyx_L4_break;
+
+ /* "View.MemoryView":1120
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * c_stride = mslice.strides[i]
+ * break
+ */
+ }
+ }
+ __pyx_L4_break:;
+
+ /* "View.MemoryView":1124
+ * break
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ */
+ __pyx_t_1 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_1;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1125
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
+ __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1126
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
+ * break
+ *
+ */
+ __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1127
+ * if mslice.shape[i] > 1:
+ * f_stride = mslice.strides[i]
+ * break # <<<<<<<<<<<<<<
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ */
+ goto __pyx_L7_break;
+
+ /* "View.MemoryView":1125
+ *
+ * for i in range(ndim):
+ * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
+ * f_stride = mslice.strides[i]
+ * break
+ */
+ }
+ }
+ __pyx_L7_break:;
+
+ /* "View.MemoryView":1129
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
+ __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1130
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
+ * return 'C' # <<<<<<<<<<<<<<
+ * else:
+ * return 'F'
+ */
+ __pyx_r = 'C';
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1129
+ * break
+ *
+ * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
+ * return 'C'
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":1132
+ * return 'C'
+ * else:
+ * return 'F' # <<<<<<<<<<<<<<
+ *
+ * @cython.cdivision(True)
+ */
+ /*else*/ {
+ __pyx_r = 'F';
+ goto __pyx_L0;
+ }
+
+ /* "View.MemoryView":1111
+ *
+ * @cname('__pyx_get_best_slice_order')
+ * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
+ * """
+ * Figure out the best memory access order for a given slice.
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1135
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+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) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
+ Py_ssize_t __pyx_v_dst_extent;
+ Py_ssize_t __pyx_v_src_stride;
+ Py_ssize_t __pyx_v_dst_stride;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+ Py_ssize_t __pyx_t_5;
+ Py_ssize_t __pyx_t_6;
+
+ /* "View.MemoryView":1142
+ *
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ */
+ __pyx_v_src_extent = (__pyx_v_src_shape[0]);
+
+ /* "View.MemoryView":1143
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ */
+ __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
+
+ /* "View.MemoryView":1144
+ * cdef Py_ssize_t src_extent = src_shape[0]
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ */
+ __pyx_v_src_stride = (__pyx_v_src_strides[0]);
+
+ /* "View.MemoryView":1145
+ * cdef Py_ssize_t dst_extent = dst_shape[0]
+ * cdef Py_ssize_t src_stride = src_strides[0]
+ * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
+
+ /* "View.MemoryView":1147
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1148
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+ __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
+ if (__pyx_t_2) {
+ } else {
+ __pyx_t_1 = __pyx_t_2;
+ goto __pyx_L5_bool_binop_done;
+ }
+
+ /* "View.MemoryView":1149
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ */
+ __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
+ if (__pyx_t_2) {
+ __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
+ }
+ __pyx_t_3 = (__pyx_t_2 != 0);
+ __pyx_t_1 = __pyx_t_3;
+ __pyx_L5_bool_binop_done:;
+
+ /* "View.MemoryView":1148
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1150
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
+
+ /* "View.MemoryView":1148
+ *
+ * if ndim == 1:
+ * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ */
+ goto __pyx_L4;
+ }
+
+ /* "View.MemoryView":1152
+ * memcpy(dst_data, src_data, itemsize * dst_extent)
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ */
+ /*else*/ {
+ __pyx_t_4 = __pyx_v_dst_extent;
+ __pyx_t_5 = __pyx_t_4;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1153
+ * else:
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
+ * src_data += src_stride
+ * dst_data += dst_stride
+ */
+ (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
+
+ /* "View.MemoryView":1154
+ * for i in range(dst_extent):
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ * else:
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1155
+ * memcpy(dst_data, src_data, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(dst_extent):
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L4:;
+
+ /* "View.MemoryView":1147
+ * cdef Py_ssize_t dst_stride = dst_strides[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if (src_stride > 0 and dst_stride > 0 and
+ * <size_t> src_stride == itemsize == <size_t> dst_stride):
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1157
+ * dst_data += dst_stride
+ * else:
+ * for i in range(dst_extent): # <<<<<<<<<<<<<<
+ * _copy_strided_to_strided(src_data, src_strides + 1,
+ * dst_data, dst_strides + 1,
+ */
+ /*else*/ {
+ __pyx_t_4 = __pyx_v_dst_extent;
+ __pyx_t_5 = __pyx_t_4;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1158
+ * else:
+ * for i in range(dst_extent):
+ * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
+ * dst_data, dst_strides + 1,
+ * src_shape + 1, dst_shape + 1,
+ */
+ _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);
+
+ /* "View.MemoryView":1162
+ * src_shape + 1, dst_shape + 1,
+ * ndim - 1, itemsize)
+ * src_data += src_stride # <<<<<<<<<<<<<<
+ * dst_data += dst_stride
+ *
+ */
+ __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
+
+ /* "View.MemoryView":1163
+ * ndim - 1, itemsize)
+ * src_data += src_stride
+ * dst_data += dst_stride # <<<<<<<<<<<<<<
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
+ */
+ __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1135
+ *
+ * @cython.cdivision(True)
+ * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
+ * char *dst_data, Py_ssize_t *dst_strides,
+ * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1165
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+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) {
+
+ /* "View.MemoryView":1168
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
+ * src.shape, dst.shape, ndim, itemsize)
+ *
+ */
+ _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);
+
+ /* "View.MemoryView":1165
+ * dst_data += dst_stride
+ *
+ * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *dst,
+ * int ndim, size_t itemsize) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1172
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
+ int __pyx_v_i;
+ Py_ssize_t __pyx_v_size;
+ Py_ssize_t __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "View.MemoryView":1175
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_size = __pyx_t_1;
+
+ /* "View.MemoryView":1177
+ * cdef Py_ssize_t size = src.memview.view.itemsize
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * size *= src.shape[i]
+ *
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1178
+ *
+ * for i in range(ndim):
+ * size *= src.shape[i] # <<<<<<<<<<<<<<
+ *
+ * return size
+ */
+ __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
+ }
+
+ /* "View.MemoryView":1180
+ * size *= src.shape[i]
+ *
+ * return size # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ */
+ __pyx_r = __pyx_v_size;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1172
+ *
+ * @cname('__pyx_memoryview_slice_get_size')
+ * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
+ * "Return the size of the memory occupied by the slice in number of bytes"
+ * cdef int i
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1183
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+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) {
+ int __pyx_v_idx;
+ Py_ssize_t __pyx_r;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+
+ /* "View.MemoryView":1192
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
+ __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1193
+ *
+ * if order == 'F':
+ * for idx in range(ndim): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ __pyx_t_2 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_idx = __pyx_t_4;
+
+ /* "View.MemoryView":1194
+ * if order == 'F':
+ * for idx in range(ndim):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ * else:
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1195
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+
+ /* "View.MemoryView":1192
+ * cdef int idx
+ *
+ * if order == 'F': # <<<<<<<<<<<<<<
+ * for idx in range(ndim):
+ * strides[idx] = stride
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1197
+ * stride = stride * shape[idx]
+ * else:
+ * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * strides[idx] = stride
+ * stride = stride * shape[idx]
+ */
+ /*else*/ {
+ for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
+ __pyx_v_idx = __pyx_t_2;
+
+ /* "View.MemoryView":1198
+ * else:
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride # <<<<<<<<<<<<<<
+ * stride = stride * shape[idx]
+ *
+ */
+ (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
+
+ /* "View.MemoryView":1199
+ * for idx in range(ndim - 1, -1, -1):
+ * strides[idx] = stride
+ * stride = stride * shape[idx] # <<<<<<<<<<<<<<
+ *
+ * return stride
+ */
+ __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1201
+ * stride = stride * shape[idx]
+ *
+ * return stride # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ */
+ __pyx_r = __pyx_v_stride;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1183
+ *
+ * @cname('__pyx_fill_contig_strides_array')
+ * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
+ * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
+ * int ndim, char order) nogil:
+ */
+
+ /* function exit code */
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1204
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+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) {
+ int __pyx_v_i;
+ void *__pyx_v_result;
+ size_t __pyx_v_itemsize;
+ size_t __pyx_v_size;
+ void *__pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ struct __pyx_memoryview_obj *__pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+
+ /* "View.MemoryView":1215
+ * cdef void *result
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ */
+ __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1216
+ *
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
+ *
+ * result = malloc(size)
+ */
+ __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
+
+ /* "View.MemoryView":1218
+ * cdef size_t size = slice_get_size(src, ndim)
+ *
+ * result = malloc(size) # <<<<<<<<<<<<<<
+ * if not result:
+ * _err(MemoryError, NULL)
+ */
+ __pyx_v_result = malloc(__pyx_v_size);
+
+ /* "View.MemoryView":1219
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1220
+ * result = malloc(size)
+ * if not result:
+ * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(2, 1220, __pyx_L1_error)
+
+ /* "View.MemoryView":1219
+ *
+ * result = malloc(size)
+ * if not result: # <<<<<<<<<<<<<<
+ * _err(MemoryError, NULL)
+ *
+ */
+ }
+
+ /* "View.MemoryView":1223
+ *
+ *
+ * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ */
+ __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
+
+ /* "View.MemoryView":1224
+ *
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ */
+ __pyx_t_4 = __pyx_v_src->memview;
+ __pyx_v_tmpslice->memview = __pyx_t_4;
+
+ /* "View.MemoryView":1225
+ * tmpslice.data = <char *> result
+ * tmpslice.memview = src.memview
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ __pyx_t_5 = __pyx_t_3;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1226
+ * tmpslice.memview = src.memview
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
+ * tmpslice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1227
+ * for i in range(ndim):
+ * tmpslice.shape[i] = src.shape[i]
+ * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
+ */
+ (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
+ }
+
+ /* "View.MemoryView":1229
+ * tmpslice.suboffsets[i] = -1
+ *
+ * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
+ * ndim, order)
+ *
+ */
+ (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));
+
+ /* "View.MemoryView":1233
+ *
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0
+ */
+ __pyx_t_3 = __pyx_v_ndim;
+ __pyx_t_5 = __pyx_t_3;
+ for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
+ __pyx_v_i = __pyx_t_6;
+
+ /* "View.MemoryView":1234
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1235
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1:
+ * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
+ *
+ * if slice_is_contig(src[0], order, ndim):
+ */
+ (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1234
+ *
+ * for i in range(ndim):
+ * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
+ * tmpslice.strides[i] = 0
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":1237
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1238
+ *
+ * if slice_is_contig(src[0], order, ndim):
+ * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ */
+ (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
+
+ /* "View.MemoryView":1237
+ * tmpslice.strides[i] = 0
+ *
+ * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
+ * memcpy(result, src.data, size)
+ * else:
+ */
+ goto __pyx_L9;
+ }
+
+ /* "View.MemoryView":1240
+ * memcpy(result, src.data, size)
+ * else:
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
+ *
+ * return result
+ */
+ /*else*/ {
+ copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
+ }
+ __pyx_L9:;
+
+ /* "View.MemoryView":1242
+ * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
+ *
+ * return result # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_r = __pyx_v_result;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1204
+ *
+ * @cname('__pyx_memoryview_copy_data_to_temp')
+ * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice *tmpslice,
+ * char order,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = NULL;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1247
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_extents", 0);
+
+ /* "View.MemoryView":1250
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ * (i, extent1, extent2)) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ */
+ __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1250, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_1);
+ PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_2);
+ PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
+ __pyx_t_1 = 0;
+ __pyx_t_2 = 0;
+ __pyx_t_3 = 0;
+
+ /* "View.MemoryView":1249
+ * cdef int _err_extents(int i, Py_ssize_t extent1,
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
+ * (i, extent1, extent2))
+ *
+ */
+ __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1249, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_4, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __PYX_ERR(2, 1249, __pyx_L1_error)
+
+ /* "View.MemoryView":1247
+ *
+ * @cname('__pyx_memoryview_err_extents')
+ * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
+ * Py_ssize_t extent2) except -1 with gil:
+ * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1253
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err_dim", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1254
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
+ * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_err')
+ */
+ __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(2, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
+ __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
+ if (likely(__pyx_t_2)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
+ __Pyx_INCREF(__pyx_t_2);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_3, function);
+ }
+ }
+ if (!__pyx_t_2) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(2, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_5);
+ __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 1254, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_Raise(__pyx_t_1, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ __PYX_ERR(2, 1254, __pyx_L1_error)
+
+ /* "View.MemoryView":1253
+ *
+ * @cname('__pyx_memoryview_err_dim')
+ * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii') % dim)
+ *
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1257
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
+ int __pyx_r;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("_err", 0);
+ __Pyx_INCREF(__pyx_v_error);
+
+ /* "View.MemoryView":1258
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
+ __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
+ if (unlikely(__pyx_t_1)) {
+
+ /* "View.MemoryView":1259
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL:
+ * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
+ * else:
+ * raise error
+ */
+ __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(2, 1259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_INCREF(__pyx_v_error);
+ __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_4, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
+ __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 1259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_3);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
+ __pyx_t_3 = 0;
+ __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 1259, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_Raise(__pyx_t_2, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __PYX_ERR(2, 1259, __pyx_L1_error)
+
+ /* "View.MemoryView":1258
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil:
+ * if msg != NULL: # <<<<<<<<<<<<<<
+ * raise error(msg.decode('ascii'))
+ * else:
+ */
+ }
+
+ /* "View.MemoryView":1261
+ * raise error(msg.decode('ascii'))
+ * else:
+ * raise error # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ */
+ /*else*/ {
+ __Pyx_Raise(__pyx_v_error, 0, 0, 0);
+ __PYX_ERR(2, 1261, __pyx_L1_error)
+ }
+
+ /* "View.MemoryView":1257
+ *
+ * @cname('__pyx_memoryview_err')
+ * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
+ * if msg != NULL:
+ * raise error(msg.decode('ascii'))
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = -1;
+ __Pyx_XDECREF(__pyx_v_error);
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1264
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+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) {
+ void *__pyx_v_tmpdata;
+ size_t __pyx_v_itemsize;
+ int __pyx_v_i;
+ char __pyx_v_order;
+ int __pyx_v_broadcasting;
+ int __pyx_v_direct_copy;
+ __Pyx_memviewslice __pyx_v_tmp;
+ int __pyx_v_ndim;
+ int __pyx_r;
+ Py_ssize_t __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ int __pyx_t_6;
+ void *__pyx_t_7;
+ int __pyx_t_8;
+
+ /* "View.MemoryView":1272
+ * Check for overlapping memory and verify the shapes.
+ * """
+ * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ */
+ __pyx_v_tmpdata = NULL;
+
+ /* "View.MemoryView":1273
+ * """
+ * cdef void *tmpdata = NULL
+ * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ */
+ __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
+ __pyx_v_itemsize = __pyx_t_1;
+
+ /* "View.MemoryView":1275
+ * cdef size_t itemsize = src.memview.view.itemsize
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
+
+ /* "View.MemoryView":1276
+ * cdef int i
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False # <<<<<<<<<<<<<<
+ * cdef bint direct_copy = False
+ * cdef __Pyx_memviewslice tmp
+ */
+ __pyx_v_broadcasting = 0;
+
+ /* "View.MemoryView":1277
+ * cdef char order = get_best_order(&src, src_ndim)
+ * cdef bint broadcasting = False
+ * cdef bint direct_copy = False # <<<<<<<<<<<<<<
+ * cdef __Pyx_memviewslice tmp
+ *
+ */
+ __pyx_v_direct_copy = 0;
+
+ /* "View.MemoryView":1280
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
+ __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1281
+ *
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
+
+ /* "View.MemoryView":1280
+ * cdef __Pyx_memviewslice tmp
+ *
+ * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1282
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ */
+ __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1283
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim:
+ * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ */
+ __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
+
+ /* "View.MemoryView":1282
+ * if src_ndim < dst_ndim:
+ * broadcast_leading(&src, src_ndim, dst_ndim)
+ * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ */
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1285
+ * broadcast_leading(&dst, dst_ndim, src_ndim)
+ *
+ * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim):
+ */
+ __pyx_t_3 = __pyx_v_dst_ndim;
+ __pyx_t_4 = __pyx_v_src_ndim;
+ if (((__pyx_t_3 > __pyx_t_4) != 0)) {
+ __pyx_t_5 = __pyx_t_3;
+ } else {
+ __pyx_t_5 = __pyx_t_4;
+ }
+ __pyx_v_ndim = __pyx_t_5;
+
+ /* "View.MemoryView":1287
+ * cdef int ndim = max(src_ndim, dst_ndim)
+ *
+ * for i in range(ndim): # <<<<<<<<<<<<<<
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ */
+ __pyx_t_5 = __pyx_v_ndim;
+ __pyx_t_3 = __pyx_t_5;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1288
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1289
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
+ __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1290
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1:
+ * broadcasting = True # <<<<<<<<<<<<<<
+ * src.strides[i] = 0
+ * else:
+ */
+ __pyx_v_broadcasting = 1;
+
+ /* "View.MemoryView":1291
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ * src.strides[i] = 0 # <<<<<<<<<<<<<<
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ */
+ (__pyx_v_src.strides[__pyx_v_i]) = 0;
+
+ /* "View.MemoryView":1289
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]:
+ * if src.shape[i] == 1: # <<<<<<<<<<<<<<
+ * broadcasting = True
+ * src.strides[i] = 0
+ */
+ goto __pyx_L7;
+ }
+
+ /* "View.MemoryView":1293
+ * src.strides[i] = 0
+ * else:
+ * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
+ *
+ * if src.suboffsets[i] >= 0:
+ */
+ /*else*/ {
+ __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(2, 1293, __pyx_L1_error)
+ }
+ __pyx_L7:;
+
+ /* "View.MemoryView":1288
+ *
+ * for i in range(ndim):
+ * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
+ * if src.shape[i] == 1:
+ * broadcasting = True
+ */
+ }
+
+ /* "View.MemoryView":1295
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
+ __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1296
+ *
+ * if src.suboffsets[i] >= 0:
+ * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ */
+ __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(2, 1296, __pyx_L1_error)
+
+ /* "View.MemoryView":1295
+ * _err_extents(i, dst.shape[i], src.shape[i])
+ *
+ * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ */
+ }
+ }
+
+ /* "View.MemoryView":1298
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
+ *
+ * if not slice_is_contig(src, order, ndim):
+ */
+ __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1300
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1301
+ *
+ * if not slice_is_contig(src, order, ndim):
+ * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ */
+ __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
+
+ /* "View.MemoryView":1300
+ * if slices_overlap(&src, &dst, ndim, itemsize):
+ *
+ * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
+ * order = get_best_order(&dst, ndim)
+ *
+ */
+ }
+
+ /* "View.MemoryView":1303
+ * order = get_best_order(&dst, ndim)
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
+ * src = tmp
+ *
+ */
+ __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(2, 1303, __pyx_L1_error)
+ __pyx_v_tmpdata = __pyx_t_7;
+
+ /* "View.MemoryView":1304
+ *
+ * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
+ * src = tmp # <<<<<<<<<<<<<<
+ *
+ * if not broadcasting:
+ */
+ __pyx_v_src = __pyx_v_tmp;
+
+ /* "View.MemoryView":1298
+ * _err_dim(ValueError, "Dimension %d is not direct", i)
+ *
+ * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
+ *
+ * if not slice_is_contig(src, order, ndim):
+ */
+ }
+
+ /* "View.MemoryView":1306
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1309
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim):
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1310
+ *
+ * if slice_is_contig(src, 'C', ndim):
+ * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
+ * elif slice_is_contig(src, 'F', ndim):
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
+
+ /* "View.MemoryView":1309
+ *
+ *
+ * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim):
+ */
+ goto __pyx_L12;
+ }
+
+ /* "View.MemoryView":1311
+ * if slice_is_contig(src, 'C', ndim):
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ */
+ __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1312
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim):
+ * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
+ *
+ * if direct_copy:
+ */
+ __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
+
+ /* "View.MemoryView":1311
+ * if slice_is_contig(src, 'C', ndim):
+ * direct_copy = slice_is_contig(dst, 'C', ndim)
+ * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ */
+ }
+ __pyx_L12:;
+
+ /* "View.MemoryView":1314
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_2 = (__pyx_v_direct_copy != 0);
+ if (__pyx_t_2) {
+
+ /* "View.MemoryView":1316
+ * if direct_copy:
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1317
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ */
+ (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
+
+ /* "View.MemoryView":1318
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ * free(tmpdata)
+ * return 0
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1319
+ * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1320
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * if order == 'F' == get_best_order(&dst, ndim):
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1314
+ * direct_copy = slice_is_contig(dst, 'F', ndim)
+ *
+ * if direct_copy: # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ }
+
+ /* "View.MemoryView":1306
+ * src = tmp
+ *
+ * if not broadcasting: # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ }
+
+ /* "View.MemoryView":1322
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_2 = (__pyx_v_order == 'F');
+ if (__pyx_t_2) {
+ __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
+ }
+ __pyx_t_8 = (__pyx_t_2 != 0);
+ if (__pyx_t_8) {
+
+ /* "View.MemoryView":1325
+ *
+ *
+ * transpose_memslice(&src) # <<<<<<<<<<<<<<
+ * transpose_memslice(&dst)
+ *
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1325, __pyx_L1_error)
+
+ /* "View.MemoryView":1326
+ *
+ * transpose_memslice(&src)
+ * transpose_memslice(&dst) # <<<<<<<<<<<<<<
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ */
+ __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(2, 1326, __pyx_L1_error)
+
+ /* "View.MemoryView":1322
+ * return 0
+ *
+ * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ }
+
+ /* "View.MemoryView":1328
+ * transpose_memslice(&dst)
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1329
+ *
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ */
+ copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
+
+ /* "View.MemoryView":1330
+ * refcount_copying(&dst, dtype_is_object, ndim, False)
+ * copy_strided_to_strided(&src, &dst, ndim, itemsize)
+ * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ * free(tmpdata)
+ */
+ __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1332
+ * refcount_copying(&dst, dtype_is_object, ndim, True)
+ *
+ * free(tmpdata) # <<<<<<<<<<<<<<
+ * return 0
+ *
+ */
+ free(__pyx_v_tmpdata);
+
+ /* "View.MemoryView":1333
+ *
+ * free(tmpdata)
+ * return 0 # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ */
+ __pyx_r = 0;
+ goto __pyx_L0;
+
+ /* "View.MemoryView":1264
+ *
+ * @cname('__pyx_memoryview_copy_contents')
+ * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
+ * __Pyx_memviewslice dst,
+ * int src_ndim, int dst_ndim,
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ {
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+ }
+ __pyx_r = -1;
+ __pyx_L0:;
+ return __pyx_r;
+}
+
+/* "View.MemoryView":1336
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
+ int __pyx_v_i;
+ int __pyx_v_offset;
+ int __pyx_t_1;
+ int __pyx_t_2;
+ int __pyx_t_3;
+
+ /* "View.MemoryView":1340
+ * int ndim_other) nogil:
+ * cdef int i
+ * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
+ *
+ * for i in range(ndim - 1, -1, -1):
+ */
+ __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
+
+ /* "View.MemoryView":1342
+ * cdef int offset = ndim_other - ndim
+ *
+ * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ */
+ for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
+ __pyx_v_i = __pyx_t_1;
+
+ /* "View.MemoryView":1343
+ *
+ * for i in range(ndim - 1, -1, -1):
+ * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
+ */
+ (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
+
+ /* "View.MemoryView":1344
+ * for i in range(ndim - 1, -1, -1):
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
+ *
+ */
+ (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
+
+ /* "View.MemoryView":1345
+ * mslice.shape[i + offset] = mslice.shape[i]
+ * mslice.strides[i + offset] = mslice.strides[i]
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
+ *
+ * for i in range(offset):
+ */
+ (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
+ }
+
+ /* "View.MemoryView":1347
+ * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
+ *
+ * for i in range(offset): # <<<<<<<<<<<<<<
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ */
+ __pyx_t_1 = __pyx_v_offset;
+ __pyx_t_2 = __pyx_t_1;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1348
+ *
+ * for i in range(offset):
+ * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1
+ */
+ (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
+
+ /* "View.MemoryView":1349
+ * for i in range(offset):
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
+ * mslice.suboffsets[i] = -1
+ *
+ */
+ (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
+
+ /* "View.MemoryView":1350
+ * mslice.shape[i] = 1
+ * mslice.strides[i] = mslice.strides[0]
+ * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
+ }
+
+ /* "View.MemoryView":1336
+ *
+ * @cname('__pyx_memoryview_broadcast_leading')
+ * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
+ * int ndim,
+ * int ndim_other) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1358
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+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) {
+ int __pyx_t_1;
+
+ /* "View.MemoryView":1362
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
+ __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1363
+ *
+ * if dtype_is_object:
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
+ * dst.strides, ndim, inc)
+ *
+ */
+ __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);
+
+ /* "View.MemoryView":1362
+ *
+ *
+ * if dtype_is_object: # <<<<<<<<<<<<<<
+ * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
+ * dst.strides, ndim, inc)
+ */
+ }
+
+ /* "View.MemoryView":1358
+ *
+ * @cname('__pyx_memoryview_refcount_copying')
+ * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
+ * int ndim, bint inc) nogil:
+ *
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1367
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+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) {
+ __Pyx_RefNannyDeclarations
+ #ifdef WITH_THREAD
+ PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
+ #endif
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
+
+ /* "View.MemoryView":1370
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
+
+ /* "View.MemoryView":1367
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
+ * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * bint inc) with gil:
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ #ifdef WITH_THREAD
+ __Pyx_PyGILState_Release(__pyx_gilstate_save);
+ #endif
+}
+
+/* "View.MemoryView":1373
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+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) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ __Pyx_RefNannyDeclarations
+ Py_ssize_t __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
+
+ /* "View.MemoryView":1377
+ * cdef Py_ssize_t i
+ *
+ * for i in range(shape[0]): # <<<<<<<<<<<<<<
+ * if ndim == 1:
+ * if inc:
+ */
+ __pyx_t_1 = (__pyx_v_shape[0]);
+ __pyx_t_2 = __pyx_t_1;
+ for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
+ __pyx_v_i = __pyx_t_3;
+
+ /* "View.MemoryView":1378
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
+ __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":1379
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
+ __pyx_t_4 = (__pyx_v_inc != 0);
+ if (__pyx_t_4) {
+
+ /* "View.MemoryView":1380
+ * if ndim == 1:
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * Py_DECREF((<PyObject **> data)[0])
+ */
+ Py_INCREF((((PyObject **)__pyx_v_data)[0]));
+
+ /* "View.MemoryView":1379
+ * for i in range(shape[0]):
+ * if ndim == 1:
+ * if inc: # <<<<<<<<<<<<<<
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ */
+ goto __pyx_L6;
+ }
+
+ /* "View.MemoryView":1382
+ * Py_INCREF((<PyObject **> data)[0])
+ * else:
+ * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ */
+ /*else*/ {
+ Py_DECREF((((PyObject **)__pyx_v_data)[0]));
+ }
+ __pyx_L6:;
+
+ /* "View.MemoryView":1378
+ *
+ * for i in range(shape[0]):
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * if inc:
+ * Py_INCREF((<PyObject **> data)[0])
+ */
+ goto __pyx_L5;
+ }
+
+ /* "View.MemoryView":1384
+ * Py_DECREF((<PyObject **> data)[0])
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, inc)
+ *
+ */
+ /*else*/ {
+
+ /* "View.MemoryView":1385
+ * else:
+ * refcount_objects_in_slice(data, shape + 1, strides + 1,
+ * ndim - 1, inc) # <<<<<<<<<<<<<<
+ *
+ * data += strides[0]
+ */
+ __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
+ }
+ __pyx_L5:;
+
+ /* "View.MemoryView":1387
+ * ndim - 1, inc)
+ *
+ * data += strides[0] # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
+ }
+
+ /* "View.MemoryView":1373
+ *
+ * @cname('__pyx_memoryview_refcount_objects_in_slice')
+ * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim, bint inc):
+ * cdef Py_ssize_t i
+ */
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+}
+
+/* "View.MemoryView":1393
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+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) {
+
+ /* "View.MemoryView":1396
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
+
+ /* "View.MemoryView":1397
+ * bint dtype_is_object) nogil:
+ * refcount_copying(dst, dtype_is_object, ndim, False)
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True)
+ */
+ __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);
+
+ /* "View.MemoryView":1399
+ * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
+ * itemsize, item)
+ * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
+
+ /* "View.MemoryView":1393
+ *
+ * @cname('__pyx_memoryview_slice_assign_scalar')
+ * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
+ * size_t itemsize, void *item,
+ * bint dtype_is_object) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "View.MemoryView":1403
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+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) {
+ CYTHON_UNUSED Py_ssize_t __pyx_v_i;
+ Py_ssize_t __pyx_v_stride;
+ Py_ssize_t __pyx_v_extent;
+ int __pyx_t_1;
+ Py_ssize_t __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ Py_ssize_t __pyx_t_4;
+
+ /* "View.MemoryView":1407
+ * size_t itemsize, void *item) nogil:
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ */
+ __pyx_v_stride = (__pyx_v_strides[0]);
+
+ /* "View.MemoryView":1408
+ * cdef Py_ssize_t i
+ * cdef Py_ssize_t stride = strides[0]
+ * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
+ *
+ * if ndim == 1:
+ */
+ __pyx_v_extent = (__pyx_v_shape[0]);
+
+ /* "View.MemoryView":1410
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
+ __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
+ if (__pyx_t_1) {
+
+ /* "View.MemoryView":1411
+ *
+ * if ndim == 1:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * memcpy(data, item, itemsize)
+ * data += stride
+ */
+ __pyx_t_2 = __pyx_v_extent;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1412
+ * if ndim == 1:
+ * for i in range(extent):
+ * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
+ * data += stride
+ * else:
+ */
+ (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
+
+ /* "View.MemoryView":1413
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ * data += stride # <<<<<<<<<<<<<<
+ * else:
+ * for i in range(extent):
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+
+ /* "View.MemoryView":1410
+ * cdef Py_ssize_t extent = shape[0]
+ *
+ * if ndim == 1: # <<<<<<<<<<<<<<
+ * for i in range(extent):
+ * memcpy(data, item, itemsize)
+ */
+ goto __pyx_L3;
+ }
+
+ /* "View.MemoryView":1415
+ * data += stride
+ * else:
+ * for i in range(extent): # <<<<<<<<<<<<<<
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ */
+ /*else*/ {
+ __pyx_t_2 = __pyx_v_extent;
+ __pyx_t_3 = __pyx_t_2;
+ for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
+ __pyx_v_i = __pyx_t_4;
+
+ /* "View.MemoryView":1416
+ * else:
+ * for i in range(extent):
+ * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
+ * ndim - 1, itemsize, item)
+ * data += stride
+ */
+ __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);
+
+ /* "View.MemoryView":1418
+ * _slice_assign_scalar(data, shape + 1, strides + 1,
+ * ndim - 1, itemsize, item)
+ * data += stride # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
+ }
+ }
+ __pyx_L3:;
+
+ /* "View.MemoryView":1403
+ *
+ * @cname('__pyx_memoryview__slice_assign_scalar')
+ * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
+ * Py_ssize_t *strides, int ndim,
+ * size_t itemsize, void *item) nogil:
+ */
+
+ /* function exit code */
+}
+
+/* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+
+/* Python wrapper */
+static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
+static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
+static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
+ PyObject *__pyx_v___pyx_type = 0;
+ long __pyx_v___pyx_checksum;
+ PyObject *__pyx_v___pyx_state = 0;
+ PyObject *__pyx_r = 0;
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
+ {
+ static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
+ PyObject* values[3] = {0,0,0};
+ if (unlikely(__pyx_kwds)) {
+ Py_ssize_t kw_args;
+ const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
+ switch (pos_args) {
+ case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ CYTHON_FALLTHROUGH;
+ case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ CYTHON_FALLTHROUGH;
+ case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ CYTHON_FALLTHROUGH;
+ case 0: break;
+ default: goto __pyx_L5_argtuple_error;
+ }
+ kw_args = PyDict_Size(__pyx_kwds);
+ switch (pos_args) {
+ case 0:
+ if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
+ else goto __pyx_L5_argtuple_error;
+ CYTHON_FALLTHROUGH;
+ case 1:
+ if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(2, 1, __pyx_L3_error)
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
+ else {
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(2, 1, __pyx_L3_error)
+ }
+ }
+ if (unlikely(kw_args > 0)) {
+ if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(2, 1, __pyx_L3_error)
+ }
+ } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
+ goto __pyx_L5_argtuple_error;
+ } else {
+ values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
+ values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
+ values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
+ }
+ __pyx_v___pyx_type = values[0];
+ __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(2, 1, __pyx_L3_error)
+ __pyx_v___pyx_state = values[2];
+ }
+ goto __pyx_L4_argument_unpacking_done;
+ __pyx_L5_argtuple_error:;
+ __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(2, 1, __pyx_L3_error)
+ __pyx_L3_error:;
+ __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __Pyx_RefNannyFinishContext();
+ return NULL;
+ __pyx_L4_argument_unpacking_done:;
+ __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
+
+ /* function exit code */
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+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) {
+ PyObject *__pyx_v___pyx_PickleError = NULL;
+ PyObject *__pyx_v___pyx_result = NULL;
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ int __pyx_t_1;
+ PyObject *__pyx_t_2 = NULL;
+ PyObject *__pyx_t_3 = NULL;
+ PyObject *__pyx_t_4 = NULL;
+ PyObject *__pyx_t_5 = NULL;
+ PyObject *__pyx_t_6 = NULL;
+ int __pyx_t_7;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
+
+ /* "(tree fragment)":2
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
+ * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ */
+ __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
+ if (__pyx_t_1) {
+
+ /* "(tree fragment)":3
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type)
+ */
+ __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_n_s_PickleError);
+ __Pyx_GIVEREF(__pyx_n_s_PickleError);
+ PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
+ __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 3, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_2);
+ __pyx_v___pyx_PickleError = __pyx_t_2;
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "(tree fragment)":4
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ */
+ __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_INCREF(__pyx_v___pyx_PickleError);
+ __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
+ if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_5)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_5);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_5) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
+ __Pyx_GIVEREF(__pyx_t_4);
+ PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
+ __pyx_t_4 = 0;
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __Pyx_Raise(__pyx_t_3, 0, 0, 0);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+ __PYX_ERR(2, 4, __pyx_L1_error)
+
+ /* "(tree fragment)":2
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
+ * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ */
+ }
+
+ /* "(tree fragment)":5
+ * from pickle import PickleError as __pyx_PickleError
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
+ * if __pyx_state is not None:
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ */
+ __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_2);
+ __pyx_t_6 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
+ __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
+ if (likely(__pyx_t_6)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
+ __Pyx_INCREF(__pyx_t_6);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_2, function);
+ }
+ }
+ if (!__pyx_t_6) {
+ __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
+ __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
+ __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_3);
+ } else
+ #endif
+ {
+ __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_4);
+ __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
+ __Pyx_INCREF(__pyx_v___pyx_type);
+ __Pyx_GIVEREF(__pyx_v___pyx_type);
+ PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
+ __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 5, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
+ __pyx_v___pyx_result = __pyx_t_3;
+ __pyx_t_3 = 0;
+
+ /* "(tree fragment)":6
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
+ __pyx_t_7 = (__pyx_t_1 != 0);
+ if (__pyx_t_7) {
+
+ /* "(tree fragment)":7
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None:
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ */
+ 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(2, 7, __pyx_L1_error)
+ __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(2, 7, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_3);
+ __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
+
+ /* "(tree fragment)":6
+ * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
+ * __pyx_result = Enum.__new__(__pyx_type)
+ * if __pyx_state is not None: # <<<<<<<<<<<<<<
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ */
+ }
+
+ /* "(tree fragment)":8
+ * if __pyx_state is not None:
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result # <<<<<<<<<<<<<<
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]
+ */
+ __Pyx_XDECREF(__pyx_r);
+ __Pyx_INCREF(__pyx_v___pyx_result);
+ __pyx_r = __pyx_v___pyx_result;
+ goto __pyx_L0;
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+
+ /* function exit code */
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_2);
+ __Pyx_XDECREF(__pyx_t_3);
+ __Pyx_XDECREF(__pyx_t_4);
+ __Pyx_XDECREF(__pyx_t_5);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = NULL;
+ __pyx_L0:;
+ __Pyx_XDECREF(__pyx_v___pyx_PickleError);
+ __Pyx_XDECREF(__pyx_v___pyx_result);
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+
+/* "(tree fragment)":9
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ */
+
+static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
+ PyObject *__pyx_r = NULL;
+ __Pyx_RefNannyDeclarations
+ PyObject *__pyx_t_1 = NULL;
+ int __pyx_t_2;
+ Py_ssize_t __pyx_t_3;
+ int __pyx_t_4;
+ int __pyx_t_5;
+ PyObject *__pyx_t_6 = NULL;
+ PyObject *__pyx_t_7 = NULL;
+ PyObject *__pyx_t_8 = NULL;
+ PyObject *__pyx_t_9 = NULL;
+ __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
+
+ /* "(tree fragment)":10
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[1])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(2, 10, __pyx_L1_error)
+ }
+ __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(2, 10, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __Pyx_GOTREF(__pyx_v___pyx_result->name);
+ __Pyx_DECREF(__pyx_v___pyx_result->name);
+ __pyx_v___pyx_result->name = __pyx_t_1;
+ __pyx_t_1 = 0;
+
+ /* "(tree fragment)":11
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[1])
+ */
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
+ __PYX_ERR(2, 11, __pyx_L1_error)
+ }
+ __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(2, 11, __pyx_L1_error)
+ __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
+ if (__pyx_t_4) {
+ } else {
+ __pyx_t_2 = __pyx_t_4;
+ goto __pyx_L4_bool_binop_done;
+ }
+ __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(2, 11, __pyx_L1_error)
+ __pyx_t_5 = (__pyx_t_4 != 0);
+ __pyx_t_2 = __pyx_t_5;
+ __pyx_L4_bool_binop_done:;
+ if (__pyx_t_2) {
+
+ /* "(tree fragment)":12
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
+ */
+ __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(2, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(2, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_7);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ if (unlikely(__pyx_v___pyx_state == Py_None)) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
+ __PYX_ERR(2, 12, __pyx_L1_error)
+ }
+ __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(2, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_6);
+ __pyx_t_8 = NULL;
+ if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
+ __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
+ if (likely(__pyx_t_8)) {
+ PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
+ __Pyx_INCREF(__pyx_t_8);
+ __Pyx_INCREF(function);
+ __Pyx_DECREF_SET(__pyx_t_7, function);
+ }
+ }
+ if (!__pyx_t_8) {
+ __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ } else {
+ #if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ #if CYTHON_FAST_PYCCALL
+ if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
+ PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
+ __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
+ __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
+ } else
+ #endif
+ {
+ __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(2, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_9);
+ __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
+ __Pyx_GIVEREF(__pyx_t_6);
+ PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
+ __pyx_t_6 = 0;
+ __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 12, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
+ }
+ }
+ __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":11
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
+ * __pyx_result.__dict__.update(__pyx_state[1])
+ */
+ }
+
+ /* "(tree fragment)":9
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ */
+
+ /* function exit code */
+ __pyx_r = Py_None; __Pyx_INCREF(Py_None);
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ __Pyx_XDECREF(__pyx_t_6);
+ __Pyx_XDECREF(__pyx_t_7);
+ __Pyx_XDECREF(__pyx_t_8);
+ __Pyx_XDECREF(__pyx_t_9);
+ __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
+ __pyx_r = 0;
+ __pyx_L0:;
+ __Pyx_XGIVEREF(__pyx_r);
+ __Pyx_RefNannyFinishContext();
+ return __pyx_r;
+}
+static struct __pyx_vtabstruct_array __pyx_vtable_array;
+
+static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_array_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_array_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_array;
+ p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
+ if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
+ return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
+}
+
+static void __pyx_tp_dealloc_array(PyObject *o) {
+ struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ 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))) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_array___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->mode);
+ Py_CLEAR(p->_format);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_array___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
+ PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
+ if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ v = __pyx_array___getattr__(o, n);
+ }
+ return v;
+}
+
+static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_array[] = {
+ {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_array[] = {
+ {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_array = {
+ __pyx_array___len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_array, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_array = {
+ __pyx_array___len__, /*mp_length*/
+ __pyx_array___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_array = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_array_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_array = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaPhysics.xas._xas.array", /*tp_name*/
+ sizeof(struct __pyx_array_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_array, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ 0, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ __pyx_tp_getattro_array, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
+ 0, /*tp_doc*/
+ 0, /*tp_traverse*/
+ 0, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_array, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_array, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_array, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
+ struct __pyx_MemviewEnum_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_MemviewEnum_obj *)o);
+ p->name = Py_None; Py_INCREF(Py_None);
+ return o;
+}
+
+static void __pyx_tp_dealloc_Enum(PyObject *o) {
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ Py_CLEAR(p->name);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ if (p->name) {
+ e = (*v)(p->name, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_Enum(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
+ tmp = ((PyObject*)p->name);
+ p->name = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ return 0;
+}
+
+static PyMethodDef __pyx_methods_Enum[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_MemviewEnum = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaPhysics.xas._xas.Enum", /*tp_name*/
+ sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_Enum, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ __pyx_MemviewEnum___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ 0, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_Enum, /*tp_traverse*/
+ __pyx_tp_clear_Enum, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_Enum, /*tp_methods*/
+ 0, /*tp_members*/
+ 0, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ __pyx_MemviewEnum___init__, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_Enum, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
+
+static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryview_obj *p;
+ PyObject *o;
+ if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
+ o = (*t->tp_alloc)(t, 0);
+ } else {
+ o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
+ }
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryview_obj *)o);
+ p->__pyx_vtab = __pyx_vtabptr_memoryview;
+ p->obj = Py_None; Py_INCREF(Py_None);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ p->view.obj = NULL;
+ if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
+ return o;
+ bad:
+ Py_DECREF(o); o = 0;
+ return NULL;
+}
+
+static void __pyx_tp_dealloc_memoryview(PyObject *o) {
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryview___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->obj);
+ Py_CLEAR(p->_size);
+ Py_CLEAR(p->_array_interface);
+ (*Py_TYPE(o)->tp_free)(o);
+}
+
+static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ if (p->obj) {
+ e = (*v)(p->obj, a); if (e) return e;
+ }
+ if (p->_size) {
+ e = (*v)(p->_size, a); if (e) return e;
+ }
+ if (p->_array_interface) {
+ e = (*v)(p->_array_interface, a); if (e) return e;
+ }
+ if (p->view.obj) {
+ e = (*v)(p->view.obj, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear_memoryview(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
+ tmp = ((PyObject*)p->obj);
+ p->obj = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_size);
+ p->_size = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ tmp = ((PyObject*)p->_array_interface);
+ p->_array_interface = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ Py_CLEAR(p->view.obj);
+ return 0;
+}
+static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
+ PyObject *r;
+ PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
+ r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
+ Py_DECREF(x);
+ return r;
+}
+
+static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
+ if (v) {
+ return __pyx_memoryview___setitem__(o, i, v);
+ }
+ else {
+ PyErr_Format(PyExc_NotImplementedError,
+ "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
+ return -1;
+ }
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
+}
+
+static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods_memoryview[] = {
+ {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
+ {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
+ {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
+ {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets_memoryview[] = {
+ {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
+ {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
+ {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
+ {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
+ {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
+ {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
+ {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
+ {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
+ {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
+ __pyx_memoryview___len__, /*sq_length*/
+ 0, /*sq_concat*/
+ 0, /*sq_repeat*/
+ __pyx_sq_item_memoryview, /*sq_item*/
+ 0, /*sq_slice*/
+ 0, /*sq_ass_item*/
+ 0, /*sq_ass_slice*/
+ 0, /*sq_contains*/
+ 0, /*sq_inplace_concat*/
+ 0, /*sq_inplace_repeat*/
+};
+
+static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
+ __pyx_memoryview___len__, /*mp_length*/
+ __pyx_memoryview___getitem__, /*mp_subscript*/
+ __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
+};
+
+static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getreadbuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getwritebuffer*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getsegcount*/
+ #endif
+ #if PY_MAJOR_VERSION < 3
+ 0, /*bf_getcharbuffer*/
+ #endif
+ __pyx_memoryview_getbuffer, /*bf_getbuffer*/
+ 0, /*bf_releasebuffer*/
+};
+
+static PyTypeObject __pyx_type___pyx_memoryview = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaPhysics.xas._xas.memoryview", /*tp_name*/
+ sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ __pyx_memoryview___repr__, /*tp_repr*/
+ 0, /*tp_as_number*/
+ &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
+ &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ __pyx_memoryview___str__, /*tp_str*/
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ 0, /*tp_doc*/
+ __pyx_tp_traverse_memoryview, /*tp_traverse*/
+ __pyx_tp_clear_memoryview, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods_memoryview, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets_memoryview, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new_memoryview, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
+
+static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
+ struct __pyx_memoryviewslice_obj *p;
+ PyObject *o = __pyx_tp_new_memoryview(t, a, k);
+ if (unlikely(!o)) return 0;
+ p = ((struct __pyx_memoryviewslice_obj *)o);
+ p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ p->from_slice.memview = NULL;
+ return o;
+}
+
+static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ #if CYTHON_USE_TP_FINALIZE
+ if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
+ if (PyObject_CallFinalizerFromDealloc(o)) return;
+ }
+ #endif
+ PyObject_GC_UnTrack(o);
+ {
+ PyObject *etype, *eval, *etb;
+ PyErr_Fetch(&etype, &eval, &etb);
+ ++Py_REFCNT(o);
+ __pyx_memoryviewslice___dealloc__(o);
+ --Py_REFCNT(o);
+ PyErr_Restore(etype, eval, etb);
+ }
+ Py_CLEAR(p->from_object);
+ PyObject_GC_Track(o);
+ __pyx_tp_dealloc_memoryview(o);
+}
+
+static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
+ int e;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
+ if (p->from_object) {
+ e = (*v)(p->from_object, a); if (e) return e;
+ }
+ return 0;
+}
+
+static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
+ PyObject* tmp;
+ struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
+ __pyx_tp_clear_memoryview(o);
+ tmp = ((PyObject*)p->from_object);
+ p->from_object = Py_None; Py_INCREF(Py_None);
+ Py_XDECREF(tmp);
+ __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
+ return 0;
+}
+
+static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
+ return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
+}
+
+static PyMethodDef __pyx_methods__memoryviewslice[] = {
+ {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
+ {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
+ {0, 0, 0, 0}
+};
+
+static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
+ {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
+ {0, 0, 0, 0, 0}
+};
+
+static PyTypeObject __pyx_type___pyx_memoryviewslice = {
+ PyVarObject_HEAD_INIT(0, 0)
+ "PyMca5.PyMcaPhysics.xas._xas._memoryviewslice", /*tp_name*/
+ sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
+ 0, /*tp_itemsize*/
+ __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
+ 0, /*tp_print*/
+ 0, /*tp_getattr*/
+ 0, /*tp_setattr*/
+ #if PY_MAJOR_VERSION < 3
+ 0, /*tp_compare*/
+ #endif
+ #if PY_MAJOR_VERSION >= 3
+ 0, /*tp_as_async*/
+ #endif
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___repr__, /*tp_repr*/
+ #else
+ 0, /*tp_repr*/
+ #endif
+ 0, /*tp_as_number*/
+ 0, /*tp_as_sequence*/
+ 0, /*tp_as_mapping*/
+ 0, /*tp_hash*/
+ 0, /*tp_call*/
+ #if CYTHON_COMPILING_IN_PYPY
+ __pyx_memoryview___str__, /*tp_str*/
+ #else
+ 0, /*tp_str*/
+ #endif
+ 0, /*tp_getattro*/
+ 0, /*tp_setattro*/
+ 0, /*tp_as_buffer*/
+ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
+ "Internal class for passing memoryview slices to Python", /*tp_doc*/
+ __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
+ __pyx_tp_clear__memoryviewslice, /*tp_clear*/
+ 0, /*tp_richcompare*/
+ 0, /*tp_weaklistoffset*/
+ 0, /*tp_iter*/
+ 0, /*tp_iternext*/
+ __pyx_methods__memoryviewslice, /*tp_methods*/
+ 0, /*tp_members*/
+ __pyx_getsets__memoryviewslice, /*tp_getset*/
+ 0, /*tp_base*/
+ 0, /*tp_dict*/
+ 0, /*tp_descr_get*/
+ 0, /*tp_descr_set*/
+ 0, /*tp_dictoffset*/
+ 0, /*tp_init*/
+ 0, /*tp_alloc*/
+ __pyx_tp_new__memoryviewslice, /*tp_new*/
+ 0, /*tp_free*/
+ 0, /*tp_is_gc*/
+ 0, /*tp_bases*/
+ 0, /*tp_mro*/
+ 0, /*tp_cache*/
+ 0, /*tp_subclasses*/
+ 0, /*tp_weaklist*/
+ 0, /*tp_del*/
+ 0, /*tp_version_tag*/
+ #if PY_VERSION_HEX >= 0x030400a1
+ 0, /*tp_finalize*/
+ #endif
+};
+
+static PyMethodDef __pyx_methods[] = {
+ {0, 0, 0, 0}
+};
+
+#if PY_MAJOR_VERSION >= 3
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
+static int __pyx_pymod_exec__xas(PyObject* module); /*proto*/
+static PyModuleDef_Slot __pyx_moduledef_slots[] = {
+ {Py_mod_create, (void*)__pyx_pymod_create},
+ {Py_mod_exec, (void*)__pyx_pymod_exec__xas},
+ {0, NULL}
+};
+#endif
+
+static struct PyModuleDef __pyx_moduledef = {
+ PyModuleDef_HEAD_INIT,
+ "_xas",
+ 0, /* m_doc */
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ 0, /* m_size */
+ #else
+ -1, /* m_size */
+ #endif
+ __pyx_methods /* m_methods */,
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_moduledef_slots, /* m_slots */
+ #else
+ NULL, /* m_reload */
+ #endif
+ NULL, /* m_traverse */
+ NULL, /* m_clear */
+ NULL /* m_free */
+};
+#endif
+
+static __Pyx_StringTabEntry __pyx_string_tab[] = {
+ {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
+ {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
+ {&__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},
+ {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
+ {&__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},
+ {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
+ {&__pyx_n_s_PyMca5_PyMcaPhysics_xas__xas, __pyx_k_PyMca5_PyMcaPhysics_xas__xas, sizeof(__pyx_k_PyMca5_PyMcaPhysics_xas__xas), 0, 0, 1, 1},
+ {&__pyx_kp_s_PyMca5_PyMcaPhysics_xas__xas_cyt, __pyx_k_PyMca5_PyMcaPhysics_xas__xas_cyt, sizeof(__pyx_k_PyMca5_PyMcaPhysics_xas__xas_cyt), 0, 0, 1, 0},
+ {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
+ {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
+ {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
+ {&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
+ {&__pyx_n_s_abs, __pyx_k_abs, sizeof(__pyx_k_abs), 0, 0, 1, 1},
+ {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
+ {&__pyx_n_s_array, __pyx_k_array, sizeof(__pyx_k_array), 0, 0, 1, 1},
+ {&__pyx_n_s_ascontiguousarray, __pyx_k_ascontiguousarray, sizeof(__pyx_k_ascontiguousarray), 0, 0, 1, 1},
+ {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
+ {&__pyx_n_s_besselMultiple, __pyx_k_besselMultiple, sizeof(__pyx_k_besselMultiple), 0, 0, 1, 1},
+ {&__pyx_n_s_besselSingle, __pyx_k_besselSingle, sizeof(__pyx_k_besselSingle), 0, 0, 1, 1},
+ {&__pyx_n_s_buffer_xh0, __pyx_k_buffer_xh0, sizeof(__pyx_k_buffer_xh0), 0, 0, 1, 1},
+ {&__pyx_n_s_buffer_xl0, __pyx_k_buffer_xl0, sizeof(__pyx_k_buffer_xl0), 0, 0, 1, 1},
+ {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
+ {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
+ {&__pyx_n_s_c_c, __pyx_k_c_c, sizeof(__pyx_k_c_c), 0, 0, 1, 1},
+ {&__pyx_n_s_c_nc, __pyx_k_c_nc, sizeof(__pyx_k_c_nc), 0, 0, 1, 1},
+ {&__pyx_n_s_c_npts, __pyx_k_c_npts, sizeof(__pyx_k_c_npts), 0, 0, 1, 1},
+ {&__pyx_n_s_c_nr, __pyx_k_c_nr, sizeof(__pyx_k_c_nr), 0, 0, 1, 1},
+ {&__pyx_n_s_c_sizeC, __pyx_k_c_sizeC, sizeof(__pyx_k_c_sizeC), 0, 0, 1, 1},
+ {&__pyx_n_s_c_w, __pyx_k_c_w, sizeof(__pyx_k_c_w), 0, 0, 1, 1},
+ {&__pyx_n_s_c_x, __pyx_k_c_x, sizeof(__pyx_k_c_x), 0, 0, 1, 1},
+ {&__pyx_n_s_c_xh, __pyx_k_c_xh, sizeof(__pyx_k_c_xh), 0, 0, 1, 1},
+ {&__pyx_n_s_c_xl, __pyx_k_c_xl, sizeof(__pyx_k_c_xl), 0, 0, 1, 1},
+ {&__pyx_n_s_c_y, __pyx_k_c_y, sizeof(__pyx_k_c_y), 0, 0, 1, 1},
+ {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
+ {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
+ {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
+ {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
+ {&__pyx_n_s_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 0, 0, 1, 1},
+ {&__pyx_n_s_df, __pyx_k_df, sizeof(__pyx_k_df), 0, 0, 1, 1},
+ {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
+ {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
+ {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
+ {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
+ {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
+ {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
+ {&__pyx_n_s_float64, __pyx_k_float64, sizeof(__pyx_k_float64), 0, 0, 1, 1},
+ {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
+ {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
+ {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
+ {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
+ {&__pyx_n_s_i1, __pyx_k_i1, sizeof(__pyx_k_i1), 0, 0, 1, 1},
+ {&__pyx_n_s_ibl, __pyx_k_ibl, sizeof(__pyx_k_ibl), 0, 0, 1, 1},
+ {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
+ {&__pyx_n_s_ik, __pyx_k_ik, sizeof(__pyx_k_ik), 0, 0, 1, 1},
+ {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
+ {&__pyx_n_s_int32, __pyx_k_int32, sizeof(__pyx_k_int32), 0, 0, 1, 1},
+ {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
+ {&__pyx_n_s_j0, __pyx_k_j0, sizeof(__pyx_k_j0), 0, 0, 1, 1},
+ {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
+ {&__pyx_n_s_len, __pyx_k_len, sizeof(__pyx_k_len), 0, 0, 1, 1},
+ {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
+ {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
+ {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
+ {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
+ {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
+ {&__pyx_n_s_n1, __pyx_k_n1, sizeof(__pyx_k_n1), 0, 0, 1, 1},
+ {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
+ {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
+ {&__pyx_n_s_nbs, __pyx_k_nbs, sizeof(__pyx_k_nbs), 0, 0, 1, 1},
+ {&__pyx_n_s_nc, __pyx_k_nc, sizeof(__pyx_k_nc), 0, 0, 1, 1},
+ {&__pyx_n_s_ncol, __pyx_k_ncol, sizeof(__pyx_k_ncol), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
+ {&__pyx_n_s_ne_idl, __pyx_k_ne_idl, sizeof(__pyx_k_ne_idl), 0, 0, 1, 1},
+ {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
+ {&__pyx_n_s_ni, __pyx_k_ni, sizeof(__pyx_k_ni), 0, 0, 1, 1},
+ {&__pyx_n_s_ni1, __pyx_k_ni1, sizeof(__pyx_k_ni1), 0, 0, 1, 1},
+ {&__pyx_n_s_nk, __pyx_k_nk, sizeof(__pyx_k_nk), 0, 0, 1, 1},
+ {&__pyx_n_s_nm1, __pyx_k_nm1, sizeof(__pyx_k_nm1), 0, 0, 1, 1},
+ {&__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},
+ {&__pyx_n_s_npts, __pyx_k_npts, sizeof(__pyx_k_npts), 0, 0, 1, 1},
+ {&__pyx_n_s_nr, __pyx_k_nr, sizeof(__pyx_k_nr), 0, 0, 1, 1},
+ {&__pyx_n_s_ns, __pyx_k_ns, sizeof(__pyx_k_ns), 0, 0, 1, 1},
+ {&__pyx_n_s_ns1, __pyx_k_ns1, sizeof(__pyx_k_ns1), 0, 0, 1, 1},
+ {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
+ {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
+ {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
+ {&__pyx_n_s_polspl, __pyx_k_polspl, sizeof(__pyx_k_polspl), 0, 0, 1, 1},
+ {&__pyx_n_s_polspl2, __pyx_k_polspl2, sizeof(__pyx_k_polspl2), 0, 0, 1, 1},
+ {&__pyx_n_s_power, __pyx_k_power, sizeof(__pyx_k_power), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
+ {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
+ {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
+ {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
+ {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
+ {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
+ {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
+ {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
+ {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
+ {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
+ {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
+ {&__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},
+ {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
+ {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
+ {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
+ {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
+ {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
+ {&__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},
+ {&__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},
+ {&__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},
+ {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
+ {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
+ {&__pyx_n_s_w, __pyx_k_w, sizeof(__pyx_k_w), 0, 0, 1, 1},
+ {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
+ {&__pyx_n_s_xh, __pyx_k_xh, sizeof(__pyx_k_xh), 0, 0, 1, 1},
+ {&__pyx_n_s_xh0, __pyx_k_xh0, sizeof(__pyx_k_xh0), 0, 0, 1, 1},
+ {&__pyx_n_s_xk, __pyx_k_xk, sizeof(__pyx_k_xk), 0, 0, 1, 1},
+ {&__pyx_n_s_xk0, __pyx_k_xk0, sizeof(__pyx_k_xk0), 0, 0, 1, 1},
+ {&__pyx_n_s_xl, __pyx_k_xl, sizeof(__pyx_k_xl), 0, 0, 1, 1},
+ {&__pyx_n_s_xl0, __pyx_k_xl0, sizeof(__pyx_k_xl0), 0, 0, 1, 1},
+ {&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
+ {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
+ {0, 0, 0, 0, 0, 0, 0}
+};
+static int __Pyx_InitCachedBuiltins(void) {
+ __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 101, __pyx_L1_error)
+ __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 229, __pyx_L1_error)
+ __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(1, 810, __pyx_L1_error)
+ __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(1, 1000, __pyx_L1_error)
+ __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 147, __pyx_L1_error)
+ __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(2, 150, __pyx_L1_error)
+ __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(2, 2, __pyx_L1_error)
+ __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(2, 399, __pyx_L1_error)
+ __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(2, 608, __pyx_L1_error)
+ __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(2, 827, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_InitCachedConstants(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":52
+ *
+ * def polspl(x, y, w, npts, xl, xh, nr, nc):
+ * c = numpy.zeros((36,), dtype=numpy.float64) # <<<<<<<<<<<<<<
+ * cdef double[:] c_c = c
+ * cdef double[:] c_x = numpy.ascontiguousarray(x,
+ */
+ __pyx_tuple_ = PyTuple_Pack(1, __pyx_int_36); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple_);
+ __Pyx_GIVEREF(__pyx_tuple_);
+ __pyx_tuple__2 = PyTuple_Pack(1, __pyx_tuple_); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 52, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__2);
+ __Pyx_GIVEREF(__pyx_tuple__2);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":85
+ * numpy.ascontiguousarray(xh0, numpy.float64)
+ * cdef double * xh = <double *> buffer_xh0.data
+ * df = numpy.zeros(26) # <<<<<<<<<<<<<<
+ * a = numpy.zeros((36,37))
+ * nbs = numpy.zeros(11,dtype=int)
+ */
+ __pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_26); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 85, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__3);
+ __Pyx_GIVEREF(__pyx_tuple__3);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":86
+ * cdef double * xh = <double *> buffer_xh0.data
+ * df = numpy.zeros(26)
+ * a = numpy.zeros((36,37)) # <<<<<<<<<<<<<<
+ * nbs = numpy.zeros(11,dtype=int)
+ * cdef double[:] xk0 = numpy.zeros(10)
+ */
+ __pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_36, __pyx_int_37); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__4);
+ __Pyx_GIVEREF(__pyx_tuple__4);
+ __pyx_tuple__5 = PyTuple_Pack(1, __pyx_tuple__4); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 86, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__5);
+ __Pyx_GIVEREF(__pyx_tuple__5);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":87
+ * df = numpy.zeros(26)
+ * a = numpy.zeros((36,37))
+ * nbs = numpy.zeros(11,dtype=int) # <<<<<<<<<<<<<<
+ * cdef double[:] xk0 = numpy.zeros(10)
+ * cdef double * xk = &xk0[0]
+ */
+ __pyx_tuple__6 = PyTuple_Pack(1, __pyx_int_11); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 87, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__6);
+ __Pyx_GIVEREF(__pyx_tuple__6);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":88
+ * a = numpy.zeros((36,37))
+ * nbs = numpy.zeros(11,dtype=int)
+ * cdef double[:] xk0 = numpy.zeros(10) # <<<<<<<<<<<<<<
+ * cdef double * xk = &xk0[0]
+ * c = numpy.zeros(36)
+ */
+ __pyx_tuple__7 = PyTuple_Pack(1, __pyx_int_10); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 88, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__7);
+ __Pyx_GIVEREF(__pyx_tuple__7);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":90
+ * cdef double[:] xk0 = numpy.zeros(10)
+ * cdef double * xk = &xk0[0]
+ * c = numpy.zeros(36) # <<<<<<<<<<<<<<
+ * cdef int j=0
+ * cdef int i=0
+ */
+ __pyx_tuple__8 = PyTuple_Pack(1, __pyx_int_36); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(0, 90, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__8);
+ __Pyx_GIVEREF(__pyx_tuple__8);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":229
+ * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
+ *
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ */
+ __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(1, 229, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__9);
+ __Pyx_GIVEREF(__pyx_tuple__9);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":233
+ * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
+ * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
+ * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
+ *
+ * info.buf = PyArray_DATA(self)
+ */
+ __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 233, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__10);
+ __Pyx_GIVEREF(__pyx_tuple__10);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":263
+ * if ((descr.byteorder == c'>' and little_endian) or
+ * (descr.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * if t == NPY_BYTE: f = "b"
+ * elif t == NPY_UBYTE: f = "B"
+ */
+ __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 263, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__11);
+ __Pyx_GIVEREF(__pyx_tuple__11);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":810
+ *
+ * if (end - f) - <int>(new_offset - offset[0]) < 15:
+ * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
+ *
+ * if ((child.byteorder == c'>' and little_endian) or
+ */
+ __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 810, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__12);
+ __Pyx_GIVEREF(__pyx_tuple__12);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":814
+ * if ((child.byteorder == c'>' and little_endian) or
+ * (child.byteorder == c'<' and not little_endian)):
+ * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
+ * # One could encode it in the format string and have Cython
+ * # complain instead, BUT: < and > in format strings also imply
+ */
+ __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 814, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__13);
+ __Pyx_GIVEREF(__pyx_tuple__13);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":834
+ * t = child.type_num
+ * if end - f < 5:
+ * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
+ *
+ * # Until ticket #99 is fixed, use integers to avoid warnings
+ */
+ __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 834, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__14);
+ __Pyx_GIVEREF(__pyx_tuple__14);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1000
+ * _import_array()
+ * except Exception:
+ * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_umath() except -1:
+ */
+ __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 1000, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__15);
+ __Pyx_GIVEREF(__pyx_tuple__15);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1006
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ *
+ * cdef inline int import_ufunc() except -1:
+ */
+ __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 1006, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__16);
+ __Pyx_GIVEREF(__pyx_tuple__16);
+
+ /* "../../../Program Files/Python37/lib/site-packages/Cython/Includes/numpy/__init__.pxd":1012
+ * _import_umath()
+ * except Exception:
+ * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 1012, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__17);
+ __Pyx_GIVEREF(__pyx_tuple__17);
+
+ /* "View.MemoryView":132
+ *
+ * if not self.ndim:
+ * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if itemsize <= 0:
+ */
+ __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(2, 132, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__18);
+ __Pyx_GIVEREF(__pyx_tuple__18);
+
+ /* "View.MemoryView":135
+ *
+ * if itemsize <= 0:
+ * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
+ *
+ * if not isinstance(format, bytes):
+ */
+ __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(2, 135, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__19);
+ __Pyx_GIVEREF(__pyx_tuple__19);
+
+ /* "View.MemoryView":138
+ *
+ * if not isinstance(format, bytes):
+ * format = format.encode('ASCII') # <<<<<<<<<<<<<<
+ * self._format = format # keep a reference to the byte string
+ * self.format = self._format
+ */
+ __pyx_tuple__20 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(2, 138, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__20);
+ __Pyx_GIVEREF(__pyx_tuple__20);
+
+ /* "View.MemoryView":147
+ *
+ * if not self._shape:
+ * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(2, 147, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__21);
+ __Pyx_GIVEREF(__pyx_tuple__21);
+
+ /* "View.MemoryView":175
+ * self.data = <char *>malloc(self.len)
+ * if not self.data:
+ * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
+ *
+ * if self.dtype_is_object:
+ */
+ __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(2, 175, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__22);
+ __Pyx_GIVEREF(__pyx_tuple__22);
+
+ /* "View.MemoryView":191
+ * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
+ * if not (flags & bufmode):
+ * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
+ * info.buf = self.data
+ * info.len = self.len
+ */
+ __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(2, 191, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__23);
+ __Pyx_GIVEREF(__pyx_tuple__23);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(2, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__24);
+ __Pyx_GIVEREF(__pyx_tuple__24);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__25);
+ __Pyx_GIVEREF(__pyx_tuple__25);
+
+ /* "View.MemoryView":413
+ * def __setitem__(memoryview self, object index, object value):
+ * if self.view.readonly:
+ * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * have_slices, index = _unellipsify(index, self.view.ndim)
+ */
+ __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(2, 413, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__26);
+ __Pyx_GIVEREF(__pyx_tuple__26);
+
+ /* "View.MemoryView":490
+ * result = struct.unpack(self.view.format, bytesitem)
+ * except struct.error:
+ * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
+ * else:
+ * if len(self.view.format) == 1:
+ */
+ __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(2, 490, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__27);
+ __Pyx_GIVEREF(__pyx_tuple__27);
+
+ /* "View.MemoryView":515
+ * def __getbuffer__(self, Py_buffer *info, int flags):
+ * if flags & PyBUF_WRITABLE and self.view.readonly:
+ * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
+ *
+ * if flags & PyBUF_STRIDES:
+ */
+ __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(2, 515, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__28);
+ __Pyx_GIVEREF(__pyx_tuple__28);
+
+ /* "View.MemoryView":565
+ * if self.view.strides == NULL:
+ *
+ * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
+ *
+ * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
+ */
+ __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(2, 565, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__29);
+ __Pyx_GIVEREF(__pyx_tuple__29);
+
+ /* "View.MemoryView":572
+ * def suboffsets(self):
+ * if self.view.suboffsets == NULL:
+ * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
+ *
+ * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
+ */
+ __pyx_tuple__30 = PyTuple_New(1); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(2, 572, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__30);
+ __Pyx_INCREF(__pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_int_neg_1);
+ PyTuple_SET_ITEM(__pyx_tuple__30, 0, __pyx_int_neg_1);
+ __Pyx_GIVEREF(__pyx_tuple__30);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(2, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__31);
+ __Pyx_GIVEREF(__pyx_tuple__31);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__32);
+ __Pyx_GIVEREF(__pyx_tuple__32);
+
+ /* "View.MemoryView":677
+ * if item is Ellipsis:
+ * if not seen_ellipsis:
+ * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
+ * seen_ellipsis = True
+ * else:
+ */
+ __pyx_slice__33 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__33)) __PYX_ERR(2, 677, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__33);
+ __Pyx_GIVEREF(__pyx_slice__33);
+
+ /* "View.MemoryView":680
+ * seen_ellipsis = True
+ * else:
+ * result.append(slice(None)) # <<<<<<<<<<<<<<
+ * have_slices = True
+ * else:
+ */
+ __pyx_slice__34 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__34)) __PYX_ERR(2, 680, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__34);
+ __Pyx_GIVEREF(__pyx_slice__34);
+
+ /* "View.MemoryView":691
+ * nslices = ndim - len(result)
+ * if nslices:
+ * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
+ *
+ * return have_slices or nslices, tuple(result)
+ */
+ __pyx_slice__35 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__35)) __PYX_ERR(2, 691, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_slice__35);
+ __Pyx_GIVEREF(__pyx_slice__35);
+
+ /* "View.MemoryView":698
+ * for suboffset in suboffsets[:ndim]:
+ * if suboffset >= 0:
+ * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(2, 698, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__36);
+ __Pyx_GIVEREF(__pyx_tuple__36);
+
+ /* "(tree fragment)":2
+ * def __reduce_cython__(self):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ */
+ __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(2, 2, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__37);
+ __Pyx_GIVEREF(__pyx_tuple__37);
+
+ /* "(tree fragment)":4
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
+ * def __setstate_cython__(self, __pyx_state):
+ * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
+ */
+ __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(2, 4, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__38);
+ __Pyx_GIVEREF(__pyx_tuple__38);
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":35
+ * from bessel0 cimport j0Single, j0Multiple
+ *
+ * def j0(x): # <<<<<<<<<<<<<<
+ * if hasattr(x, "__len__"):
+ * return _besselMultiple(x)
+ */
+ __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_x); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__39);
+ __Pyx_GIVEREF(__pyx_tuple__39);
+ __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaPhysics_xas__xas_cyt, __pyx_n_s_j0, 35, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(0, 35, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":41
+ * return _besselSingle(x)
+ *
+ * def _besselMultiple(x): # <<<<<<<<<<<<<<
+ * result = numpy.array(x, copy=True, dtype=numpy.float64)
+ * cdef double[:] c_x = result
+ */
+ __pyx_tuple__41 = PyTuple_Pack(4, __pyx_n_s_x, __pyx_n_s_result, __pyx_n_s_c_x, __pyx_n_s_c_npts); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(0, 41, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__41);
+ __Pyx_GIVEREF(__pyx_tuple__41);
+ __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaPhysics_xas__xas_cyt, __pyx_n_s_besselMultiple, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(0, 41, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":48
+ * return result
+ *
+ * def _besselSingle(double x): # <<<<<<<<<<<<<<
+ * return j0Single(x)
+ *
+ */
+ __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_x, __pyx_n_s_x); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(0, 48, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__43);
+ __Pyx_GIVEREF(__pyx_tuple__43);
+ __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(1, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaPhysics_xas__xas_cyt, __pyx_n_s_besselSingle, 48, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(0, 48, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":51
+ * return j0Single(x)
+ *
+ * def polspl(x, y, w, npts, xl, xh, nr, nc): # <<<<<<<<<<<<<<
+ * c = numpy.zeros((36,), dtype=numpy.float64)
+ * cdef double[:] c_c = c
+ */
+ __pyx_tuple__45 = PyTuple_Pack(19, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_npts, __pyx_n_s_xl, __pyx_n_s_xh, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_c, __pyx_n_s_c_c, __pyx_n_s_c_x, __pyx_n_s_c_y, __pyx_n_s_c_w, __pyx_n_s_c_npts, __pyx_n_s_c_xl, __pyx_n_s_c_xh, __pyx_n_s_c_nr, __pyx_n_s_c_nc, __pyx_n_s_c_sizeC); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(0, 51, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__45);
+ __Pyx_GIVEREF(__pyx_tuple__45);
+ __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(8, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaPhysics_xas__xas_cyt, __pyx_n_s_polspl, 51, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(0, 51, __pyx_L1_error)
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":73
+ * return c
+ *
+ * def polspl2(x,y,w,npts,xl0,xh0,nr,nc): # <<<<<<<<<<<<<<
+ *
+ * # ;
+ */
+ __pyx_tuple__47 = PyTuple_Pack(36, __pyx_n_s_x, __pyx_n_s_y, __pyx_n_s_w, __pyx_n_s_npts, __pyx_n_s_xl0, __pyx_n_s_xh0, __pyx_n_s_nr, __pyx_n_s_nc, __pyx_n_s_buffer_xl0, __pyx_n_s_xl, __pyx_n_s_buffer_xh0, __pyx_n_s_xh, __pyx_n_s_df, __pyx_n_s_a, __pyx_n_s_nbs, __pyx_n_s_xk0, __pyx_n_s_xk, __pyx_n_s_c, __pyx_n_s_j, __pyx_n_s_i, __pyx_n_s_ne_idl, __pyx_n_s_n, __pyx_n_s_k, __pyx_n_s_ibl, __pyx_n_s_ns, __pyx_n_s_ns1, __pyx_n_s_t, __pyx_n_s_n1, __pyx_n_s_ncol, __pyx_n_s_nk, __pyx_n_s_ik, __pyx_n_s_i1, __pyx_n_s_nm1, __pyx_n_s_m, __pyx_n_s_ni, __pyx_n_s_ni1); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__47);
+ __Pyx_GIVEREF(__pyx_tuple__47);
+ __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(8, 0, 36, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_PyMca5_PyMcaPhysics_xas__xas_cyt, __pyx_n_s_polspl2, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 73, __pyx_L1_error)
+
+ /* "View.MemoryView":285
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(2, 285, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__49);
+ __Pyx_GIVEREF(__pyx_tuple__49);
+
+ /* "View.MemoryView":286
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(2, 286, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__50);
+ __Pyx_GIVEREF(__pyx_tuple__50);
+
+ /* "View.MemoryView":287
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(2, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__51);
+ __Pyx_GIVEREF(__pyx_tuple__51);
+
+ /* "View.MemoryView":290
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(2, 290, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__52);
+ __Pyx_GIVEREF(__pyx_tuple__52);
+
+ /* "View.MemoryView":291
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(2, 291, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__53);
+ __Pyx_GIVEREF(__pyx_tuple__53);
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+ __pyx_tuple__54 = 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__54)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_tuple__54);
+ __Pyx_GIVEREF(__pyx_tuple__54);
+ __pyx_codeobj__55 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__54, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__55)) __PYX_ERR(2, 1, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_InitGlobals(void) {
+ if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ __pyx_float_1_0 = PyFloat_FromDouble(1.0); if (unlikely(!__pyx_float_1_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_float_neg_1_ = PyFloat_FromDouble(-1.); if (unlikely(!__pyx_float_neg_1_)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_11 = PyInt_FromLong(11); if (unlikely(!__pyx_int_11)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_26 = PyInt_FromLong(26); if (unlikely(!__pyx_int_26)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_36 = PyInt_FromLong(36); if (unlikely(!__pyx_int_36)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_37 = PyInt_FromLong(37); if (unlikely(!__pyx_int_37)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ return 0;
+ __pyx_L1_error:;
+ return -1;
+}
+
+static int __Pyx_modinit_global_init_code(void); /*proto*/
+static int __Pyx_modinit_variable_export_code(void); /*proto*/
+static int __Pyx_modinit_function_export_code(void); /*proto*/
+static int __Pyx_modinit_type_init_code(void); /*proto*/
+static int __Pyx_modinit_type_import_code(void); /*proto*/
+static int __Pyx_modinit_variable_import_code(void); /*proto*/
+static int __Pyx_modinit_function_import_code(void); /*proto*/
+
+static int __Pyx_modinit_global_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
+ /*--- Global init code ---*/
+ generic = Py_None; Py_INCREF(Py_None);
+ strided = Py_None; Py_INCREF(Py_None);
+ indirect = Py_None; Py_INCREF(Py_None);
+ contiguous = Py_None; Py_INCREF(Py_None);
+ indirect_contiguous = Py_None; Py_INCREF(Py_None);
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_variable_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
+ /*--- Variable export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_export_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
+ /*--- Function export code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_type_init_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
+ /*--- Type init code ---*/
+ __pyx_vtabptr_array = &__pyx_vtable_array;
+ __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
+ if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error)
+ __pyx_type___pyx_array.tp_print = 0;
+ if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(2, 104, __pyx_L1_error)
+ __pyx_array_type = &__pyx_type___pyx_array;
+ if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 278, __pyx_L1_error)
+ __pyx_type___pyx_MemviewEnum.tp_print = 0;
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(2, 278, __pyx_L1_error)
+ __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
+ __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
+ __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
+ __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
+ __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
+ __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
+ __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
+ __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
+ __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
+ if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error)
+ __pyx_type___pyx_memoryview.tp_print = 0;
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(2, 329, __pyx_L1_error)
+ __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
+ __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
+ __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
+ __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
+ __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
+ __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
+ if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error)
+ __pyx_type___pyx_memoryviewslice.tp_print = 0;
+ if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
+ __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
+ }
+ if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error)
+ if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(2, 960, __pyx_L1_error)
+ __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_type_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
+ /*--- Type import code ---*/
+ __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
+ #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
+ sizeof(PyTypeObject),
+ #else
+ sizeof(PyHeapTypeObject),
+ #endif
+ 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(3, 9, __pyx_L1_error)
+ __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(1, 164, __pyx_L1_error)
+ __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(1, 186, __pyx_L1_error)
+ __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(1, 190, __pyx_L1_error)
+ __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(1, 199, __pyx_L1_error)
+ __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(1, 872, __pyx_L1_error)
+ __Pyx_RefNannyFinishContext();
+ return 0;
+ __pyx_L1_error:;
+ __Pyx_RefNannyFinishContext();
+ return -1;
+}
+
+static int __Pyx_modinit_variable_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
+ /*--- Variable import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+static int __Pyx_modinit_function_import_code(void) {
+ __Pyx_RefNannyDeclarations
+ __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
+ /*--- Function import code ---*/
+ __Pyx_RefNannyFinishContext();
+ return 0;
+}
+
+
+#if PY_MAJOR_VERSION < 3
+#ifdef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC void
+#else
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#endif
+#else
+#ifdef CYTHON_NO_PYINIT_EXPORT
+#define __Pyx_PyMODINIT_FUNC PyObject *
+#else
+#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
+#endif
+#endif
+#ifndef CYTHON_SMALL_CODE
+#if defined(__clang__)
+ #define CYTHON_SMALL_CODE
+#elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
+ #define CYTHON_SMALL_CODE __attribute__((optimize("Os")))
+#else
+ #define CYTHON_SMALL_CODE
+#endif
+#endif
+
+
+#if PY_MAJOR_VERSION < 3
+__Pyx_PyMODINIT_FUNC init_xas(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC init_xas(void)
+#else
+__Pyx_PyMODINIT_FUNC PyInit__xas(void) CYTHON_SMALL_CODE; /*proto*/
+__Pyx_PyMODINIT_FUNC PyInit__xas(void)
+#if CYTHON_PEP489_MULTI_PHASE_INIT
+{
+ return PyModuleDef_Init(&__pyx_moduledef);
+}
+static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
+ PyObject *value = PyObject_GetAttrString(spec, from_name);
+ int result = 0;
+ if (likely(value)) {
+ result = PyDict_SetItemString(moddict, to_name, value);
+ Py_DECREF(value);
+ } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Clear();
+ } else {
+ result = -1;
+ }
+ return result;
+}
+static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
+ PyObject *module = NULL, *moddict, *modname;
+ if (__pyx_m)
+ return __Pyx_NewRef(__pyx_m);
+ modname = PyObject_GetAttrString(spec, "name");
+ if (unlikely(!modname)) goto bad;
+ module = PyModule_NewObject(modname);
+ Py_DECREF(modname);
+ if (unlikely(!module)) goto bad;
+ moddict = PyModule_GetDict(module);
+ if (unlikely(!moddict)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
+ if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
+ return module;
+bad:
+ Py_XDECREF(module);
+ return NULL;
+}
+
+
+static int __pyx_pymod_exec__xas(PyObject *__pyx_pyinit_module)
+#endif
+#endif
+{
+ PyObject *__pyx_t_1 = NULL;
+ static PyThread_type_lock __pyx_t_2[8];
+ __Pyx_RefNannyDeclarations
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
+ #elif PY_MAJOR_VERSION >= 3
+ if (__pyx_m) return __Pyx_NewRef(__pyx_m);
+ #endif
+ #if CYTHON_REFNANNY
+__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
+if (!__Pyx_RefNanny) {
+ PyErr_Clear();
+ __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
+ if (!__Pyx_RefNanny)
+ Py_FatalError("failed to import 'refnanny' module");
+}
+#endif
+ __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit__xas(void)", 0);
+ if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #ifdef __Pyx_CyFunction_USED
+ if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_FusedFunction_USED
+ if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Coroutine_USED
+ if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_Generator_USED
+ if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_AsyncGen_USED
+ if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ #ifdef __Pyx_StopAsyncIteration_USED
+ if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ /*--- Library function declarations ---*/
+ /*--- Threads initialization code ---*/
+ #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
+ #ifdef WITH_THREAD /* Python build with threading support? */
+ PyEval_InitThreads();
+ #endif
+ #endif
+ /*--- Module creation code ---*/
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ __pyx_m = __pyx_pyinit_module;
+ Py_INCREF(__pyx_m);
+ #else
+ #if PY_MAJOR_VERSION < 3
+ __pyx_m = Py_InitModule4("_xas", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
+ #else
+ __pyx_m = PyModule_Create(&__pyx_moduledef);
+ #endif
+ if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
+ Py_INCREF(__pyx_d);
+ __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
+ #if CYTHON_COMPILING_IN_PYPY
+ Py_INCREF(__pyx_b);
+ #endif
+ if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
+ /*--- Initialize various global constants etc. ---*/
+ if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
+ if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+ if (__pyx_module_is_main_PyMca5__PyMcaPhysics__xas___xas) {
+ if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ #if PY_MAJOR_VERSION >= 3
+ {
+ PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
+ if (!PyDict_GetItemString(modules, "PyMca5.PyMcaPhysics.xas._xas")) {
+ if (unlikely(PyDict_SetItemString(modules, "PyMca5.PyMcaPhysics.xas._xas", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
+ }
+ }
+ #endif
+ /*--- Builtin init code ---*/
+ if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Constants init code ---*/
+ if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ /*--- Global type/function init code ---*/
+ (void)__Pyx_modinit_global_init_code();
+ (void)__Pyx_modinit_variable_export_code();
+ (void)__Pyx_modinit_function_export_code();
+ if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
+ if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
+ (void)__Pyx_modinit_variable_import_code();
+ (void)__Pyx_modinit_function_import_code();
+ /*--- Execution code ---*/
+ #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
+ if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ #endif
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":30
+ * #############################################################################*[inserted by cython to avoid comment closer]/
+ * cimport cython
+ * import numpy # <<<<<<<<<<<<<<
+ * cimport numpy
+ * from polspl cimport polspl as _polspl
+ */
+ __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 30, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_numpy, __pyx_t_1) < 0) __PYX_ERR(0, 30, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":35
+ * from bessel0 cimport j0Single, j0Multiple
+ *
+ * def j0(x): # <<<<<<<<<<<<<<
+ * if hasattr(x, "__len__"):
+ * return _besselMultiple(x)
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_1j0, NULL, __pyx_n_s_PyMca5_PyMcaPhysics_xas__xas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_j0, __pyx_t_1) < 0) __PYX_ERR(0, 35, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":41
+ * return _besselSingle(x)
+ *
+ * def _besselMultiple(x): # <<<<<<<<<<<<<<
+ * result = numpy.array(x, copy=True, dtype=numpy.float64)
+ * cdef double[:] c_x = result
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_3_besselMultiple, NULL, __pyx_n_s_PyMca5_PyMcaPhysics_xas__xas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 41, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_besselMultiple, __pyx_t_1) < 0) __PYX_ERR(0, 41, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":48
+ * return result
+ *
+ * def _besselSingle(double x): # <<<<<<<<<<<<<<
+ * return j0Single(x)
+ *
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_5_besselSingle, NULL, __pyx_n_s_PyMca5_PyMcaPhysics_xas__xas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 48, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_besselSingle, __pyx_t_1) < 0) __PYX_ERR(0, 48, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":51
+ * return j0Single(x)
+ *
+ * def polspl(x, y, w, npts, xl, xh, nr, nc): # <<<<<<<<<<<<<<
+ * c = numpy.zeros((36,), dtype=numpy.float64)
+ * cdef double[:] c_c = c
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_7polspl, NULL, __pyx_n_s_PyMca5_PyMcaPhysics_xas__xas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 51, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_polspl, __pyx_t_1) < 0) __PYX_ERR(0, 51, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":73
+ * return c
+ *
+ * def polspl2(x,y,w,npts,xl0,xh0,nr,nc): # <<<<<<<<<<<<<<
+ *
+ * # ;
+ */
+ __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_6PyMca5_12PyMcaPhysics_3xas_4_xas_9polspl2, NULL, __pyx_n_s_PyMca5_PyMcaPhysics_xas__xas); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_polspl2, __pyx_t_1) < 0) __PYX_ERR(0, 73, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "PyMca5/PyMcaPhysics/xas/_xas/cython/_xas.pyx":1
+ * #/[inserted by cython to avoid comment start]*########################################################################## # <<<<<<<<<<<<<<
+ * #
+ * # The PyMca X-Ray Fluorescence Toolkit
+ */
+ __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "View.MemoryView":208
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ * def __dealloc__(array self):
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 208, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 208, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_array_type);
+
+ /* "View.MemoryView":285
+ * return self.name
+ *
+ * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>")
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 285, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(generic);
+ __Pyx_DECREF_SET(generic, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":286
+ *
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
+ * cdef indirect = Enum("<strided and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 286, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(strided);
+ __Pyx_DECREF_SET(strided, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":287
+ * cdef generic = Enum("<strided and direct or indirect>")
+ * cdef strided = Enum("<strided and direct>") # default
+ * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 287, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect);
+ __Pyx_DECREF_SET(indirect, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":290
+ *
+ *
+ * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>")
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 290, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(contiguous);
+ __Pyx_DECREF_SET(contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":291
+ *
+ * cdef contiguous = Enum("<contiguous and direct>")
+ * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 291, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ __Pyx_XGOTREF(indirect_contiguous);
+ __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
+ __Pyx_GIVEREF(__pyx_t_1);
+ __pyx_t_1 = 0;
+
+ /* "View.MemoryView":315
+ *
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
+ * PyThread_allocate_lock(),
+ */
+ __pyx_memoryview_thread_locks_used = 0;
+
+ /* "View.MemoryView":316
+ * DEF THREAD_LOCKS_PREALLOCATED = 8
+ * cdef int __pyx_memoryview_thread_locks_used = 0
+ * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
+ * PyThread_allocate_lock(),
+ * PyThread_allocate_lock(),
+ */
+ __pyx_t_2[0] = PyThread_allocate_lock();
+ __pyx_t_2[1] = PyThread_allocate_lock();
+ __pyx_t_2[2] = PyThread_allocate_lock();
+ __pyx_t_2[3] = PyThread_allocate_lock();
+ __pyx_t_2[4] = PyThread_allocate_lock();
+ __pyx_t_2[5] = PyThread_allocate_lock();
+ __pyx_t_2[6] = PyThread_allocate_lock();
+ __pyx_t_2[7] = PyThread_allocate_lock();
+ memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
+
+ /* "View.MemoryView":544
+ * info.obj = self
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 544, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 544, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryview_type);
+
+ /* "View.MemoryView":990
+ * return self.from_object
+ *
+ * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
+ *
+ *
+ */
+ __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 990, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(2, 990, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+ PyType_Modified(__pyx_memoryviewslice_type);
+
+ /* "(tree fragment)":1
+ * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
+ * if __pyx_checksum != 0xb068931:
+ * from pickle import PickleError as __pyx_PickleError
+ */
+ __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(2, 1, __pyx_L1_error)
+ __Pyx_GOTREF(__pyx_t_1);
+ if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(2, 1, __pyx_L1_error)
+ __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
+
+ /* "(tree fragment)":9
+ * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
+ * return __pyx_result
+ * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
+ * __pyx_result.name = __pyx_state[0]
+ * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
+ */
+
+ /*--- Wrapped vars code ---*/
+
+ goto __pyx_L0;
+ __pyx_L1_error:;
+ __Pyx_XDECREF(__pyx_t_1);
+ if (__pyx_m) {
+ if (__pyx_d) {
+ __Pyx_AddTraceback("init PyMca5.PyMcaPhysics.xas._xas", 0, __pyx_lineno, __pyx_filename);
+ }
+ Py_DECREF(__pyx_m); __pyx_m = 0;
+ } else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_ImportError, "init PyMca5.PyMcaPhysics.xas._xas");
+ }
+ __pyx_L0:;
+ __Pyx_RefNannyFinishContext();
+ #if CYTHON_PEP489_MULTI_PHASE_INIT
+ return (__pyx_m != NULL) ? 0 : -1;
+ #elif PY_MAJOR_VERSION >= 3
+ return __pyx_m;
+ #else
+ return;
+ #endif
+}
+
+/* --- Runtime support code --- */
+/* Refnanny */
+#if CYTHON_REFNANNY
+static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
+ PyObject *m = NULL, *p = NULL;
+ void *r = NULL;
+ m = PyImport_ImportModule((char *)modname);
+ if (!m) goto end;
+ p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
+ if (!p) goto end;
+ r = PyLong_AsVoidPtr(p);
+end:
+ Py_XDECREF(p);
+ Py_XDECREF(m);
+ return (__Pyx_RefNannyAPIStruct *)r;
+}
+#endif
+
+/* PyObjectGetAttrStr */
+#if CYTHON_USE_TYPE_SLOTS
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
+ PyTypeObject* tp = Py_TYPE(obj);
+ if (likely(tp->tp_getattro))
+ return tp->tp_getattro(obj, attr_name);
+#if PY_MAJOR_VERSION < 3
+ if (likely(tp->tp_getattr))
+ return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
+#endif
+ return PyObject_GetAttr(obj, attr_name);
+}
+#endif
+
+/* GetBuiltinName */
+static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
+ PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
+ if (unlikely(!result)) {
+ PyErr_Format(PyExc_NameError,
+#if PY_MAJOR_VERSION >= 3
+ "name '%U' is not defined", name);
+#else
+ "name '%.200s' is not defined", PyString_AS_STRING(name));
+#endif
+ }
+ return result;
+}
+
+/* GetAttr */
+static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
+#if CYTHON_USE_TYPE_SLOTS
+#if PY_MAJOR_VERSION >= 3
+ if (likely(PyUnicode_Check(n)))
+#else
+ if (likely(PyString_Check(n)))
+#endif
+ return __Pyx_PyObject_GetAttrStr(o, n);
+#endif
+ return PyObject_GetAttr(o, n);
+}
+
+/* HasAttr */
+static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
+ PyObject *r;
+ if (unlikely(!__Pyx_PyBaseString_Check(n))) {
+ PyErr_SetString(PyExc_TypeError,
+ "hasattr(): attribute name must be string");
+ return -1;
+ }
+ r = __Pyx_GetAttr(o, n);
+ if (unlikely(!r)) {
+ PyErr_Clear();
+ return 0;
+ } else {
+ Py_DECREF(r);
+ return 1;
+ }
+}
+
+/* GetModuleGlobalName */
+static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
+ PyObject *result;
+#if !CYTHON_AVOID_BORROWED_REFS
+#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
+ result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else if (unlikely(PyErr_Occurred())) {
+ result = NULL;
+ } else {
+#else
+ result = PyDict_GetItem(__pyx_d, name);
+ if (likely(result)) {
+ Py_INCREF(result);
+ } else {
+#endif
+#else
+ result = PyObject_GetItem(__pyx_d, name);
+ if (!result) {
+ PyErr_Clear();
+#endif
+ result = __Pyx_GetBuiltinName(name);
+ }
+ return result;
+}
+
+/* PyCFunctionFastCall */
+ #if CYTHON_FAST_PYCCALL
+static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
+ PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
+ PyCFunction meth = PyCFunction_GET_FUNCTION(func);
+ PyObject *self = PyCFunction_GET_SELF(func);
+ int flags = PyCFunction_GET_FLAGS(func);
+ assert(PyCFunction_Check(func));
+ assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
+ assert(nargs >= 0);
+ assert(nargs == 0 || args != NULL);
+ /* _PyCFunction_FastCallDict() must not be called with an exception set,
+ because it may clear it (directly or indirectly) and so the
+ caller loses its exception */
+ assert(!PyErr_Occurred());
+ if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
+ return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
+ } else {
+ return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
+ }
+}
+#endif
+
+/* PyFunctionFastCall */
+ #if CYTHON_FAST_PYCALL
+#include "frameobject.h"
+static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
+ PyObject *globals) {
+ PyFrameObject *f;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject **fastlocals;
+ Py_ssize_t i;
+ PyObject *result;
+ assert(globals != NULL);
+ /* XXX Perhaps we should create a specialized
+ PyFrame_New() that doesn't take locals, but does
+ take builtins without sanity checking them.
+ */
+ assert(tstate != NULL);
+ f = PyFrame_New(tstate, co, globals, NULL);
+ if (f == NULL) {
+ return NULL;
+ }
+ fastlocals = f->f_localsplus;
+ for (i = 0; i < na; i++) {
+ Py_INCREF(*args);
+ fastlocals[i] = *args++;
+ }
+ result = PyEval_EvalFrameEx(f,0);
+ ++tstate->recursion_depth;
+ Py_DECREF(f);
+ --tstate->recursion_depth;
+ return result;
+}
+#if 1 || PY_VERSION_HEX < 0x030600B1
+static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
+ PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
+ PyObject *globals = PyFunction_GET_GLOBALS(func);
+ PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
+ PyObject *closure;
+#if PY_MAJOR_VERSION >= 3
+ PyObject *kwdefs;
+#endif
+ PyObject *kwtuple, **k;
+ PyObject **d;
+ Py_ssize_t nd;
+ Py_ssize_t nk;
+ PyObject *result;
+ assert(kwargs == NULL || PyDict_Check(kwargs));
+ nk = kwargs ? PyDict_Size(kwargs) : 0;
+ if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
+ return NULL;
+ }
+ if (
+#if PY_MAJOR_VERSION >= 3
+ co->co_kwonlyargcount == 0 &&
+#endif
+ likely(kwargs == NULL || nk == 0) &&
+ co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
+ if (argdefs == NULL && co->co_argcount == nargs) {
+ result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
+ goto done;
+ }
+ else if (nargs == 0 && argdefs != NULL
+ && co->co_argcount == Py_SIZE(argdefs)) {
+ /* function called with no arguments, but all parameters have
+ a default value: use default values as arguments .*/
+ args = &PyTuple_GET_ITEM(argdefs, 0);
+ result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
+ goto done;
+ }
+ }
+ if (kwargs != NULL) {
+ Py_ssize_t pos, i;
+ kwtuple = PyTuple_New(2 * nk);
+ if (kwtuple == NULL) {
+ result = NULL;
+ goto done;
+ }
+ k = &PyTuple_GET_ITEM(kwtuple, 0);
+ pos = i = 0;
+ while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
+ Py_INCREF(k[i]);
+ Py_INCREF(k[i+1]);
+ i += 2;
+ }
+ nk = i / 2;
+ }
+ else {
+ kwtuple = NULL;
+ k = NULL;
+ }
+ closure = PyFunction_GET_CLOSURE(func);
+#if PY_MAJOR_VERSION >= 3
+ kwdefs = PyFunction_GET_KW_DEFAULTS(func);
+#endif
+ if (argdefs != NULL) {
+ d = &PyTuple_GET_ITEM(argdefs, 0);
+ nd = Py_SIZE(argdefs);
+ }
+ else {
+ d = NULL;
+ nd = 0;
+ }
+#if PY_MAJOR_VERSION >= 3
+ result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, kwdefs, closure);
+#else
+ result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
+ args, nargs,
+ k, (int)nk,
+ d, (int)nd, closure);
+#endif
+ Py_XDECREF(kwtuple);
+done:
+ Py_LeaveRecursiveCall();
+ return result;
+}
+#endif
+#endif
+
+/* PyObjectCall */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
+ PyObject *result;
+ ternaryfunc call = func->ob_type->tp_call;
+ if (unlikely(!call))
+ return PyObject_Call(func, arg, kw);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = (*call)(func, arg, kw);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallMethO */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
+ PyObject *self, *result;
+ PyCFunction cfunc;
+ cfunc = PyCFunction_GET_FUNCTION(func);
+ self = PyCFunction_GET_SELF(func);
+ if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
+ return NULL;
+ result = cfunc(self, arg);
+ Py_LeaveRecursiveCall();
+ if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
+ PyErr_SetString(
+ PyExc_SystemError,
+ "NULL result without error in PyObject_Call");
+ }
+ return result;
+}
+#endif
+
+/* PyObjectCallOneArg */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_New(1);
+ if (unlikely(!args)) return NULL;
+ Py_INCREF(arg);
+ PyTuple_SET_ITEM(args, 0, arg);
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+#if CYTHON_FAST_PYCALL
+ if (PyFunction_Check(func)) {
+ return __Pyx_PyFunction_FastCall(func, &arg, 1);
+ }
+#endif
+ if (likely(PyCFunction_Check(func))) {
+ if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
+ return __Pyx_PyObject_CallMethO(func, arg);
+#if CYTHON_FAST_PYCCALL
+ } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
+ return __Pyx_PyCFunction_FastCall(func, &arg, 1);
+#endif
+ }
+ }
+ return __Pyx__PyObject_CallOneArg(func, arg);
+}
+#else
+static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
+ PyObject *result;
+ PyObject *args = PyTuple_Pack(1, arg);
+ if (unlikely(!args)) return NULL;
+ result = __Pyx_PyObject_Call(func, args, NULL);
+ Py_DECREF(args);
+ return result;
+}
+#endif
+
+/* BufferIndexError */
+ static void __Pyx_RaiseBufferIndexError(int axis) {
+ PyErr_Format(PyExc_IndexError,
+ "Out of bounds on buffer access (axis %d)", axis);
+}
+
+/* MemviewSliceInit */
+ static int
+__Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
+ int ndim,
+ __Pyx_memviewslice *memviewslice,
+ int memview_is_new_reference)
+{
+ __Pyx_RefNannyDeclarations
+ int i, retval=-1;
+ Py_buffer *buf = &memview->view;
+ __Pyx_RefNannySetupContext("init_memviewslice", 0);
+ if (!buf) {
+ PyErr_SetString(PyExc_ValueError,
+ "buf is NULL.");
+ goto fail;
+ } else if (memviewslice->memview || memviewslice->data) {
+ PyErr_SetString(PyExc_ValueError,
+ "memviewslice is already initialized!");
+ goto fail;
+ }
+ if (buf->strides) {
+ for (i = 0; i < ndim; i++) {
+ memviewslice->strides[i] = buf->strides[i];
+ }
+ } else {
+ Py_ssize_t stride = buf->itemsize;
+ for (i = ndim - 1; i >= 0; i--) {
+ memviewslice->strides[i] = stride;
+ stride *= buf->shape[i];
+ }
+ }
+ for (i = 0; i < ndim; i++) {
+ memviewslice->shape[i] = buf->shape[i];
+ if (buf->suboffsets) {
+ memviewslice->suboffsets[i] = buf->suboffsets[i];
+ } else {
+ memviewslice->suboffsets[i] = -1;
+ }
+ }
+ memviewslice->memview = memview;
+ memviewslice->data = (char *)buf->buf;
+ if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
+ Py_INCREF(memview);
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ memviewslice->memview = 0;
+ memviewslice->data = 0;
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+#ifndef Py_NO_RETURN
+#define Py_NO_RETURN
+#endif
+static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
+ va_list vargs;
+ char msg[200];
+#ifdef HAVE_STDARG_PROTOTYPES
+ va_start(vargs, fmt);
+#else
+ va_start(vargs);
+#endif
+ vsnprintf(msg, 200, fmt, vargs);
+ va_end(vargs);
+ Py_FatalError(msg);
+}
+static CYTHON_INLINE int
+__pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)++;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE int
+__pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
+ PyThread_type_lock lock)
+{
+ int result;
+ PyThread_acquire_lock(lock, 1);
+ result = (*acquisition_count)--;
+ PyThread_release_lock(lock);
+ return result;
+}
+static CYTHON_INLINE void
+__Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
+{
+ int first_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview || (PyObject *) memview == Py_None)
+ return;
+ if (__pyx_get_slice_count(memview) < 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ first_time = __pyx_add_acquisition_count(memview) == 0;
+ if (first_time) {
+ if (have_gil) {
+ Py_INCREF((PyObject *) memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_INCREF((PyObject *) memview);
+ PyGILState_Release(_gilstate);
+ }
+ }
+}
+static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
+ int have_gil, int lineno) {
+ int last_time;
+ struct __pyx_memoryview_obj *memview = memslice->memview;
+ if (!memview ) {
+ return;
+ } else if ((PyObject *) memview == Py_None) {
+ memslice->memview = NULL;
+ return;
+ }
+ if (__pyx_get_slice_count(memview) <= 0)
+ __pyx_fatalerror("Acquisition count is %d (line %d)",
+ __pyx_get_slice_count(memview), lineno);
+ last_time = __pyx_sub_acquisition_count(memview) == 1;
+ memslice->data = NULL;
+ if (last_time) {
+ if (have_gil) {
+ Py_CLEAR(memslice->memview);
+ } else {
+ PyGILState_STATE _gilstate = PyGILState_Ensure();
+ Py_CLEAR(memslice->memview);
+ PyGILState_Release(_gilstate);
+ }
+ } else {
+ memslice->memview = NULL;
+ }
+}
+
+/* RaiseArgTupleInvalid */
+ static void __Pyx_RaiseArgtupleInvalid(
+ const char* func_name,
+ int exact,
+ Py_ssize_t num_min,
+ Py_ssize_t num_max,
+ Py_ssize_t num_found)
+{
+ Py_ssize_t num_expected;
+ const char *more_or_less;
+ if (num_found < num_min) {
+ num_expected = num_min;
+ more_or_less = "at least";
+ } else {
+ num_expected = num_max;
+ more_or_less = "at most";
+ }
+ if (exact) {
+ more_or_less = "exactly";
+ }
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
+ func_name, more_or_less, num_expected,
+ (num_expected == 1) ? "" : "s", num_found);
+}
+
+/* RaiseDoubleKeywords */
+ static void __Pyx_RaiseDoubleKeywordsError(
+ const char* func_name,
+ PyObject* kw_name)
+{
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION >= 3
+ "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
+ #else
+ "%s() got multiple values for keyword argument '%s'", func_name,
+ PyString_AsString(kw_name));
+ #endif
+}
+
+/* ParseKeywords */
+ static int __Pyx_ParseOptionalKeywords(
+ PyObject *kwds,
+ PyObject **argnames[],
+ PyObject *kwds2,
+ PyObject *values[],
+ Py_ssize_t num_pos_args,
+ const char* function_name)
+{
+ PyObject *key = 0, *value = 0;
+ Py_ssize_t pos = 0;
+ PyObject*** name;
+ PyObject*** first_kw_arg = argnames + num_pos_args;
+ while (PyDict_Next(kwds, &pos, &key, &value)) {
+ name = first_kw_arg;
+ while (*name && (**name != key)) name++;
+ if (*name) {
+ values[name-argnames] = value;
+ continue;
+ }
+ name = first_kw_arg;
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
+ while (*name) {
+ if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**name, key)) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ if ((**argname == key) || (
+ (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
+ && _PyString_Eq(**argname, key))) {
+ goto arg_passed_twice;
+ }
+ argname++;
+ }
+ }
+ } else
+ #endif
+ if (likely(PyUnicode_Check(key))) {
+ while (*name) {
+ int cmp = (**name == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**name, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) {
+ values[name-argnames] = value;
+ break;
+ }
+ name++;
+ }
+ if (*name) continue;
+ else {
+ PyObject*** argname = argnames;
+ while (argname != first_kw_arg) {
+ int cmp = (**argname == key) ? 0 :
+ #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
+ (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
+ #endif
+ PyUnicode_Compare(**argname, key);
+ if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
+ if (cmp == 0) goto arg_passed_twice;
+ argname++;
+ }
+ }
+ } else
+ goto invalid_keyword_type;
+ if (kwds2) {
+ if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
+ } else {
+ goto invalid_keyword;
+ }
+ }
+ return 0;
+arg_passed_twice:
+ __Pyx_RaiseDoubleKeywordsError(function_name, key);
+ goto bad;
+invalid_keyword_type:
+ PyErr_Format(PyExc_TypeError,
+ "%.200s() keywords must be strings", function_name);
+ goto bad;
+invalid_keyword:
+ PyErr_Format(PyExc_TypeError,
+ #if PY_MAJOR_VERSION < 3
+ "%.200s() got an unexpected keyword argument '%.200s'",
+ function_name, PyString_AsString(key));
+ #else
+ "%s() got an unexpected keyword argument '%U'",
+ function_name, key);
+ #endif
+bad:
+ return -1;
+}
+
+/* ExtTypeTest */
+ static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ if (likely(__Pyx_TypeCheck(obj, type)))
+ return 1;
+ PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
+ Py_TYPE(obj)->tp_name, type->tp_name);
+ return 0;
+}
+
+/* IsLittleEndian */
+ static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
+{
+ union {
+ uint32_t u32;
+ uint8_t u8[4];
+ } S;
+ S.u32 = 0x01020304;
+ return S.u8[0] == 4;
+}
+
+/* BufferFormatCheck */
+ static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
+ __Pyx_BufFmt_StackElem* stack,
+ __Pyx_TypeInfo* type) {
+ stack[0].field = &ctx->root;
+ stack[0].parent_offset = 0;
+ ctx->root.type = type;
+ ctx->root.name = "buffer dtype";
+ ctx->root.offset = 0;
+ ctx->head = stack;
+ ctx->head->field = &ctx->root;
+ ctx->fmt_offset = 0;
+ ctx->head->parent_offset = 0;
+ ctx->new_packmode = '@';
+ ctx->enc_packmode = '@';
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ ctx->is_valid_array = 0;
+ ctx->struct_alignment = 0;
+ while (type->typegroup == 'S') {
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = 0;
+ type = type->fields->type;
+ }
+}
+static int __Pyx_BufFmt_ParseNumber(const char** ts) {
+ int count;
+ const char* t = *ts;
+ if (*t < '0' || *t > '9') {
+ return -1;
+ } else {
+ count = *t++ - '0';
+ while (*t >= '0' && *t < '9') {
+ count *= 10;
+ count += *t++ - '0';
+ }
+ }
+ *ts = t;
+ return count;
+}
+static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
+ int number = __Pyx_BufFmt_ParseNumber(ts);
+ if (number == -1)
+ PyErr_Format(PyExc_ValueError,\
+ "Does not understand character buffer dtype format string ('%c')", **ts);
+ return number;
+}
+static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
+ PyErr_Format(PyExc_ValueError,
+ "Unexpected format string character: '%c'", ch);
+}
+static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': return "'char'";
+ case 'b': return "'signed char'";
+ case 'B': return "'unsigned char'";
+ case 'h': return "'short'";
+ case 'H': return "'unsigned short'";
+ case 'i': return "'int'";
+ case 'I': return "'unsigned int'";
+ case 'l': return "'long'";
+ case 'L': return "'unsigned long'";
+ case 'q': return "'long long'";
+ case 'Q': return "'unsigned long long'";
+ case 'f': return (is_complex ? "'complex float'" : "'float'");
+ case 'd': return (is_complex ? "'complex double'" : "'double'");
+ case 'g': return (is_complex ? "'complex long double'" : "'long double'");
+ case 'T': return "a struct";
+ case 'O': return "Python object";
+ case 'P': return "a pointer";
+ case 's': case 'p': return "a string";
+ case 0: return "end";
+ default: return "unparseable format string";
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return 2;
+ case 'i': case 'I': case 'l': case 'L': return 4;
+ case 'q': case 'Q': return 8;
+ case 'f': return (is_complex ? 8 : 4);
+ case 'd': return (is_complex ? 16 : 8);
+ case 'g': {
+ PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
+ return 0;
+ }
+ case 'O': case 'P': return sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
+ switch (ch) {
+ case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(short);
+ case 'i': case 'I': return sizeof(int);
+ case 'l': case 'L': return sizeof(long);
+ #ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(PY_LONG_LONG);
+ #endif
+ case 'f': return sizeof(float) * (is_complex ? 2 : 1);
+ case 'd': return sizeof(double) * (is_complex ? 2 : 1);
+ case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
+ case 'O': case 'P': return sizeof(void*);
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+typedef struct { char c; short x; } __Pyx_st_short;
+typedef struct { char c; int x; } __Pyx_st_int;
+typedef struct { char c; long x; } __Pyx_st_long;
+typedef struct { char c; float x; } __Pyx_st_float;
+typedef struct { char c; double x; } __Pyx_st_double;
+typedef struct { char c; long double x; } __Pyx_st_longdouble;
+typedef struct { char c; void *x; } __Pyx_st_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+/* These are for computing the padding at the end of the struct to align
+ on the first member of the struct. This will probably the same as above,
+ but we don't have any guarantees.
+ */
+typedef struct { short x; char c; } __Pyx_pad_short;
+typedef struct { int x; char c; } __Pyx_pad_int;
+typedef struct { long x; char c; } __Pyx_pad_long;
+typedef struct { float x; char c; } __Pyx_pad_float;
+typedef struct { double x; char c; } __Pyx_pad_double;
+typedef struct { long double x; char c; } __Pyx_pad_longdouble;
+typedef struct { void *x; char c; } __Pyx_pad_void_p;
+#ifdef HAVE_LONG_LONG
+typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
+#endif
+static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
+ switch (ch) {
+ case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
+ case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
+ case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
+ case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
+#ifdef HAVE_LONG_LONG
+ case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
+#endif
+ case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
+ case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
+ case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
+ case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
+ default:
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+}
+static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
+ switch (ch) {
+ case 'c':
+ return 'H';
+ case 'b': case 'h': case 'i':
+ case 'l': case 'q': case 's': case 'p':
+ return 'I';
+ case 'B': case 'H': case 'I': case 'L': case 'Q':
+ return 'U';
+ case 'f': case 'd': case 'g':
+ return (is_complex ? 'C' : 'R');
+ case 'O':
+ return 'O';
+ case 'P':
+ return 'P';
+ default: {
+ __Pyx_BufFmt_RaiseUnexpectedChar(ch);
+ return 0;
+ }
+ }
+}
+static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
+ if (ctx->head == NULL || ctx->head->field == &ctx->root) {
+ const char* expected;
+ const char* quote;
+ if (ctx->head == NULL) {
+ expected = "end";
+ quote = "";
+ } else {
+ expected = ctx->head->field->type->name;
+ quote = "'";
+ }
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected %s%s%s but got %s",
+ quote, expected, quote,
+ __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
+ } else {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_StructField* parent = (ctx->head - 1)->field;
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
+ field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
+ parent->type->name, field->name);
+ }
+}
+static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
+ char group;
+ size_t size, offset, arraysize = 1;
+ if (ctx->enc_type == 0) return 0;
+ if (ctx->head->field->type->arraysize[0]) {
+ int i, ndim = 0;
+ if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
+ ctx->is_valid_array = ctx->head->field->type->ndim == 1;
+ ndim = 1;
+ if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
+ PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %zu",
+ ctx->head->field->type->arraysize[0], ctx->enc_count);
+ return -1;
+ }
+ }
+ if (!ctx->is_valid_array) {
+ PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
+ ctx->head->field->type->ndim, ndim);
+ return -1;
+ }
+ for (i = 0; i < ctx->head->field->type->ndim; i++) {
+ arraysize *= ctx->head->field->type->arraysize[i];
+ }
+ ctx->is_valid_array = 0;
+ ctx->enc_count = 1;
+ }
+ group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
+ do {
+ __Pyx_StructField* field = ctx->head->field;
+ __Pyx_TypeInfo* type = field->type;
+ if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
+ size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
+ } else {
+ size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
+ }
+ if (ctx->enc_packmode == '@') {
+ size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
+ size_t align_mod_offset;
+ if (align_at == 0) return -1;
+ align_mod_offset = ctx->fmt_offset % align_at;
+ if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
+ if (ctx->struct_alignment == 0)
+ ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
+ ctx->is_complex);
+ }
+ if (type->size != size || type->typegroup != group) {
+ if (type->typegroup == 'C' && type->fields != NULL) {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ ++ctx->head;
+ ctx->head->field = type->fields;
+ ctx->head->parent_offset = parent_offset;
+ continue;
+ }
+ if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
+ } else {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ }
+ offset = ctx->head->parent_offset + field->offset;
+ if (ctx->fmt_offset != offset) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
+ (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
+ return -1;
+ }
+ ctx->fmt_offset += size;
+ if (arraysize)
+ ctx->fmt_offset += (arraysize - 1) * size;
+ --ctx->enc_count;
+ while (1) {
+ if (field == &ctx->root) {
+ ctx->head = NULL;
+ if (ctx->enc_count != 0) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return -1;
+ }
+ break;
+ }
+ ctx->head->field = ++field;
+ if (field->type == NULL) {
+ --ctx->head;
+ field = ctx->head->field;
+ continue;
+ } else if (field->type->typegroup == 'S') {
+ size_t parent_offset = ctx->head->parent_offset + field->offset;
+ if (field->type->fields->type == NULL) continue;
+ field = field->type->fields;
+ ++ctx->head;
+ ctx->head->field = field;
+ ctx->head->parent_offset = parent_offset;
+ break;
+ } else {
+ break;
+ }
+ }
+ } while (ctx->enc_count);
+ ctx->enc_type = 0;
+ ctx->is_complex = 0;
+ return 0;
+}
+static PyObject *
+__pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
+{
+ const char *ts = *tsp;
+ int i = 0, number;
+ int ndim = ctx->head->field->type->ndim;
+;
+ ++ts;
+ if (ctx->new_count != 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Cannot handle repeated arrays in format string");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ while (*ts && *ts != ')') {
+ switch (*ts) {
+ case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
+ default: break;
+ }
+ number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a dimension of size %zu, got %d",
+ ctx->head->field->type->arraysize[i], number);
+ if (*ts != ',' && *ts != ')')
+ return PyErr_Format(PyExc_ValueError,
+ "Expected a comma in format string, got '%c'", *ts);
+ if (*ts == ',') ts++;
+ i++;
+ }
+ if (i != ndim)
+ return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
+ ctx->head->field->type->ndim, i);
+ if (!*ts) {
+ PyErr_SetString(PyExc_ValueError,
+ "Unexpected end of format string, expected ')'");
+ return NULL;
+ }
+ ctx->is_valid_array = 1;
+ ctx->new_count = 1;
+ *tsp = ++ts;
+ return Py_None;
+}
+static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
+ int got_Z = 0;
+ while (1) {
+ switch(*ts) {
+ case 0:
+ if (ctx->enc_type != 0 && ctx->head == NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ if (ctx->head != NULL) {
+ __Pyx_BufFmt_RaiseExpected(ctx);
+ return NULL;
+ }
+ return ts;
+ case ' ':
+ case '\r':
+ case '\n':
+ ++ts;
+ break;
+ case '<':
+ if (!__Pyx_Is_Little_Endian()) {
+ PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '>':
+ case '!':
+ if (__Pyx_Is_Little_Endian()) {
+ PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
+ return NULL;
+ }
+ ctx->new_packmode = '=';
+ ++ts;
+ break;
+ case '=':
+ case '@':
+ case '^':
+ ctx->new_packmode = *ts++;
+ break;
+ case 'T':
+ {
+ const char* ts_after_sub;
+ size_t i, struct_count = ctx->new_count;
+ size_t struct_alignment = ctx->struct_alignment;
+ ctx->new_count = 1;
+ ++ts;
+ if (*ts != '{') {
+ PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
+ return NULL;
+ }
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ ctx->enc_count = 0;
+ ctx->struct_alignment = 0;
+ ++ts;
+ ts_after_sub = ts;
+ for (i = 0; i != struct_count; ++i) {
+ ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
+ if (!ts_after_sub) return NULL;
+ }
+ ts = ts_after_sub;
+ if (struct_alignment) ctx->struct_alignment = struct_alignment;
+ }
+ break;
+ case '}':
+ {
+ size_t alignment = ctx->struct_alignment;
+ ++ts;
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_type = 0;
+ if (alignment && ctx->fmt_offset % alignment) {
+ ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
+ }
+ }
+ return ts;
+ case 'x':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->fmt_offset += ctx->new_count;
+ ctx->new_count = 1;
+ ctx->enc_count = 0;
+ ctx->enc_type = 0;
+ ctx->enc_packmode = ctx->new_packmode;
+ ++ts;
+ break;
+ case 'Z':
+ got_Z = 1;
+ ++ts;
+ if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
+ __Pyx_BufFmt_RaiseUnexpectedChar('Z');
+ return NULL;
+ }
+ CYTHON_FALLTHROUGH;
+ case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
+ case 'l': case 'L': case 'q': case 'Q':
+ case 'f': case 'd': case 'g':
+ case 'O': case 'p':
+ if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
+ ctx->enc_packmode == ctx->new_packmode) {
+ ctx->enc_count += ctx->new_count;
+ ctx->new_count = 1;
+ got_Z = 0;
+ ++ts;
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ case 's':
+ if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
+ ctx->enc_count = ctx->new_count;
+ ctx->enc_packmode = ctx->new_packmode;
+ ctx->enc_type = *ts;
+ ctx->is_complex = got_Z;
+ ++ts;
+ ctx->new_count = 1;
+ got_Z = 0;
+ break;
+ case ':':
+ ++ts;
+ while(*ts != ':') ++ts;
+ ++ts;
+ break;
+ case '(':
+ if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
+ break;
+ default:
+ {
+ int number = __Pyx_BufFmt_ExpectNumber(&ts);
+ if (number == -1) return NULL;
+ ctx->new_count = (size_t)number;
+ }
+ }
+ }
+}
+
+/* BufferGetAndValidate */
+ static CYTHON_INLINE void __Pyx_SafeReleaseBuffer(Py_buffer* info) {
+ if (unlikely(info->buf == NULL)) return;
+ if (info->suboffsets == __Pyx_minusones) info->suboffsets = NULL;
+ __Pyx_ReleaseBuffer(info);
+}
+static void __Pyx_ZeroBuffer(Py_buffer* buf) {
+ buf->buf = NULL;
+ buf->obj = NULL;
+ buf->strides = __Pyx_zeros;
+ buf->shape = __Pyx_zeros;
+ buf->suboffsets = __Pyx_minusones;
+}
+static int __Pyx__GetBufferAndValidate(
+ Py_buffer* buf, PyObject* obj, __Pyx_TypeInfo* dtype, int flags,
+ int nd, int cast, __Pyx_BufFmt_StackElem* stack)
+{
+ buf->buf = NULL;
+ if (unlikely(__Pyx_GetBuffer(obj, buf, flags) == -1)) {
+ __Pyx_ZeroBuffer(buf);
+ return -1;
+ }
+ if (unlikely(buf->ndim != nd)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ nd, buf->ndim);
+ goto fail;
+ }
+ if (!cast) {
+ __Pyx_BufFmt_Context ctx;
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if (unlikely((unsigned)buf->itemsize != dtype->size)) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "d byte%s) does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "d byte%s)",
+ buf->itemsize, (buf->itemsize > 1) ? "s" : "",
+ dtype->name, (Py_ssize_t)dtype->size, (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ if (buf->suboffsets == NULL) buf->suboffsets = __Pyx_minusones;
+ return 0;
+fail:;
+ __Pyx_SafeReleaseBuffer(buf);
+ return -1;
+}
+
+/* SetItemInt */
+ static int __Pyx_SetItemInt_Generic(PyObject *o, PyObject *j, PyObject *v) {
+ int r;
+ if (!j) return -1;
+ r = PyObject_SetItem(o, j, v);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE int __Pyx_SetItemInt_Fast(PyObject *o, Py_ssize_t i, PyObject *v, int is_list,
+ CYTHON_NCP_UNUSED int wraparound, CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = (!wraparound) ? i : ((likely(i >= 0)) ? i : i + PyList_GET_SIZE(o));
+ if ((!boundscheck) || likely((n >= 0) & (n < PyList_GET_SIZE(o)))) {
+ PyObject* old = PyList_GET_ITEM(o, n);
+ Py_INCREF(v);
+ PyList_SET_ITEM(o, n, v);
+ Py_DECREF(old);
+ return 1;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_ass_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return -1;
+ PyErr_Clear();
+ }
+ }
+ return m->sq_ass_item(o, i, v);
+ }
+ }
+#else
+#if CYTHON_COMPILING_IN_PYPY
+ if (is_list || (PySequence_Check(o) && !PyDict_Check(o))) {
+#else
+ if (is_list || PySequence_Check(o)) {
+#endif
+ return PySequence_SetItem(o, i, v);
+ }
+#endif
+ return __Pyx_SetItemInt_Generic(o, PyInt_FromSsize_t(i), v);
+}
+
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a + b);
+ if (likely((x^a) >= 0 || (x^b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
+ }
+ }
+ x = a + b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla + llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("add", return NULL)
+ result = ((double)a) + (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
+}
+#endif
+
+/* GetItemInt */
+ static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
+ PyObject *r;
+ if (!j) return NULL;
+ r = PyObject_GetItem(o, j);
+ Py_DECREF(j);
+ return r;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyList_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
+ PyObject *r = PyList_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
+ Py_ssize_t wrapped_i = i;
+ if (wraparound & unlikely(i < 0)) {
+ wrapped_i += PyTuple_GET_SIZE(o);
+ }
+ if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
+ Py_INCREF(r);
+ return r;
+ }
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+#else
+ return PySequence_GetItem(o, i);
+#endif
+}
+static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
+ CYTHON_NCP_UNUSED int wraparound,
+ CYTHON_NCP_UNUSED int boundscheck) {
+#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
+ if (is_list || PyList_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
+ if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
+ PyObject *r = PyList_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ }
+ else if (PyTuple_CheckExact(o)) {
+ Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
+ if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
+ PyObject *r = PyTuple_GET_ITEM(o, n);
+ Py_INCREF(r);
+ return r;
+ }
+ } else {
+ PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
+ if (likely(m && m->sq_item)) {
+ if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
+ Py_ssize_t l = m->sq_length(o);
+ if (likely(l >= 0)) {
+ i += l;
+ } else {
+ if (!PyErr_ExceptionMatches(PyExc_OverflowError))
+ return NULL;
+ PyErr_Clear();
+ }
+ }
+ return m->sq_item(o, i);
+ }
+ }
+#else
+ if (is_list || PySequence_Check(o)) {
+ return PySequence_GetItem(o, i);
+ }
+#endif
+ return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
+}
+
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long x;
+ long a = PyInt_AS_LONG(op1);
+ x = (long)((unsigned long)a - b);
+ if (likely((x^a) >= 0 || (x^~b) >= 0))
+ return PyInt_FromLong(x);
+ return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a, x;
+#ifdef HAVE_LONG_LONG
+ const PY_LONG_LONG llb = intval;
+ PY_LONG_LONG lla, llx;
+#endif
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
+ lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+#ifdef HAVE_LONG_LONG
+ } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
+ 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]));
+ goto long_long;
+#endif
+ }
+ CYTHON_FALLTHROUGH;
+ default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
+ }
+ }
+ x = a - b;
+ return PyLong_FromLong(x);
+#ifdef HAVE_LONG_LONG
+ long_long:
+ llx = lla - llb;
+ return PyLong_FromLongLong(llx);
+#endif
+
+
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ double result;
+ PyFPE_START_PROTECT("subtract", return NULL)
+ result = ((double)a) - (double)b;
+ PyFPE_END_PROTECT(result)
+ return PyFloat_FromDouble(result);
+ }
+ return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
+}
+#endif
+
+/* ObjectGetItem */
+ #if CYTHON_USE_TYPE_SLOTS
+static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
+ PyObject *runerr;
+ Py_ssize_t key_value;
+ PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
+ if (unlikely(!(m && m->sq_item))) {
+ PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
+ return NULL;
+ }
+ key_value = __Pyx_PyIndex_AsSsize_t(index);
+ if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
+ return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
+ }
+ if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
+ PyErr_Clear();
+ PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
+ }
+ return NULL;
+}
+static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
+ PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
+ if (likely(m && m->mp_subscript)) {
+ return m->mp_subscript(obj, key);
+ }
+ return __Pyx_PyObject_GetIndex(obj, key);
+}
+#endif
+
+/* PyIntBinop */
+ #if !CYTHON_COMPILING_IN_PYPY
+static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
+ if (op1 == op2) {
+ Py_RETURN_TRUE;
+ }
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(op1))) {
+ const long b = intval;
+ long a = PyInt_AS_LONG(op1);
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ #if CYTHON_USE_PYLONG_INTERNALS
+ if (likely(PyLong_CheckExact(op1))) {
+ const long b = intval;
+ long a;
+ const digit* digits = ((PyLongObject*)op1)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(op1);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ a = likely(size) ? digits[0] : 0;
+ if (size == -1) a = -a;
+ } else {
+ switch (size) {
+ case -2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ case 2:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ case -3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ case 3:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ case -4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ case 4:
+ if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
+ break;
+ }
+ CYTHON_FALLTHROUGH;
+ #if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
+ default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
+ #else
+ default: Py_RETURN_FALSE;
+ #endif
+ }
+ }
+ if (a == b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ #endif
+ if (PyFloat_CheckExact(op1)) {
+ const long b = intval;
+ double a = PyFloat_AS_DOUBLE(op1);
+ if ((double)a == (double)b) {
+ Py_RETURN_TRUE;
+ } else {
+ Py_RETURN_FALSE;
+ }
+ }
+ return PyObject_RichCompare(op1, op2, Py_EQ);
+}
+#endif
+
+/* PyErrFetchRestore */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ tmp_type = tstate->curexc_type;
+ tmp_value = tstate->curexc_value;
+ tmp_tb = tstate->curexc_traceback;
+ tstate->curexc_type = type;
+ tstate->curexc_value = value;
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ *type = tstate->curexc_type;
+ *value = tstate->curexc_value;
+ *tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+}
+#endif
+
+/* RaiseException */
+ #if PY_MAJOR_VERSION < 3
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
+ CYTHON_UNUSED PyObject *cause) {
+ __Pyx_PyThreadState_declare
+ Py_XINCREF(type);
+ if (!value || value == Py_None)
+ value = NULL;
+ else
+ Py_INCREF(value);
+ if (!tb || tb == Py_None)
+ tb = NULL;
+ else {
+ Py_INCREF(tb);
+ if (!PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto raise_error;
+ }
+ }
+ if (PyType_Check(type)) {
+#if CYTHON_COMPILING_IN_PYPY
+ if (!value) {
+ Py_INCREF(Py_None);
+ value = Py_None;
+ }
+#endif
+ PyErr_NormalizeException(&type, &value, &tb);
+ } else {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto raise_error;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(type);
+ Py_INCREF(type);
+ if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto raise_error;
+ }
+ }
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrRestore(type, value, tb);
+ return;
+raise_error:
+ Py_XDECREF(value);
+ Py_XDECREF(type);
+ Py_XDECREF(tb);
+ return;
+}
+#else
+static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
+ PyObject* owned_instance = NULL;
+ if (tb == Py_None) {
+ tb = 0;
+ } else if (tb && !PyTraceBack_Check(tb)) {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: arg 3 must be a traceback or None");
+ goto bad;
+ }
+ if (value == Py_None)
+ value = 0;
+ if (PyExceptionInstance_Check(type)) {
+ if (value) {
+ PyErr_SetString(PyExc_TypeError,
+ "instance exception may not have a separate value");
+ goto bad;
+ }
+ value = type;
+ type = (PyObject*) Py_TYPE(value);
+ } else if (PyExceptionClass_Check(type)) {
+ PyObject *instance_class = NULL;
+ if (value && PyExceptionInstance_Check(value)) {
+ instance_class = (PyObject*) Py_TYPE(value);
+ if (instance_class != type) {
+ int is_subclass = PyObject_IsSubclass(instance_class, type);
+ if (!is_subclass) {
+ instance_class = NULL;
+ } else if (unlikely(is_subclass == -1)) {
+ goto bad;
+ } else {
+ type = instance_class;
+ }
+ }
+ }
+ if (!instance_class) {
+ PyObject *args;
+ if (!value)
+ args = PyTuple_New(0);
+ else if (PyTuple_Check(value)) {
+ Py_INCREF(value);
+ args = value;
+ } else
+ args = PyTuple_Pack(1, value);
+ if (!args)
+ goto bad;
+ owned_instance = PyObject_Call(type, args, NULL);
+ Py_DECREF(args);
+ if (!owned_instance)
+ goto bad;
+ value = owned_instance;
+ if (!PyExceptionInstance_Check(value)) {
+ PyErr_Format(PyExc_TypeError,
+ "calling %R should have returned an instance of "
+ "BaseException, not %R",
+ type, Py_TYPE(value));
+ goto bad;
+ }
+ }
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "raise: exception class must be a subclass of BaseException");
+ goto bad;
+ }
+ if (cause) {
+ PyObject *fixed_cause;
+ if (cause == Py_None) {
+ fixed_cause = NULL;
+ } else if (PyExceptionClass_Check(cause)) {
+ fixed_cause = PyObject_CallObject(cause, NULL);
+ if (fixed_cause == NULL)
+ goto bad;
+ } else if (PyExceptionInstance_Check(cause)) {
+ fixed_cause = cause;
+ Py_INCREF(fixed_cause);
+ } else {
+ PyErr_SetString(PyExc_TypeError,
+ "exception causes must derive from "
+ "BaseException");
+ goto bad;
+ }
+ PyException_SetCause(value, fixed_cause);
+ }
+ PyErr_SetObject(type, value);
+ if (tb) {
+#if CYTHON_COMPILING_IN_PYPY
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
+ Py_INCREF(tb);
+ PyErr_Restore(tmp_type, tmp_value, tb);
+ Py_XDECREF(tmp_tb);
+#else
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ PyObject* tmp_tb = tstate->curexc_traceback;
+ if (tb != tmp_tb) {
+ Py_INCREF(tb);
+ tstate->curexc_traceback = tb;
+ Py_XDECREF(tmp_tb);
+ }
+#endif
+ }
+bad:
+ Py_XDECREF(owned_instance);
+ return;
+}
+#endif
+
+/* DictGetItem */
+ #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
+static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
+ PyObject *value;
+ value = PyDict_GetItemWithError(d, key);
+ if (unlikely(!value)) {
+ if (!PyErr_Occurred()) {
+ PyObject* args = PyTuple_Pack(1, key);
+ if (likely(args))
+ PyErr_SetObject(PyExc_KeyError, args);
+ Py_XDECREF(args);
+ }
+ return NULL;
+ }
+ Py_INCREF(value);
+ return value;
+}
+#endif
+
+/* RaiseTooManyValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
+ PyErr_Format(PyExc_ValueError,
+ "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
+}
+
+/* RaiseNeedMoreValuesToUnpack */
+ static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
+ PyErr_Format(PyExc_ValueError,
+ "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
+ index, (index == 1) ? "" : "s");
+}
+
+/* RaiseNoneIterError */
+ static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
+ PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
+}
+
+/* SaveResetException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ #if PY_VERSION_HEX >= 0x030700A2
+ *type = tstate->exc_state.exc_type;
+ *value = tstate->exc_state.exc_value;
+ *tb = tstate->exc_state.exc_traceback;
+ #else
+ *type = tstate->exc_type;
+ *value = tstate->exc_value;
+ *tb = tstate->exc_traceback;
+ #endif
+ Py_XINCREF(*type);
+ Py_XINCREF(*value);
+ Py_XINCREF(*tb);
+}
+static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if PY_VERSION_HEX >= 0x030700A2
+ tmp_type = tstate->exc_state.exc_type;
+ tmp_value = tstate->exc_state.exc_value;
+ tmp_tb = tstate->exc_state.exc_traceback;
+ tstate->exc_state.exc_type = type;
+ tstate->exc_state.exc_value = value;
+ tstate->exc_state.exc_traceback = tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = type;
+ tstate->exc_value = value;
+ tstate->exc_traceback = tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+}
+#endif
+
+/* PyErrExceptionMatches */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(tuple);
+#if PY_MAJOR_VERSION >= 3
+ for (i=0; i<n; i++) {
+ if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
+ }
+#endif
+ for (i=0; i<n; i++) {
+ if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
+ }
+ return 0;
+}
+static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
+ PyObject *exc_type = tstate->curexc_type;
+ if (exc_type == err) return 1;
+ if (unlikely(!exc_type)) return 0;
+ if (unlikely(PyTuple_Check(err)))
+ return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
+ return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
+}
+#endif
+
+/* GetException */
+ #if CYTHON_FAST_THREAD_STATE
+static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+#else
+static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
+#endif
+ PyObject *local_type, *local_value, *local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ local_type = tstate->curexc_type;
+ local_value = tstate->curexc_value;
+ local_tb = tstate->curexc_traceback;
+ tstate->curexc_type = 0;
+ tstate->curexc_value = 0;
+ tstate->curexc_traceback = 0;
+#else
+ PyErr_Fetch(&local_type, &local_value, &local_tb);
+#endif
+ PyErr_NormalizeException(&local_type, &local_value, &local_tb);
+#if CYTHON_FAST_THREAD_STATE
+ if (unlikely(tstate->curexc_type))
+#else
+ if (unlikely(PyErr_Occurred()))
+#endif
+ goto bad;
+ #if PY_MAJOR_VERSION >= 3
+ if (local_tb) {
+ if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
+ goto bad;
+ }
+ #endif
+ Py_XINCREF(local_tb);
+ Py_XINCREF(local_type);
+ Py_XINCREF(local_value);
+ *type = local_type;
+ *value = local_value;
+ *tb = local_tb;
+#if CYTHON_FAST_THREAD_STATE
+ #if PY_VERSION_HEX >= 0x030700A2
+ tmp_type = tstate->exc_state.exc_type;
+ tmp_value = tstate->exc_state.exc_value;
+ tmp_tb = tstate->exc_state.exc_traceback;
+ tstate->exc_state.exc_type = local_type;
+ tstate->exc_state.exc_value = local_value;
+ tstate->exc_state.exc_traceback = local_tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = local_type;
+ tstate->exc_value = local_value;
+ tstate->exc_traceback = local_tb;
+ #endif
+ Py_XDECREF(tmp_type);
+ Py_XDECREF(tmp_value);
+ Py_XDECREF(tmp_tb);
+#else
+ PyErr_SetExcInfo(local_type, local_value, local_tb);
+#endif
+ return 0;
+bad:
+ *type = 0;
+ *value = 0;
+ *tb = 0;
+ Py_XDECREF(local_type);
+ Py_XDECREF(local_value);
+ Py_XDECREF(local_tb);
+ return -1;
+}
+
+/* ArgTypeTest */
+ static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
+{
+ if (unlikely(!type)) {
+ PyErr_SetString(PyExc_SystemError, "Missing type object");
+ return 0;
+ }
+ else if (exact) {
+ #if PY_MAJOR_VERSION == 2
+ if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
+ #endif
+ }
+ else {
+ if (likely(__Pyx_TypeCheck(obj, type))) return 1;
+ }
+ PyErr_Format(PyExc_TypeError,
+ "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
+ name, type->tp_name, Py_TYPE(obj)->tp_name);
+ return 0;
+}
+
+/* BytesEquals */
+ static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+ if (s1 == s2) {
+ return (equals == Py_EQ);
+ } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
+ const char *ps1, *ps2;
+ Py_ssize_t length = PyBytes_GET_SIZE(s1);
+ if (length != PyBytes_GET_SIZE(s2))
+ return (equals == Py_NE);
+ ps1 = PyBytes_AS_STRING(s1);
+ ps2 = PyBytes_AS_STRING(s2);
+ if (ps1[0] != ps2[0]) {
+ return (equals == Py_NE);
+ } else if (length == 1) {
+ return (equals == Py_EQ);
+ } else {
+ int result;
+#if CYTHON_USE_UNICODE_INTERNALS
+ Py_hash_t hash1, hash2;
+ hash1 = ((PyBytesObject*)s1)->ob_shash;
+ hash2 = ((PyBytesObject*)s2)->ob_shash;
+ if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
+ return (equals == Py_NE);
+ }
+#endif
+ result = memcmp(ps1, ps2, (size_t)length);
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
+ return (equals == Py_NE);
+ } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
+ return (equals == Py_NE);
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+#endif
+}
+
+/* UnicodeEquals */
+ static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
+#if CYTHON_COMPILING_IN_PYPY
+ return PyObject_RichCompareBool(s1, s2, equals);
+#else
+#if PY_MAJOR_VERSION < 3
+ PyObject* owned_ref = NULL;
+#endif
+ int s1_is_unicode, s2_is_unicode;
+ if (s1 == s2) {
+ goto return_eq;
+ }
+ s1_is_unicode = PyUnicode_CheckExact(s1);
+ s2_is_unicode = PyUnicode_CheckExact(s2);
+#if PY_MAJOR_VERSION < 3
+ if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
+ owned_ref = PyUnicode_FromObject(s2);
+ if (unlikely(!owned_ref))
+ return -1;
+ s2 = owned_ref;
+ s2_is_unicode = 1;
+ } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
+ owned_ref = PyUnicode_FromObject(s1);
+ if (unlikely(!owned_ref))
+ return -1;
+ s1 = owned_ref;
+ s1_is_unicode = 1;
+ } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
+ return __Pyx_PyBytes_Equals(s1, s2, equals);
+ }
+#endif
+ if (s1_is_unicode & s2_is_unicode) {
+ Py_ssize_t length;
+ int kind;
+ void *data1, *data2;
+ if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
+ return -1;
+ length = __Pyx_PyUnicode_GET_LENGTH(s1);
+ if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
+ goto return_ne;
+ }
+#if CYTHON_USE_UNICODE_INTERNALS
+ {
+ Py_hash_t hash1, hash2;
+ #if CYTHON_PEP393_ENABLED
+ hash1 = ((PyASCIIObject*)s1)->hash;
+ hash2 = ((PyASCIIObject*)s2)->hash;
+ #else
+ hash1 = ((PyUnicodeObject*)s1)->hash;
+ hash2 = ((PyUnicodeObject*)s2)->hash;
+ #endif
+ if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
+ goto return_ne;
+ }
+ }
+#endif
+ kind = __Pyx_PyUnicode_KIND(s1);
+ if (kind != __Pyx_PyUnicode_KIND(s2)) {
+ goto return_ne;
+ }
+ data1 = __Pyx_PyUnicode_DATA(s1);
+ data2 = __Pyx_PyUnicode_DATA(s2);
+ if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
+ goto return_ne;
+ } else if (length == 1) {
+ goto return_eq;
+ } else {
+ int result = memcmp(data1, data2, (size_t)(length * kind));
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ) ? (result == 0) : (result != 0);
+ }
+ } else if ((s1 == Py_None) & s2_is_unicode) {
+ goto return_ne;
+ } else if ((s2 == Py_None) & s1_is_unicode) {
+ goto return_ne;
+ } else {
+ int result;
+ PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
+ if (!py_result)
+ return -1;
+ result = __Pyx_PyObject_IsTrue(py_result);
+ Py_DECREF(py_result);
+ return result;
+ }
+return_eq:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_EQ);
+return_ne:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(owned_ref);
+ #endif
+ return (equals == Py_NE);
+#endif
+}
+
+/* None */
+ static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
+ Py_ssize_t q = a / b;
+ Py_ssize_t r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+/* decode_c_string */
+ static CYTHON_INLINE PyObject* __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)) {
+ Py_ssize_t length;
+ if (unlikely((start < 0) | (stop < 0))) {
+ size_t slen = strlen(cstring);
+ if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
+ PyErr_SetString(PyExc_OverflowError,
+ "c-string too long to convert to Python");
+ return NULL;
+ }
+ length = (Py_ssize_t) slen;
+ if (start < 0) {
+ start += length;
+ if (start < 0)
+ start = 0;
+ }
+ if (stop < 0)
+ stop += length;
+ }
+ length = stop - start;
+ if (unlikely(length <= 0))
+ return PyUnicode_FromUnicode(NULL, 0);
+ cstring += start;
+ if (decode_func) {
+ return decode_func(cstring, length, errors);
+ } else {
+ return PyUnicode_Decode(cstring, length, encoding, errors);
+ }
+}
+
+/* GetAttr3 */
+ static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
+ return NULL;
+ __Pyx_PyErr_Clear();
+ Py_INCREF(d);
+ return d;
+}
+static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
+ PyObject *r = __Pyx_GetAttr(o, n);
+ return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
+}
+
+/* SwapException */
+ #if CYTHON_FAST_THREAD_STATE
+static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ #if PY_VERSION_HEX >= 0x030700A2
+ tmp_type = tstate->exc_state.exc_type;
+ tmp_value = tstate->exc_state.exc_value;
+ tmp_tb = tstate->exc_state.exc_traceback;
+ tstate->exc_state.exc_type = *type;
+ tstate->exc_state.exc_value = *value;
+ tstate->exc_state.exc_traceback = *tb;
+ #else
+ tmp_type = tstate->exc_type;
+ tmp_value = tstate->exc_value;
+ tmp_tb = tstate->exc_traceback;
+ tstate->exc_type = *type;
+ tstate->exc_value = *value;
+ tstate->exc_traceback = *tb;
+ #endif
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#else
+static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
+ PyObject *tmp_type, *tmp_value, *tmp_tb;
+ PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
+ PyErr_SetExcInfo(*type, *value, *tb);
+ *type = tmp_type;
+ *value = tmp_value;
+ *tb = tmp_tb;
+}
+#endif
+
+/* Import */
+ static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
+ PyObject *empty_list = 0;
+ PyObject *module = 0;
+ PyObject *global_dict = 0;
+ PyObject *empty_dict = 0;
+ PyObject *list;
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_import;
+ py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
+ if (!py_import)
+ goto bad;
+ #endif
+ if (from_list)
+ list = from_list;
+ else {
+ empty_list = PyList_New(0);
+ if (!empty_list)
+ goto bad;
+ list = empty_list;
+ }
+ global_dict = PyModule_GetDict(__pyx_m);
+ if (!global_dict)
+ goto bad;
+ empty_dict = PyDict_New();
+ if (!empty_dict)
+ goto bad;
+ {
+ #if PY_MAJOR_VERSION >= 3
+ if (level == -1) {
+ if (strchr(__Pyx_MODULE_NAME, '.')) {
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, 1);
+ if (!module) {
+ if (!PyErr_ExceptionMatches(PyExc_ImportError))
+ goto bad;
+ PyErr_Clear();
+ }
+ }
+ level = 0;
+ }
+ #endif
+ if (!module) {
+ #if PY_MAJOR_VERSION < 3
+ PyObject *py_level = PyInt_FromLong(level);
+ if (!py_level)
+ goto bad;
+ module = PyObject_CallFunctionObjArgs(py_import,
+ name, global_dict, empty_dict, list, py_level, NULL);
+ Py_DECREF(py_level);
+ #else
+ module = PyImport_ImportModuleLevelObject(
+ name, global_dict, empty_dict, list, level);
+ #endif
+ }
+ }
+bad:
+ #if PY_MAJOR_VERSION < 3
+ Py_XDECREF(py_import);
+ #endif
+ Py_XDECREF(empty_list);
+ Py_XDECREF(empty_dict);
+ return module;
+}
+
+/* FastTypeChecks */
+ #if CYTHON_COMPILING_IN_CPYTHON
+static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
+ while (a) {
+ a = a->tp_base;
+ if (a == b)
+ return 1;
+ }
+ return b == &PyBaseObject_Type;
+}
+static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
+ PyObject *mro;
+ if (a == b) return 1;
+ mro = a->tp_mro;
+ if (likely(mro)) {
+ Py_ssize_t i, n;
+ n = PyTuple_GET_SIZE(mro);
+ for (i = 0; i < n; i++) {
+ if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
+ return 1;
+ }
+ return 0;
+ }
+ return __Pyx_InBases(a, b);
+}
+#if PY_MAJOR_VERSION == 2
+static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
+ PyObject *exception, *value, *tb;
+ int res;
+ __Pyx_PyThreadState_declare
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&exception, &value, &tb);
+ res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ if (!res) {
+ res = PyObject_IsSubclass(err, exc_type2);
+ if (unlikely(res == -1)) {
+ PyErr_WriteUnraisable(err);
+ res = 0;
+ }
+ }
+ __Pyx_ErrRestore(exception, value, tb);
+ return res;
+}
+#else
+static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
+ int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
+ if (!res) {
+ res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
+ }
+ return res;
+}
+#endif
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
+ if (likely(err == exc_type)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
+ }
+ return PyErr_GivenExceptionMatches(err, exc_type);
+}
+static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
+ if (likely(err == exc_type1 || err == exc_type2)) return 1;
+ if (likely(PyExceptionClass_Check(err))) {
+ return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
+ }
+ return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
+}
+#endif
+
+/* None */
+ static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
+ PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
+}
+
+/* None */
+ static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
+ long q = a / b;
+ long r = a - q*b;
+ q -= ((r != 0) & ((r ^ b) < 0));
+ return q;
+}
+
+/* WriteUnraisableException */
+ static void __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) {
+ PyObject *old_exc, *old_val, *old_tb;
+ PyObject *ctx;
+ __Pyx_PyThreadState_declare
+#ifdef WITH_THREAD
+ PyGILState_STATE state;
+ if (nogil)
+ state = PyGILState_Ensure();
+#ifdef _MSC_VER
+ else state = (PyGILState_STATE)-1;
+#endif
+#endif
+ __Pyx_PyThreadState_assign
+ __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
+ if (full_traceback) {
+ Py_XINCREF(old_exc);
+ Py_XINCREF(old_val);
+ Py_XINCREF(old_tb);
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ PyErr_PrintEx(1);
+ }
+ #if PY_MAJOR_VERSION < 3
+ ctx = PyString_FromString(name);
+ #else
+ ctx = PyUnicode_FromString(name);
+ #endif
+ __Pyx_ErrRestore(old_exc, old_val, old_tb);
+ if (!ctx) {
+ PyErr_WriteUnraisable(Py_None);
+ } else {
+ PyErr_WriteUnraisable(ctx);
+ Py_DECREF(ctx);
+ }
+#ifdef WITH_THREAD
+ if (nogil)
+ PyGILState_Release(state);
+#endif
+}
+
+/* ImportFrom */
+ static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
+ PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
+ if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
+ PyErr_Format(PyExc_ImportError,
+ #if PY_MAJOR_VERSION < 3
+ "cannot import name %.230s", PyString_AS_STRING(name));
+ #else
+ "cannot import name %S", name);
+ #endif
+ }
+ return value;
+}
+
+/* PyObject_GenericGetAttrNoDict */
+ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
+ PyErr_Format(PyExc_AttributeError,
+#if PY_MAJOR_VERSION >= 3
+ "'%.50s' object has no attribute '%U'",
+ tp->tp_name, attr_name);
+#else
+ "'%.50s' object has no attribute '%.400s'",
+ tp->tp_name, PyString_AS_STRING(attr_name));
+#endif
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
+ PyObject *descr;
+ PyTypeObject *tp = Py_TYPE(obj);
+ if (unlikely(!PyString_Check(attr_name))) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ assert(!tp->tp_dictoffset);
+ descr = _PyType_Lookup(tp, attr_name);
+ if (unlikely(!descr)) {
+ return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
+ }
+ Py_INCREF(descr);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
+ #endif
+ {
+ descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
+ if (unlikely(f)) {
+ PyObject *res = f(descr, obj, (PyObject *)tp);
+ Py_DECREF(descr);
+ return res;
+ }
+ }
+ return descr;
+}
+#endif
+
+/* PyObject_GenericGetAttr */
+ #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
+static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
+ if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
+ return PyObject_GenericGetAttr(obj, attr_name);
+ }
+ return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
+}
+#endif
+
+/* SetVTable */
+ static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
+#if PY_VERSION_HEX >= 0x02070000
+ PyObject *ob = PyCapsule_New(vtable, 0, 0);
+#else
+ PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
+#endif
+ if (!ob)
+ goto bad;
+ if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
+ goto bad;
+ Py_DECREF(ob);
+ return 0;
+bad:
+ Py_XDECREF(ob);
+ return -1;
+}
+
+/* SetupReduce */
+ static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
+ int ret;
+ PyObject *name_attr;
+ name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
+ if (likely(name_attr)) {
+ ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
+ } else {
+ ret = -1;
+ }
+ if (unlikely(ret < 0)) {
+ PyErr_Clear();
+ ret = 0;
+ }
+ Py_XDECREF(name_attr);
+ return ret;
+}
+static int __Pyx_setup_reduce(PyObject* type_obj) {
+ int ret = 0;
+ PyObject *object_reduce = NULL;
+ PyObject *object_reduce_ex = NULL;
+ PyObject *reduce = NULL;
+ PyObject *reduce_ex = NULL;
+ PyObject *reduce_cython = NULL;
+ PyObject *setstate = NULL;
+ PyObject *setstate_cython = NULL;
+#if CYTHON_USE_PYTYPE_LOOKUP
+ if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
+#else
+ if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
+#endif
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
+#else
+ object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
+#endif
+ reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
+ if (reduce_ex == object_reduce_ex) {
+#if CYTHON_USE_PYTYPE_LOOKUP
+ object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
+#else
+ object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
+#endif
+ reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
+ if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
+ reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
+ setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
+ if (!setstate) PyErr_Clear();
+ if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
+ setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
+ ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
+ ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
+ }
+ PyType_Modified((PyTypeObject*)type_obj);
+ }
+ }
+ goto GOOD;
+BAD:
+ if (!PyErr_Occurred())
+ PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
+ ret = -1;
+GOOD:
+#if !CYTHON_USE_PYTYPE_LOOKUP
+ Py_XDECREF(object_reduce);
+ Py_XDECREF(object_reduce_ex);
+#endif
+ Py_XDECREF(reduce);
+ Py_XDECREF(reduce_ex);
+ Py_XDECREF(reduce_cython);
+ Py_XDECREF(setstate);
+ Py_XDECREF(setstate_cython);
+ return ret;
+}
+
+/* CLineInTraceback */
+ #ifndef CYTHON_CLINE_IN_TRACEBACK
+static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
+ PyObject *use_cline;
+ PyObject *ptype, *pvalue, *ptraceback;
+#if CYTHON_COMPILING_IN_CPYTHON
+ PyObject **cython_runtime_dict;
+#endif
+ if (unlikely(!__pyx_cython_runtime)) {
+ return c_line;
+ }
+ __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
+#if CYTHON_COMPILING_IN_CPYTHON
+ cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
+ if (likely(cython_runtime_dict)) {
+ use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
+ } else
+#endif
+ {
+ PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
+ if (use_cline_obj) {
+ use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
+ Py_DECREF(use_cline_obj);
+ } else {
+ PyErr_Clear();
+ use_cline = NULL;
+ }
+ }
+ if (!use_cline) {
+ c_line = 0;
+ PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
+ }
+ else if (PyObject_Not(use_cline) != 0) {
+ c_line = 0;
+ }
+ __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
+ return c_line;
+}
+#endif
+
+/* CodeObjectCache */
+ static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
+ int start = 0, mid = 0, end = count - 1;
+ if (end >= 0 && code_line > entries[end].code_line) {
+ return count;
+ }
+ while (start < end) {
+ mid = start + (end - start) / 2;
+ if (code_line < entries[mid].code_line) {
+ end = mid;
+ } else if (code_line > entries[mid].code_line) {
+ start = mid + 1;
+ } else {
+ return mid;
+ }
+ }
+ if (code_line <= entries[mid].code_line) {
+ return mid;
+ } else {
+ return mid + 1;
+ }
+}
+static PyCodeObject *__pyx_find_code_object(int code_line) {
+ PyCodeObject* code_object;
+ int pos;
+ if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
+ return NULL;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
+ return NULL;
+ }
+ code_object = __pyx_code_cache.entries[pos].code_object;
+ Py_INCREF(code_object);
+ return code_object;
+}
+static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
+ int pos, i;
+ __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
+ if (unlikely(!code_line)) {
+ return;
+ }
+ if (unlikely(!entries)) {
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (likely(entries)) {
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = 64;
+ __pyx_code_cache.count = 1;
+ entries[0].code_line = code_line;
+ entries[0].code_object = code_object;
+ Py_INCREF(code_object);
+ }
+ return;
+ }
+ pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
+ if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
+ PyCodeObject* tmp = entries[pos].code_object;
+ entries[pos].code_object = code_object;
+ Py_DECREF(tmp);
+ return;
+ }
+ if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
+ int new_max = __pyx_code_cache.max_count + 64;
+ entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
+ __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
+ if (unlikely(!entries)) {
+ return;
+ }
+ __pyx_code_cache.entries = entries;
+ __pyx_code_cache.max_count = new_max;
+ }
+ for (i=__pyx_code_cache.count; i>pos; i--) {
+ entries[i] = entries[i-1];
+ }
+ entries[pos].code_line = code_line;
+ entries[pos].code_object = code_object;
+ __pyx_code_cache.count++;
+ Py_INCREF(code_object);
+}
+
+/* AddTraceback */
+ #include "compile.h"
+#include "frameobject.h"
+#include "traceback.h"
+static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
+ const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyObject *py_srcfile = 0;
+ PyObject *py_funcname = 0;
+ #if PY_MAJOR_VERSION < 3
+ py_srcfile = PyString_FromString(filename);
+ #else
+ py_srcfile = PyUnicode_FromString(filename);
+ #endif
+ if (!py_srcfile) goto bad;
+ if (c_line) {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #else
+ py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
+ #endif
+ }
+ else {
+ #if PY_MAJOR_VERSION < 3
+ py_funcname = PyString_FromString(funcname);
+ #else
+ py_funcname = PyUnicode_FromString(funcname);
+ #endif
+ }
+ if (!py_funcname) goto bad;
+ py_code = __Pyx_PyCode_New(
+ 0,
+ 0,
+ 0,
+ 0,
+ 0,
+ __pyx_empty_bytes, /*PyObject *code,*/
+ __pyx_empty_tuple, /*PyObject *consts,*/
+ __pyx_empty_tuple, /*PyObject *names,*/
+ __pyx_empty_tuple, /*PyObject *varnames,*/
+ __pyx_empty_tuple, /*PyObject *freevars,*/
+ __pyx_empty_tuple, /*PyObject *cellvars,*/
+ py_srcfile, /*PyObject *filename,*/
+ py_funcname, /*PyObject *name,*/
+ py_line,
+ __pyx_empty_bytes /*PyObject *lnotab*/
+ );
+ Py_DECREF(py_srcfile);
+ Py_DECREF(py_funcname);
+ return py_code;
+bad:
+ Py_XDECREF(py_srcfile);
+ Py_XDECREF(py_funcname);
+ return NULL;
+}
+static void __Pyx_AddTraceback(const char *funcname, int c_line,
+ int py_line, const char *filename) {
+ PyCodeObject *py_code = 0;
+ PyFrameObject *py_frame = 0;
+ PyThreadState *tstate = __Pyx_PyThreadState_Current;
+ if (c_line) {
+ c_line = __Pyx_CLineForTraceback(tstate, c_line);
+ }
+ py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
+ if (!py_code) {
+ py_code = __Pyx_CreateCodeObjectForTraceback(
+ funcname, c_line, py_line, filename);
+ if (!py_code) goto bad;
+ __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
+ }
+ py_frame = PyFrame_New(
+ tstate, /*PyThreadState *tstate,*/
+ py_code, /*PyCodeObject *code,*/
+ __pyx_d, /*PyObject *globals,*/
+ 0 /*PyObject *locals*/
+ );
+ if (!py_frame) goto bad;
+ __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
+ PyTraceBack_Here(py_frame);
+bad:
+ Py_XDECREF(py_code);
+ Py_XDECREF(py_frame);
+}
+
+#if PY_MAJOR_VERSION < 3
+static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
+ if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
+ if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
+ if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
+ if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
+ PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
+ return -1;
+}
+static void __Pyx_ReleaseBuffer(Py_buffer *view) {
+ PyObject *obj = view->obj;
+ if (!obj) return;
+ if (PyObject_CheckBuffer(obj)) {
+ PyBuffer_Release(view);
+ return;
+ }
+ if ((0)) {}
+ else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
+ view->obj = NULL;
+ Py_DECREF(obj);
+}
+#endif
+
+
+ /* MemviewSliceIsContig */
+ static int
+__pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
+{
+ int i, index, step, start;
+ Py_ssize_t itemsize = mvs.memview->view.itemsize;
+ if (order == 'F') {
+ step = 1;
+ start = 0;
+ } else {
+ step = -1;
+ start = ndim - 1;
+ }
+ for (i = 0; i < ndim; i++) {
+ index = start + step * i;
+ if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
+ return 0;
+ itemsize *= mvs.shape[index];
+ }
+ return 1;
+}
+
+/* OverlappingSlices */
+ static void
+__pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
+ void **out_start, void **out_end,
+ int ndim, size_t itemsize)
+{
+ char *start, *end;
+ int i;
+ start = end = slice->data;
+ for (i = 0; i < ndim; i++) {
+ Py_ssize_t stride = slice->strides[i];
+ Py_ssize_t extent = slice->shape[i];
+ if (extent == 0) {
+ *out_start = *out_end = start;
+ return;
+ } else {
+ if (stride > 0)
+ end += stride * (extent - 1);
+ else
+ start += stride * (extent - 1);
+ }
+ }
+ *out_start = start;
+ *out_end = end + itemsize;
+}
+static int
+__pyx_slices_overlap(__Pyx_memviewslice *slice1,
+ __Pyx_memviewslice *slice2,
+ int ndim, size_t itemsize)
+{
+ void *start1, *end1, *start2, *end2;
+ __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
+ __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
+ return (start1 < end2) && (start2 < end1);
+}
+
+/* Capsule */
+ static CYTHON_INLINE PyObject *
+__pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
+{
+ PyObject *cobj;
+#if PY_VERSION_HEX >= 0x02070000
+ cobj = PyCapsule_New(p, sig, NULL);
+#else
+ cobj = PyCObject_FromVoidPtr(p, NULL);
+#endif
+ return cobj;
+}
+
+/* MemviewDtypeToObject */
+ static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
+ return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
+}
+static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
+ double value = __pyx_PyFloat_AsDouble(obj);
+ if ((value == (double)-1) && PyErr_Occurred())
+ return 0;
+ *(double *) itemp = value;
+ return 1;
+}
+
+/* CIntFromPyVerify */
+ #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
+#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
+ __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
+#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
+ {\
+ func_type value = func_value;\
+ if (sizeof(target_type) < sizeof(func_type)) {\
+ if (unlikely(value != (func_type) (target_type) value)) {\
+ func_type zero = 0;\
+ if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
+ return (target_type) -1;\
+ if (is_unsigned && unlikely(value < zero))\
+ goto raise_neg_overflow;\
+ else\
+ goto raise_overflow;\
+ }\
+ }\
+ return (target_type) value;\
+ }
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(long) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(long) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(long) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(long),
+ little, !is_unsigned);
+ }
+}
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(int) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(int) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(int) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(int),
+ little, !is_unsigned);
+ }
+}
+
+/* Declarations */
+ #if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+ return ::std::complex< float >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+ return x + y*(__pyx_t_float_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
+ __pyx_t_float_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabsf(b.real) >= fabsf(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ float r = b.imag / b.real;
+ float s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ float r = b.real / b.imag;
+ float s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_float_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ float denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_float_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
+ __pyx_t_float_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrtf(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypotf(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
+ __pyx_t_float_complex z;
+ float r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ float denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(a, a);
+ case 3:
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, a);
+ case 4:
+ z = __Pyx_c_prod_float(a, a);
+ return __Pyx_c_prod_float(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ } else if (b.imag == 0) {
+ z.real = powf(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2f(0, -1);
+ }
+ } else {
+ r = __Pyx_c_abs_float(a);
+ theta = atan2f(a.imag, a.real);
+ }
+ lnr = logf(r);
+ z_r = expf(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cosf(z_theta);
+ z.imag = z_r * sinf(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+/* Declarations */
+ #if CYTHON_CCOMPLEX
+ #ifdef __cplusplus
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return ::std::complex< double >(x, y);
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ return x + y*(__pyx_t_double_complex)_Complex_I;
+ }
+ #endif
+#else
+ static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
+ __pyx_t_double_complex z;
+ z.real = x;
+ z.imag = y;
+ return z;
+ }
+#endif
+
+/* Arithmetic */
+ #if CYTHON_CCOMPLEX
+#else
+ static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ return (a.real == b.real) && (a.imag == b.imag);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real + b.real;
+ z.imag = a.imag + b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real - b.real;
+ z.imag = a.imag - b.imag;
+ return z;
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ z.real = a.real * b.real - a.imag * b.imag;
+ z.imag = a.real * b.imag + a.imag * b.real;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else if (fabs(b.real) >= fabs(b.imag)) {
+ if (b.real == 0 && b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
+ } else {
+ double r = b.imag / b.real;
+ double s = 1.0 / (b.real + b.imag * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
+ }
+ } else {
+ double r = b.real / b.imag;
+ double s = 1.0 / (b.imag + b.real * r);
+ return __pyx_t_double_complex_from_parts(
+ (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
+ }
+ }
+ #else
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ if (b.imag == 0) {
+ return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
+ } else {
+ double denom = b.real * b.real + b.imag * b.imag;
+ return __pyx_t_double_complex_from_parts(
+ (a.real * b.real + a.imag * b.imag) / denom,
+ (a.imag * b.real - a.real * b.imag) / denom);
+ }
+ }
+ #endif
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = -a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
+ return (a.real == 0) && (a.imag == 0);
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
+ __pyx_t_double_complex z;
+ z.real = a.real;
+ z.imag = -a.imag;
+ return z;
+ }
+ #if 1
+ static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
+ #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
+ return sqrt(z.real*z.real + z.imag*z.imag);
+ #else
+ return hypot(z.real, z.imag);
+ #endif
+ }
+ static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
+ __pyx_t_double_complex z;
+ double r, lnr, theta, z_r, z_theta;
+ if (b.imag == 0 && b.real == (int)b.real) {
+ if (b.real < 0) {
+ double denom = a.real * a.real + a.imag * a.imag;
+ a.real = a.real / denom;
+ a.imag = -a.imag / denom;
+ b.real = -b.real;
+ }
+ switch ((int)b.real) {
+ case 0:
+ z.real = 1;
+ z.imag = 0;
+ return z;
+ case 1:
+ return a;
+ case 2:
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(a, a);
+ case 3:
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, a);
+ case 4:
+ z = __Pyx_c_prod_double(a, a);
+ return __Pyx_c_prod_double(z, z);
+ }
+ }
+ if (a.imag == 0) {
+ if (a.real == 0) {
+ return a;
+ } else if (b.imag == 0) {
+ z.real = pow(a.real, b.real);
+ z.imag = 0;
+ return z;
+ } else if (a.real > 0) {
+ r = a.real;
+ theta = 0;
+ } else {
+ r = -a.real;
+ theta = atan2(0, -1);
+ }
+ } else {
+ r = __Pyx_c_abs_double(a);
+ theta = atan2(a.imag, a.real);
+ }
+ lnr = log(r);
+ z_r = exp(lnr * b.real - theta * b.imag);
+ z_theta = theta * b.real + lnr * b.imag;
+ z.real = z_r * cos(z_theta);
+ z.imag = z_r * sin(z_theta);
+ return z;
+ }
+ #endif
+#endif
+
+/* CIntToPy */
+ static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
+ const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
+ const int is_unsigned = neg_one > const_zero;
+ if (is_unsigned) {
+ if (sizeof(enum NPY_TYPES) < sizeof(long)) {
+ return PyInt_FromLong((long) value);
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
+ return PyLong_FromUnsignedLong((unsigned long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
+ return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
+#endif
+ }
+ } else {
+ if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
+ return PyInt_FromLong((long) value);
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
+ return PyLong_FromLongLong((PY_LONG_LONG) value);
+#endif
+ }
+ }
+ {
+ int one = 1; int little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&value;
+ return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
+ little, !is_unsigned);
+ }
+}
+
+/* MemviewSliceCopyTemplate */
+ 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)
+{
+ __Pyx_RefNannyDeclarations
+ int i;
+ __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
+ struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
+ Py_buffer *buf = &from_memview->view;
+ PyObject *shape_tuple = NULL;
+ PyObject *temp_int = NULL;
+ struct __pyx_array_obj *array_obj = NULL;
+ struct __pyx_memoryview_obj *memview_obj = NULL;
+ __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
+ for (i = 0; i < ndim; i++) {
+ if (from_mvs->suboffsets[i] >= 0) {
+ PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
+ "indirect dimensions (axis %d)", i);
+ goto fail;
+ }
+ }
+ shape_tuple = PyTuple_New(ndim);
+ if (unlikely(!shape_tuple)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(shape_tuple);
+ for(i = 0; i < ndim; i++) {
+ temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
+ if(unlikely(!temp_int)) {
+ goto fail;
+ } else {
+ PyTuple_SET_ITEM(shape_tuple, i, temp_int);
+ temp_int = NULL;
+ }
+ }
+ array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
+ if (unlikely(!array_obj)) {
+ goto fail;
+ }
+ __Pyx_GOTREF(array_obj);
+ memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ (PyObject *) array_obj, contig_flag,
+ dtype_is_object,
+ from_mvs->memview->typeinfo);
+ if (unlikely(!memview_obj))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
+ goto fail;
+ if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
+ dtype_is_object) < 0))
+ goto fail;
+ goto no_fail;
+fail:
+ __Pyx_XDECREF(new_mvs.memview);
+ new_mvs.memview = NULL;
+ new_mvs.data = NULL;
+no_fail:
+ __Pyx_XDECREF(shape_tuple);
+ __Pyx_XDECREF(temp_int);
+ __Pyx_XDECREF(array_obj);
+ __Pyx_RefNannyFinishContext();
+ return new_mvs;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
+ const int neg_one = (int) -1, const_zero = (int) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(int) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (int) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
+ return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
+ return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
+ return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (int) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(int) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (int) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
+ return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(int) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ int val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (int) -1;
+ }
+ } else {
+ int val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (int) -1;
+ val = __Pyx_PyInt_As_int(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to int");
+ return (int) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to int");
+ return (int) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
+ const long neg_one = (long) -1, const_zero = (long) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(long) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (long) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
+ return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
+ return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
+ return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (long) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(long) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (long) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
+ return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(long) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ long val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (long) -1;
+ }
+ } else {
+ long val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (long) -1;
+ val = __Pyx_PyInt_As_long(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to long");
+ return (long) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to long");
+ return (long) -1;
+}
+
+/* CIntFromPy */
+ static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
+ const char neg_one = (char) -1, const_zero = (char) 0;
+ const int is_unsigned = neg_one > const_zero;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x))) {
+ if (sizeof(char) < sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
+ } else {
+ long val = PyInt_AS_LONG(x);
+ if (is_unsigned && unlikely(val < 0)) {
+ goto raise_neg_overflow;
+ }
+ return (char) val;
+ }
+ } else
+#endif
+ if (likely(PyLong_Check(x))) {
+ if (is_unsigned) {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
+ return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
+ return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
+ return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
+ }
+ }
+ break;
+ }
+#endif
+#if CYTHON_COMPILING_IN_CPYTHON
+ if (unlikely(Py_SIZE(x) < 0)) {
+ goto raise_neg_overflow;
+ }
+#else
+ {
+ int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
+ if (unlikely(result < 0))
+ return (char) -1;
+ if (unlikely(result == 1))
+ goto raise_neg_overflow;
+ }
+#endif
+ if (sizeof(char) <= sizeof(unsigned long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
+#endif
+ }
+ } else {
+#if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)x)->ob_digit;
+ switch (Py_SIZE(x)) {
+ case 0: return (char) 0;
+ case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
+ case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
+ case -2:
+ if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 2:
+ if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -3:
+ if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 3:
+ if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
+ __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
+ } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case -4:
+ if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ case 4:
+ if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
+ if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
+ __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])))
+ } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
+ return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
+ }
+ }
+ break;
+ }
+#endif
+ if (sizeof(char) <= sizeof(long)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
+#ifdef HAVE_LONG_LONG
+ } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
+ __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
+#endif
+ }
+ }
+ {
+#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
+ PyErr_SetString(PyExc_RuntimeError,
+ "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
+#else
+ char val;
+ PyObject *v = __Pyx_PyNumber_IntOrLong(x);
+ #if PY_MAJOR_VERSION < 3
+ if (likely(v) && !PyLong_Check(v)) {
+ PyObject *tmp = v;
+ v = PyNumber_Long(tmp);
+ Py_DECREF(tmp);
+ }
+ #endif
+ if (likely(v)) {
+ int one = 1; int is_little = (int)*(unsigned char *)&one;
+ unsigned char *bytes = (unsigned char *)&val;
+ int ret = _PyLong_AsByteArray((PyLongObject *)v,
+ bytes, sizeof(val),
+ is_little, !is_unsigned);
+ Py_DECREF(v);
+ if (likely(!ret))
+ return val;
+ }
+#endif
+ return (char) -1;
+ }
+ } else {
+ char val;
+ PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
+ if (!tmp) return (char) -1;
+ val = __Pyx_PyInt_As_char(tmp);
+ Py_DECREF(tmp);
+ return val;
+ }
+raise_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "value too large to convert to char");
+ return (char) -1;
+raise_neg_overflow:
+ PyErr_SetString(PyExc_OverflowError,
+ "can't convert negative value to char");
+ return (char) -1;
+}
+
+/* TypeInfoCompare */
+ static int
+__pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
+{
+ int i;
+ if (!a || !b)
+ return 0;
+ if (a == b)
+ return 1;
+ if (a->size != b->size || a->typegroup != b->typegroup ||
+ a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
+ if (a->typegroup == 'H' || b->typegroup == 'H') {
+ return a->size == b->size;
+ } else {
+ return 0;
+ }
+ }
+ if (a->ndim) {
+ for (i = 0; i < a->ndim; i++)
+ if (a->arraysize[i] != b->arraysize[i])
+ return 0;
+ }
+ if (a->typegroup == 'S') {
+ if (a->flags != b->flags)
+ return 0;
+ if (a->fields || b->fields) {
+ if (!(a->fields && b->fields))
+ return 0;
+ for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
+ __Pyx_StructField *field_a = a->fields + i;
+ __Pyx_StructField *field_b = b->fields + i;
+ if (field_a->offset != field_b->offset ||
+ !__pyx_typeinfo_cmp(field_a->type, field_b->type))
+ return 0;
+ }
+ return !a->fields[i].type && !b->fields[i].type;
+ }
+ }
+ return 1;
+}
+
+/* MemviewSliceValidateAndInit */
+ static int
+__pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
+{
+ if (buf->shape[dim] <= 1)
+ return 1;
+ if (buf->strides) {
+ if (spec & __Pyx_MEMVIEW_CONTIG) {
+ if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
+ if (buf->strides[dim] != sizeof(void *)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly contiguous "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ } else if (buf->strides[dim] != buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_FOLLOW) {
+ Py_ssize_t stride = buf->strides[dim];
+ if (stride < 0)
+ stride = -stride;
+ if (stride < buf->itemsize) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer and memoryview are not contiguous "
+ "in the same dimension.");
+ goto fail;
+ }
+ }
+ } else {
+ if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not contiguous in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (spec & (__Pyx_MEMVIEW_PTR)) {
+ PyErr_Format(PyExc_ValueError,
+ "C-contiguous buffer is not indirect in "
+ "dimension %d", dim);
+ goto fail;
+ } else if (buf->suboffsets) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer exposes suboffsets but no strides");
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
+{
+ if (spec & __Pyx_MEMVIEW_DIRECT) {
+ if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer not compatible with direct access "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ if (spec & __Pyx_MEMVIEW_PTR) {
+ if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer is not indirectly accessible "
+ "in dimension %d.", dim);
+ goto fail;
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int
+__pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
+{
+ int i;
+ if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = 0; i < ndim; i++) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1)
+ {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not fortran contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
+ Py_ssize_t stride = 1;
+ for (i = ndim - 1; i >- 1; i--) {
+ if (stride * buf->itemsize != buf->strides[i] &&
+ buf->shape[i] > 1) {
+ PyErr_SetString(PyExc_ValueError,
+ "Buffer not C contiguous.");
+ goto fail;
+ }
+ stride = stride * buf->shape[i];
+ }
+ }
+ return 1;
+fail:
+ return 0;
+}
+static int __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)
+{
+ struct __pyx_memoryview_obj *memview, *new_memview;
+ __Pyx_RefNannyDeclarations
+ Py_buffer *buf;
+ int i, spec = 0, retval = -1;
+ __Pyx_BufFmt_Context ctx;
+ int from_memoryview = __pyx_memoryview_check(original_obj);
+ __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
+ if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
+ original_obj)->typeinfo)) {
+ memview = (struct __pyx_memoryview_obj *) original_obj;
+ new_memview = NULL;
+ } else {
+ memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
+ original_obj, buf_flags, 0, dtype);
+ new_memview = memview;
+ if (unlikely(!memview))
+ goto fail;
+ }
+ buf = &memview->view;
+ if (buf->ndim != ndim) {
+ PyErr_Format(PyExc_ValueError,
+ "Buffer has wrong number of dimensions (expected %d, got %d)",
+ ndim, buf->ndim);
+ goto fail;
+ }
+ if (new_memview) {
+ __Pyx_BufFmt_Init(&ctx, stack, dtype);
+ if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
+ }
+ if ((unsigned) buf->itemsize != dtype->size) {
+ PyErr_Format(PyExc_ValueError,
+ "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
+ "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
+ buf->itemsize,
+ (buf->itemsize > 1) ? "s" : "",
+ dtype->name,
+ dtype->size,
+ (dtype->size > 1) ? "s" : "");
+ goto fail;
+ }
+ for (i = 0; i < ndim; i++) {
+ spec = axes_specs[i];
+ if (!__pyx_check_strides(buf, i, ndim, spec))
+ goto fail;
+ if (!__pyx_check_suboffsets(buf, i, ndim, spec))
+ goto fail;
+ }
+ if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
+ goto fail;
+ if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
+ new_memview != NULL) == -1)) {
+ goto fail;
+ }
+ retval = 0;
+ goto no_fail;
+fail:
+ Py_XDECREF(new_memview);
+ retval = -1;
+no_fail:
+ __Pyx_RefNannyFinishContext();
+ return retval;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS_RO | writable_flag, 1,
+ &__Pyx_TypeInfo_double, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* ObjectToMemviewSlice */
+ static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_int(PyObject *obj, int writable_flag) {
+ __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
+ __Pyx_BufFmt_StackElem stack[1];
+ int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
+ int retcode;
+ if (obj == Py_None) {
+ result.memview = (struct __pyx_memoryview_obj *) Py_None;
+ return result;
+ }
+ retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
+ PyBUF_RECORDS_RO | writable_flag, 1,
+ &__Pyx_TypeInfo_int, stack,
+ &result, obj);
+ if (unlikely(retcode == -1))
+ goto __pyx_fail;
+ return result;
+__pyx_fail:
+ result.memview = NULL;
+ result.data = NULL;
+ return result;
+}
+
+/* CheckBinaryVersion */
+ static int __Pyx_check_binary_version(void) {
+ char ctversion[4], rtversion[4];
+ PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
+ PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
+ if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
+ char message[200];
+ PyOS_snprintf(message, sizeof(message),
+ "compiletime version %s of module '%.100s' "
+ "does not match runtime version %s",
+ ctversion, __Pyx_MODULE_NAME, rtversion);
+ return PyErr_WarnEx(NULL, message, 1);
+ }
+ return 0;
+}
+
+/* ModuleImport */
+ #ifndef __PYX_HAVE_RT_ImportModule
+#define __PYX_HAVE_RT_ImportModule
+static PyObject *__Pyx_ImportModule(const char *name) {
+ PyObject *py_name = 0;
+ PyObject *py_module = 0;
+ py_name = __Pyx_PyIdentifier_FromString(name);
+ if (!py_name)
+ goto bad;
+ py_module = PyImport_Import(py_name);
+ Py_DECREF(py_name);
+ return py_module;
+bad:
+ Py_XDECREF(py_name);
+ return 0;
+}
+#endif
+
+/* TypeImport */
+ #ifndef __PYX_HAVE_RT_ImportType
+#define __PYX_HAVE_RT_ImportType
+static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
+ size_t size, int strict)
+{
+ PyObject *py_module = 0;
+ PyObject *result = 0;
+ PyObject *py_name = 0;
+ char warning[200];
+ Py_ssize_t basicsize;
+#ifdef Py_LIMITED_API
+ PyObject *py_basicsize;
+#endif
+ py_module = __Pyx_ImportModule(module_name);
+ if (!py_module)
+ goto bad;
+ py_name = __Pyx_PyIdentifier_FromString(class_name);
+ if (!py_name)
+ goto bad;
+ result = PyObject_GetAttr(py_module, py_name);
+ Py_DECREF(py_name);
+ py_name = 0;
+ Py_DECREF(py_module);
+ py_module = 0;
+ if (!result)
+ goto bad;
+ if (!PyType_Check(result)) {
+ PyErr_Format(PyExc_TypeError,
+ "%.200s.%.200s is not a type object",
+ module_name, class_name);
+ goto bad;
+ }
+#ifndef Py_LIMITED_API
+ basicsize = ((PyTypeObject *)result)->tp_basicsize;
+#else
+ py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
+ if (!py_basicsize)
+ goto bad;
+ basicsize = PyLong_AsSsize_t(py_basicsize);
+ Py_DECREF(py_basicsize);
+ py_basicsize = 0;
+ if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
+ goto bad;
+#endif
+ if (!strict && (size_t)basicsize > size) {
+ PyOS_snprintf(warning, sizeof(warning),
+ "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
+ if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
+ }
+ else if ((size_t)basicsize != size) {
+ PyErr_Format(PyExc_ValueError,
+ "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
+ module_name, class_name, basicsize, size);
+ goto bad;
+ }
+ return (PyTypeObject *)result;
+bad:
+ Py_XDECREF(py_module);
+ Py_XDECREF(result);
+ return NULL;
+}
+#endif
+
+/* InitStrings */
+ static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
+ while (t->p) {
+ #if PY_MAJOR_VERSION < 3
+ if (t->is_unicode) {
+ *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
+ } else if (t->intern) {
+ *t->p = PyString_InternFromString(t->s);
+ } else {
+ *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
+ }
+ #else
+ if (t->is_unicode | t->is_str) {
+ if (t->intern) {
+ *t->p = PyUnicode_InternFromString(t->s);
+ } else if (t->encoding) {
+ *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
+ } else {
+ *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
+ }
+ } else {
+ *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
+ }
+ #endif
+ if (!*t->p)
+ return -1;
+ if (PyObject_Hash(*t->p) == -1)
+ return -1;
+ ++t;
+ }
+ return 0;
+}
+
+static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
+ return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
+}
+static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
+ Py_ssize_t ignore;
+ return __Pyx_PyObject_AsStringAndSize(o, &ignore);
+}
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+#if !CYTHON_PEP393_ENABLED
+static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ char* defenc_c;
+ PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
+ if (!defenc) return NULL;
+ defenc_c = PyBytes_AS_STRING(defenc);
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ {
+ char* end = defenc_c + PyBytes_GET_SIZE(defenc);
+ char* c;
+ for (c = defenc_c; c < end; c++) {
+ if ((unsigned char) (*c) >= 128) {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+ }
+ }
+#endif
+ *length = PyBytes_GET_SIZE(defenc);
+ return defenc_c;
+}
+#else
+static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+ if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ if (likely(PyUnicode_IS_ASCII(o))) {
+ *length = PyUnicode_GET_LENGTH(o);
+ return PyUnicode_AsUTF8(o);
+ } else {
+ PyUnicode_AsASCIIString(o);
+ return NULL;
+ }
+#else
+ return PyUnicode_AsUTF8AndSize(o, length);
+#endif
+}
+#endif
+#endif
+static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
+#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
+ if (
+#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
+ __Pyx_sys_getdefaultencoding_not_ascii &&
+#endif
+ PyUnicode_Check(o)) {
+ return __Pyx_PyUnicode_AsStringAndSize(o, length);
+ } else
+#endif
+#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
+ if (PyByteArray_Check(o)) {
+ *length = PyByteArray_GET_SIZE(o);
+ return PyByteArray_AS_STRING(o);
+ } else
+#endif
+ {
+ char* result;
+ int r = PyBytes_AsStringAndSize(o, &result, length);
+ if (unlikely(r < 0)) {
+ return NULL;
+ } else {
+ return result;
+ }
+ }
+}
+static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
+ int is_true = x == Py_True;
+ if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
+ else return PyObject_IsTrue(x);
+}
+static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
+#if PY_MAJOR_VERSION >= 3
+ if (PyLong_Check(result)) {
+ if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
+ "__int__ returned non-int (type %.200s). "
+ "The ability to return an instance of a strict subclass of int "
+ "is deprecated, and may be removed in a future version of Python.",
+ Py_TYPE(result)->tp_name)) {
+ Py_DECREF(result);
+ return NULL;
+ }
+ return result;
+ }
+#endif
+ PyErr_Format(PyExc_TypeError,
+ "__%.4s__ returned non-%.4s (type %.200s)",
+ type_name, type_name, Py_TYPE(result)->tp_name);
+ Py_DECREF(result);
+ return NULL;
+}
+static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
+#if CYTHON_USE_TYPE_SLOTS
+ PyNumberMethods *m;
+#endif
+ const char *name = NULL;
+ PyObject *res = NULL;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_Check(x) || PyLong_Check(x)))
+#else
+ if (likely(PyLong_Check(x)))
+#endif
+ return __Pyx_NewRef(x);
+#if CYTHON_USE_TYPE_SLOTS
+ m = Py_TYPE(x)->tp_as_number;
+ #if PY_MAJOR_VERSION < 3
+ if (m && m->nb_int) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ else if (m && m->nb_long) {
+ name = "long";
+ res = m->nb_long(x);
+ }
+ #else
+ if (likely(m && m->nb_int)) {
+ name = "int";
+ res = m->nb_int(x);
+ }
+ #endif
+#else
+ if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
+ res = PyNumber_Int(x);
+ }
+#endif
+ if (likely(res)) {
+#if PY_MAJOR_VERSION < 3
+ if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
+#else
+ if (unlikely(!PyLong_CheckExact(res))) {
+#endif
+ return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
+ }
+ }
+ else if (!PyErr_Occurred()) {
+ PyErr_SetString(PyExc_TypeError,
+ "an integer is required");
+ }
+ return res;
+}
+static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
+ Py_ssize_t ival;
+ PyObject *x;
+#if PY_MAJOR_VERSION < 3
+ if (likely(PyInt_CheckExact(b))) {
+ if (sizeof(Py_ssize_t) >= sizeof(long))
+ return PyInt_AS_LONG(b);
+ else
+ return PyInt_AsSsize_t(x);
+ }
+#endif
+ if (likely(PyLong_CheckExact(b))) {
+ #if CYTHON_USE_PYLONG_INTERNALS
+ const digit* digits = ((PyLongObject*)b)->ob_digit;
+ const Py_ssize_t size = Py_SIZE(b);
+ if (likely(__Pyx_sst_abs(size) <= 1)) {
+ ival = likely(size) ? digits[0] : 0;
+ if (size == -1) ival = -ival;
+ return ival;
+ } else {
+ switch (size) {
+ case 2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -2:
+ if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case -3:
+ if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
+ return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
+ }
+ break;
+ case 4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ 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]));
+ }
+ break;
+ case -4:
+ if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
+ 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]));
+ }
+ break;
+ }
+ }
+ #endif
+ return PyLong_AsSsize_t(b);
+ }
+ x = PyNumber_Index(b);
+ if (!x) return -1;
+ ival = PyInt_AsSsize_t(x);
+ Py_DECREF(x);
+ return ival;
+}
+static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
+ return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
+}
+static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
+ return PyInt_FromSize_t(ival);
+}
+
+
+#endif /* Py_PYTHON_H */
diff --git a/PyMca5/PyMcaPlugins/AlignmentScanPlugin.py b/PyMca5/PyMcaPlugins/AlignmentScanPlugin.py
index 40fdf2d..ee33c2e 100644
--- a/PyMca5/PyMcaPlugins/AlignmentScanPlugin.py
+++ b/PyMca5/PyMcaPlugins/AlignmentScanPlugin.py
@@ -23,6 +23,8 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin aligns all curves with the active curve, using the FFT.
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
diff --git a/PyMca5/PyMcaPlugins/BackgroundScanPlugin.py b/PyMca5/PyMcaPlugins/BackgroundScanPlugin.py
index 6e56093..48a08c4 100644
--- a/PyMca5/PyMcaPlugins/BackgroundScanPlugin.py
+++ b/PyMca5/PyMcaPlugins/BackgroundScanPlugin.py
@@ -23,6 +23,15 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin provides 3 methods:
+
+ - subtract a SNIP1D background from the active curve
+ - apply a Savitsky-Golay filter on the active curve
+ - smooth and replace current curve by its SNIP1D background (deglitch)
+
+
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
diff --git a/PyMca5/PyMcaPlugins/BackgroundStackPlugin.py b/PyMca5/PyMcaPlugins/BackgroundStackPlugin.py
index 15f7adf..1357d39 100644
--- a/PyMca5/PyMcaPlugins/BackgroundStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/BackgroundStackPlugin.py
@@ -23,41 +23,21 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This stack plugin provides filtering and background subtraction methods:
+
+ - Savitzky-Golay Filtering (smoothing)
+ - Deglitch with SNIP 1D Background
+ - Subtract SNIP 1D Background
+ - Subtract SNIP 2D Background
+ - Subtract active curve
+"""
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-A Stack plugin is a module that will be automatically added to the PyMca
-stack windows in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the
-functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
from PyMca5 import StackPluginBase
from PyMca5.PyMcaGui import SGWindow
from PyMca5.PyMcaGui import SNIPWindow
diff --git a/PyMca5/PyMcaPlugins/ExternalImagesStackPlugin.py b/PyMca5/PyMcaPlugins/ExternalImagesStackPlugin.py
index 0d9b070..b78da58 100644
--- a/PyMca5/PyMcaPlugins/ExternalImagesStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/ExternalImagesStackPlugin.py
@@ -23,40 +23,25 @@
# THE SOFTWARE.
#
#############################################################################*/
-__author__ = "V.A. Sole - ESRF Data Analysis"
-__contact__ = "sole@esrf.fr"
-__license__ = "MIT"
-__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
"""
+This plugin open a file selection dialog to open one or more images in a
+new window. Usual image data formats are supported, as well as standard
+image formats (JPG, PNG).
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
+The tool is meant to view an alternative view of the data, such as a
+photograph of the sample or a different type of scientific measurement
+of the same sample.
- #mask related
- setSelectionMask
- getSelectionMask
+The window offer a cropping tool, to crop the image to the current visible
+zoomed area and then resize it to fit the original size.
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
+The mask of this plot widget is synchronized with the master stack widget.
"""
+__author__ = "V.A. Sole - ESRF Data Analysis"
+__contact__ = "sole@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
import os
from PyMca5 import StackPluginBase
from PyMca5.PyMcaGui import PyMcaQt as qt
diff --git a/PyMca5/PyMcaPlugins/FitAllCurvesPlugin.py b/PyMca5/PyMcaPlugins/FitAllCurvesPlugin.py
index 8cd98b5..705623b 100644
--- a/PyMca5/PyMcaPlugins/FitAllCurvesPlugin.py
+++ b/PyMca5/PyMcaPlugins/FitAllCurvesPlugin.py
@@ -23,6 +23,11 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin allows to perform a fit on all curves in the plot.
+A widget is provided to configure the fit parameters and to specify the
+output file.
+The fit results are saved as a NeXus HDF5 file, with one entry per
+fitted curve."""
try:
from PyMca5.PyMcaCore import Plugin1DBase
diff --git a/PyMca5/PyMcaPlugins/FitStackPlugin.py b/PyMca5/PyMcaPlugins/FitStackPlugin.py
index ecbbf33..e11205b 100644
--- a/PyMca5/PyMcaPlugins/FitStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/FitStackPlugin.py
@@ -23,40 +23,22 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin allows to configure and execute a batch fitting for all
+spectra in the stack.
+
+The user can select the fit function and a background function from a
+selection of functions, and must provide the initial estimation for
+the iterative fit.
+
+The fit result is saved to file, at the end. A 2D map is created for each
+fitted parameter, and saved in EDF and ASCII formats."""
+
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
+
try:
from PyMca5 import StackPluginBase
from PyMca5.PyMcaGui import StackSimpleFitWindow
diff --git a/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py b/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py
index 924a02b..7ede608 100644
--- a/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/ImageAlignmentStackPlugin.py
@@ -1,5 +1,5 @@
#/*##########################################################################
-# Copyright (C) 2004-2014 V.A. Sole, European Synchrotron Radiation Facility
+# Copyright (C) 2004-2018 V.A. Sole, European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -23,40 +23,20 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin provides two methods to align stack images, one based on a FFT
+algorithm and the other one based on the SIFT algorithm (on GPU).
+
+The result of the alignment computation may be applied directly to the data,
+or saved to a file.
+
+This plugin also allows to apply the results from a file.
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
import sys
import os
import numpy
@@ -525,7 +505,7 @@ class ImageAlignmentStackPlugin(StackPluginBase.StackPluginBase):
mcaIndex = stack.info.get('McaIndex')
if not (mcaIndex in [0, -1, 2]):
raise IndexError("1D index must be 0, 2, or -1")
- filefilter = ['HDF5 Files (*.h5 *.nxs *.hdf)', 'CSV 2-column (*.csv)', 'ASCII 2-column (*)']
+ filefilter = ['HDF5 Files (*.h5 *.nxs *.hdf *.hdf5)', 'CSV 2-column (*.csv)', 'ASCII 2-column (*)']
filename, ffilter = PyMcaFileDialogs.\
getFileList(parent=None,
filetypelist=filefilter,
diff --git a/PyMca5/PyMcaPlugins/LoadPositionersStackPlugin.py b/PyMca5/PyMcaPlugins/LoadPositionersStackPlugin.py
index c4cae64..d6bd9b5 100644
--- a/PyMca5/PyMcaPlugins/LoadPositionersStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/LoadPositionersStackPlugin.py
@@ -24,7 +24,21 @@
#
# ###########################################################################*/
"""
-Plugin to load positioner info from a CSV or HDF5 file.
+This plugin is used to load motor positions from a CSV or HDF5 file.
+
+The number of values associated with a given positioner should be equal
+to the number of pixels in the stack image. A single scalar value can also be
+provided for a motor, if it didn't move during the experiment.
+
+A CSV file should have unique motor names in the header line, and can have
+an arbitrary number of motors/columns.
+
+Motor positions in a HDF5 files are 1-dimensional datasets whose names are
+the motor names. The user is allowed to select the HDF5 group containing all
+motor datasets.
+
+Data loaded with this plugin can then be used by other tools, such as the
+"Stack motor positions" plugin.
"""
__authors__ = ["P. Knobel"]
__license__ = "MIT"
diff --git a/PyMca5/PyMcaPlugins/MathPlugins.py b/PyMca5/PyMcaPlugins/MathPlugins.py
index 496ef56..ae61f87 100644
--- a/PyMca5/PyMcaPlugins/MathPlugins.py
+++ b/PyMca5/PyMcaPlugins/MathPlugins.py
@@ -23,10 +23,14 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin provide simple math functions, to derivate or invert the
+active curve.
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
import numpy
try:
from PyMca5 import Plugin1DBase
diff --git a/PyMca5/PyMcaPlugins/MedianFilterScanDeglitchPlugin.py b/PyMca5/PyMcaPlugins/MedianFilterScanDeglitchPlugin.py
index 4bbc561..f350a5c 100644
--- a/PyMca5/PyMcaPlugins/MedianFilterScanDeglitchPlugin.py
+++ b/PyMca5/PyMcaPlugins/MedianFilterScanDeglitchPlugin.py
@@ -23,6 +23,12 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin uses a median filter smoothing to remove glitches from curves.
+A configuration widget can be used to configure the median filter (width and
+threshold), and the user can choose to apply it on the active curve or on all
+curves.
+
+"""
__author__ = "T. Rueter - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
diff --git a/PyMca5/PyMcaPlugins/MedianFilterScanPlugin.py b/PyMca5/PyMcaPlugins/MedianFilterScanPlugin.py
index 856be4a..152f469 100644
--- a/PyMca5/PyMcaPlugins/MedianFilterScanPlugin.py
+++ b/PyMca5/PyMcaPlugins/MedianFilterScanPlugin.py
@@ -23,6 +23,13 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin provides methods to replace curves by their median filter average.
+3-, 5-, 7- or 9-points filters are provided. The filter can be applied on the
+data in its original order, or in a randomized order.
+
+"""
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
diff --git a/PyMca5/PyMcaPlugins/MedianFilterStackPlugin.py b/PyMca5/PyMcaPlugins/MedianFilterStackPlugin.py
index 5c906d6..b414c56 100644
--- a/PyMca5/PyMcaPlugins/MedianFilterStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/MedianFilterStackPlugin.py
@@ -23,40 +23,23 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin open a new stack window with a configurable median filter
+applied to the data.
+
+The user can select the frame and modify the filter width.
+
+He can also choose to apply a conditional median filter instead
+of the regular median filter.
+With a regular median filter, each pixel value is replaced with the median
+value of all pixels in the window. With the conditional option enabled,
+the pixel value is only replaced if it is the minimum or the maximum value
+in the smoothing window.
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
from PyMca5 import StackPluginBase
from PyMca5.PyMcaGui.pymca import Median2DBrowser
diff --git a/PyMca5/PyMcaPlugins/MotorInfoPlugin.py b/PyMca5/PyMcaPlugins/MotorInfoPlugin.py
index 2f0d976..ed55964 100644
--- a/PyMca5/PyMcaPlugins/MotorInfoPlugin.py
+++ b/PyMca5/PyMcaPlugins/MotorInfoPlugin.py
@@ -23,6 +23,11 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin opens a widget displaying values of various motors associated
+with each spectrum, if the curve originates from a file whose format provides
+this information.
+"""
+
__author__ = "Tonn Rueter"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
diff --git a/PyMca5/PyMcaPlugins/NormalizationPlugins.py b/PyMca5/PyMcaPlugins/NormalizationPlugins.py
index 8c83263..cb7c006 100644
--- a/PyMca5/PyMcaPlugins/NormalizationPlugins.py
+++ b/PyMca5/PyMcaPlugins/NormalizationPlugins.py
@@ -23,6 +23,17 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin provides methods to normalize all curves.
+
+Following normalization methods are available:
+
+ - Normalize to maximum y / max(y)
+ - Subtract offset and normalize to new maximum (y-min(y))/(max(y)-min(y))
+ - Subtract offset and normalize to integrated area (y-min(y))/trapz(max(y)-min(y),x)
+ - Subtract offset and normalize to counts (y-min(y))/sum(max(y)-min(y))
+ - Divide all curves by active curve
+"""
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
@@ -50,7 +61,7 @@ class NormalizationPlugins(Plugin1DBase.Plugin1DBase):
"Subtract offset and normalize to new maximum",
None],
'(y-min(y))/trapz(max(y)-min(y),x)':[self.offsetAndArea,
- "Subtract offset and normalize to integrated are",
+ "Subtract offset and normalize to integrated area",
None],
'(y-min(y))/sum(max(y)-min(y))':[self.offsetAndCounts,
"Subtract offset and normalize to counts",
diff --git a/PyMca5/PyMcaPlugins/PCAStackPlugin.py b/PyMca5/PyMcaPlugins/PCAStackPlugin.py
index 4a88569..e03fc90 100644
--- a/PyMca5/PyMcaPlugins/PCAStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/PCAStackPlugin.py
@@ -23,42 +23,30 @@
# THE SOFTWARE.
#
#############################################################################*/
-__author__ = "V.A. Sole - ESRF Data Analysis"
-__contact__ = "sole@esrf.fr"
-__license__ = "MIT"
-__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
"""
+This plugin opens a window allowing to configure and compute the principal
+component analysis.
+Each spectrum is considered an *observation*, and each channel is considered
+a *variable*.
-A Stack plugin is a module that will be automatically added to the PyMca
-stack windows in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the
-functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
- isStackFinite
-
- #images related
- addImage
- removeImage
- replaceImage
+The user can configure following parameters:
- #mask related
- setSelectionMask
- getSelectionMask
+ - PCA method (*Covariance, Expectation Max, Covariance Multiple Arrays*)
+ - Number of Principal Components
+ - Spectral Binning
+ - Spectral Regions
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
+After the configuration dialog is validated, the eigenimages and the
+eigenvectors are computed and displayed in another window.
- #information method
- stackUpdated
- selectionMaskUpdated
"""
+# TODO: explain PCA methods and regions
+# TODO: provide a practical use case for a PCA. Isolating elements?
+__author__ = "V.A. Sole - ESRF Data Analysis"
+__contact__ = "sole@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
import numpy
from PyMca5 import StackPluginBase
diff --git a/PyMca5/PyMcaPlugins/ROIStackPlugin.py b/PyMca5/PyMcaPlugins/ROIStackPlugin.py
index a5f6328..0a73164 100644
--- a/PyMca5/PyMcaPlugins/ROIStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/ROIStackPlugin.py
@@ -23,40 +23,25 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin opens a stack ROI window providing alternative views:
+
+ - ICR Energy at Max.
+ - ICR Energy at Min.
+ - 3 energy slices
+ - ICR Background
+
+This window also provides a median filter tool, with a configurable filter
+width, to smooth the stack image.
+
+The mask of this plot widget is synchronized with the master stack widget.
+
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
from PyMca5 import StackPluginBase
from PyMca5.PyMcaGui.pymca import StackROIWindow
from PyMca5.PyMcaGui import PyMca_Icons as PyMca_Icons
diff --git a/PyMca5/PyMcaPlugins/ReverseStackPlugin.py b/PyMca5/PyMcaPlugins/ReverseStackPlugin.py
index 8d91220..2b3f65a 100644
--- a/PyMca5/PyMcaPlugins/ReverseStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/ReverseStackPlugin.py
@@ -23,40 +23,22 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin offers 4 methods for rearranging spectra within the stack data
+cube:
+
+ - Reverse Odd Rows
+ - Reverse Even Rows
+ - Reverse Odd Columns
+ - Reverse Even Columns
+
+"""
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
import numpy
from PyMca5 import StackPluginBase
diff --git a/PyMca5/PyMcaPlugins/SilxExternalImagesStackPlugin.py b/PyMca5/PyMcaPlugins/SilxExternalImagesStackPlugin.py
index 4de636d..824a183 100644
--- a/PyMca5/PyMcaPlugins/SilxExternalImagesStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/SilxExternalImagesStackPlugin.py
@@ -23,8 +23,21 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""Plugin allowing to view an external image in a plot widget, with tools to
-crop and rotate the image.
+"""This plugin open a file selection dialog to open an image in a
+new window. Usual image data formats are supported, as well as standard
+image formats (JPG, PNG).
+
+The tool is meant to view an alternative view of the data, such as a
+photograph of the sample or a different type of scientific measurement
+of the same sample, and to compare it with the image displayed in the
+master stack window.
+
+The master image is overlaid with the newly opened image, and its
+level of transparency can be configured with a slider.
+
+The window offer a cropping tool, to crop the image to the current visible
+zoomed area and then resize it to fit the original size. It also provides
+a tool to rotate the image.
The mask of the plot widget is synchronized with the master stack widget."""
@@ -338,7 +351,7 @@ class SilxExternalImagesStackPlugin(StackPluginBase.StackPluginBase):
width = qimage.width()
height = qimage.height()
if qimage.format() == qt.QImage.Format_Indexed8:
- pixmap0 = numpy.fromstring(qimage.bits().asstring(width * height),
+ pixmap0 = numpy.frombuffer(qimage.bits().asstring(width * height),
dtype=numpy.uint8)
pixmap = numpy.zeros((height * width, 4), numpy.uint8)
pixmap[:, 0] = pixmap0[:]
@@ -348,10 +361,11 @@ class SilxExternalImagesStackPlugin(StackPluginBase.StackPluginBase):
pixmap.shape = height, width, 4
else:
qimage = qimage.convertToFormat(qt.QImage.Format_ARGB32)
- pixmap = numpy.fromstring(qimage.bits().asstring(width * height * 4),
- dtype=numpy.uint8)
+ pixmap0 = numpy.frombuffer(qimage.bits().asstring(width * height * 4),
+ dtype=numpy.uint8)
+ pixmap = numpy.array(pixmap0) # copy
pixmap.shape = height, width, -1
- # Qt uses BGRA, convert to RGBA # TODO: check this (qt doc says 0xAARRGGBB)
+ # Qt uses BGRA, convert to RGBA
tmpBuffer = numpy.array(pixmap[:, :, 0], copy=True, dtype=pixmap.dtype)
pixmap[:, :, 0] = pixmap[:, :, 2]
pixmap[:, :, 2] = tmpBuffer
diff --git a/PyMca5/PyMcaPlugins/SilxRoiStackPlugin.py b/PyMca5/PyMcaPlugins/SilxRoiStackPlugin.py
index 41e28c4..978f5d5 100644
--- a/PyMca5/PyMcaPlugins/SilxRoiStackPlugin.py
+++ b/PyMca5/PyMcaPlugins/SilxRoiStackPlugin.py
@@ -23,7 +23,19 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""Plugin to apply a median filter on the ROI stack.
+"""
+This plugin opens a stack ROI window providing alternative views:
+
+ - ICR Energy at Max.
+ - ICR Energy at Min.
+ - 3 energy slices
+ - ICR Background
+
+The background image can be subtracted from the other images to show
+a net count.
+
+This window also provides a median filter tool, with a configurable filter
+width, to smooth the stack image.
The mask of the plot widget is synchronized with the master stack widget.
"""
diff --git a/PyMca5/PyMcaPlugins/SimpleShift.py b/PyMca5/PyMcaPlugins/SimpleShift.py
index ec863f6..d8d3944 100644
--- a/PyMca5/PyMcaPlugins/SimpleShift.py
+++ b/PyMca5/PyMcaPlugins/SimpleShift.py
@@ -23,18 +23,27 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin replaces all curves with a normalized and shifted
+curve.
+The minimum is subtracted, than the data is normalized to the maximum, and
+finally it is shifted up by i*0.1 (i being the curve index).
+"""
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
+
from PyMca5 import Plugin1DBase
+
class Shifting(Plugin1DBase.Plugin1DBase):
def getMethods(self, plottype=None):
return ["Shift"]
def getMethodToolTip(self, methodName):
if methodName != "Shift":
- raise InvalidArgument("Method %s not valid" % methodName)
+ raise KeyError("Method %s not valid" % methodName)
return "Subtract minimum, normalize to maximum, and shift up by 0.1"
def applyMethod(self, methodName):
@@ -57,7 +66,7 @@ class Shifting(Plugin1DBase.Plugin1DBase):
else:
replace = False
self.addCurve(x, y, legend=legend + " %.2f" % (i * increment),
- info=info, replace=replace, replot=replot)
+ info=info, replace=replace, replot=replot)
MENU_TEXT="Simple Vertical Shift"
def getPlugin1DInstance(plotWindow, **kw):
diff --git a/PyMca5/PyMcaPlugins/StackAxesPlugin.py b/PyMca5/PyMcaPlugins/StackAxesPlugin.py
index 6bed8eb..ed1fe26 100644
--- a/PyMca5/PyMcaPlugins/StackAxesPlugin.py
+++ b/PyMca5/PyMcaPlugins/StackAxesPlugin.py
@@ -23,41 +23,20 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin can be used to replace the stack's X data with data from
+a text file, or with the MCA curve's X or Y data.
+
+When loading from a file, the data should be in a format that can be
+loaded using `numpy.loadtxt
+<https://docs.scipy.org/doc/numpy-1.14.0/reference/generated/numpy.loadtxt.html>`_,
+i.e. must be a CSV file without a header line and with a single column.
+"""
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-A Stack plugin is a module that will be automatically added to the PyMca
-stack windows in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the
-functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
import numpy
from PyMca5 import StackPluginBase
from PyMca5.PyMcaGui import PyMcaFileDialogs
diff --git a/PyMca5/PyMcaPlugins/StackBrowserPlugin.py b/PyMca5/PyMcaPlugins/StackBrowserPlugin.py
index 238a491..1091af3 100644
--- a/PyMca5/PyMcaPlugins/StackBrowserPlugin.py
+++ b/PyMca5/PyMcaPlugins/StackBrowserPlugin.py
@@ -23,40 +23,21 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin open a plot window with a browser to browse all images in
+the stack.
+
+A averaging filter with a configurable width is provided, to display an
+average of several consecutive frames rather than a single frame.
+
+The plot has also mask tools synchronized with the mask in the master
+window.
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
-
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
from PyMca5 import StackPluginBase
from PyMca5.PyMcaGui.pymca import StackBrowser
diff --git a/PyMca5/PyMcaPlugins/StackMotorInfoPlugin.py b/PyMca5/PyMcaPlugins/StackMotorInfoPlugin.py
index 041ff93..65a50c8 100644
--- a/PyMca5/PyMcaPlugins/StackMotorInfoPlugin.py
+++ b/PyMca5/PyMcaPlugins/StackMotorInfoPlugin.py
@@ -23,8 +23,9 @@
# THE SOFTWARE.
#
# ###########################################################################*/
-"""Plugin opening a stack plot and a another window displaying motor positions
-at the current mouse position."""
+"""If positioners data is available for this stack, this plugin opens
+a stack plot with a widget displaying motor positions at the current mouse
+position in the plot."""
__authors__ = ["P. Knobel"]
__contact__ = "sole@esrf.fr"
diff --git a/PyMca5/PyMcaPlugins/StackNormalizationPlugin.py b/PyMca5/PyMcaPlugins/StackNormalizationPlugin.py
index 9ae20ee..de9caae 100644
--- a/PyMca5/PyMcaPlugins/StackNormalizationPlugin.py
+++ b/PyMca5/PyMcaPlugins/StackNormalizationPlugin.py
@@ -1,5 +1,5 @@
#/*##########################################################################
-# Copyright (C) 2004-2015 V.A. Sole, European Synchrotron Radiation Facility
+# Copyright (C) 2004-2018 V.A. Sole, European Synchrotron Radiation Facility
#
# This file is part of the PyMca X-ray Fluorescence Toolkit developed at
# the ESRF by the Software group.
@@ -23,40 +23,36 @@
# THE SOFTWARE.
#
#############################################################################*/
-__author__ = "V.A. Sole - ESRF Data Analysis"
-__contact__ = "sole@esrf.fr"
-__license__ = "MIT"
-__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
+"""This plugin provides normalisation methods.
+
+Two methods can be applied to normalize the stack based on the
+active curve (I0):
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
+ - I/I0 Normalization: divide all spectra by the active curve
+ - -log(I/I0) Normalization
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
+Three methods are provided to normalize the stack images based on
+an external image (I0) read from a file:
- #images related
- addImage
- removeImage
- replaceImage
+ - Image I/I0 Normalization
+ - Image I * (max(I0)/I0) Scaling
+ - Image -log(I/I0) Normalization
- #mask related
- setSelectionMask
- getSelectionMask
+External images can be read from following file formats:
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
+ - EDF
+ - HDF5
+ - ASCII
- #information method
- stackUpdated
- selectionMaskUpdated
+If a multiframe EDF file is opened, the first frame is used. In case
+a HDF5 file is selected, a browser is used to select a 2D dataset.
"""
+
+__author__ = "V.A. Sole - ESRF Data Analysis"
+__contact__ = "sole@esrf.fr"
+__license__ = "MIT"
+__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
+
import numpy
from PyMca5 import StackPluginBase
# Add support for normalization by data
@@ -142,7 +138,7 @@ class StackNormalizationPlugin(StackPluginBase.StackPluginBase):
getfilter = True
fileTypeList = ["EDF Files (*edf *ccd *tif)"]
if HDF5:
- fileTypeList.append('HDF5 Files (*.h5 *.nxs *.hdf)')
+ fileTypeList.append('HDF5 Files (*.h5 *.nxs *.hdf *.hdf5)')
fileTypeList.append('ASCII Files (*)')
fileTypeList.append("EDF Files (*)")
message = "Open data file"
diff --git a/PyMca5/PyMcaPlugins/StackScanWindowPlugin.py b/PyMca5/PyMcaPlugins/StackScanWindowPlugin.py
index 75b7c6a..c898ab6 100644
--- a/PyMca5/PyMcaPlugins/StackScanWindowPlugin.py
+++ b/PyMca5/PyMcaPlugins/StackScanWindowPlugin.py
@@ -23,40 +23,16 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""This plugin opens a scan window the first time it is called.
+The user can then send the current active curve to it, for further
+analysis.
+"""
+
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-"""
-
-A Stack plugin is a module that will be automatically added to the PyMca stack windows
-in order to perform user defined operations on the data stack.
-
-These plugins will be compatible with any stack window that provides the functions:
- #data related
- getStackDataObject
- getStackData
- getStackInfo
- setStack
- #images related
- addImage
- removeImage
- replaceImage
-
- #mask related
- setSelectionMask
- getSelectionMask
-
- #displayed curves
- getActiveCurve
- getGraphXLimits
- getGraphYLimits
-
- #information method
- stackUpdated
- selectionMaskUpdated
-"""
import numpy
from PyMca5.PyMcaGui import ScanWindow
diff --git a/PyMca5/PyMcaPlugins/StackShowSpectra.py b/PyMca5/PyMcaPlugins/StackShowSpectra.py
index 628c530..b50dbab 100644
--- a/PyMca5/PyMcaPlugins/StackShowSpectra.py
+++ b/PyMca5/PyMcaPlugins/StackShowSpectra.py
@@ -23,6 +23,11 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+This plugin opens a scan window displaying a number of spectra.
+
+The user can choose to display 10, 100, 1000 or all spectra.
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
diff --git a/PyMca5/PyMcaPlugins/XASPlugin.py b/PyMca5/PyMcaPlugins/XASPlugin.py
index 7005409..c1d049c 100644
--- a/PyMca5/PyMcaPlugins/XASPlugin.py
+++ b/PyMca5/PyMcaPlugins/XASPlugin.py
@@ -23,6 +23,9 @@
# THE SOFTWARE.
#
#############################################################################*/
+"""
+
+"""
__author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
diff --git a/PyMca5/__init__.py b/PyMca5/__init__.py
index a99541e..9c131c6 100644
--- a/PyMca5/__init__.py
+++ b/PyMca5/__init__.py
@@ -27,7 +27,7 @@ __author__ = "V.A. Sole - ESRF Data Analysis"
__contact__ = "sole@esrf.fr"
__license__ = "MIT"
__copyright__ = "European Synchrotron Radiation Facility, Grenoble, France"
-__version__ = "5.3.1"
+__version__ = "5.3.2"
import os
import sys
@@ -57,14 +57,13 @@ if os.path.exists(os.path.join(\
def version():
return __version__
-def getDefaultSettingsFile():
+def getDefaultSettingsDirectory():
"""
- Return the path to the default settings file (PyMca.ini).
+ Return the path to the directory containing the default settings file,
+ user plugins and user fit functions.
- The file itself may not exist, but this function tries to create
- the containing directory if not already created.
+ This function tries to create the directory if not already created.
"""
- filename = "PyMca.ini"
if sys.platform == 'win32':
# recipe based on: http://bugs.python.org/issue1763#msg62242
dll = ctypes.windll.shell32
@@ -75,7 +74,6 @@ def getDefaultSettingsFile():
# the above should have worked
home = os.getenv('USERPROFILE')
try:
- l = len(home)
directory = os.path.join(home, "My Documents")
except:
home = '\\'
@@ -84,16 +82,30 @@ def getDefaultSettingsFile():
directory = os.path.join(directory, "PyMca")
else:
directory = os.path.join(home, "PyMca")
- if not os.path.exists('%s' % directory):
- os.mkdir('%s' % directory)
- finalfile = os.path.join(directory, filename)
else:
home = os.getenv('HOME')
- directory = os.path.join(home, "PyMca")
- if not os.path.exists('%s' % directory):
- os.mkdir('%s' % directory)
- finalfile = os.path.join(directory, filename)
- return finalfile
+ directory = os.path.join(home, ".pymca")
+ if not os.path.isdir('%s' % directory):
+ # if legacy directory exists, possibly containing user plugins,
+ # we should keep using it
+ legacy_directory = os.path.join(home, "PyMca")
+ if os.path.exists(os.path.join(legacy_directory, "plugins")):
+ directory = legacy_directory
+
+ if not os.path.exists('%s' % directory):
+ os.mkdir('%s' % directory)
+ return directory
+
+def getDefaultSettingsFile():
+ """
+ Return the path to the default settings file (PyMca.ini).
+
+ The file itself may not exist, but this function tries to create
+ the containing directory if not already created.
+ """
+ filename = "PyMca.ini"
+ return os.path.join(getDefaultSettingsDirectory(),
+ filename)
def getDefaultUserPluginsDirectory():
"""
@@ -102,7 +114,7 @@ def getDefaultUserPluginsDirectory():
The directory will be created if not existing. In case of error it returns None.
"""
try:
- settingsDir = os.path.dirname(getDefaultSettingsFile())
+ settingsDir = getDefaultSettingsDirectory()
if os.path.exists(settingsDir):
userPluginDir = os.path.join(settingsDir, "plugins")
if not os.path.exists(userPluginDir):
@@ -111,7 +123,26 @@ def getDefaultUserPluginsDirectory():
else:
return None
except:
- print("WARNING: Cannot initialize plugis directory")
+ print("WARNING: Cannot initialize plugins directory")
+ return None
+
+def getDefaultUserFitFunctionsDirectory():
+ """
+ Return the default directory to look for user defined fit functions.
+
+ The directory will be created if not existing. In case of error it returns None.
+ """
+ try:
+ settingsDir = os.path.dirname(getDefaultSettingsFile())
+ if os.path.exists(settingsDir):
+ fitFunctionsDir = os.path.join(settingsDir, "fit")
+ if not os.path.exists(fitFunctionsDir):
+ os.mkdir(fitFunctionsDir)
+ return fitFunctionsDir
+ else:
+ return None
+ except:
+ print("WARNING: Cannot initialize fit functions directory")
return None
def getUserDataFile(fileName, directory=""):
@@ -120,7 +151,7 @@ def getUserDataFile(fileName, directory=""):
"""
userDataDir = None
try:
- settingsDir = os.path.dirname(getDefaultSettingsFile())
+ settingsDir = getDefaultSettingsDirectory()
if os.path.exists(settingsDir):
userDataDir = os.path.join(settingsDir, "data")
if not os.path.exists(userDataDir):
@@ -150,7 +181,7 @@ def getDataFile(fileName, directory=None):
Look for the provided file name in directories following the priority:
0 - The provided file
- 1 - User data directory (~/PyMca/PyMcaData)
+ 1 - User data directory (~/.pymca/PyMcaData)
2 - PyMca data directory (PyMcaDataDir.PYMCA_DATA_DIR)
3 - fisx data directory (fisx.DataDir.FISX_DATA_DIR)
"""
@@ -158,7 +189,7 @@ def getDataFile(fileName, directory=None):
# return the input file name if exists
if os.path.exists(fileName):
if DEBUG:
- print("Filename as supplied <%s>" % newFileName)
+ print("Filename as supplied <%s>" % fileName)
return fileName
# the list of sub-directories where to look for the file
@@ -208,7 +239,7 @@ if sys.platform.startswith("win"):
try:
#try to avoid matplotlib config dir problem under windows
if os.getenv("MPLCONFIGDIR") is None:
- os.environ['MPLCONFIGDIR'] = os.path.dirname(getDefaultSettingsFile())
+ os.environ['MPLCONFIGDIR'] = getDefaultSettingsDirectory()
except:
print("WARNING: Could not set MPLCONFIGDIR.", sys.exc_info()[1])
diff --git a/PyMca5/scripts/edfviewer b/PyMca5/scripts/edfviewer
index e83c826..f9f8c68 100644
--- a/PyMca5/scripts/edfviewer
+++ b/PyMca5/scripts/edfviewer
@@ -2,10 +2,17 @@
import os
import sys
-import PyMca5.PyMcaGui.pymca.EdfFileSimpleViewer as target
+import PyMca5.PyMcaGui.pymca as target
fname = os.path.join(os.path.dirname(target.__file__), 'EdfFileSimpleViewer.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
diff --git a/PyMca5/scripts/elementsinfo b/PyMca5/scripts/elementsinfo
index 8d5985c..df20328 100644
--- a/PyMca5/scripts/elementsinfo
+++ b/PyMca5/scripts/elementsinfo
@@ -2,10 +2,17 @@
import os
import sys
-import PyMca5.PyMcaGui.physics.xrf.ElementsInfo as target
+import PyMca5.PyMcaGui.physics.xrf as target
fname = os.path.join(os.path.dirname(target.__file__), 'ElementsInfo.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
diff --git a/PyMca5/scripts/mca2edf b/PyMca5/scripts/mca2edf
index e0468fe..b46542e 100644
--- a/PyMca5/scripts/mca2edf
+++ b/PyMca5/scripts/mca2edf
@@ -2,10 +2,17 @@
import os
import sys
-import PyMca5.PyMcaGui.pymca.Mca2Edf as target
+import PyMca5.PyMcaGui.pymca as target
fname = os.path.join(os.path.dirname(target.__file__), 'Mca2Edf.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
diff --git a/PyMca5/scripts/peakidentifier b/PyMca5/scripts/peakidentifier
index 0aa3329..108c117 100644
--- a/PyMca5/scripts/peakidentifier
+++ b/PyMca5/scripts/peakidentifier
@@ -2,11 +2,17 @@
import os
import sys
-import PyMca5
-from PyMca5.PyMcaGui import PeakIdentifier
+import PyMca5.PyMcaGui.physics.xrf as target
-fname = os.path.join(os.path.dirname(PeakIdentifier.__file__), 'PeakIdentifier.py')
+fname = os.path.join(os.path.dirname(target.__file__), 'PeakIdentifier.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
diff --git a/PyMca5/scripts/pymca b/PyMca5/scripts/pymca
index b4cb5a4..9653a8b 100644
--- a/PyMca5/scripts/pymca
+++ b/PyMca5/scripts/pymca
@@ -2,11 +2,17 @@
import os
import sys
-import PyMca5.PyMcaGui.pymca as PyMca
+import PyMca5.PyMcaGui.pymca as target
-sys.path.insert(0, os.path.dirname(PyMca.__file__))
-fname = os.path.join(os.path.dirname(PyMca.__file__), 'PyMcaMain.py')
+fname = os.path.join(os.path.dirname(target.__file__), 'PyMcaMain.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
diff --git a/PyMca5/scripts/pymcabatch b/PyMca5/scripts/pymcabatch
index 3057213..cf40f7c 100644
--- a/PyMca5/scripts/pymcabatch
+++ b/PyMca5/scripts/pymcabatch
@@ -2,10 +2,17 @@
import os
import sys
-import PyMca5.PyMcaGui.pymca.PyMcaBatch as target
+import PyMca5.PyMcaGui.pymca as target
fname = os.path.join(os.path.dirname(target.__file__), 'PyMcaBatch.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
diff --git a/PyMca5/scripts/pymcapostbatch b/PyMca5/scripts/pymcapostbatch
index c09555e..a2b1bf7 100644
--- a/PyMca5/scripts/pymcapostbatch
+++ b/PyMca5/scripts/pymcapostbatch
@@ -2,10 +2,17 @@
import os
import sys
-import PyMca5.PyMcaGui.pymca.PyMcaPostBatch as target
+import PyMca5.PyMcaGui.pymca as target
fname = os.path.join(os.path.dirname(target.__file__), 'PyMcaPostBatch.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
diff --git a/PyMca5/scripts/pymcaroitool b/PyMca5/scripts/pymcaroitool
index 5ad8104..48c3b53 100644
--- a/PyMca5/scripts/pymcaroitool
+++ b/PyMca5/scripts/pymcaroitool
@@ -2,10 +2,18 @@
import os
import sys
-from PyMca5.PyMcaGui.pymca import QStackWidget as target
+import PyMca5.PyMcaGui.pymca as target
fname = os.path.join(os.path.dirname(target.__file__), 'QStackWidget.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
+
diff --git a/PyMca5/scripts/rgbcorrelator b/PyMca5/scripts/rgbcorrelator
index c09555e..48c3b53 100644
--- a/PyMca5/scripts/rgbcorrelator
+++ b/PyMca5/scripts/rgbcorrelator
@@ -2,10 +2,18 @@
import os
import sys
-import PyMca5.PyMcaGui.pymca.PyMcaPostBatch as target
+import PyMca5.PyMcaGui.pymca as target
-fname = os.path.join(os.path.dirname(target.__file__), 'PyMcaPostBatch.py')
+fname = os.path.join(os.path.dirname(target.__file__), 'QStackWidget.py')
if sys.version < '3.0':
execfile(fname)
else:
- exec(compile(open(fname).read(), fname, 'exec'))
+ f = open(fname, "rb")
+ code_txt = f.read()
+ f.close()
+ if sys.version_info < (3, 7):
+ code = compile(code_txt, fname, 'exec')
+ else:
+ code = code_txt
+ exec(code)
+
diff --git a/PyMca5/tests/XrfTest.py b/PyMca5/tests/XrfTest.py
index 1c3b13b..8f97429 100644
--- a/PyMca5/tests/XrfTest.py
+++ b/PyMca5/tests/XrfTest.py
@@ -317,8 +317,8 @@ class testXrf(unittest.TestCase):
self.assertTrue(referenceElement == "Co",
"referenceElement is <%s> instead of <Co>" % referenceElement)
cobalt = concentrationsResult["mass fraction"]["Co K"]
- self.assertTrue( cobalt == 0.0005,
- "Wrong Co concentration %f" % cobalt)
+ self.assertTrue( abs(cobalt-0.0005) < 1.0E-7,
+ "Wrong Co concentration %f expected 0.0005" % cobalt)
# we should get the same result with internal parameters
cTool = ConcentrationsTool.ConcentrationsTool()
diff --git a/changelog.txt b/changelog.txt
index c5d3584..2ff9a9d 100644
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,12 @@
+VERSION 5.3.2
+-------------
+
+- Fix build issues under Python 3.7
+
+- Fix numpy 1.14.x deprecation warnings
+
+- Continue the documentation improvements
+
VERSION 5.3.1
-------------
diff --git a/doc/man/pymca.1 b/doc/man/pymca.1
index dc4b61a..cfebe58 100644
--- a/doc/man/pymca.1
+++ b/doc/man/pymca.1
@@ -40,5 +40,17 @@ Open the LShellConstants.dat and list its contents in the source browser.
.P
Allows one to browse the HDF5 file your_HDF5_file.h5 in PyMca if the Python module h5py is installed.
+.B pymca --nativefiledialogs=X
+.P
+With X set to 1, the program will use the file dialogs from the operating system. With X set to 0, the program will use Qt file dialogs.
+
+.B pymca --backend=XX
+.P
+Start the program using the selected graphics backend (mpl for matplotlib, gl for OpenGL)
+i
+.B pymca --binding=XX
+.P
+Start the program using the selected Qt binding. It has ot be one of PyQt5, PyQt4, PySide or PySide2.
+
.SH SEE ALSO
HDF5, h5py
diff --git a/doc/man/pymcaroitool.1 b/doc/man/pymcaroitool.1
index 230e3da..c7d9ec6 100644
--- a/doc/man/pymcaroitool.1
+++ b/doc/man/pymcaroitool.1
@@ -41,6 +41,10 @@ its format is supported.
.P
Start the program with a file browser to select the input files.
+.B pymcaroitool --binding=XX
+.P
+Start the program using the selected Qt binding. It has ot be one of PyQt5, PyQt4, PySide or PySide2.
+
.B pymcaroitool file_0001.edf
.P
Tries to open the file named file_0001.edf and all indexed files of
@@ -51,7 +55,6 @@ the form file_????.edf where ???? is a number.
Tries to open the file named file_0001.edf and all indexed files of
the form file_????.edf where ???? is a number as a set of images.
-
.B pymcaroitool uncompressed_tiff_file_0001.tif
.P
Tries to open a series of uncompressed TIFF files as an image stack.
diff --git a/doc/source/customization/index.rst b/doc/source/customization/index.rst
index 7a74053..02b2707 100644
--- a/doc/source/customization/index.rst
+++ b/doc/source/customization/index.rst
@@ -3,6 +3,7 @@ Customizing PyMca
=================
.. toctree::
+ :maxdepth: 3
- plugins1d
- stackplugins
+ settings
+ plugins/index.rst
diff --git a/doc/source/customization/plugins/index.rst b/doc/source/customization/plugins/index.rst
new file mode 100644
index 0000000..92aec36
--- /dev/null
+++ b/doc/source/customization/plugins/index.rst
@@ -0,0 +1,9 @@
+
+
+Plugins
+-------
+
+.. toctree::
+
+ plugins1d
+ stackplugins
diff --git a/doc/source/customization/plugins/plugins1d.rst b/doc/source/customization/plugins/plugins1d.rst
new file mode 100644
index 0000000..77bb7b9
--- /dev/null
+++ b/doc/source/customization/plugins/plugins1d.rst
@@ -0,0 +1,89 @@
+
+1D plugins
+----------
+
+Adding 1D plugins
+*****************
+
+.. currentmodule:: PyMca5.PyMcaCore.Plugin1DBase
+
+Overview
+++++++++
+
+.. automodule:: PyMca5.PyMcaCore.Plugin1DBase
+
+1D plugin API
++++++++++++++
+
+.. autoclass:: Plugin1DBase
+ :members:
+
+.. autoattribute:: MENU_TEXT
+
+.. autofunction:: getPlugin1DInstance
+
+
+Builtin 1D plugins
+******************
+
+Background subtraction tools
+++++++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.BackgroundScanPlugin
+
+Median filter average
++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.MedianFilterScanPlugin
+
+.. TODO: XAS
+
+Simple vertical shift
++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.SimpleShift
+
+.. TODO: MultipleScanToMeshPlugin
+
+Alignment plugin
+++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.AlignmentScanPlugin
+
+.. TODO: Kinetic tools
+
+.. TODO: XASNormalization
+
+.. TODO: AdvancedAlignmentScanPlugin (see .html file in PYMCA_DOC_DIR)
+
+Remove glitches from curves
++++++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.MedianFilterScanDeglitchPlugin
+
+
+Built-in Math
++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.MathPlugins
+
+
+.. TODO: XAS Self-Attenuation Correction
+.. TODO: Regular Mesh Plugins
+
+Normalization
++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.NormalizationPlugins
+
+Fit all curves
+++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.FitAllCurvesPlugin
+
+Motor Info
+++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.MotorInfoPlugin
+
+.. TODO: XLD/XMCD Analysis
diff --git a/doc/source/customization/plugins/stackplugins.rst b/doc/source/customization/plugins/stackplugins.rst
new file mode 100644
index 0000000..b9cc9fc
--- /dev/null
+++ b/doc/source/customization/plugins/stackplugins.rst
@@ -0,0 +1,127 @@
+
+Stack plugins
+-------------
+
+Adding stack plugins
+********************
+
+.. currentmodule:: PyMca5.PyMcaCore.StackPluginBase
+
+Overview
+++++++++
+
+.. automodule:: PyMca5.PyMcaCore.StackPluginBase
+
+Stack plugin API
+++++++++++++++++
+
+.. autoclass:: StackPluginBase
+ :members:
+
+.. autoattribute:: MENU_TEXT
+
+.. autofunction:: getStackPluginInstance
+
+
+Builtin stack plugins
+*********************
+
+Alternative ROI options
++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.ROIStackPlugin
+
+Silx Alternative ROI options
+++++++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.SilxRoiStackPlugin
+
+External Images Tool
+++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.ExternalImagesStackPlugin
+
+Silx External Images Tool
++++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.SilxExternalImagesStackPlugin
+
+Image Alignment Tool
+++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.ImageAlignmentStackPlugin
+
+Image Browser with Median Filter
+++++++++++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.MedianFilterStackPlugin
+
+
+Load positioners from file
+++++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.LoadPositionersStackPlugin
+
+.. TODO:
+
+ PyMca NNMA
+ ++++++++++
+
+ .. automodule:: PyMca5.PyMcaPlugins.NNMAStackPlugin
+
+PyMca PCA
++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.PCAStackPlugin
+
+
+Show Spectra
+++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.StackShowSpectra
+
+Stack Axes Options
+++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.StackAxesPlugin
+
+Stack Filtering Options
++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.BackgroundStackPlugin
+
+Stack Image Browser
++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.StackBrowserPlugin
+
+Stack Normalization
++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.StackNormalizationPlugin
+
+.. TODO: Stack ROI Batch
+
+Stack Row or Column Reversing
++++++++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.ReverseStackPlugin
+
+Stack Scan Window Plugin
+++++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.StackScanWindowPlugin
+
+Stack Simple Fitting
+++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.FitStackPlugin
+
+Stack motor positions
++++++++++++++++++++++
+
+.. automodule:: PyMca5.PyMcaPlugins.StackMotorInfoPlugin
+
+.. TODO: XAS Batch
+
+.. TODO: XAS Stack Normalization
diff --git a/doc/source/customization/plugins1d.rst b/doc/source/customization/plugins1d.rst
deleted file mode 100644
index 929b7f0..0000000
--- a/doc/source/customization/plugins1d.rst
+++ /dev/null
@@ -1,20 +0,0 @@
-
-Adding 1D plugins
------------------
-
-.. currentmodule:: PyMca5.PyMcaCore.Plugin1DBase
-
-Overview
-++++++++
-
-.. automodule:: PyMca5.PyMcaCore.Plugin1DBase
-
-1D plugin API
-+++++++++++++
-
-.. autoclass:: Plugin1DBase
- :members:
-
-.. autoattribute:: MENU_TEXT
-
-.. autofunction:: getPlugin1DInstance
diff --git a/doc/source/customization/settings.rst b/doc/source/customization/settings.rst
new file mode 100644
index 0000000..d39314a
--- /dev/null
+++ b/doc/source/customization/settings.rst
@@ -0,0 +1,4 @@
+
+Settings
+--------
+
diff --git a/doc/source/customization/stackplugins.rst b/doc/source/customization/stackplugins.rst
deleted file mode 100644
index 3a8684a..0000000
--- a/doc/source/customization/stackplugins.rst
+++ /dev/null
@@ -1,21 +0,0 @@
-
-
-Adding stack plugins
---------------------
-
-.. currentmodule:: PyMca5.PyMcaCore.StackPluginBase
-
-Overview
-++++++++
-
-.. automodule:: PyMca5.PyMcaCore.StackPluginBase
-
-Stack plugin API
-++++++++++++++++
-
-.. autoclass:: StackPluginBase
- :members:
-
-.. autoattribute:: MENU_TEXT
-
-.. autofunction:: getStackPluginInstance
diff --git a/doc/source/faq.rst b/doc/source/faq.rst
index 95ac1bf..c13e43c 100644
--- a/doc/source/faq.rst
+++ b/doc/source/faq.rst
@@ -1,16 +1,16 @@
Frequently Asked Questions
==========================
- Should I write PyMCA or PyMca?
- Why did you take the Gioconda as logo?
- I do not use the ESRF data format nor the SPEC file format. Do I have to convert my data?
- I use an X-ray tube, how can I make quantitative analysis?
- The description of the scattering peaks is very poor, why?
- I am on windows, what program version should I use?
- Does PyMca work on Vista or Windows 7?
- I have a Mac, the program seems to hang or to do nothing, how can I report what's happening?
- What have you used to build the binaries?
- I want to build the program from its source code. Do I need Numeric or Numpy?
+- `Should I write PyMCA or PyMca?`_
+- `Why did you take the Gioconda as logo?`_
+- `I do not use the ESRF data format nor the SPEC file format. Do I have to convert my data?`_
+- `I use an X-ray tube, how can I make quantitative analysis?`_
+- `The description of the scattering peaks is very poor, why?`_
+- `I am on windows, what program version should I use?`_
+- `Does PyMca work on Windows 7 and Windows 10?`_
+- `I have a Mac, the program seems to hang or to do nothing, how can I report what's happening?`_
+- `What have you used to build the binaries?`_
+- `I want to build the program from its source code. What do I need?`_
Should I write PyMCA or PyMca?
------------------------------
@@ -42,7 +42,10 @@ The description of the scattering peaks is very poor, why?
----------------------------------------------------------
Because they are fitted as simple gaussians and that is not correct. The reason? I considered that you could always leave them out of the fitting region and therefore the main interest of having them is to allow to deal with their escape peaks when falling into the fitting region. I have to admit that, while this is mostly the case when using synchrotron radiation as excitation source, the Compton peaks can be a problem when using X-ray tubes.
+
I am on windows, what program version should I use?
+---------------------------------------------------
+
The most recent.
From the program point of view I would say that the bugs introduced when switching from PyQt to PyQt4 have been already fixed. In any case, if you make any batch fitting or imaging, you certainly want the latest version. Among other features you can easily find a 10 fold speed improvement ...
@@ -68,6 +71,6 @@ What have you used to build the binaries?
I have used cx_freeze on linux and windows. For the Mac I have used py2app. In order to make installable packages I have used the Nullsoft installer on windows and Platypus on the Mac.
I want to build the program from its source code. What do I need?
------------------------------------------------------------------------------
+-----------------------------------------------------------------
-Please refer to the appropriate installation section.
+Please refer to the paragraph :ref:`Installing from source` in the installation instructions.
diff --git a/doc/source/hdf5/index.rst b/doc/source/hdf5/index.rst
index 3431cc9..fd56830 100644
--- a/doc/source/hdf5/index.rst
+++ b/doc/source/hdf5/index.rst
@@ -14,19 +14,19 @@ Generic HDF5 Support
The data in an HDF5 file provide information about their size and type but they do not provide information about what they represent. Therefore, the approach followed by PyMca to properly visualize the data is cumbersome (at least when used for first time) but simple.
-The approach is based on creating a USER selection table with the datasets of interest inorder to allow the user to choose waht to visualize (aka. *signal*) against what (aka. *axes*).
+The approach is based on creating a USER selection table with the datasets of interest in order to allow the user to choose what to visualize (aka. *signal*) against what (aka. *axes*).
This can be achieved by double clicking the relevant datasets or via a right-button mouse click.
-The nice feature is that the table provides a context menu (right-buttonmouse click) allowing the user to save or load selection tables therefore reducing the need to repetitively browse the file. In addition, the selection table is saved among the PyMca settings(File Menu -> Save ->PyMca Configuration or File Menu -> Save Default Settings).
+The nice feature is that the table provides a context menu (right-buttonmouse click) allowing the user to save or load selection tables therefore reducing the need to repetitively browse the file. In addition, the selection table is saved among the PyMca settings (File Menu -> Save ->PyMca Configuration or File Menu -> Save Default Settings).
Once the datasets of user interest are in the table, the user can select what datasets are to be used as axes (first table column containing checkboxes), as signals (second column containing checkboxes) and eventually as monitor (third column with checkboxes). The only selection that is mandatory to generate a plot is the one corresponding to the signal.
-In case of selection of selecting several axes, the order in which the check boxes were selected determines the dataset to be used as first, second or third axis.
+In case of selecting several axes, the order in which the check boxes were selected determines the dataset to be used as first, second or third axis.
NeXus Support
-------------
-`NeXus <http://www.nexusformat.org>`_ provides a set of directives to share data among different facilities. It provides an API supporting an HDF4 backend, an XML backend and an HDF5 backend. PyMca does not use the NeXus API and therefore only supports the HDF5 backend. By other hand, HDF5 is the most common NeXus backend used at large scale research facilities.
+`NeXus <http://www.nexusformat.org>`_ provides a set of directives to share data among different facilities. It provides an API supporting an HDF4 backend, an XML backend and an HDF5 backend. PyMca does not use the NeXus API and therefore only supports the HDF5 backend. On the other hand, HDF5 is the most common NeXus backend used at large scale research facilities.
NeXus HDF5 files can be handled in the same way as standard HDF5 files. In addition, PyMca will try to make as much use as possible of metadata, default plots and application definitions provided by NeXus to reduce user interaction.
@@ -35,11 +35,11 @@ For instance, version 5.3.0 of PyMca highlights NXdata groups in blue and a doub
Measurement Group Support
-------------------------
-Some facilities follow what we can call the *measurement group approach* when collecting data. It is an additional convention to NeXus characterized for the addition of a group named *measurement* to each NXentry. That goal of that group is to provide the user with a quick access to information without the burden of having to hunt for the information in the highly hierarchical layout imposed by NeXus.
+Some facilities follow what we can call the *measurement group approach* when collecting data. It is an additional convention to NeXus characterized by the addition of a group named *measurement* to each NXentry. The goal of that group is to provide the user with a quick access to information without the burden of having to hunt for the information in the highly hierarchical layout imposed by NeXus.
-The *measurement* group was thought havingin mind interactive handling of HDF5 files by users. Despite that, PyMca exploits that to provide a an automatically filled selection table based on the contents of a *measurement* if present. Therefore, besides the USER selection table described above, PyMca provides the AUTO selection table automatically generated.
+The *measurement* group was thought having in mind interactive handling of HDF5 files by users. Despite that, PyMca exploits that to provide an automatically filled selection table based on the contents of a *measurement* if present. Therefore, besides the USER selection table described above, PyMca provides the AUTO selection table automatically generated.
-Other facilities following a different approache consiting on having an NXdata group as container irrespectively of defining a default plot or not. In an attempt to offer the described functionality to users dealing with data from those facilities, PyMca also fills the AUTO table with the datasets found in the NXdata group containing the largest number of datasets.
+Other facilities follow a different approach consiting on having an NXdata group as container irrespectively of defining a default plot or not. In an attempt to offer the described functionality to users dealing with data from those facilities, PyMca also fills the AUTO table with the datasets found in the NXdata group containing the largest number of datasets.
This is implemented by the function :func:`PyMca5.PyMcaCore.NexusTools.getMeasurementGroup`
diff --git a/doc/source/index.rst b/doc/source/index.rst
index 3c247b2..4f1ce15 100644
--- a/doc/source/index.rst
+++ b/doc/source/index.rst
@@ -39,6 +39,7 @@ Table of contents
changelog.rst
license.rst
faq.rst
+ customization/index.rst
.. toctree::
:hidden:
diff --git a/doc/source/install.rst b/doc/source/install.rst
index 5e6db01..98995cb 100644
--- a/doc/source/install.rst
+++ b/doc/source/install.rst
@@ -2,8 +2,10 @@
Installation steps
==================
-*PyMca* supports most operating systems and different version of the Python
-programming language.
+*PyMca* supports most operating systems and different version of the Python programming language.
+
+It can be installed as a stand alone application or as a Python module. The later offer a greater flexibility besides the possibility to
+make use of different features of *PyMca* in your own Python programs.
Stand-alone Executable
----------------------
@@ -14,11 +16,7 @@ Stand-alone applications (aka. frozen binaries) are supplied for Windows and Mac
Python module
-------------
-The best use of PyMca can be achieved installing PyMca as a python package inside an existing Python installation. For Windows and MacOS there are pre-compiled modules available in order to simplify the tast.
-
-You can also install PyMca from its source code. While `numpy <http://www.numpy.org/>`_ and `fisx <https://github.com/vasole/fisx>`_ are the only mandatory dependencies for command line usage,
-graphical widgets require Qt and `matplotlib <http://matplotlib.org/>`_ and management of HDF5 data files requires
-`h5py <http://docs.h5py.org/en/latest/build.html>`_.
+The best use of PyMca can be achieved installing PyMca as a python package inside an existing Python installation. For Windows and MacOS there are pre-compiled modules available in order to simplify the task.
This table summarized the the support matrix of PyMca:
@@ -35,62 +33,56 @@ This table summarized the the support matrix of PyMca:
For all platforms, you can install *PyMca5* from the source, see `Installing from source`_.
-Dependencies
-------------
+Installing Python
++++++++++++++++++
-Tools for reading and writing HDF5 files depend on:
+You can skip this section if you already have a properly configured Python installation.
-* `h5py <http://docs.h5py.org/en/latest/build.html>`_
+Windows
+.......
-The GUI widgets depend on the following extra packages:
+Download and install `Python <https://www.python.org/downloads/windows/>`_.
-* A Qt binding: either `PyQt5, PyQt4 <https://riverbankcomputing.com/software/pyqt/intro>`_,
- `PySide <https://pypi.python.org/pypi/PySide/>`_, or `PySide2 <https://wiki.qt.io/PySide2>`_
-* `matplotlib <http://matplotlib.org/>`_
+We recommend that you install the 64bits version of Python, which is not the
+default version suggested on the Python website.
+The 32bits version is limited to 2 GB of memory, and also we don't provide a
+binary wheel for it what means that you would have to install *PyMca5* from its sources, which requires you to install a C compiler first.
-The following packages are optional dependencies:
-
-* `silx <https://github.com/silx-kit/silx>`_ for enhanced widgets
-* `qt_console <https://pypi.python.org/pypi/qtconsole>`_ for the interactive console widget.
-* `PyOpenGL <http://pyopengl.sourceforge.net/>`_ for 3D and scatter plot visualization
+We also encourage you to use Python 3.5 or newer, former versions are no more
+officially supported.
-It is expected that h5py and silx become required dependencies within short because:
+Configure Python as explained on
+`docs.python.org <https://docs.python.org/3/using/windows.html#configuring-python>`_
+to add the python installation directory to your PATH environment variable.
-- h5py will become the preferred input/output file format of PyMca
-- silx provides a better widget library than the one currently supplied by PyMca
-
-The complete list of dependencies with the minimal version is described in the
-`requirements.txt <https://github.com/vasole/pymca/requirements.txt>`_
-at the top level of the source package.
+You may need to configure your PATH environment variable to include the pip installation directory.
-Build dependencies
-++++++++++++++++++
+MacOS
+.....
-In addition to run-time dependencies, building *PyMca* requires a C/C++ compiler,
-`numpy <http://www.numpy.org/>`_ and `cython <http://cython.org>`_ (optional).
+Python 2.7 is shipped by default but we recommend using Python 3.5 or newer to simplify the installation of the Qt library.
-On Windows it is recommended to use Python 3.5 or later, because of using a more recent compiler.
+Download and install Python from `python.org <https://www.python.org/downloads/mac-osx/>`_ or, alternatively, install Python from the `anaconda distribution <https://www.anaconda.com/download/>`_
-This project uses Cython (version > 0.21) to generate C files.
-Cython is now mandatory to build *PyMca* from the development branch and is only
-needed when compiling binary modules.
+Open a terminal and type ``which python3`` and ``which pip3``. Those commands should give you back the location of the respective scripts if you have properly installed python.
Linux
------
+.....
-There are no frozen binaries or wheels available for linux. Nevertheless, there are strong chances that *PyMca* is available as a native package for your distribution.
+For Linux please refer to the relevant documentation of your linux distribution.
-If you need to build *PyMca* from its source code, and NumPy and fisx are not installed on your system, you need to install them first, preferably with the package manager of your system. If you cannot use the package manager of your system (which requires the root access), please refer to the Virtual Environment procedure explained in the `silx documentation <http://www.silx.org/doc/silx/latest/install.html>`_
-Please refer to `Installing from source`_
+Installing PyMca
+++++++++++++++++
-.. note::
+This assumes you have Python and pip installed and configured. If you don't, read the previous sections.
- The Debian packages `python-pymca5` and `python3-pymca5` will not install executables
- (`pymca`, `pymcaroitool` ...). Please install the pymca package.
+For MacOS and Windows this should work without issues, as binary wheels of *PyMca* are provided on PyPI.
+
+.. _Windows:
Windows
--------
+.......
The simple way of installing *PyMca* on Windows is to type the following
commands in a command prompt:
@@ -99,91 +91,91 @@ commands in a command prompt:
pip install PyMca5
-.. note::
-
- This installs *PyMca* without the optional dependencies.
- Instructions on how to install dependencies are given in the
- `Installing dependencies`_ section.
-
-This assumes you have Python and pip installed and configured. If you don't,
-read the following sections.
-
+That install *PyMca* for command line use but all dependencies may be simply installed with pip.
-Installing Python
-+++++++++++++++++
+A convenient set of dependencies can be installed with:
-Please follow the instructions suplied by the silx project http://www.silx.org/doc/silx/latest/install.html
+.. code-block:: bash
-Using pip
-+++++++++
+ pip install -r https://raw.githubusercontent.com/vasole/pymca/master/requirements.txt
-Configure your PATH environment variable to include the pip installation
-directory, the same way as described for Python.
+.. note::
+
+ Detailed instructions on how to install dependencies are given in the
+ `Installing dependencies`_ section.
-The pip installation directory will likely be ``C:\Python35\Scripts\``.
-Then you will be able to use all pip commands listed in following in a command
-prompt.
+.. _MacOS:
+MacOS
+.....
-Installing dependencies
-+++++++++++++++++++++++
-All dependencies may be simply installed with pip:
+It is exactly like with windows, perhaps you may need to replace pip by pip3 as follows:
.. code-block:: bash
- pip install -r https://raw.githubusercontent.com/vasole/pymca/master/requirements.txt
-
-
-Installing *PyMca*
-++++++++++++++++++
+ pip3 uninstall pymca
+ pip3 uninstall PyMca5
+ pip3 install pymca
-Provided numpy is installed, you can install *PyMca* with:
+or
.. code-block:: bash
- pip install pymca
+ pip3 uninstall pymca
+ pip3 uninstall PyMca5
+ pip3 install PyMca5
-or
+A convenient set of dependencies can be installed with:
.. code-block:: bash
- pip install PyMca5
+ pip3 install -r https://raw.githubusercontent.com/vasole/pymca/master/requirements.txt
+.. note::
+
+ Detailed instructions on how to install dependencies are given in the
+ `Installing dependencies`_ section.
-MacOS
------
+.. _Linux:
-While Apple ships Python 2.7 by default on their operating systems, we recommend
-using Python 3.5 or newer to ease the installation of the Qt library.
+Linux
+.....
-The installation of PyMca can simply be performed by:
+There are no frozen binaries or wheels available for linux. Nevertheless, there are strong chances that *PyMca* is available as a native package for your distribution.
-.. code-block:: bash
+If you need to build *PyMca* from its source code, and NumPy and fisx are not installed on your system, you need to install them first, preferably with the package manager of your system. If you cannot use the package manager of your system (which requires the root access), please refer to the Virtual Environment procedure explained in the `silx documentation <http://www.silx.org/doc/silx/latest/install.html>`_
- pip install -r https://raw.githubusercontent.com/vasole/pymca/master/requirements.txt
+Please refer to `Installing from source`_
-Then install *PyMca* with:
+.. note::
-.. code-block:: bash
+ The Debian packages `python-pymca5` and `python3-pymca5` will not install executables
+ (`pymca`, `pymcaroitool` ...). Please install the pymca package.
- pip install pymca
-or
+You can also install PyMca from its source code. While `numpy <http://www.numpy.org/>`_ and `fisx <https://github.com/vasole/fisx>`_ are the only mandatory dependencies for command line usage,
+graphical widgets require Qt and `matplotlib <http://matplotlib.org/>`_ and management of HDF5 data files requires
+`h5py <http://docs.h5py.org/en/latest/build.html>`_.
-.. code-block:: bash
+.. _Installing from source:
- pip install PyMca5
+Installing from source
+----------------------
-This should work without issues, as binary wheels of *PyMca* are provided on PyPI.
+To build *PyMca* from source requires the use of compiler. While this is not a problem under linux, it can be problematic for Windows or MacOS users. The installation of Visual Studio under windows or XCode under MacOS is beyond the purpose of this tutorial. Please refer to appropriate documentation sources.
+Build dependencies
+++++++++++++++++++
-Installing from source
-----------------------
+In addition to run-time dependencies, building *PyMca* requires a C/C++ compiler, `numpy <http://www.numpy.org/>`_ and `cython <http://cython.org>`_ (optional).
+
+This project uses Cython (version > 0.21) to generate C files.
+Cython is now mandatory to build *PyMca* from the development branch and is only
+needed when compiling binary modules.
-Building *PyMca* from the source requires NumPy and fisx installed that can be
-installed using:
+Building *PyMca* from the source requires NumPy and fisx installed that can be installed using:
.. code-block:: bash
@@ -210,7 +202,7 @@ After downloading the `PyMca5-x.y.z.tar.gz` archive, extract its content:
tar xzvf PyMca5-x.y.z.tar.gz
cd PyMca5-x.y.z
- pip uninstall -y silx
+ pip uninstall -y PyMca5
pip install . [--user]
Alternatively, you can get the latest source code from the master branch of the
@@ -245,7 +237,7 @@ There are few advanced options to ``setup.py build``:
* ``--no-cython``: Prevent Cython (even if installed) to re-generate the C source code.
Use the one provided by the development team.
-It is not recommended to run the test suite of *PyMca* only after installation:
+It is recommended to run the test suite of *PyMca* only after installation:
.. code-block:: bash
@@ -264,9 +256,65 @@ To build the documentation, using `Sphinx <http://www.sphinx-doc.org/>`_:
python setup.py build build_doc
+.. _installing dependencies:
+
+Dependencies
+++++++++++++
+
+Tools for reading and writing HDF5 files depend on:
+
+* `h5py <http://docs.h5py.org/en/latest/build.html>`_
+
+The GUI widgets depend on the following extra packages:
+
+* A Qt binding: either `PyQt5, PyQt4 <https://riverbankcomputing.com/software/pyqt/intro>`_,
+ `PySide <https://pypi.python.org/pypi/PySide/>`_, or `PySide2 <https://wiki.qt.io/PySide2>`_
+* `matplotlib <http://matplotlib.org/>`_
+
+The following packages are optional dependencies:
+
+* `silx <https://github.com/silx-kit/silx>`_ for enhanced widgets
+* `qt_console <https://pypi.python.org/pypi/qtconsole>`_ for the interactive console widget.
+* `PyOpenGL <http://pyopengl.sourceforge.net/>`_ for 3D and scatter plot visualization
+
+It is expected that h5py and silx become required dependencies within short because:
+
+- h5py will become the preferred input/output file format of PyMca
+- silx provides a better widget library than the one currently supplied by PyMca
+
+The complete list of dependencies with the minimal version is described in the
+`requirements.txt <https://github.com/vasole/pymca/requirements.txt>`_
+at the top level of the source package.
+
+
+Installing *PyMca*
+++++++++++++++++++
+
+Provided numpy is installed, you can install *PyMca* with:
+
+.. code-block:: bash
+
+ pip install pymca
+
+or
+
+.. code-block:: bash
+
+ pip install PyMca5
+
+For MacOS and Windows this should work without issues, as binary wheels of *PyMca* are provided on PyPI.
+
+Please remember to replace pip by pip3 if that is what you are using.
+
+All dependencies may be simply installed with pip. Please replace pip by pip3 if that is what you are using:
+
+.. code-block:: bash
+
+ pip install -r https://raw.githubusercontent.com/vasole/pymca/master/requirements.txt
+
Testing
-+++++++
+-------
To run the tests of an installed version of *PyMca*, from the python interpreter, run:
@@ -280,3 +328,10 @@ To run the test suite from the command line run:
.. code-block:: bash
python -m PyMca5.tests.TestAll
+
+or
+
+.. code-block:: bash
+
+ python3 -m PyMca5.tests.TestAll
+
diff --git a/setup.py b/setup.py
index 593f50c..b1fc4b8 100644
--- a/setup.py
+++ b/setup.py
@@ -58,7 +58,10 @@ if ("--install-scripts" in sys.argv or "--install-lib" in sys.argv or
try:
from Cython.Distutils import build_ext
import Cython.Compiler.Version
- if Cython.Compiler.Version.version < '0.18':
+ cython_version = Cython.Compiler.Version.version
+ if (sys.version_info >= (3, 7)) and (cython_version < "0.28.3"):
+ build_ext = None
+ elif cython_version < '0.18':
build_ext = None
except ImportError:
build_ext = None
@@ -119,6 +122,27 @@ def use_cython():
return True
+# check if GUI dependencies are to be considered install_requires
+def use_gui():
+ """
+ Check if GUI dependencies are requested.
+ """
+
+ if "WITH_GUI" in os.environ:
+ if os.environ["WITH_GUI"] not in ["False", "0", 0]:
+ print("GUI requirements requested by environment")
+ return True
+
+ if "--gui" in sys.argv:
+ sys.argv.remove("--gui")
+ os.environ["WITH_GUI"] = "True"
+ print("GUI requrements requested by command line")
+ return True
+
+ return False
+
+
+
if build_ext is not None:
# we can use cython, but it may have been explicitely disabled
if not use_cython():
@@ -383,13 +407,33 @@ def build_plotting_ctools(ext_modules):
c_files = [os.path.join(basedir, 'src', 'InsidePolygonWithBounds.c'),
os.path.join(basedir, 'src', 'MinMaxImpl.c'),
os.path.join(basedir, 'src', 'Colormap.c')]
-
+ cython_dir = os.path.join(basedir, 'cython')
if build_ext:
+ # delete previously generated code (if any)
+ for fname in glob.glob(os.path.join(cython_dir, '*.c')):
+ try:
+ os.remove(fname)
+ except:
+ print("Cannot delete previously generated code <%s>" % fname)
+ raise
src = [os.path.join(basedir, 'cython', '_ctools.pyx')]
else:
- src = []
- for fname in glob.glob(os.path.join(basedir, 'cython', '*.c')):
- src.append(os.path.join(basedir, 'cython', os.path.basename(fname)))
+ inSrc = os.path.join(cython_dir, 'default', '_ctools.c')
+ outSrc = os.path.join(cython_dir, '_ctools.c')
+ inFile = open(inSrc, 'rb')
+ inLines = inFile.readlines()
+ inFile.close()
+ if os.path.exists(outSrc):
+ outFile = open(outSrc, 'rb')
+ outLines = outFile.readlines()
+ outFile.close()
+ if outLines != inLines:
+ os.remove(outSrc)
+ if not os.path.exists(outSrc):
+ outFile = open(outSrc, 'wb')
+ outFile.writelines(inLines)
+ outFile.close()
+ src = [outSrc]
src += c_files
if sys.platform == 'win32':
@@ -414,12 +458,33 @@ def build_xas_xas(ext_modules):
basedir = os.path.join('PyMca5', 'PyMcaPhysics', 'xas', '_xas')
c_files = [os.path.join(basedir, 'src', 'polspl.c'),
os.path.join(basedir, 'src', 'bessel0.c')]
+ cython_dir = os.path.join(basedir, 'cython')
if build_ext:
+ # delete previously generated code (if any)
+ for fname in glob.glob(os.path.join(cython_dir, '*.c')):
+ try:
+ os.remove(fname)
+ except:
+ print("Cannot delete previously generated code <%s>" % fname)
+ raise
src = [os.path.join(basedir, 'cython', '_xas.pyx')]
else:
- src = []
- for fname in glob.glob(os.path.join(basedir, 'cython', '*.c')):
- src.append(os.path.join(basedir, 'cython', os.path.basename(fname)))
+ inSrc = os.path.join(cython_dir, 'default', '_xas.c')
+ inFile = open(inSrc, 'rb')
+ inLines = inFile.readlines()
+ inFile.close()
+ outSrc = os.path.join(cython_dir, '_xas.c')
+ if os.path.exists(outSrc):
+ outFile = open(outSrc, 'rb')
+ outLines = outFile.readlines()
+ outFile.close()
+ if outLines != inLines:
+ os.remove(outSrc)
+ if not os.path.exists(outSrc):
+ outFile = open(outSrc, 'wb')
+ outFile.writelines(inLines)
+ outFile.close()
+ src = [outSrc]
src += c_files
if sys.platform == 'win32':
extra_compile_args = []
@@ -827,7 +892,19 @@ classifiers = ["Development Status :: 5 - Production/Stable",
"Topic :: Scientific/Engineering :: Visualization",
]
-install_requires = ["numpy", "matplotlib", "fisx>=1.1.4"]
+# install requires for non-GUI usage
+install_requires = ["numpy",
+ "matplotlib>1.0",
+ "fisx>=1.1.4",
+ "h5py"]
+if use_gui():
+ # install requires with all easy-to-provide GUI functionality
+ # please take a look at requirements.txt for detailed explanation
+ install_requires += ["PyOpenGL",
+ "qtconsole",
+ "PyQt5", # either PyQt4 or PySide supported too
+ "silx>=0.8"]
+
setup_requires = ["numpy"]
distrib = setup(name="PyMca5",
@@ -837,7 +914,7 @@ distrib = setup(name="PyMca5",
author_email="sole@esrf.fr",
license="MIT",
url="http://pymca.sourceforge.net",
- download_url="https://github.com/vasole/pymca/archive/v%s.tar.gz" % __version__,
+ download_url="https://github.com/vasole/pymca/archive/v%s.tar.gz" % __version__,
long_description=long_description,
packages=packages,
platforms='any',