Skip to content
Fetching contributors…
Cannot retrieve contributors at this time
14444 lines (13514 sloc) 635 KB
/* Generated by Cython 0.17.1 on Mon Oct 29 21:22:25 2012 */
#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 < 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 PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && !PyComplex_Check(o))
#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"
#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 > 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_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
#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__scipy__io__matlab__mio5_utils
#define __PYX_HAVE_API__scipy__io__matlab__mio5_utils
#include "stdlib.h"
#include "string.h"
#include "stdio.h"
#include "pythread.h"
#include "numpy/arrayobject.h"
#include "numpy/ufuncobject.h"
#include "numpy_rephrasing.h"
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */
#ifdef PYREX_WITHOUT_ASSERTIONS
#define CYTHON_WITHOUT_ASSERTIONS
#endif
/* inline attribute */
#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
/* unused attribute */
#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 long n; const char* encoding; const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
/* Type Conversion Predeclarations */
#define __Pyx_PyBytes_FromUString(s) PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s) ((unsigned char*) PyBytes_AsString(s))
#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))
#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_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[] = {
"mio5_utils.pyx",
"numpy.pxd",
"type.pxd",
"bool.pxd",
"complex.pxd",
"streams.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;
/* "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< 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
#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
/*--- Type declarations ---*/
struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream;
struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5;
struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5;
/* "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;
struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_seek;
struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_read_string;
/* "streams.pxd":6
* cdef object fobj
*
* cpdef int seek(self, long int offset, int whence=*) except -1 # <<<<<<<<<<<<<<
* cpdef long int tell(self) except -1
* cdef int read_into(self, void *buf, size_t n) except -1
*/
struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_seek {
int __pyx_n;
int whence;
};
/* "streams.pxd":9
* cpdef long int tell(self) except -1
* cdef int read_into(self, void *buf, size_t n) except -1
* cdef object read_string(self, size_t n, void **pp, int copy=*) # <<<<<<<<<<<<<<
*
* cpdef GenericStream make_stream(object fobj)
*/
struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_read_string {
int __pyx_n;
int copy;
};
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element;
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric;
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_mi_matrix;
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_array_from_header;
/* "scipy/io/matlab/mio5_utils.pyx":68
*
*
* cdef enum: # <<<<<<<<<<<<<<
* miINT8 = 1
* miUINT8 = 2
*/
enum {
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT8 = 1,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miUINT8 = 2,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT16 = 3,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miUINT16 = 4,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT32 = 5,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miUINT32 = 6,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miSINGLE = 7,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miDOUBLE = 9,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miINT64 = 12,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miUINT64 = 13,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miMATRIX = 14,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miCOMPRESSED = 15,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miUTF8 = 16,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miUTF16 = 17,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_miUTF32 = 18
};
/* "scipy/io/matlab/mio5_utils.pyx":85
* miUTF32 = 18
*
* cdef enum: # see comments in mio5_params # <<<<<<<<<<<<<<
* mxCELL_CLASS = 1
* mxSTRUCT_CLASS = 2
*/
enum {
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxCELL_CLASS = 1,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxSTRUCT_CLASS = 2,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOBJECT_CLASS = 3,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxCHAR_CLASS = 4,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxSPARSE_CLASS = 5,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxDOUBLE_CLASS = 6,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxSINGLE_CLASS = 7,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT8_CLASS = 8,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT8_CLASS = 9,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT16_CLASS = 10,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT16_CLASS = 11,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT32_CLASS = 12,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT32_CLASS = 13,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxINT64_CLASS = 14,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxUINT64_CLASS = 15,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxFUNCTION_CLASS = 16,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOPAQUE_CLASS = 17,
__pyx_e_5scipy_2io_6matlab_10mio5_utils_mxOBJECT_CLASS_FROM_MATRIX_H = 18
};
/* "scipy/io/matlab/mio5_utils.pyx":316
* return 1
*
* cdef object read_element(self, # <<<<<<<<<<<<<<
* cnp.uint32_t *mdtype_ptr,
* cnp.uint32_t *byte_count_ptr,
*/
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element {
int __pyx_n;
int copy;
};
/* "scipy/io/matlab/mio5_utils.pyx":412
* return 0
*
* cpdef cnp.ndarray read_numeric(self, int copy=True): # <<<<<<<<<<<<<<
* ''' Read numeric data element into ndarray
*
*/
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric {
int __pyx_n;
int copy;
};
/* "scipy/io/matlab/mio5_utils.pyx":592
* return size
*
* cdef read_mi_matrix(self, int process=1): # <<<<<<<<<<<<<<
* ''' Read header with matrix at sub-levels
*
*/
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_mi_matrix {
int __pyx_n;
int process;
};
/* "scipy/io/matlab/mio5_utils.pyx":624
* return self.array_from_header(header, process)
*
* cpdef array_from_header(self, VarHeader5 header, int process=1): # <<<<<<<<<<<<<<
* ''' Read array of any class, given matrix `header`
*
*/
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_array_from_header {
int __pyx_n;
int process;
};
/* "streams.pxd":3
* # -*- python -*- or rather like
*
* cdef class GenericStream: # <<<<<<<<<<<<<<
* cdef object fobj
*
*/
struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream {
PyObject_HEAD
struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *__pyx_vtab;
PyObject *fobj;
};
/* "scipy/io/matlab/mio5_utils.pyx":119
*
*
* cdef class VarHeader5: # <<<<<<<<<<<<<<
* cdef readonly object name
* cdef readonly int mclass
*/
struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 {
PyObject_HEAD
PyObject *name;
int mclass;
PyObject *dims;
__pyx_t_5numpy_int32_t dims_ptr[32];
int n_dims;
int is_complex;
int is_logical;
int is_global;
size_t nzmax;
};
/* "scipy/io/matlab/mio5_utils.pyx":141
*
*
* cdef class VarReader5: # <<<<<<<<<<<<<<
* cdef public int is_swapped, little_endian
* cdef int struct_as_record
*/
struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 {
PyObject_HEAD
struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_vtab;
int is_swapped;
int little_endian;
int struct_as_record;
PyObject *codecs;
PyObject *uint16_codec;
struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *cstream;
PyObject *dtypes[20];
PyObject *class_dtypes[20];
PyArray_Descr *U1_dtype;
PyArray_Descr *bool_dtype;
int mat_dtype;
int squeeze_me;
int chars_as_strings;
};
/* "streams.pxd":3
* # -*- python -*- or rather like
*
* cdef class GenericStream: # <<<<<<<<<<<<<<
* cdef object fobj
*
*/
struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream {
int (*seek)(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *, long, int __pyx_skip_dispatch, struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_seek *__pyx_optional_args);
long (*tell)(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *, int __pyx_skip_dispatch);
int (*read_into)(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *, void *, size_t);
PyObject *(*read_string)(struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *, size_t, void **, struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_read_string *__pyx_optional_args);
};
static struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *__pyx_vtabptr_5scipy_2io_6matlab_7streams_GenericStream;
/* "scipy/io/matlab/mio5_utils.pyx":141
*
*
* cdef class VarReader5: # <<<<<<<<<<<<<<
* cdef public int is_swapped, little_endian
* cdef int struct_as_record
*/
struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 {
int (*cread_tag)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, char *);
PyObject *(*read_element)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void **, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element *__pyx_optional_args);
int (*read_element_into)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *, void *);
PyArrayObject *(*read_numeric)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int __pyx_skip_dispatch, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric *__pyx_optional_args);
PyObject *(*read_int8_string)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *);
int (*read_into_int32s)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_int32_t *);
int (*cread_full_tag)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, __pyx_t_5numpy_uint32_t *, __pyx_t_5numpy_uint32_t *);
struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *(*read_header)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int __pyx_skip_dispatch);
size_t (*size_from_header)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *);
PyObject *(*read_mi_matrix)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_mi_matrix *__pyx_optional_args);
PyObject *(*array_from_header)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *, int __pyx_skip_dispatch, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_array_from_header *__pyx_optional_args);
PyArrayObject *(*read_real_complex)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *, int __pyx_skip_dispatch);
PyObject *(*read_sparse)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *);
PyArrayObject *(*read_char)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *, int __pyx_skip_dispatch);
PyArrayObject *(*read_cells)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *, int __pyx_skip_dispatch);
PyObject *(*cread_fieldnames)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int *);
PyArrayObject *(*read_struct)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *, int __pyx_skip_dispatch);
PyArrayObject *(*read_opaque)(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *, int __pyx_skip_dispatch);
};
static struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_vtabptr_5scipy_2io_6matlab_10mio5_utils_VarReader5;
static CYTHON_INLINE PyObject *__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_int8_string(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *);
static CYTHON_INLINE size_t __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_size_from_header(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *);
static CYTHON_INLINE PyObject *__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_cread_fieldnames(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *, int *);
#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)
static PyObject *__Pyx_GetName(PyObject *dict, 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 CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*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 long __Pyx_mod_long(long, long); /* proto */
static CYTHON_INLINE long __Pyx_div_long(long, long); /* proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
if (likely(PyList_CheckExact(L))) {
if (unlikely(PyList_Append(L, x) < 0)) return NULL;
Py_INCREF(Py_None);
return Py_None; /* this is just to have an accurate signature */
} else {
PyObject *r, *m;
m = __Pyx_GetAttrString(L, "append");
if (!m) return NULL;
r = PyObject_CallFunctionObjArgs(m, x, NULL);
Py_DECREF(m);
return r;
}
}
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
const char *name, int exact); /*proto*/
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;
}
#define __Pyx_GetItemInt_List(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_List_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
if (likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
PyObject *r = PyList_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyList_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyList_GET_ITEM(o, PyList_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Tuple_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
if (likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, i);
Py_INCREF(r);
return r;
}
else if ((-PyTuple_GET_SIZE(o) <= i) & (i < 0)) {
PyObject *r = PyTuple_GET_ITEM(o, PyTuple_GET_SIZE(o) + i);
Py_INCREF(r);
return r;
}
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
return PySequence_GetItem(o, i);
#endif
}
#define __Pyx_GetItemInt(o, i, size, to_py_func) (((size) <= sizeof(Py_ssize_t)) ? \
__Pyx_GetItemInt_Fast(o, i) : \
__Pyx_GetItemInt_Generic(o, to_py_func(i)))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i) {
#if CYTHON_COMPILING_IN_CPYTHON
if (PyList_CheckExact(o)) {
Py_ssize_t n = (likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
if (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 = (likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
if (likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
PyObject *r = PyTuple_GET_ITEM(o, n);
Py_INCREF(r);
return r;
}
} else { /* inlined PySequence_GetItem() */
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
if (likely(m && m->sq_item)) {
if (unlikely(i < 0) && likely(m->sq_length)) {
Py_ssize_t l = m->sq_length(o);
if (unlikely(l < 0)) return NULL;
i += l;
}
return m->sq_item(o, i);
}
}
#else
if (PySequence_Check(o)) {
return PySequence_GetItem(o, i);
}
#endif
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}
static CYTHON_INLINE int __Pyx_PySequence_Contains(PyObject* item, PyObject* seq, int eq) {
int result = PySequence_Contains(seq, item);
return unlikely(result < 0) ? result : (result == (eq == Py_EQ));
}
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);
static void __Pyx_RaiseBufferFallbackError(void); /*proto*/
static void __Pyx_RaiseBufferIndexError(int axis); /*proto*/
#define __Pyx_BufPtrStrided1d(type, buf, i0, s0) (type)((char*)buf + i0 * s0)
static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t); /* proto */
#define UNARY_NEG_WOULD_OVERFLOW(x) (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
#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)) {
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_RaiseNoneNotIterableError(void);
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, long level); /*proto*/
static CYTHON_INLINE void __Pyx_RaiseImportError(PyObject *name);
static CYTHON_INLINE npy_uint32 __Pyx_PyInt_from_py_npy_uint32(PyObject *);
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_uint32(npy_uint32);
static CYTHON_INLINE npy_int32 __Pyx_PyInt_from_py_npy_int32(PyObject *);
static CYTHON_INLINE PyObject *__Pyx_PyInt_to_py_npy_int32(npy_int32);
#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_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 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 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_check_binary_version(void);
static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*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
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*/
static void* __Pyx_GetVtable(PyObject *dict); /*proto*/
static int __Pyx_ImportFunction(PyObject *module, const char *funcname, void (**f)(void), const char *sig); /*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 'libc.stdlib' */
/* Module declarations from 'libc.string' */
/* Module declarations from 'cpython.version' */
/* Module declarations from 'cpython.ref' */
/* Module declarations from 'cpython.exc' */
/* Module declarations from 'cpython.module' */
/* Module declarations from 'cpython.mem' */
/* Module declarations from 'cpython.tuple' */
/* Module declarations from 'cpython.list' */
/* Module declarations from 'libc.stdio' */
/* Module declarations from 'cpython.object' */
/* Module declarations from 'cpython.sequence' */
/* Module declarations from 'cpython.mapping' */
/* Module declarations from 'cpython.iterator' */
/* Module declarations from '__builtin__' */
/* Module declarations from 'cpython.type' */
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
/* Module declarations from 'cpython.number' */
/* Module declarations from 'cpython.int' */
/* Module declarations from '__builtin__' */
/* Module declarations from 'cpython.bool' */
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
/* Module declarations from 'cpython.long' */
/* Module declarations from 'cpython.float' */
/* Module declarations from '__builtin__' */
/* Module declarations from 'cpython.complex' */
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
/* Module declarations from 'cpython.string' */
/* Module declarations from 'cpython.unicode' */
/* Module declarations from 'cpython.dict' */
/* Module declarations from 'cpython.instance' */
/* Module declarations from 'cpython.function' */
/* Module declarations from 'cpython.method' */
/* Module declarations from 'cpython.weakref' */
/* Module declarations from 'cpython.getargs' */
/* Module declarations from 'cpython.pythread' */
/* Module declarations from 'cpython.pystate' */
/* Module declarations from 'cpython.cobject' */
/* Module declarations from 'cpython.oldbuffer' */
/* Module declarations from 'cpython.set' */
/* Module declarations from 'cpython.buffer' */
/* Module declarations from 'cpython.bytes' */
/* Module declarations from 'cpython.pycapsule' */
/* Module declarations from 'cpython' */
/* 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 'scipy.io.matlab.streams' */
static PyTypeObject *__pyx_ptype_5scipy_2io_6matlab_7streams_GenericStream = 0;
static struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *(*__pyx_f_5scipy_2io_6matlab_7streams_make_stream)(PyObject *, int __pyx_skip_dispatch); /*proto*/
/* Module declarations from 'scipy.io.matlab.mio5_utils' */
static PyTypeObject *__pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarHeader5 = 0;
static PyTypeObject *__pyx_ptype_5scipy_2io_6matlab_10mio5_utils_VarReader5 = 0;
static PyArray_Descr *__pyx_v_5scipy_2io_6matlab_10mio5_utils_OPAQUE_DTYPE = 0;
static __pyx_t_5numpy_uint32_t __pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_t_5numpy_uint32_t, int __pyx_skip_dispatch); /*proto*/
static __Pyx_TypeInfo __Pyx_TypeInfo_object = { "Python object", NULL, sizeof(PyObject *), { 0 }, 0, 'O', 0, 0 };
#define __Pyx_MODULE_NAME "scipy.io.matlab.mio5_utils"
int __pyx_module_is_main_scipy__io__matlab__mio5_utils = 0;
/* Implementation of 'scipy.io.matlab.mio5_utils' */
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_object;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_uint32_t __pyx_v_u4); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_set_dims(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self, PyObject *__pyx_v_dims); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self); /* proto */
static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global_2__set__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5___cinit__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, PyObject *__pyx_v_preader); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_2set_stream(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, PyObject *__pyx_v_fobj); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_4read_tag(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_6read_numeric(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, int __pyx_v_copy); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_8read_full_tag(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10read_header(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_12array_from_header(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_header, int __pyx_v_process); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_14read_real_complex(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_header); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_16read_char(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_header); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_18read_cells(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_header); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_20read_fieldnames(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_22read_struct(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_header); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_24read_opaque(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_hdr); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self); /* proto */
static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_10is_swapped_2__set__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self); /* proto */
static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_13little_endian_2__set__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, PyObject *__pyx_v_value); /* 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 char __pyx_k_1[] = " ";
static char __pyx_k_2[] = " ";
static char __pyx_k_3[] = "<U1";
static char __pyx_k_5[] = ">U1";
static char __pyx_k_8[] = "Error in SDE format data";
static char __pyx_k_10[] = "Expecting miINT8 as data type";
static char __pyx_k_12[] = "Expecting miINT32 as data type";
static char __pyx_k_14[] = "Too many dimensions (%d) for numpy arrays";
static char __pyx_k_15[] = "Expecting matrix here";
static char __pyx_k_20[] = "Do not support encoding %d";
static char __pyx_k_21[] = "Type %d does not appear to be char type";
static char __pyx_k_23[] = "Only one value for namelength";
static char __pyx_k_25[] = "_%d_%s";
static char __pyx_k_29[] = "ndarray is not C contiguous";
static char __pyx_k_31[] = "ndarray is not Fortran contiguous";
static char __pyx_k_33[] = "Non-native byte order not supported";
static char __pyx_k_35[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_36[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_39[] = "Format string allocated too short.";
static char __pyx_k_41[] = " Cython mio5 utility routines (-*- python -*- like)\n\n";
static char __pyx_k_42[] = "numpy.compat";
static char __pyx_k_43[] = "scipy.io.matlab.miobase";
static char __pyx_k_44[] = "*";
static char __pyx_k_45[] = "scipy.io.matlab.mio_utils";
static char __pyx_k_46[] = "scipy.io.matlab.mio5_params";
static char __pyx_k_47[] = "scipy.sparse";
static char __pyx_k_48[] = "<";
static char __pyx_k_49[] = ">";
static char __pyx_k__B[] = "B";
static char __pyx_k__F[] = "F";
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__T[] = "T";
static char __pyx_k__U[] = "U";
static char __pyx_k__b[] = "b";
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__c8[] = "c8";
static char __pyx_k__np[] = "np";
static char __pyx_k__s0[] = "s0";
static char __pyx_k__s1[] = "s1";
static char __pyx_k__s2[] = "s2";
static char __pyx_k__arr[] = "arr";
static char __pyx_k__c16[] = "c16";
static char __pyx_k__sys[] = "sys";
static char __pyx_k__bool[] = "bool";
static char __pyx_k__copy[] = "copy";
static char __pyx_k__imag[] = "imag";
static char __pyx_k__miob[] = "miob";
static char __pyx_k__array[] = "array";
static char __pyx_k__ascii[] = "ascii";
static char __pyx_k__asstr[] = "asstr";
static char __pyx_k__dtype[] = "dtype";
static char __pyx_k__empty[] = "empty";
static char __pyx_k__items[] = "items";
static char __pyx_k__mio5p[] = "mio5p";
static char __pyx_k__numpy[] = "numpy";
static char __pyx_k__order[] = "order";
static char __pyx_k__range[] = "range";
static char __pyx_k__scipy[] = "scipy";
static char __pyx_k__shape[] = "shape";
static char __pyx_k__uint8[] = "uint8";
static char __pyx_k__astype[] = "astype";
static char __pyx_k__buffer[] = "buffer";
static char __pyx_k__codecs[] = "codecs";
static char __pyx_k__decode[] = "decode";
static char __pyx_k__dtypes[] = "dtypes";
static char __pyx_k__encode[] = "encode";
static char __pyx_k__header[] = "header";
static char __pyx_k__little[] = "little";
static char __pyx_k__object[] = "object";
static char __pyx_k__pycopy[] = "pycopy";
static char __pyx_k__sparse[] = "sparse";
static char __pyx_k__MDTYPES[] = "MDTYPES";
static char __pyx_k__asbytes[] = "asbytes";
static char __pyx_k__classes[] = "classes";
static char __pyx_k__ndarray[] = "ndarray";
static char __pyx_k__preader[] = "preader";
static char __pyx_k__process[] = "process";
static char __pyx_k__reshape[] = "reshape";
static char __pyx_k____dict__[] = "__dict__";
static char __pyx_k____main__[] = "__main__";
static char __pyx_k____test__[] = "__test__";
static char __pyx_k__itemsize[] = "itemsize";
static char __pyx_k__tostring[] = "tostring";
static char __pyx_k__TypeError[] = "TypeError";
static char __pyx_k__byteorder[] = "byteorder";
static char __pyx_k__enumerate[] = "enumerate";
static char __pyx_k__mat_dtype[] = "mat_dtype";
static char __pyx_k__read_char[] = "read_char";
static char __pyx_k__sys_is_le[] = "sys_is_le";
static char __pyx_k__ValueError[] = "ValueError";
static char __pyx_k__byte_order[] = "byte_order";
static char __pyx_k__csc_matrix[] = "csc_matrix";
static char __pyx_k__mat_stream[] = "mat_stream";
static char __pyx_k__mat_struct[] = "mat_struct";
static char __pyx_k__read_cells[] = "read_cells";
static char __pyx_k__set_stream[] = "set_stream";
static char __pyx_k__squeeze_me[] = "squeeze_me";
static char __pyx_k__uint16_len[] = "uint16_len";
static char __pyx_k___fieldnames[] = "_fieldnames";
static char __pyx_k__native_code[] = "native_code";
static char __pyx_k__read_header[] = "read_header";
static char __pyx_k__read_opaque[] = "read_opaque";
static char __pyx_k__read_struct[] = "read_struct";
static char __pyx_k__MatlabObject[] = "MatlabObject";
static char __pyx_k__MatlabOpaque[] = "MatlabOpaque";
static char __pyx_k__OPAQUE_DTYPE[] = "OPAQUE_DTYPE";
static char __pyx_k__RuntimeError[] = "RuntimeError";
static char __pyx_k__read_numeric[] = "read_numeric";
static char __pyx_k__swapped_code[] = "swapped_code";
static char __pyx_k__uint16_codec[] = "uint16_codec";
static char __pyx_k__MatlabFunction[] = "MatlabFunction";
static char __pyx_k__squeeze_element[] = "squeeze_element";
static char __pyx_k__chars_as_strings[] = "chars_as_strings";
static char __pyx_k__chars_to_strings[] = "chars_to_strings";
static char __pyx_k__struct_as_record[] = "struct_as_record";
static char __pyx_k__array_from_header[] = "array_from_header";
static char __pyx_k__read_real_complex[] = "read_real_complex";
static PyObject *__pyx_kp_s_1;
static PyObject *__pyx_kp_s_10;
static PyObject *__pyx_kp_s_12;
static PyObject *__pyx_kp_s_14;
static PyObject *__pyx_kp_s_15;
static PyObject *__pyx_kp_s_2;
static PyObject *__pyx_kp_s_20;
static PyObject *__pyx_kp_s_21;
static PyObject *__pyx_kp_s_23;
static PyObject *__pyx_kp_s_25;
static PyObject *__pyx_kp_u_29;
static PyObject *__pyx_kp_s_3;
static PyObject *__pyx_kp_u_31;
static PyObject *__pyx_kp_u_33;
static PyObject *__pyx_kp_u_35;
static PyObject *__pyx_kp_u_36;
static PyObject *__pyx_kp_u_39;
static PyObject *__pyx_n_s_42;
static PyObject *__pyx_n_s_43;
static PyObject *__pyx_n_s_44;
static PyObject *__pyx_n_s_45;
static PyObject *__pyx_n_s_46;
static PyObject *__pyx_n_s_47;
static PyObject *__pyx_kp_s_48;
static PyObject *__pyx_kp_s_49;
static PyObject *__pyx_kp_s_5;
static PyObject *__pyx_kp_s_8;
static PyObject *__pyx_n_s__F;
static PyObject *__pyx_n_s__MDTYPES;
static PyObject *__pyx_n_s__MatlabFunction;
static PyObject *__pyx_n_s__MatlabObject;
static PyObject *__pyx_n_s__MatlabOpaque;
static PyObject *__pyx_n_s__OPAQUE_DTYPE;
static PyObject *__pyx_n_s__RuntimeError;
static PyObject *__pyx_n_s__T;
static PyObject *__pyx_n_s__TypeError;
static PyObject *__pyx_n_s__U;
static PyObject *__pyx_n_s__ValueError;
static PyObject *__pyx_n_s____dict__;
static PyObject *__pyx_n_s____main__;
static PyObject *__pyx_n_s____test__;
static PyObject *__pyx_n_s___fieldnames;
static PyObject *__pyx_n_s__arr;
static PyObject *__pyx_n_s__array;
static PyObject *__pyx_n_s__array_from_header;
static PyObject *__pyx_n_s__asbytes;
static PyObject *__pyx_n_s__ascii;
static PyObject *__pyx_n_s__asstr;
static PyObject *__pyx_n_s__astype;
static PyObject *__pyx_n_s__bool;
static PyObject *__pyx_n_s__buffer;
static PyObject *__pyx_n_s__byte_order;
static PyObject *__pyx_n_s__byteorder;
static PyObject *__pyx_n_s__c16;
static PyObject *__pyx_n_s__c8;
static PyObject *__pyx_n_s__chars_as_strings;
static PyObject *__pyx_n_s__chars_to_strings;
static PyObject *__pyx_n_s__classes;
static PyObject *__pyx_n_s__codecs;
static PyObject *__pyx_n_s__copy;
static PyObject *__pyx_n_s__csc_matrix;
static PyObject *__pyx_n_s__decode;
static PyObject *__pyx_n_s__dtype;
static PyObject *__pyx_n_s__dtypes;
static PyObject *__pyx_n_s__empty;
static PyObject *__pyx_n_s__encode;
static PyObject *__pyx_n_s__enumerate;
static PyObject *__pyx_n_s__header;
static PyObject *__pyx_n_s__imag;
static PyObject *__pyx_n_s__items;
static PyObject *__pyx_n_s__itemsize;
static PyObject *__pyx_n_s__little;
static PyObject *__pyx_n_s__mat_dtype;
static PyObject *__pyx_n_s__mat_stream;
static PyObject *__pyx_n_s__mat_struct;
static PyObject *__pyx_n_s__mio5p;
static PyObject *__pyx_n_s__miob;
static PyObject *__pyx_n_s__native_code;
static PyObject *__pyx_n_s__ndarray;
static PyObject *__pyx_n_s__np;
static PyObject *__pyx_n_s__numpy;
static PyObject *__pyx_n_s__object;
static PyObject *__pyx_n_s__order;
static PyObject *__pyx_n_s__preader;
static PyObject *__pyx_n_s__process;
static PyObject *__pyx_n_s__pycopy;
static PyObject *__pyx_n_s__range;
static PyObject *__pyx_n_s__read_cells;
static PyObject *__pyx_n_s__read_char;
static PyObject *__pyx_n_s__read_header;
static PyObject *__pyx_n_s__read_numeric;
static PyObject *__pyx_n_s__read_opaque;
static PyObject *__pyx_n_s__read_real_complex;
static PyObject *__pyx_n_s__read_struct;
static PyObject *__pyx_n_s__reshape;
static PyObject *__pyx_n_s__s0;
static PyObject *__pyx_n_s__s1;
static PyObject *__pyx_n_s__s2;
static PyObject *__pyx_n_s__scipy;
static PyObject *__pyx_n_s__set_stream;
static PyObject *__pyx_n_s__shape;
static PyObject *__pyx_n_s__sparse;
static PyObject *__pyx_n_s__squeeze_element;
static PyObject *__pyx_n_s__squeeze_me;
static PyObject *__pyx_n_s__struct_as_record;
static PyObject *__pyx_n_s__swapped_code;
static PyObject *__pyx_n_s__sys;
static PyObject *__pyx_n_s__sys_is_le;
static PyObject *__pyx_n_s__tostring;
static PyObject *__pyx_n_s__uint16_codec;
static PyObject *__pyx_n_s__uint16_len;
static PyObject *__pyx_n_s__uint8;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_15;
static PyObject *__pyx_k_tuple_4;
static PyObject *__pyx_k_tuple_6;
static PyObject *__pyx_k_tuple_7;
static PyObject *__pyx_k_tuple_9;
static PyObject *__pyx_k_slice_19;
static PyObject *__pyx_k_slice_22;
static PyObject *__pyx_k_slice_26;
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_18;
static PyObject *__pyx_k_tuple_24;
static PyObject *__pyx_k_tuple_27;
static PyObject *__pyx_k_tuple_28;
static PyObject *__pyx_k_tuple_30;
static PyObject *__pyx_k_tuple_32;
static PyObject *__pyx_k_tuple_34;
static PyObject *__pyx_k_tuple_37;
static PyObject *__pyx_k_tuple_38;
static PyObject *__pyx_k_tuple_40;
/* "scipy/io/matlab/mio5_utils.pyx":112
*
*
* cpdef cnp.uint32_t byteswap_u4(cnp.uint32_t u4): # <<<<<<<<<<<<<<
* return ((u4 << 24) |
* ((u4 << 8) & 0xff0000U) |
*/
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_1byteswap_u4(PyObject *__pyx_self, PyObject *__pyx_arg_u4); /*proto*/
static __pyx_t_5numpy_uint32_t __pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_t_5numpy_uint32_t __pyx_v_u4, CYTHON_UNUSED int __pyx_skip_dispatch) {
__pyx_t_5numpy_uint32_t __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("byteswap_u4", 0);
/* "scipy/io/matlab/mio5_utils.pyx":116
* ((u4 << 8) & 0xff0000U) |
* ((u4 >> 8 & 0xff00u)) |
* (u4 >> 24)) # <<<<<<<<<<<<<<
*
*
*/
__pyx_r = ((((__pyx_v_u4 << 24) | ((__pyx_v_u4 << 8) & 0xff0000U)) | ((__pyx_v_u4 >> 8) & 0xff00U)) | (__pyx_v_u4 >> 24));
goto __pyx_L0;
__pyx_r = 0;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_1byteswap_u4(PyObject *__pyx_self, PyObject *__pyx_arg_u4); /*proto*/
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_1byteswap_u4(PyObject *__pyx_self, PyObject *__pyx_arg_u4) {
__pyx_t_5numpy_uint32_t __pyx_v_u4;
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("byteswap_u4 (wrapper)", 0);
assert(__pyx_arg_u4); {
__pyx_v_u4 = __Pyx_PyInt_from_py_npy_uint32(__pyx_arg_u4); if (unlikely((__pyx_v_u4 == (npy_uint32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L3_error:;
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.byteswap_u4", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return NULL;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_self, ((__pyx_t_5numpy_uint32_t)__pyx_v_u4));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":112
*
*
* cpdef cnp.uint32_t byteswap_u4(cnp.uint32_t u4): # <<<<<<<<<<<<<<
* return ((u4 << 24) |
* ((u4 << 8) & 0xff0000U) |
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(CYTHON_UNUSED PyObject *__pyx_self, __pyx_t_5numpy_uint32_t __pyx_v_u4) {
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("byteswap_u4", 0);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = __Pyx_PyInt_to_py_npy_uint32(__pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4(__pyx_v_u4, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __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("scipy.io.matlab.mio5_utils.byteswap_u4", __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_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_1set_dims(PyObject *__pyx_v_self, PyObject *__pyx_v_dims); /*proto*/
static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_set_dims[] = " Allow setting of dimensions from python\n\n This is for constructing headers for tests\n ";
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_1set_dims(PyObject *__pyx_v_self, PyObject *__pyx_v_dims) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_dims (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_set_dims(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self), ((PyObject *)__pyx_v_dims));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":130
* cdef size_t nzmax
*
* def set_dims(self, dims): # <<<<<<<<<<<<<<
* """ Allow setting of dimensions from python
*
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_set_dims(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self, PyObject *__pyx_v_dims) {
PyObject *__pyx_v_i = NULL;
PyObject *__pyx_v_dim = NULL;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
Py_ssize_t __pyx_t_1;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
PyObject *(*__pyx_t_4)(PyObject *);
PyObject *__pyx_t_5 = NULL;
PyObject *__pyx_t_6 = NULL;
__pyx_t_5numpy_int32_t __pyx_t_7;
Py_ssize_t __pyx_t_8;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("set_dims", 0);
/* "scipy/io/matlab/mio5_utils.pyx":135
* This is for constructing headers for tests
* """
* self.dims = dims # <<<<<<<<<<<<<<
* self.n_dims = len(dims)
* for i, dim in enumerate(dims):
*/
__Pyx_INCREF(__pyx_v_dims);
__Pyx_GIVEREF(__pyx_v_dims);
__Pyx_GOTREF(__pyx_v_self->dims);
__Pyx_DECREF(__pyx_v_self->dims);
__pyx_v_self->dims = __pyx_v_dims;
/* "scipy/io/matlab/mio5_utils.pyx":136
* """
* self.dims = dims
* self.n_dims = len(dims) # <<<<<<<<<<<<<<
* for i, dim in enumerate(dims):
* self.dims_ptr[i] = <cnp.int32_t>int(dim)
*/
__pyx_t_1 = PyObject_Length(__pyx_v_dims); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->n_dims = __pyx_t_1;
/* "scipy/io/matlab/mio5_utils.pyx":137
* self.dims = dims
* self.n_dims = len(dims)
* for i, dim in enumerate(dims): # <<<<<<<<<<<<<<
* self.dims_ptr[i] = <cnp.int32_t>int(dim)
*
*/
__Pyx_INCREF(__pyx_int_0);
__pyx_t_2 = __pyx_int_0;
if (PyList_CheckExact(__pyx_v_dims) || PyTuple_CheckExact(__pyx_v_dims)) {
__pyx_t_3 = __pyx_v_dims; __Pyx_INCREF(__pyx_t_3); __pyx_t_1 = 0;
__pyx_t_4 = NULL;
} else {
__pyx_t_1 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_dims); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = Py_TYPE(__pyx_t_3)->tp_iternext;
}
for (;;) {
if (!__pyx_t_4 && PyList_CheckExact(__pyx_t_3)) {
if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_4 && PyTuple_CheckExact(__pyx_t_3)) {
if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_1); __Pyx_INCREF(__pyx_t_5); __pyx_t_1++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_4(__pyx_t_3);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
__Pyx_XDECREF(__pyx_v_dim);
__pyx_v_dim = __pyx_t_5;
__pyx_t_5 = 0;
__Pyx_INCREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_v_i);
__pyx_v_i = __pyx_t_2;
__pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_int_1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2);
__pyx_t_2 = __pyx_t_5;
__pyx_t_5 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":138
* self.n_dims = len(dims)
* for i, dim in enumerate(dims):
* self.dims_ptr[i] = <cnp.int32_t>int(dim) # <<<<<<<<<<<<<<
*
*
*/
__pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_INCREF(__pyx_v_dim);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_dim);
__Pyx_GIVEREF(__pyx_v_dim);
__pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)(&PyInt_Type))), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_6);
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__pyx_t_7 = __Pyx_PyInt_from_py_npy_int32(__pyx_t_6); if (unlikely((__pyx_t_7 == (npy_int32)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
__pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 138; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->dims_ptr[__pyx_t_8]) = ((__pyx_t_5numpy_int32_t)__pyx_t_7);
}
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
__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_XDECREF(__pyx_t_3);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_6);
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarHeader5.set_dims", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_i);
__Pyx_XDECREF(__pyx_v_dim);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name___get__(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":120
*
* cdef class VarHeader5:
* cdef readonly object name # <<<<<<<<<<<<<<
* cdef readonly int mclass
* cdef readonly object dims
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4name___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__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;
}
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass___get__(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":121
* cdef class VarHeader5:
* cdef readonly object name
* cdef readonly int mclass # <<<<<<<<<<<<<<
* cdef readonly object dims
* cdef cnp.int32_t dims_ptr[_MAT_MAXDIMS]
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_6mclass___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__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);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyInt_FromLong(__pyx_v_self->mclass); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 121; __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("scipy.io.matlab.mio5_utils.VarHeader5.mclass.__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_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims___get__(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":122
* cdef readonly object name
* cdef readonly int mclass
* cdef readonly object dims # <<<<<<<<<<<<<<
* cdef cnp.int32_t dims_ptr[_MAT_MAXDIMS]
* cdef int n_dims
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_4dims___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self) {
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__", 0);
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_self->dims);
__pyx_r = __pyx_v_self->dims;
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_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global_1__get__(PyObject *__pyx_v_self) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___get__(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":127
* cdef int is_complex
* cdef int is_logical
* cdef public int is_global # <<<<<<<<<<<<<<
* cdef size_t nzmax
*
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global___get__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__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);
__Pyx_XDECREF(__pyx_r);
__pyx_t_1 = PyInt_FromLong(__pyx_v_self->is_global); 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);
__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("scipy.io.matlab.mio5_utils.VarHeader5.is_global.__get__", __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_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global_2__set__(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *)__pyx_v_self), ((PyObject *)__pyx_v_value));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarHeader5_9is_global_2__set__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarHeader5 *__pyx_v_self, PyObject *__pyx_v_value) {
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__set__", 0);
__pyx_t_1 = __Pyx_PyInt_AsInt(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 127; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_self->is_global = __pyx_t_1;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarHeader5.is_global.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static int __pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarReader5_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarReader5_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
PyObject *__pyx_v_preader = 0;
int __pyx_r;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
{
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s__preader,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__preader)) != 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, "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __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_preader = values[0];
}
goto __pyx_L4_argument_unpacking_done;
__pyx_L5_argtuple_error:;
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
__pyx_L3_error:;
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__Pyx_RefNannyFinishContext();
return -1;
__pyx_L4_argument_unpacking_done:;
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5___cinit__(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), __pyx_v_preader);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":172
* * squeeze_me (bool)
* """
* def __cinit__(self, preader): # <<<<<<<<<<<<<<
* byte_order = preader.byte_order
* self.is_swapped = byte_order == swapped_code
*/
static int __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5___cinit__(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, PyObject *__pyx_v_preader) {
PyObject *__pyx_v_byte_order = NULL;
PyObject *__pyx_v_uint16_codec = NULL;
PyObject *__pyx_v_key = NULL;
PyObject *__pyx_v_dt = NULL;
CYTHON_UNUSED PyObject *__pyx_v_bool_dtype = NULL;
int __pyx_r;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
int __pyx_t_3;
int __pyx_t_4;
PyObject *__pyx_t_5 = NULL;
Py_ssize_t __pyx_t_6;
Py_ssize_t __pyx_t_7;
PyObject *(*__pyx_t_8)(PyObject *);
PyObject *__pyx_t_9 = NULL;
PyObject *__pyx_t_10 = NULL;
PyObject *(*__pyx_t_11)(PyObject *);
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("__cinit__", 0);
/* "scipy/io/matlab/mio5_utils.pyx":173
* """
* def __cinit__(self, preader):
* byte_order = preader.byte_order # <<<<<<<<<<<<<<
* self.is_swapped = byte_order == swapped_code
* if self.is_swapped:
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__byte_order); 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_v_byte_order = __pyx_t_1;
__pyx_t_1 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":174
* def __cinit__(self, preader):
* byte_order = preader.byte_order
* self.is_swapped = byte_order == swapped_code # <<<<<<<<<<<<<<
* if self.is_swapped:
* self.little_endian = not sys_is_le
*/
__pyx_t_1 = __Pyx_GetName(__pyx_m, __pyx_n_s__swapped_code); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_RichCompare(__pyx_v_byte_order, __pyx_t_1, Py_EQ); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->is_swapped = __pyx_t_3;
/* "scipy/io/matlab/mio5_utils.pyx":175
* byte_order = preader.byte_order
* self.is_swapped = byte_order == swapped_code
* if self.is_swapped: # <<<<<<<<<<<<<<
* self.little_endian = not sys_is_le
* else:
*/
if (__pyx_v_self->is_swapped) {
/* "scipy/io/matlab/mio5_utils.pyx":176
* self.is_swapped = byte_order == swapped_code
* if self.is_swapped:
* self.little_endian = not sys_is_le # <<<<<<<<<<<<<<
* else:
* self.little_endian = sys_is_le
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 176; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->little_endian = (!__pyx_t_4);
goto __pyx_L3;
}
/*else*/ {
/* "scipy/io/matlab/mio5_utils.pyx":178
* self.little_endian = not sys_is_le
* else:
* self.little_endian = sys_is_le # <<<<<<<<<<<<<<
* # option affecting reading of matlab struct arrays
* self.struct_as_record = preader.struct_as_record
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__sys_is_le); 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);
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->little_endian = __pyx_t_3;
}
__pyx_L3:;
/* "scipy/io/matlab/mio5_utils.pyx":180
* self.little_endian = sys_is_le
* # option affecting reading of matlab struct arrays
* self.struct_as_record = preader.struct_as_record # <<<<<<<<<<<<<<
* # store codecs for text matrix reading
* self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy()
*/
__pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__struct_as_record); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->struct_as_record = __pyx_t_3;
/* "scipy/io/matlab/mio5_utils.pyx":182
* self.struct_as_record = preader.struct_as_record
* # store codecs for text matrix reading
* self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy() # <<<<<<<<<<<<<<
* self.uint16_codec = preader.uint16_codec
* uint16_codec = self.uint16_codec
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_1 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MDTYPES); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __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_GetItem(__pyx_t_1, __pyx_v_byte_order); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __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_GetItem(__pyx_t_2, ((PyObject *)__pyx_n_s__codecs)); if (!__pyx_t_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __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_GetAttr(__pyx_t_1, __pyx_n_s__copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __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_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 182; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->codecs);
__Pyx_DECREF(__pyx_v_self->codecs);
__pyx_v_self->codecs = __pyx_t_1;
__pyx_t_1 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":183
* # store codecs for text matrix reading
* self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy()
* self.uint16_codec = preader.uint16_codec # <<<<<<<<<<<<<<
* uint16_codec = self.uint16_codec
* # Set length of miUINT16 char encoding
*/
__pyx_t_1 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__uint16_codec); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->uint16_codec);
__Pyx_DECREF(__pyx_v_self->uint16_codec);
__pyx_v_self->uint16_codec = __pyx_t_1;
__pyx_t_1 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":184
* self.codecs = mio5p.MDTYPES[byte_order]['codecs'].copy()
* self.uint16_codec = preader.uint16_codec
* uint16_codec = self.uint16_codec # <<<<<<<<<<<<<<
* # Set length of miUINT16 char encoding
* self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \
*/
__Pyx_INCREF(__pyx_v_self->uint16_codec);
__pyx_v_uint16_codec = __pyx_v_self->uint16_codec;
/* "scipy/io/matlab/mio5_utils.pyx":186
* uint16_codec = self.uint16_codec
* # Set length of miUINT16 char encoding
* self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ # <<<<<<<<<<<<<<
* - len(" ".encode(uint16_codec))
* self.codecs['uint16_codec'] = uint16_codec
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_1), __pyx_n_s__encode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __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 = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_uint16_codec);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_uint16_codec);
__Pyx_GIVEREF(__pyx_v_uint16_codec);
__pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_t_6 = PyObject_Length(__pyx_t_5); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":187
* # Set length of miUINT16 char encoding
* self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \
* - len(" ".encode(uint16_codec)) # <<<<<<<<<<<<<<
* self.codecs['uint16_codec'] = uint16_codec
* # set c-optimized stream object from python file-like object
*/
__pyx_t_5 = PyObject_GetAttr(((PyObject *)__pyx_kp_s_2), __pyx_n_s__encode); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_INCREF(__pyx_v_uint16_codec);
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_uint16_codec);
__Pyx_GIVEREF(__pyx_v_uint16_codec);
__pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
__pyx_t_7 = PyObject_Length(__pyx_t_1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
__pyx_t_1 = PyInt_FromSsize_t((__pyx_t_6 - __pyx_t_7)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
/* "scipy/io/matlab/mio5_utils.pyx":186
* uint16_codec = self.uint16_codec
* # Set length of miUINT16 char encoding
* self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \ # <<<<<<<<<<<<<<
* - len(" ".encode(uint16_codec))
* self.codecs['uint16_codec'] = uint16_codec
*/
if (PyObject_SetItem(__pyx_v_self->codecs, ((PyObject *)__pyx_n_s__uint16_len), __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":188
* self.codecs['uint16_len'] = len(" ".encode(uint16_codec)) \
* - len(" ".encode(uint16_codec))
* self.codecs['uint16_codec'] = uint16_codec # <<<<<<<<<<<<<<
* # set c-optimized stream object from python file-like object
* self.set_stream(preader.mat_stream)
*/
if (PyObject_SetItem(__pyx_v_self->codecs, ((PyObject *)__pyx_n_s__uint16_codec), __pyx_v_uint16_codec) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "scipy/io/matlab/mio5_utils.pyx":190
* self.codecs['uint16_codec'] = uint16_codec
* # set c-optimized stream object from python file-like object
* self.set_stream(preader.mat_stream) # <<<<<<<<<<<<<<
* # options for element processing
* self.mat_dtype = preader.mat_dtype
*/
__pyx_t_1 = PyObject_GetAttr(((PyObject *)__pyx_v_self), __pyx_n_s__set_stream); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_stream); 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_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
__Pyx_GIVEREF(__pyx_t_2);
__pyx_t_2 = 0;
__pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_5), NULL); 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_1); __pyx_t_1 = 0;
__Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":192
* self.set_stream(preader.mat_stream)
* # options for element processing
* self.mat_dtype = preader.mat_dtype # <<<<<<<<<<<<<<
* self.chars_as_strings = preader.chars_as_strings
* self.squeeze_me = preader.squeeze_me
*/
__pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__mat_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->mat_dtype = __pyx_t_3;
/* "scipy/io/matlab/mio5_utils.pyx":193
* # options for element processing
* self.mat_dtype = preader.mat_dtype
* self.chars_as_strings = preader.chars_as_strings # <<<<<<<<<<<<<<
* self.squeeze_me = preader.squeeze_me
* # copy refs to dtypes into object pointer array. We only need the
*/
__pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__chars_as_strings); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->chars_as_strings = __pyx_t_3;
/* "scipy/io/matlab/mio5_utils.pyx":194
* self.mat_dtype = preader.mat_dtype
* self.chars_as_strings = preader.chars_as_strings
* self.squeeze_me = preader.squeeze_me # <<<<<<<<<<<<<<
* # copy refs to dtypes into object pointer array. We only need the
* # integer-keyed dtypes
*/
__pyx_t_2 = PyObject_GetAttr(__pyx_v_preader, __pyx_n_s__squeeze_me); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_3 = __Pyx_PyInt_AsInt(__pyx_t_2); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_v_self->squeeze_me = __pyx_t_3;
/* "scipy/io/matlab/mio5_utils.pyx":197
* # copy refs to dtypes into object pointer array. We only need the
* # integer-keyed dtypes
* for key, dt in mio5p.MDTYPES[byte_order]['dtypes'].items(): # <<<<<<<<<<<<<<
* if isinstance(key, str):
* continue
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); 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_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MDTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_GetItem(__pyx_t_5, __pyx_v_byte_order); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __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_2, ((PyObject *)__pyx_n_s__dtypes)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__items); 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_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); 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_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_8(__pyx_t_2);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
PyObject* sequence = __pyx_t_5;
#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[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_1 = PyList_GET_ITEM(sequence, 0);
__pyx_t_9 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_1);
__Pyx_INCREF(__pyx_t_9);
#else
__pyx_t_1 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_9 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
{
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
index = 1; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L6_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L7_unpacking_done;
__pyx_L6_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L7_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_key);
__pyx_v_key = __pyx_t_1;
__pyx_t_1 = 0;
__Pyx_XDECREF(__pyx_v_dt);
__pyx_v_dt = __pyx_t_9;
__pyx_t_9 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":198
* # integer-keyed dtypes
* for key, dt in mio5p.MDTYPES[byte_order]['dtypes'].items():
* if isinstance(key, str): # <<<<<<<<<<<<<<
* continue
* self.dtypes[key] = <PyObject*>dt
*/
__pyx_t_5 = ((PyObject *)((PyObject*)(&PyString_Type)));
__Pyx_INCREF(__pyx_t_5);
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_key, __pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
/* "scipy/io/matlab/mio5_utils.pyx":199
* for key, dt in mio5p.MDTYPES[byte_order]['dtypes'].items():
* if isinstance(key, str):
* continue # <<<<<<<<<<<<<<
* self.dtypes[key] = <PyObject*>dt
* # copy refs to class_dtypes into object pointer array
*/
goto __pyx_L4_continue;
goto __pyx_L8;
}
__pyx_L8:;
/* "scipy/io/matlab/mio5_utils.pyx":200
* if isinstance(key, str):
* continue
* self.dtypes[key] = <PyObject*>dt # <<<<<<<<<<<<<<
* # copy refs to class_dtypes into object pointer array
* for key, dt in mio5p.MDTYPES[byte_order]['classes'].items():
*/
__pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->dtypes[__pyx_t_6]) = ((PyObject *)__pyx_v_dt);
__pyx_L4_continue:;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":202
* self.dtypes[key] = <PyObject*>dt
* # copy refs to class_dtypes into object pointer array
* for key, dt in mio5p.MDTYPES[byte_order]['classes'].items(): # <<<<<<<<<<<<<<
* if isinstance(key, str):
* continue
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__mio5p); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__MDTYPES); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_GetItem(__pyx_t_5, __pyx_v_byte_order); if (!__pyx_t_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __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_2, ((PyObject *)__pyx_n_s__classes)); if (!__pyx_t_5) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_GetAttr(__pyx_t_5, __pyx_n_s__items); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __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_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
__pyx_t_2 = __pyx_t_5; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
__pyx_t_8 = NULL;
} else {
__pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_8 = Py_TYPE(__pyx_t_2)->tp_iternext;
}
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
for (;;) {
if (!__pyx_t_8 && PyList_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else if (!__pyx_t_8 && PyTuple_CheckExact(__pyx_t_2)) {
if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
#if CYTHON_COMPILING_IN_CPYTHON
__pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#else
__pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
} else {
__pyx_t_5 = __pyx_t_8(__pyx_t_2);
if (unlikely(!__pyx_t_5)) {
if (PyErr_Occurred()) {
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) PyErr_Clear();
else {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
break;
}
__Pyx_GOTREF(__pyx_t_5);
}
if ((likely(PyTuple_CheckExact(__pyx_t_5))) || (PyList_CheckExact(__pyx_t_5))) {
PyObject* sequence = __pyx_t_5;
#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[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
}
#if CYTHON_COMPILING_IN_CPYTHON
if (likely(PyTuple_CheckExact(sequence))) {
__pyx_t_9 = PyTuple_GET_ITEM(sequence, 0);
__pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
} else {
__pyx_t_9 = PyList_GET_ITEM(sequence, 0);
__pyx_t_1 = PyList_GET_ITEM(sequence, 1);
}
__Pyx_INCREF(__pyx_t_9);
__Pyx_INCREF(__pyx_t_1);
#else
__pyx_t_9 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
#endif
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
} else
{
Py_ssize_t index = -1;
__pyx_t_10 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_10)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_10);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_t_11 = Py_TYPE(__pyx_t_10)->tp_iternext;
index = 0; __pyx_t_9 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_9)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_9);
index = 1; __pyx_t_1 = __pyx_t_11(__pyx_t_10); if (unlikely(!__pyx_t_1)) goto __pyx_L11_unpacking_failed;
__Pyx_GOTREF(__pyx_t_1);
if (__Pyx_IternextUnpackEndCheck(__pyx_t_11(__pyx_t_10), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_t_11 = NULL;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
goto __pyx_L12_unpacking_done;
__pyx_L11_unpacking_failed:;
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
__pyx_t_11 = NULL;
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
{__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_L12_unpacking_done:;
}
__Pyx_XDECREF(__pyx_v_key);
__pyx_v_key = __pyx_t_9;
__pyx_t_9 = 0;
__Pyx_XDECREF(__pyx_v_dt);
__pyx_v_dt = __pyx_t_1;
__pyx_t_1 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":203
* # copy refs to class_dtypes into object pointer array
* for key, dt in mio5p.MDTYPES[byte_order]['classes'].items():
* if isinstance(key, str): # <<<<<<<<<<<<<<
* continue
* self.class_dtypes[key] = <PyObject*>dt
*/
__pyx_t_5 = ((PyObject *)((PyObject*)(&PyString_Type)));
__Pyx_INCREF(__pyx_t_5);
__pyx_t_4 = __Pyx_TypeCheck(__pyx_v_key, __pyx_t_5);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
if (__pyx_t_4) {
/* "scipy/io/matlab/mio5_utils.pyx":204
* for key, dt in mio5p.MDTYPES[byte_order]['classes'].items():
* if isinstance(key, str):
* continue # <<<<<<<<<<<<<<
* self.class_dtypes[key] = <PyObject*>dt
* # cache correctly byte ordered dtypes
*/
goto __pyx_L9_continue;
goto __pyx_L13;
}
__pyx_L13:;
/* "scipy/io/matlab/mio5_utils.pyx":205
* if isinstance(key, str):
* continue
* self.class_dtypes[key] = <PyObject*>dt # <<<<<<<<<<<<<<
* # cache correctly byte ordered dtypes
* if self.little_endian:
*/
__pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_self->class_dtypes[__pyx_t_6]) = ((PyObject *)__pyx_v_dt);
__pyx_L9_continue:;
}
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":207
* self.class_dtypes[key] = <PyObject*>dt
* # cache correctly byte ordered dtypes
* if self.little_endian: # <<<<<<<<<<<<<<
* self.U1_dtype = np.dtype('<U1')
* else:
*/
if (__pyx_v_self->little_endian) {
/* "scipy/io/matlab/mio5_utils.pyx":208
* # cache correctly byte ordered dtypes
* if self.little_endian:
* self.U1_dtype = np.dtype('<U1') # <<<<<<<<<<<<<<
* else:
* self.U1_dtype = np.dtype('>U1')
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__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_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 208; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->U1_dtype);
__Pyx_DECREF(((PyObject *)__pyx_v_self->U1_dtype));
__pyx_v_self->U1_dtype = ((PyArray_Descr *)__pyx_t_2);
__pyx_t_2 = 0;
goto __pyx_L14;
}
/*else*/ {
/* "scipy/io/matlab/mio5_utils.pyx":210
* self.U1_dtype = np.dtype('<U1')
* else:
* self.U1_dtype = np.dtype('>U1') # <<<<<<<<<<<<<<
* bool_dtype = np.dtype('bool')
*
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_6), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__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_dtype))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GIVEREF(__pyx_t_2);
__Pyx_GOTREF(__pyx_v_self->U1_dtype);
__Pyx_DECREF(((PyObject *)__pyx_v_self->U1_dtype));
__pyx_v_self->U1_dtype = ((PyArray_Descr *)__pyx_t_2);
__pyx_t_2 = 0;
}
__pyx_L14:;
/* "scipy/io/matlab/mio5_utils.pyx":211
* else:
* self.U1_dtype = np.dtype('>U1')
* bool_dtype = np.dtype('bool') # <<<<<<<<<<<<<<
*
* def set_stream(self, fobj):
*/
__pyx_t_2 = __Pyx_GetName(__pyx_m, __pyx_n_s__np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__pyx_t_5 = PyObject_GetAttr(__pyx_t_2, __pyx_n_s__dtype); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
__pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_k_tuple_7), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 211; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_2);
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
__pyx_v_bool_dtype = __pyx_t_2;
__pyx_t_2 = 0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_XDECREF(__pyx_t_2);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_XDECREF(__pyx_t_9);
__Pyx_XDECREF(__pyx_t_10);
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_byte_order);
__Pyx_XDECREF(__pyx_v_uint16_codec);
__Pyx_XDECREF(__pyx_v_key);
__Pyx_XDECREF(__pyx_v_dt);
__Pyx_XDECREF(__pyx_v_bool_dtype);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* Python wrapper */
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarReader5_3set_stream(PyObject *__pyx_v_self, PyObject *__pyx_v_fobj); /*proto*/
static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_2set_stream[] = " Set stream of best type from file-like `fobj`\n\n Called from Python when initiating a variable read\n ";
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarReader5_3set_stream(PyObject *__pyx_v_self, PyObject *__pyx_v_fobj) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("set_stream (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_2set_stream(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self), ((PyObject *)__pyx_v_fobj));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":213
* bool_dtype = np.dtype('bool')
*
* def set_stream(self, fobj): # <<<<<<<<<<<<<<
* ''' Set stream of best type from file-like `fobj`
*
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_2set_stream(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, PyObject *__pyx_v_fobj) {
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("set_stream", 0);
/* "scipy/io/matlab/mio5_utils.pyx":218
* Called from Python when initiating a variable read
* '''
* self.cstream = streams.make_stream(fobj) # <<<<<<<<<<<<<<
*
* def read_tag(self):
*/
__pyx_t_1 = ((PyObject *)__pyx_f_5scipy_2io_6matlab_7streams_make_stream(__pyx_v_fobj, 0)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_1);
__Pyx_GIVEREF(__pyx_t_1);
__Pyx_GOTREF(__pyx_v_self->cstream);
__Pyx_DECREF(((PyObject *)__pyx_v_self->cstream));
__pyx_v_self->cstream = ((struct __pyx_obj_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_t_1);
__pyx_t_1 = 0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_1);
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.set_stream", __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_5scipy_2io_6matlab_10mio5_utils_10VarReader5_5read_tag(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
static char __pyx_doc_5scipy_2io_6matlab_10mio5_utils_10VarReader5_4read_tag[] = " Read tag mdtype and byte_count\n\n Does necessary swapping and takes account of SDE formats.\n\n See also ``read_full_tag`` method.\n \n Returns\n -------\n mdtype : int\n matlab data type code\n byte_count : int\n number of bytes following that comprise the data\n tag_data : None or str\n Any data from the tag itself. This is None for a full tag,\n and string length `byte_count` if this is a small data\n element.\n ";
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarReader5_5read_tag(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
PyObject *__pyx_r = 0;
__Pyx_RefNannyDeclarations
__Pyx_RefNannySetupContext("read_tag (wrapper)", 0);
__pyx_r = __pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_4read_tag(((struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self));
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":220
* self.cstream = streams.make_stream(fobj)
*
* def read_tag(self): # <<<<<<<<<<<<<<
* ''' Read tag mdtype and byte_count
*
*/
static PyObject *__pyx_pf_5scipy_2io_6matlab_10mio5_utils_10VarReader5_4read_tag(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self) {
__pyx_t_5numpy_uint32_t __pyx_v_mdtype;
__pyx_t_5numpy_uint32_t __pyx_v_byte_count;
char __pyx_v_tag_ptr[4];
int __pyx_v_tag_res;
PyObject *__pyx_v_tag_data = 0;
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("read_tag", 0);
/* "scipy/io/matlab/mio5_utils.pyx":241
* cdef char tag_ptr[4]
* cdef int tag_res
* cdef object tag_data = None # <<<<<<<<<<<<<<
* tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr)
* if tag_res == 2: # sde format
*/
__Pyx_INCREF(Py_None);
__pyx_v_tag_data = Py_None;
/* "scipy/io/matlab/mio5_utils.pyx":242
* cdef int tag_res
* cdef object tag_data = None
* tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr) # <<<<<<<<<<<<<<
* if tag_res == 2: # sde format
* tag_data = tag_ptr[:byte_count]
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, (&__pyx_v_mdtype), (&__pyx_v_byte_count), __pyx_v_tag_ptr); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_tag_res = __pyx_t_1;
/* "scipy/io/matlab/mio5_utils.pyx":243
* cdef object tag_data = None
* tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr)
* if tag_res == 2: # sde format # <<<<<<<<<<<<<<
* tag_data = tag_ptr[:byte_count]
* return (mdtype, byte_count, tag_data)
*/
__pyx_t_2 = (__pyx_v_tag_res == 2);
if (__pyx_t_2) {
/* "scipy/io/matlab/mio5_utils.pyx":244
* tag_res = self.cread_tag(&mdtype, &byte_count, tag_ptr)
* if tag_res == 2: # sde format
* tag_data = tag_ptr[:byte_count] # <<<<<<<<<<<<<<
* return (mdtype, byte_count, tag_data)
*
*/
__pyx_t_3 = PyBytes_FromStringAndSize(((const char*)__pyx_v_tag_ptr) + 0, __pyx_v_byte_count - 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(((PyObject *)__pyx_t_3));
__Pyx_DECREF(__pyx_v_tag_data);
__pyx_v_tag_data = ((PyObject *)__pyx_t_3);
__pyx_t_3 = 0;
goto __pyx_L3;
}
__pyx_L3:;
/* "scipy/io/matlab/mio5_utils.pyx":245
* if tag_res == 2: # sde format
* tag_data = tag_ptr[:byte_count]
* return (mdtype, byte_count, tag_data) # <<<<<<<<<<<<<<
*
* cdef int cread_tag(self,
*/
__Pyx_XDECREF(__pyx_r);
__pyx_t_3 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_mdtype); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_t_4 = __Pyx_PyInt_to_py_npy_uint32(__pyx_v_byte_count); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 245; __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[0]; __pyx_lineno = 245; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_5);
PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3);
__Pyx_GIVEREF(__pyx_t_3);
PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
__Pyx_GIVEREF(__pyx_t_4);
__Pyx_INCREF(__pyx_v_tag_data);
PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_tag_data);
__Pyx_GIVEREF(__pyx_v_tag_data);
__pyx_t_3 = 0;
__pyx_t_4 = 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_3);
__Pyx_XDECREF(__pyx_t_4);
__Pyx_XDECREF(__pyx_t_5);
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_tag", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = NULL;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_tag_data);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":247
* return (mdtype, byte_count, tag_data)
*
* cdef int cread_tag(self, # <<<<<<<<<<<<<<
* cnp.uint32_t *mdtype_ptr,
* cnp.uint32_t *byte_count_ptr,
*/
static int __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_cread_tag(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype_ptr, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count_ptr, char *__pyx_v_data_ptr) {
__pyx_t_5numpy_uint16_t __pyx_v_mdtype_sde;
__pyx_t_5numpy_uint16_t __pyx_v_byte_count_sde;
__pyx_t_5numpy_uint32_t __pyx_v_mdtype;
__pyx_t_5numpy_uint32_t *__pyx_v_u4_ptr;
__pyx_t_5numpy_uint32_t __pyx_v_u4s[2];
int __pyx_r;
__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("cread_tag", 0);
/* "scipy/io/matlab/mio5_utils.pyx":262
* cdef cnp.uint16_t mdtype_sde, byte_count_sde
* cdef cnp.uint32_t mdtype
* cdef cnp.uint32_t* u4_ptr = <cnp.uint32_t*>data_ptr # <<<<<<<<<<<<<<
* cdef cnp.uint32_t u4s[2]
* # First read 8 bytes. The 8 bytes can be in one of two formats.
*/
__pyx_v_u4_ptr = ((__pyx_t_5numpy_uint32_t *)__pyx_v_data_ptr);
/* "scipy/io/matlab/mio5_utils.pyx":290
* # first four bytes are two little-endian uint16 values, first
* # ``mdtype`` and second ``byte_count``.
* self.cstream.read_into(<void *>u4s, 8) # <<<<<<<<<<<<<<
* if self.is_swapped:
* mdtype = byteswap_u4(u4s[0])
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, ((void *)__pyx_v_u4s), 8); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 290; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
/* "scipy/io/matlab/mio5_utils.pyx":291
* # ``mdtype`` and second ``byte_count``.
* self.cstream.read_into(<void *>u4s, 8)
* if self.is_swapped: # <<<<<<<<<<<<<<
* mdtype = byteswap_u4(u4s[0])
* else:
*/
if (__pyx_v_self->is_swapped) {
/* "scipy/io/matlab/mio5_utils.pyx":292
* self.cstream.read_into(<void *>u4s, 8)
* if self.is_swapped:
* mdtype = byteswap_u4(u4s[0]) # <<<<<<<<<<<<<<
* else:
* mdtype = u4s[0]
*/
__pyx_v_mdtype = __pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4((__pyx_v_u4s[0]), 0);
goto __pyx_L3;
}
/*else*/ {
/* "scipy/io/matlab/mio5_utils.pyx":294
* mdtype = byteswap_u4(u4s[0])
* else:
* mdtype = u4s[0] # <<<<<<<<<<<<<<
* # The most significant two bytes of a U4 *mdtype* will always be
* # 0, if they are not, this must be SDE format
*/
__pyx_v_mdtype = (__pyx_v_u4s[0]);
}
__pyx_L3:;
/* "scipy/io/matlab/mio5_utils.pyx":297
* # The most significant two bytes of a U4 *mdtype* will always be
* # 0, if they are not, this must be SDE format
* byte_count_sde = mdtype >> 16 # <<<<<<<<<<<<<<
* if byte_count_sde: # small data element format
* mdtype_sde = mdtype & 0xffff
*/
__pyx_v_byte_count_sde = (__pyx_v_mdtype >> 16);
/* "scipy/io/matlab/mio5_utils.pyx":298
* # 0, if they are not, this must be SDE format
* byte_count_sde = mdtype >> 16
* if byte_count_sde: # small data element format # <<<<<<<<<<<<<<
* mdtype_sde = mdtype & 0xffff
* if byte_count_sde > 4:
*/
if (__pyx_v_byte_count_sde) {
/* "scipy/io/matlab/mio5_utils.pyx":299
* byte_count_sde = mdtype >> 16
* if byte_count_sde: # small data element format
* mdtype_sde = mdtype & 0xffff # <<<<<<<<<<<<<<
* if byte_count_sde > 4:
* raise ValueError('Error in SDE format data')
*/
__pyx_v_mdtype_sde = (__pyx_v_mdtype & 0xffff);
/* "scipy/io/matlab/mio5_utils.pyx":300
* if byte_count_sde: # small data element format
* mdtype_sde = mdtype & 0xffff
* if byte_count_sde > 4: # <<<<<<<<<<<<<<
* raise ValueError('Error in SDE format data')
* return -1
*/
__pyx_t_2 = (__pyx_v_byte_count_sde > 4);
if (__pyx_t_2) {
/* "scipy/io/matlab/mio5_utils.pyx":301
* mdtype_sde = mdtype & 0xffff
* if byte_count_sde > 4:
* raise ValueError('Error in SDE format data') # <<<<<<<<<<<<<<
* return -1
* u4_ptr[0] = u4s[1]
*/
__pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_k_tuple_9), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __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[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L5;
}
__pyx_L5:;
/* "scipy/io/matlab/mio5_utils.pyx":303
* raise ValueError('Error in SDE format data')
* return -1
* u4_ptr[0] = u4s[1] # <<<<<<<<<<<<<<
* mdtype_ptr[0] = mdtype_sde
* byte_count_ptr[0] = byte_count_sde
*/
(__pyx_v_u4_ptr[0]) = (__pyx_v_u4s[1]);
/* "scipy/io/matlab/mio5_utils.pyx":304
* return -1
* u4_ptr[0] = u4s[1]
* mdtype_ptr[0] = mdtype_sde # <<<<<<<<<<<<<<
* byte_count_ptr[0] = byte_count_sde
* return 2
*/
(__pyx_v_mdtype_ptr[0]) = __pyx_v_mdtype_sde;
/* "scipy/io/matlab/mio5_utils.pyx":305
* u4_ptr[0] = u4s[1]
* mdtype_ptr[0] = mdtype_sde
* byte_count_ptr[0] = byte_count_sde # <<<<<<<<<<<<<<
* return 2
* # regular element
*/
(__pyx_v_byte_count_ptr[0]) = __pyx_v_byte_count_sde;
/* "scipy/io/matlab/mio5_utils.pyx":306
* mdtype_ptr[0] = mdtype_sde
* byte_count_ptr[0] = byte_count_sde
* return 2 # <<<<<<<<<<<<<<
* # regular element
* if self.is_swapped:
*/
__pyx_r = 2;
goto __pyx_L0;
goto __pyx_L4;
}
__pyx_L4:;
/* "scipy/io/matlab/mio5_utils.pyx":308
* return 2
* # regular element
* if self.is_swapped: # <<<<<<<<<<<<<<
* byte_count_ptr[0] = byteswap_u4(u4s[1])
* else:
*/
if (__pyx_v_self->is_swapped) {
/* "scipy/io/matlab/mio5_utils.pyx":309
* # regular element
* if self.is_swapped:
* byte_count_ptr[0] = byteswap_u4(u4s[1]) # <<<<<<<<<<<<<<
* else:
* byte_count_ptr[0] = u4s[1]
*/
(__pyx_v_byte_count_ptr[0]) = __pyx_f_5scipy_2io_6matlab_10mio5_utils_byteswap_u4((__pyx_v_u4s[1]), 0);
goto __pyx_L6;
}
/*else*/ {
/* "scipy/io/matlab/mio5_utils.pyx":311
* byte_count_ptr[0] = byteswap_u4(u4s[1])
* else:
* byte_count_ptr[0] = u4s[1] # <<<<<<<<<<<<<<
* mdtype_ptr[0] = mdtype
* u4_ptr[0] = 0
*/
(__pyx_v_byte_count_ptr[0]) = (__pyx_v_u4s[1]);
}
__pyx_L6:;
/* "scipy/io/matlab/mio5_utils.pyx":312
* else:
* byte_count_ptr[0] = u4s[1]
* mdtype_ptr[0] = mdtype # <<<<<<<<<<<<<<
* u4_ptr[0] = 0
* return 1
*/
(__pyx_v_mdtype_ptr[0]) = __pyx_v_mdtype;
/* "scipy/io/matlab/mio5_utils.pyx":313
* byte_count_ptr[0] = u4s[1]
* mdtype_ptr[0] = mdtype
* u4_ptr[0] = 0 # <<<<<<<<<<<<<<
* return 1
*
*/
(__pyx_v_u4_ptr[0]) = 0;
/* "scipy/io/matlab/mio5_utils.pyx":314
* mdtype_ptr[0] = mdtype
* u4_ptr[0] = 0
* return 1 # <<<<<<<<<<<<<<
*
* cdef object read_element(self,
*/
__pyx_r = 1;
goto __pyx_L0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.cread_tag", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":316
* return 1
*
* cdef object read_element(self, # <<<<<<<<<<<<<<
* cnp.uint32_t *mdtype_ptr,
* cnp.uint32_t *byte_count_ptr,
*/
static PyObject *__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype_ptr, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count_ptr, void **__pyx_v_pp, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element *__pyx_optional_args) {
/* "scipy/io/matlab/mio5_utils.pyx":320
* cnp.uint32_t *byte_count_ptr,
* void **pp,
* int copy=True): # <<<<<<<<<<<<<<
* ''' Read data element into string buffer, return buffer
*
*/
int __pyx_v_copy = ((int)1);
CYTHON_UNUSED __pyx_t_5numpy_uint32_t __pyx_v_mdtype;
__pyx_t_5numpy_uint32_t __pyx_v_byte_count;
char __pyx_v_tag_data[4];
PyObject *__pyx_v_data = 0;
int __pyx_v_mod8;
int __pyx_v_tag_res;
PyObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
PyObject *__pyx_t_3 = NULL;
struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_read_string __pyx_t_4;
struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_seek __pyx_t_5;
char *__pyx_t_6;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_element", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_copy = __pyx_optional_args->copy;
}
}
/* "scipy/io/matlab/mio5_utils.pyx":356
* cdef int tag_res = self.cread_tag(mdtype_ptr,
* byte_count_ptr,
* tag_data) # <<<<<<<<<<<<<<
* mdtype = mdtype_ptr[0]
* byte_count = byte_count_ptr[0]
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, __pyx_v_tag_data); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 354; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_tag_res = __pyx_t_1;
/* "scipy/io/matlab/mio5_utils.pyx":357
* byte_count_ptr,
* tag_data)
* mdtype = mdtype_ptr[0] # <<<<<<<<<<<<<<
* byte_count = byte_count_ptr[0]
* if tag_res == 1: # full format
*/
__pyx_v_mdtype = (__pyx_v_mdtype_ptr[0]);
/* "scipy/io/matlab/mio5_utils.pyx":358
* tag_data)
* mdtype = mdtype_ptr[0]
* byte_count = byte_count_ptr[0] # <<<<<<<<<<<<<<
* if tag_res == 1: # full format
* data = self.cstream.read_string(
*/
__pyx_v_byte_count = (__pyx_v_byte_count_ptr[0]);
/* "scipy/io/matlab/mio5_utils.pyx":359
* mdtype = mdtype_ptr[0]
* byte_count = byte_count_ptr[0]
* if tag_res == 1: # full format # <<<<<<<<<<<<<<
* data = self.cstream.read_string(
* byte_count,
*/
__pyx_t_2 = (__pyx_v_tag_res == 1);
if (__pyx_t_2) {
/* "scipy/io/matlab/mio5_utils.pyx":363
* byte_count,
* pp,
* copy) # <<<<<<<<<<<<<<
* # Seek to next 64-bit boundary
* mod8 = byte_count % 8
*/
__pyx_t_4.__pyx_n = 1;
__pyx_t_4.copy = __pyx_v_copy;
__pyx_t_3 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_string(__pyx_v_self->cstream, __pyx_v_byte_count, __pyx_v_pp, &__pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 360; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_data = __pyx_t_3;
__pyx_t_3 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":365
* copy)
* # Seek to next 64-bit boundary
* mod8 = byte_count % 8 # <<<<<<<<<<<<<<
* if mod8:
* self.cstream.seek(8 - mod8, 1)
*/
__pyx_v_mod8 = __Pyx_mod_long(__pyx_v_byte_count, 8);
/* "scipy/io/matlab/mio5_utils.pyx":366
* # Seek to next 64-bit boundary
* mod8 = byte_count % 8
* if mod8: # <<<<<<<<<<<<<<
* self.cstream.seek(8 - mod8, 1)
* else: # SDE format, make safer home for data
*/
if (__pyx_v_mod8) {
/* "scipy/io/matlab/mio5_utils.pyx":367
* mod8 = byte_count % 8
* if mod8:
* self.cstream.seek(8 - mod8, 1) # <<<<<<<<<<<<<<
* else: # SDE format, make safer home for data
* data = PyBytes_FromStringAndSize(tag_data, byte_count)
*/
__pyx_t_5.__pyx_n = 1;
__pyx_t_5.whence = 1;
__pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_5); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 367; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L3;
}
/*else*/ {
/* "scipy/io/matlab/mio5_utils.pyx":369
* self.cstream.seek(8 - mod8, 1)
* else: # SDE format, make safer home for data
* data = PyBytes_FromStringAndSize(tag_data, byte_count) # <<<<<<<<<<<<<<
* pp[0] = <char *>data
* return data
*/
__pyx_t_3 = ((PyObject *)PyBytes_FromStringAndSize(__pyx_v_tag_data, __pyx_v_byte_count)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 369; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__Pyx_GOTREF(__pyx_t_3);
__pyx_v_data = __pyx_t_3;
__pyx_t_3 = 0;
/* "scipy/io/matlab/mio5_utils.pyx":370
* else: # SDE format, make safer home for data
* data = PyBytes_FromStringAndSize(tag_data, byte_count)
* pp[0] = <char *>data # <<<<<<<<<<<<<<
* return data
*
*/
__pyx_t_6 = PyBytes_AsString(__pyx_v_data); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 370; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
(__pyx_v_pp[0]) = ((char *)__pyx_t_6);
}
__pyx_L3:;
/* "scipy/io/matlab/mio5_utils.pyx":371
* data = PyBytes_FromStringAndSize(tag_data, byte_count)
* pp[0] = <char *>data
* return data # <<<<<<<<<<<<<<
*
* cdef int read_element_into(self,
*/
__Pyx_XDECREF(__pyx_r);
__Pyx_INCREF(__pyx_v_data);
__pyx_r = __pyx_v_data;
goto __pyx_L0;
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_XDECREF(__pyx_t_3);
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_element", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = 0;
__pyx_L0:;
__Pyx_XDECREF(__pyx_v_data);
__Pyx_XGIVEREF(__pyx_r);
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":373
* return data
*
* cdef int read_element_into(self, # <<<<<<<<<<<<<<
* cnp.uint32_t *mdtype_ptr,
* cnp.uint32_t *byte_count_ptr,
*/
static int __pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element_into(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, __pyx_t_5numpy_uint32_t *__pyx_v_mdtype_ptr, __pyx_t_5numpy_uint32_t *__pyx_v_byte_count_ptr, void *__pyx_v_ptr) {
int __pyx_v_mod8;
int __pyx_v_res;
__pyx_t_5numpy_uint32_t __pyx_v_byte_count;
int __pyx_r;
__Pyx_RefNannyDeclarations
int __pyx_t_1;
int __pyx_t_2;
struct __pyx_opt_args_5scipy_2io_6matlab_7streams_13GenericStream_seek __pyx_t_3;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_element_into", 0);
/* "scipy/io/matlab/mio5_utils.pyx":402
* mdtype_ptr,
* byte_count_ptr,
* <char *>ptr) # <<<<<<<<<<<<<<
* cdef cnp.uint32_t byte_count = byte_count_ptr[0]
* if res == 1: # full format
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_10mio5_utils_VarReader5 *)__pyx_v_self->__pyx_vtab)->cread_tag(__pyx_v_self, __pyx_v_mdtype_ptr, __pyx_v_byte_count_ptr, ((char *)__pyx_v_ptr)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 399; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_res = __pyx_t_1;
/* "scipy/io/matlab/mio5_utils.pyx":403
* byte_count_ptr,
* <char *>ptr)
* cdef cnp.uint32_t byte_count = byte_count_ptr[0] # <<<<<<<<<<<<<<
* if res == 1: # full format
* res = self.cstream.read_into(ptr, byte_count)
*/
__pyx_v_byte_count = (__pyx_v_byte_count_ptr[0]);
/* "scipy/io/matlab/mio5_utils.pyx":404
* <char *>ptr)
* cdef cnp.uint32_t byte_count = byte_count_ptr[0]
* if res == 1: # full format # <<<<<<<<<<<<<<
* res = self.cstream.read_into(ptr, byte_count)
* # Seek to next 64-bit boundary
*/
__pyx_t_2 = (__pyx_v_res == 1);
if (__pyx_t_2) {
/* "scipy/io/matlab/mio5_utils.pyx":405
* cdef cnp.uint32_t byte_count = byte_count_ptr[0]
* if res == 1: # full format
* res = self.cstream.read_into(ptr, byte_count) # <<<<<<<<<<<<<<
* # Seek to next 64-bit boundary
* mod8 = byte_count % 8
*/
__pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->read_into(__pyx_v_self->cstream, __pyx_v_ptr, __pyx_v_byte_count); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 405; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
__pyx_v_res = __pyx_t_1;
/* "scipy/io/matlab/mio5_utils.pyx":407
* res = self.cstream.read_into(ptr, byte_count)
* # Seek to next 64-bit boundary
* mod8 = byte_count % 8 # <<<<<<<<<<<<<<
* if mod8:
* self.cstream.seek(8 - mod8, 1)
*/
__pyx_v_mod8 = __Pyx_mod_long(__pyx_v_byte_count, 8);
/* "scipy/io/matlab/mio5_utils.pyx":408
* # Seek to next 64-bit boundary
* mod8 = byte_count % 8
* if mod8: # <<<<<<<<<<<<<<
* self.cstream.seek(8 - mod8, 1)
* return 0
*/
if (__pyx_v_mod8) {
/* "scipy/io/matlab/mio5_utils.pyx":409
* mod8 = byte_count % 8
* if mod8:
* self.cstream.seek(8 - mod8, 1) # <<<<<<<<<<<<<<
* return 0
*
*/
__pyx_t_3.__pyx_n = 1;
__pyx_t_3.whence = 1;
__pyx_t_1 = ((struct __pyx_vtabstruct_5scipy_2io_6matlab_7streams_GenericStream *)__pyx_v_self->cstream->__pyx_vtab)->seek(__pyx_v_self->cstream, (8 - __pyx_v_mod8), 0, &__pyx_t_3); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
goto __pyx_L4;
}
__pyx_L4:;
goto __pyx_L3;
}
__pyx_L3:;
/* "scipy/io/matlab/mio5_utils.pyx":410
* if mod8:
* self.cstream.seek(8 - mod8, 1)
* return 0 # <<<<<<<<<<<<<<
*
* cpdef cnp.ndarray read_numeric(self, int copy=True):
*/
__pyx_r = 0;
goto __pyx_L0;
__pyx_r = 0;
goto __pyx_L0;
__pyx_L1_error:;
__Pyx_AddTraceback("scipy.io.matlab.mio5_utils.VarReader5.read_element_into", __pyx_clineno, __pyx_lineno, __pyx_filename);
__pyx_r = -1;
__pyx_L0:;
__Pyx_RefNannyFinishContext();
return __pyx_r;
}
/* "scipy/io/matlab/mio5_utils.pyx":412
* return 0
*
* cpdef cnp.ndarray read_numeric(self, int copy=True): # <<<<<<<<<<<<<<
* ''' Read numeric data element into ndarray
*
*/
static PyObject *__pyx_pw_5scipy_2io_6matlab_10mio5_utils_10VarReader5_7read_numeric(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static PyArrayObject *__pyx_f_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric(struct __pyx_obj_5scipy_2io_6matlab_10mio5_utils_VarReader5 *__pyx_v_self, int __pyx_skip_dispatch, struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_numeric *__pyx_optional_args) {
int __pyx_v_copy = ((int)1);
__pyx_t_5numpy_uint32_t __pyx_v_mdtype;
__pyx_t_5numpy_uint32_t __pyx_v_byte_count;
void *__pyx_v_data_ptr;
npy_intp __pyx_v_el_count;
PyArrayObject *__pyx_v_el = 0;
PyObject *__pyx_v_data = 0;
PyArray_Descr *__pyx_v_dt = 0;
int __pyx_v_flags;
PyArrayObject *__pyx_r = NULL;
__Pyx_RefNannyDeclarations
PyObject *__pyx_t_1 = NULL;
PyObject *__pyx_t_2 = NULL;
PyObject *__pyx_t_3 = NULL;
struct __pyx_opt_args_5scipy_2io_6matlab_10mio5_utils_10VarReader5_read_element __pyx_t_4;
int __pyx_lineno = 0;
const char *__pyx_filename = NULL;
int __pyx_clineno = 0;
__Pyx_RefNannySetupContext("read_numeric", 0);
if (__pyx_optional_args) {
if (__pyx_optional_args->__pyx_n > 0) {
__pyx_v_copy = __pyx_optional_args->copy;
}
}
/* Check if called by wrapper */
if (unlikely(__pyx_skip_dispatch)) ;
/* Check if overriden in Python */
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
__pyx_t_1 =