/* Generated by Cython 0.11.3 on Sun Dec 20 00:04:47 2009 */

#define PY_SSIZE_T_CLEAN
#include "Python.h"
#include "structmember.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#else
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#if PY_VERSION_HEX < 0x02040000
  #define METH_COEXIST 0
  #define PyDict_CheckExact(op) (Py_TYPE(op) == &PyDict_Type)
#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 PyInt_FromSsize_t(z) PyInt_FromLong(z)
  #define PyInt_AsSsize_t(o)   PyInt_AsLong(o)
  #define PyNumber_Index(o)    PyNumber_Int(o)
  #define PyIndex_Check(o)     PyNumber_Check(o)
#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)

#endif
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#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_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyString_Type                PyBytes_Type
  #define PyString_CheckExact          PyBytes_CheckExact
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define PyBytes_Type                 PyString_Type
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyMethod_New(func, self, klass) PyInstanceMethod_New(func)
#endif
#if !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#else
  #define _USE_MATH_DEFINES
#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
#ifdef __cplusplus
#define __PYX_EXTERN_C extern "C"
#else
#define __PYX_EXTERN_C extern
#endif
#include <math.h>
#define __PYX_HAVE_API__pysdif___pysdif
#include "stdio.h"
#include "stdlib.h"
#include "string.h"
#include "numpy/arrayobject.h"
#include "sdif.h"
#define __PYX_USE_C99_COMPLEX defined(_Complex_I)


#ifdef __GNUC__
#define INLINE __inline__
#elif _WIN32
#define INLINE __inline
#else
#define INLINE 
#endif

typedef struct {PyObject **p; char *s; long n; char is_unicode; char intern; char is_identifier;} __Pyx_StringTabEntry; /*proto*/



static int __pyx_skip_dispatch = 0;


/* Type Conversion Predeclarations */

#if PY_MAJOR_VERSION < 3
#define __Pyx_PyBytes_FromString          PyString_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyString_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyString_AsString
#else
#define __Pyx_PyBytes_FromString          PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize   PyBytes_FromStringAndSize
#define __Pyx_PyBytes_AsString            PyBytes_AsString
#endif

#define __Pyx_PyBytes_FromUString(s)      __Pyx_PyBytes_FromString((char*)s)
#define __Pyx_PyBytes_AsUString(s)        ((unsigned char*) __Pyx_PyBytes_AsString(s))

#define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
static INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);

#if !defined(T_PYSSIZET)
#if PY_VERSION_HEX < 0x02050000
#define T_PYSSIZET T_INT
#elif !defined(T_LONGLONG)
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))  ? T_INT  : \
        ((sizeof(Py_ssize_t) == sizeof(long)) ? T_LONG : -1))
#else
#define T_PYSSIZET \
        ((sizeof(Py_ssize_t) == sizeof(int))          ? T_INT      : \
        ((sizeof(Py_ssize_t) == sizeof(long))         ? T_LONG     : \
        ((sizeof(Py_ssize_t) == sizeof(PY_LONG_LONG)) ? T_LONGLONG : -1)))
#endif
#endif


#if !defined(T_ULONGLONG)
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : -1))))
#else
#define __Pyx_T_UNSIGNED_INT(x) \
        ((sizeof(x) == sizeof(unsigned char))  ? T_UBYTE : \
        ((sizeof(x) == sizeof(unsigned short)) ? T_USHORT : \
        ((sizeof(x) == sizeof(unsigned int))   ? T_UINT : \
        ((sizeof(x) == sizeof(unsigned long))  ? T_ULONG : \
        ((sizeof(x) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))))
#endif
#if !defined(T_LONGLONG)
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : -1))))
#else
#define __Pyx_T_SIGNED_INT(x) \
        ((sizeof(x) == sizeof(char))  ? T_BYTE : \
        ((sizeof(x) == sizeof(short)) ? T_SHORT : \
        ((sizeof(x) == sizeof(int))   ? T_INT : \
        ((sizeof(x) == sizeof(long))  ? T_LONG : \
        ((sizeof(x) == sizeof(PY_LONG_LONG))   ? T_LONGLONG : -1)))))
#endif

#define __Pyx_T_FLOATING(x) \
        ((sizeof(x) == sizeof(float)) ? T_FLOAT : \
        ((sizeof(x) == sizeof(double)) ? T_DOUBLE : -1))

#if !defined(T_SIZET)
#if !defined(T_ULONGLONG)
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))  ? T_UINT  : \
        ((sizeof(size_t) == sizeof(unsigned long)) ? T_ULONG : -1))
#else
#define T_SIZET \
        ((sizeof(size_t) == sizeof(unsigned int))          ? T_UINT      : \
        ((sizeof(size_t) == sizeof(unsigned long))         ? T_ULONG     : \
        ((sizeof(size_t) == sizeof(unsigned PY_LONG_LONG)) ? T_ULONGLONG : -1)))
#endif
#endif

static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject*);

#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : 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;
static const char **__pyx_f;


#ifdef 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* (*NewContext)(const char*, int, const char*);
  void (*FinishContext)(void**);
} __Pyx_RefnannyAPIStruct;
static __Pyx_RefnannyAPIStruct *__Pyx_Refnanny = NULL;
#define __Pyx_ImportRefcountAPI(name)   (__Pyx_RefnannyAPIStruct *) PyCObject_Import((char *)name, (char *)"RefnannyAPI")
#define __Pyx_INCREF(r) __Pyx_Refnanny->INCREF(__pyx_refchk, (PyObject *)(r), __LINE__)
#define __Pyx_DECREF(r) __Pyx_Refnanny->DECREF(__pyx_refchk, (PyObject *)(r), __LINE__)
#define __Pyx_GOTREF(r) __Pyx_Refnanny->GOTREF(__pyx_refchk, (PyObject *)(r), __LINE__)
#define __Pyx_GIVEREF(r) __Pyx_Refnanny->GIVEREF(__pyx_refchk, (PyObject *)(r), __LINE__)
#define __Pyx_XDECREF(r) if((r) == NULL) ; else __Pyx_DECREF(r)
#define __Pyx_SetupRefcountContext(name)   void* __pyx_refchk = __Pyx_Refnanny->NewContext((name), __LINE__, __FILE__)
#define __Pyx_FinishRefcountContext()   __Pyx_Refnanny->FinishContext(&__pyx_refchk)
#else
#define __Pyx_INCREF(r) Py_INCREF(r)
#define __Pyx_DECREF(r) Py_DECREF(r)
#define __Pyx_GOTREF(r)
#define __Pyx_GIVEREF(r)
#define __Pyx_XDECREF(r) Py_XDECREF(r)
#define __Pyx_SetupRefcountContext(name)
#define __Pyx_FinishRefcountContext()
#endif /* CYTHON_REFNANNY */
#define __Pyx_XGIVEREF(r) if((r) == NULL) ; else __Pyx_GIVEREF(r)
#define __Pyx_XGOTREF(r) if((r) == NULL) ; else __Pyx_GOTREF(r)

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name, PyObject* kw_name); /*proto*/

static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/

static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],     PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,     const char* function_name); /*proto*/


static 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, size <= sizeof(long)) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
    if (likely(o != Py_None)) {
        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, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
}

#define __Pyx_GetItemInt_Tuple(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Tuple_Fast(o, i, size <= sizeof(long)) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
    if (likely(o != Py_None)) {
        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, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
}


#define __Pyx_GetItemInt(o, i, size, to_py_func) ((size <= sizeof(Py_ssize_t)) ? \
                                                    __Pyx_GetItemInt_Fast(o, i, size <= sizeof(long)) : \
                                                    __Pyx_GetItemInt_Generic(o, to_py_func(i)))

static INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int fits_long) {
    PyObject *r;
    if (PyList_CheckExact(o) && ((0 <= i) & (i < PyList_GET_SIZE(o)))) {
        r = PyList_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (PyTuple_CheckExact(o) && ((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
        r = PyTuple_GET_ITEM(o, i);
        Py_INCREF(r);
    }
    else if (Py_TYPE(o)->tp_as_sequence && Py_TYPE(o)->tp_as_sequence->sq_item && (likely(i >= 0))) {
        r = PySequence_GetItem(o, i);
    }
    else {
        r = __Pyx_GetItemInt_Generic(o, fits_long ? PyInt_FromLong(i) : PyLong_FromLongLong(i));
    }
    return r;
}

static INLINE void __Pyx_RaiseNoneNotIterableError(void);

static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

static INLINE void __Pyx_RaiseTooManyValuesError(void);

static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index); /*proto*/

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact); /*proto*/

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list); /*proto*/

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name); /*proto*/

static INLINE SdifSignature __Pyx_PyInt_from_py_SdifSignature(PyObject *);

static INLINE PyObject* __Pyx_PyObject_Append(PyObject* L, PyObject* x) {
    if (likely(PyList_CheckExact(L))) {
        if (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 INLINE PyObject *__Pyx_PyInt_to_py_SdifUInt4(SdifUInt4);

static INLINE SdifUInt4 __Pyx_PyInt_from_py_SdifUInt4(PyObject *);

static int __Pyx_Print(PyObject *, int); /*proto*/
#if PY_MAJOR_VERSION >= 3
static PyObject* __pyx_print = 0;
static PyObject* __pyx_print_kwargs = 0;
#endif

static int __Pyx_PrintOne(PyObject *o); /*proto*/

static INLINE PyObject *__Pyx_PyInt_to_py_SdifSignature(SdifSignature);

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb); /*proto*/

static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/

static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp);

static INLINE PyObject *__Pyx_PyInt_to_py_SdiffPosT(SdiffPosT);

static PyObject *__Pyx_UnpackItem(PyObject *, Py_ssize_t index); /*proto*/
static int __Pyx_EndUnpack(PyObject *); /*proto*/

#if __PYX_USE_C99_COMPLEX
    #define __Pyx_REAL_PART(z) __real__(z)
    #define __Pyx_IMAG_PART(z) __imag__(z)
#else
    #define __Pyx_REAL_PART(z) ((z).real)
    #define __Pyx_IMAG_PART(z) ((z).imag)
#endif

#define __pyx_PyObject_from_complex(z) PyComplex_FromDoubles((double)__Pyx_REAL_PART(z), (double)__Pyx_IMAG_PART(z))

#if __PYX_USE_C99_COMPLEX

    typedef float _Complex __pyx_t_float_complex;
    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      return x + y*(__pyx_t_float_complex)_Complex_I;
    }
    
    #define __pyx_t_float_complex_is_zero(a) ((a) == 0)
    #define __pyx_t_float_complex_eq(a, b) ((a) == (b))
    #define __pyx_t_float_complex_add(a, b) ((a)+(b))
    #define __pyx_t_float_complex_sub(a, b) ((a)-(b))
    #define __pyx_t_float_complex_mul(a, b) ((a)*(b))
    #define __pyx_t_float_complex_div(a, b) ((a)/(b))
    #define __pyx_t_float_complex_neg(a) (-(a))

#else

    typedef struct { float real, imag; } __pyx_t_float_complex;
    static INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
      __pyx_t_float_complex c; c.real = x; c.imag = y; return c;
    }
    
    static INLINE int __pyx_t_float_complex_is_zero(__pyx_t_float_complex a) {
       return (a.real == 0) & (a.imag == 0);
    }

    static INLINE int __pyx_t_float_complex_eq(__pyx_t_float_complex a, __pyx_t_float_complex b) {
       return (a.real == b.real) & (a.imag == b.imag);
    }

    static INLINE __pyx_t_float_complex __pyx_t_float_complex_add(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }

    static INLINE __pyx_t_float_complex __pyx_t_float_complex_sub(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }

    static INLINE __pyx_t_float_complex __pyx_t_float_complex_mul(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }

    static INLINE __pyx_t_float_complex __pyx_t_float_complex_div(__pyx_t_float_complex a, __pyx_t_float_complex b) {
        __pyx_t_float_complex z;
        float denom = b.real*b.real + b.imag*b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }

    static INLINE __pyx_t_float_complex __pyx_t_float_complex_neg(__pyx_t_float_complex a) {
        __pyx_t_float_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }

#endif

#if __PYX_USE_C99_COMPLEX

    typedef double _Complex __pyx_t_double_complex;
    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      return x + y*(__pyx_t_double_complex)_Complex_I;
    }
    
    #define __pyx_t_double_complex_is_zero(a) ((a) == 0)
    #define __pyx_t_double_complex_eq(a, b) ((a) == (b))
    #define __pyx_t_double_complex_add(a, b) ((a)+(b))
    #define __pyx_t_double_complex_sub(a, b) ((a)-(b))
    #define __pyx_t_double_complex_mul(a, b) ((a)*(b))
    #define __pyx_t_double_complex_div(a, b) ((a)/(b))
    #define __pyx_t_double_complex_neg(a) (-(a))

#else

    typedef struct { double real, imag; } __pyx_t_double_complex;
    static INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
      __pyx_t_double_complex c; c.real = x; c.imag = y; return c;
    }
    
    static INLINE int __pyx_t_double_complex_is_zero(__pyx_t_double_complex a) {
       return (a.real == 0) & (a.imag == 0);
    }

    static INLINE int __pyx_t_double_complex_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
       return (a.real == b.real) & (a.imag == b.imag);
    }

    static INLINE __pyx_t_double_complex __pyx_t_double_complex_add(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }

    static INLINE __pyx_t_double_complex __pyx_t_double_complex_sub(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }

    static INLINE __pyx_t_double_complex __pyx_t_double_complex_mul(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }

    static INLINE __pyx_t_double_complex __pyx_t_double_complex_div(__pyx_t_double_complex a, __pyx_t_double_complex b) {
        __pyx_t_double_complex z;
        double denom = b.real*b.real + b.imag*b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }

    static INLINE __pyx_t_double_complex __pyx_t_double_complex_neg(__pyx_t_double_complex a) {
        __pyx_t_double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }

#endif

#if __PYX_USE_C99_COMPLEX

    typedef long double _Complex __pyx_t_long__double_complex;
    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) {
      return x + y*(__pyx_t_long__double_complex)_Complex_I;
    }
    
    #define __pyx_t_long__double_complex_is_zero(a) ((a) == 0)
    #define __pyx_t_long__double_complex_eq(a, b) ((a) == (b))
    #define __pyx_t_long__double_complex_add(a, b) ((a)+(b))
    #define __pyx_t_long__double_complex_sub(a, b) ((a)-(b))
    #define __pyx_t_long__double_complex_mul(a, b) ((a)*(b))
    #define __pyx_t_long__double_complex_div(a, b) ((a)/(b))
    #define __pyx_t_long__double_complex_neg(a) (-(a))

#else

    typedef struct { long double real, imag; } __pyx_t_long__double_complex;
    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_from_parts(long double x, long double y) {
      __pyx_t_long__double_complex c; c.real = x; c.imag = y; return c;
    }
    
    static INLINE int __pyx_t_long__double_complex_is_zero(__pyx_t_long__double_complex a) {
       return (a.real == 0) & (a.imag == 0);
    }

    static INLINE int __pyx_t_long__double_complex_eq(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
       return (a.real == b.real) & (a.imag == b.imag);
    }

    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_add(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
        __pyx_t_long__double_complex z;
        z.real = a.real + b.real;
        z.imag = a.imag + b.imag;
        return z;
    }

    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_sub(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
        __pyx_t_long__double_complex z;
        z.real = a.real - b.real;
        z.imag = a.imag - b.imag;
        return z;
    }

    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_mul(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
        __pyx_t_long__double_complex z;
        z.real = a.real * b.real - a.imag * b.imag;
        z.imag = a.real * b.imag + a.imag * b.real;
        return z;
    }

    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_div(__pyx_t_long__double_complex a, __pyx_t_long__double_complex b) {
        __pyx_t_long__double_complex z;
        long double denom = b.real*b.real + b.imag*b.imag;
        z.real = (a.real * b.real + a.imag * b.imag) / denom;
        z.imag = (a.imag * b.real - a.real * b.imag) / denom;
        return z;
    }

    static INLINE __pyx_t_long__double_complex __pyx_t_long__double_complex_neg(__pyx_t_long__double_complex a) {
        __pyx_t_long__double_complex z;
        z.real = -a.real;
        z.imag = -a.imag;
        return z;
    }

#endif

static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject *);

static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject *);

static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject *);

static INLINE char __Pyx_PyInt_AsChar(PyObject *);

static INLINE short __Pyx_PyInt_AsShort(PyObject *);

static INLINE int __Pyx_PyInt_AsInt(PyObject *);

static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject *);

static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject *);

static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject *);

static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject *);

static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject *);

static INLINE long __Pyx_PyInt_AsLong(PyObject *);

static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject *);

static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject *);

static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject *);

static void __Pyx_WriteUnraisable(const char *name); /*proto*/

static int __Pyx_SetVtable(PyObject *dict, void *vtable); /*proto*/

static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, long size);  /*proto*/

static PyObject *__Pyx_ImportModule(const char *name); /*proto*/

static void __Pyx_AddTraceback(const char *funcname); /*proto*/

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/

/* Type declarations */

typedef npy_int8 __pyx_t_5numpy_int8_t;

typedef npy_int16 __pyx_t_5numpy_int16_t;

typedef npy_int32 __pyx_t_5numpy_int32_t;

typedef npy_int64 __pyx_t_5numpy_int64_t;

typedef npy_uint8 __pyx_t_5numpy_uint8_t;

typedef npy_uint16 __pyx_t_5numpy_uint16_t;

typedef npy_uint32 __pyx_t_5numpy_uint32_t;

typedef npy_uint64 __pyx_t_5numpy_uint64_t;

typedef npy_float32 __pyx_t_5numpy_float32_t;

typedef npy_float64 __pyx_t_5numpy_float64_t;

typedef __pyx_t_float_complex __pyx_t_5numpy_complex64_t;

typedef __pyx_t_double_complex __pyx_t_5numpy_complex128_t;

typedef npy_long __pyx_t_5numpy_int_t;

typedef npy_longlong __pyx_t_5numpy_long_t;

typedef npy_ulong __pyx_t_5numpy_uint_t;

typedef npy_ulonglong __pyx_t_5numpy_ulong_t;

typedef npy_double __pyx_t_5numpy_float_t;

typedef npy_double __pyx_t_5numpy_double_t;

typedef npy_longdouble __pyx_t_5numpy_longdouble_t;

typedef npy_cfloat __pyx_t_5numpy_cfloat_t;

typedef npy_cdouble __pyx_t_5numpy_cdouble_t;

typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;

typedef npy_cdouble __pyx_t_5numpy_complex_t;

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":362
 * 
 * # enums to keep state of reading
 * cdef enum MatrixStatusE:             # <<<<<<<<<<<<<<
 *     eMatrixInvalid,
 *     eMatrixNothingRead,
 */

enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE {
  __pyx_e_6pysdif_7_pysdif_eMatrixInvalid,
  __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead,
  __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead,
  __pyx_e_6pysdif_7_pysdif_eMatrixDataRead,
  __pyx_e_6pysdif_7_pysdif_eMatrixDataSkipped,
  __pyx_e_6pysdif_7_pysdif_eMatrixOffline
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":370
 *     eMatrixOffline
 * 
 * cdef enum FrameStatusE:             # <<<<<<<<<<<<<<
 *     eFrameInvalid,
 *     eFrameNothingRead,
 */

enum __pyx_t_6pysdif_7_pysdif_FrameStatusE {
  __pyx_e_6pysdif_7_pysdif_eFrameInvalid,
  __pyx_e_6pysdif_7_pysdif_eFrameNothingRead,
  __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead,
  __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead,
  __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead,
  __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":378
 *     eFrameSignatureRead
 * 
 * cdef enum SdifStatusE:             # <<<<<<<<<<<<<<
 *     eSdifNothing,
 *     eSdifGeneralHeader,
 */

enum __pyx_t_6pysdif_7_pysdif_SdifStatusE {
  __pyx_e_6pysdif_7_pysdif_eSdifNothing,
  __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader,
  __pyx_e_6pysdif_7_pysdif_eSdifAllASCIIChunks,
  __pyx_e_6pysdif_7_pysdif_eSdifSignature,
  __pyx_e_6pysdif_7_pysdif_eSdifFrameHeader,
  __pyx_e_6pysdif_7_pysdif_eSdifMatrixHeader,
  __pyx_e_6pysdif_7_pysdif_eSdifMatrixData
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":642
 *         self.sdiffile.write_status = eSdifMatrixData
 * 
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig, SdifFloat8 time, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *     cdef FrameW f = FrameW()
 *     f.sdiffile = sdiffile
 */

struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new {
  int __pyx_n;
  SdifUInt4 streamID;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":184
 *     return streams
 * 
 * cdef class StreamID:             # <<<<<<<<<<<<<<
 *     cdef SdifStreamIDT *this
 *     cdef int own_this
 */

struct __pyx_obj_6pysdif_7_pysdif_StreamID {
  PyObject_HEAD
  SdifStreamIDT *this;
  int own_this;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":233
 *     return ft
 * 
 * cdef class MatrixTypeDefinition:             # <<<<<<<<<<<<<<
 *     cdef public object signature
 *     cdef public list column_names
 */

struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_vtab;
  PyObject *signature;
  PyObject *column_names;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":389
 * # -----------------------------------------------------------------------------------------------
 * 
 * cdef class Matrix:             # <<<<<<<<<<<<<<
 *     """
 *     Matrix is only a placeholder class to
 */

struct __pyx_obj_6pysdif_7_pysdif_Matrix {
  PyObject_HEAD
  SdifFileT *source_this;
  SdifSignature _signature;
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *source;
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE status;
  PyArrayObject *data;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":308
 *     return out
 * 
 * cdef class FrameTypeDefinition:             # <<<<<<<<<<<<<<
 *     cdef public str signature
 *     cdef public list components
 */

struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition {
  PyObject_HEAD
  PyObject *signature;
  PyObject *components;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":272
 *     return out
 * 
 * cdef class Component:             # <<<<<<<<<<<<<<
 *     cdef readonly str signature
 *     cdef readonly str name
 */

struct __pyx_obj_6pysdif_7_pysdif_Component {
  PyObject_HEAD
  PyObject *signature;
  PyObject *name;
  unsigned int num;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":358
 * 
 * # Forward declarations
 * cdef class FrameR             # <<<<<<<<<<<<<<
 * cdef class SdifFile
 * 
 */

struct __pyx_obj_6pysdif_7_pysdif_FrameR {
  PyObject_HEAD
  SdifFrameHeaderT *header;
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *source;
  SdifFileT *source_this;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":359
 * # Forward declarations
 * cdef class FrameR
 * cdef class SdifFile             # <<<<<<<<<<<<<<
 * 
 * # enums to keep state of reading
 */

struct __pyx_obj_6pysdif_7_pysdif_SdifFile {
  PyObject_HEAD
  struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *__pyx_vtab;
  SdifFileT *this;
  int eof;
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *frame;
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *matrix;
  enum __pyx_t_6pysdif_7_pysdif_FrameStatusE frame_status;
  size_t matrix_idx;
  enum __pyx_t_6pysdif_7_pysdif_MatrixStatusE matrix_status;
  enum __pyx_t_6pysdif_7_pysdif_SdifStatusE write_status;
};

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":578
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 * 
 * cdef class FrameW:             # <<<<<<<<<<<<<<
 *     """
 *     FrameW : class to write frames to a SdifFile
 */

struct __pyx_obj_6pysdif_7_pysdif_FrameW {
  PyObject_HEAD
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *sdiffile;
  SdifSignature signature;
  SdifFloat8 time;
  SdifUInt4 streamID;
  PyObject *matrices;
  PyObject *signatures;
  SdifUInt4 frame_size;
  SdifUInt4 num_matrices;
};


/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":233
 *     return ft
 * 
 * cdef class MatrixTypeDefinition:             # <<<<<<<<<<<<<<
 *     cdef public object signature
 *     cdef public list column_names
 */

struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition {
  SdifMatrixTypeT *(*toSdifMatrixType)(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *);
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition;


/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":657
 * # -----------------------------------------------------------------------------------------------
 * 
 * cdef class SdifFile:             # <<<<<<<<<<<<<<
 *     """
 *     SdifFile(filename, mode="r")
 */

struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile {
  void (*init_read)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*init_containers)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*init_write)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*finalize_frame)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*read_signature)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*read_matrix_data)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
  void (*reinit)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *);
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *__pyx_vtabptr_6pysdif_7_pysdif_SdifFile;
/* Module declarations from stdio */

/* Module declarations from stdlib */

/* Module declarations from python_buffer */

/* 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 INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
/* Module declarations from python_string */

/* Module declarations from pysdif.pysdif */

/* Module declarations from pysdif._pysdif */

static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_StreamID = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_Component = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_FrameR = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_SdifFile = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_Matrix = 0;
static PyTypeObject *__pyx_ptype_6pysdif_7_pysdif_FrameW = 0;
static int __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED;
static int __pyx_v_6pysdif_7_pysdif__g_sdif_initiated;
static PyObject *__pyx_v_6pysdif_7_pysdif__SDIF_FILEMODE = 0;
static PyObject *__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES = 0;
static PyObject *__pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM = 0;
static INLINE int __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(int); /*proto*/
static INLINE int __pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(int); /*proto*/
static INLINE unsigned int __pyx_f_6pysdif_7_pysdif__str2sig(char *); /*proto*/
static INLINE PyObject *__pyx_f_6pysdif_7_pysdif_sig2str(SdifSignature); /*proto*/
static INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(SdifMatrixDataT *); /*proto*/
static INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_copy(SdifMatrixDataT *); /*proto*/
static INLINE SdifSignature __pyx_f_6pysdif_7_pysdif_as_signature(PyObject *); /*proto*/
static INLINE PyObject *__pyx_f_6pysdif_7_pysdif_PyString_from_SdifString(SdifStringT *); /*proto*/
static INLINE SdifStringT *__pyx_f_6pysdif_7_pysdif_SdifString_from_PyString(PyObject *); /*proto*/
static INLINE PyObject *__pyx_f_6pysdif_7_pysdif_nvt_to_dict(SdifNameValueTableT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_valuetables_to_dicts(SdifNameValuesLT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_streamidtable_to_list(SdifStreamIDTableT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_StreamID_fromSdifStreadIDT(SdifStreamIDT *); /*proto*/
static SdifMatrixTypeT *__pyx_f_6pysdif_7_pysdif_MatrixType_create(PyObject *, PyObject *); /*proto*/
static SdifFrameTypeT *__pyx_f_6pysdif_7_pysdif_FrameType_create(PyObject *, PyObject *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_MatrixTypesTable_to_list(SdifHashTableT *); /*proto*/
static struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_f_6pysdif_7_pysdif_Component_from_SdifComponent(SdifComponentT *); /*proto*/
static PyObject *__pyx_f_6pysdif_7_pysdif_FrameTypesTable_to_list(SdifHashTableT *); /*proto*/
static struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_f_6pysdif_7_pysdif_FrameW_new(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *, SdifSignature, SdifFloat8, struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new *__pyx_optional_args); /*proto*/
#define __Pyx_MODULE_NAME "pysdif._pysdif"
int __pyx_module_is_main_pysdif___pysdif = 0;

/* Implementation of pysdif._pysdif */
static char __pyx_k_57[] = "RBEP ReassignedBandEnhancedPartials";
static char __pyx_k_60[] = "Index, Frequency, Amplitude, Phase, Bandwidth, Offset";
static PyObject *__pyx_int_0x0301;
static PyObject *__pyx_int_0x0004;
static PyObject *__pyx_int_0x0008;
static PyObject *__pyx_int_0x0101;
static PyObject *__pyx_int_0x0102;
static PyObject *__pyx_int_0x0104;
static PyObject *__pyx_int_0x0108;
static PyObject *__pyx_int_0x0201;
static PyObject *__pyx_int_0x0202;
static PyObject *__pyx_int_0x0204;
static PyObject *__pyx_int_0x0208;
static PyObject *__pyx_int_neg_1;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_5;
static char __pyx_k___main__[] = "__main__";
static PyObject *__pyx_kp___main__;
static char __pyx_k___cinit__[] = "__cinit__";
static PyObject *__pyx_kp___cinit__;
static char __pyx_k___dealloc__[] = "__dealloc__";
static PyObject *__pyx_kp___dealloc__;
static char __pyx_k___repr__[] = "__repr__";
static PyObject *__pyx_kp___repr__;
static char __pyx_k___init__[] = "__init__";
static PyObject *__pyx_kp___init__;
static char __pyx_k___iter__[] = "__iter__";
static PyObject *__pyx_kp___iter__;
static char __pyx_k___len__[] = "__len__";
static PyObject *__pyx_kp___len__;
static char __pyx_k_get_data[] = "get_data";
static PyObject *__pyx_kp_get_data;
static char __pyx_k_copy[] = "copy";
static PyObject *__pyx_kp_copy;
static char __pyx_k_skip[] = "skip";
static PyObject *__pyx_kp_skip;
static char __pyx_k_matrix_exists[] = "matrix_exists";
static PyObject *__pyx_kp_matrix_exists;
static char __pyx_k___next__[] = "__next__";
static PyObject *__pyx_kp___next__;
static char __pyx_k_get_matrix_data[] = "get_matrix_data";
static PyObject *__pyx_kp_get_matrix_data;
static char __pyx_k_add_matrix[] = "add_matrix";
static PyObject *__pyx_kp_add_matrix;
static char __pyx_k_write[] = "write";
static PyObject *__pyx_kp_write;
static char __pyx_k_close[] = "close";
static PyObject *__pyx_kp_close;
static char __pyx_k_read_frame_header[] = "read_frame_header";
static PyObject *__pyx_kp_read_frame_header;
static char __pyx_k_skip_frame_data[] = "skip_frame_data";
static PyObject *__pyx_kp_skip_frame_data;
static char __pyx_k_read_matrix_header[] = "read_matrix_header";
static PyObject *__pyx_kp_read_matrix_header;
static char __pyx_k_skip_matrix_data[] = "skip_matrix_data";
static PyObject *__pyx_kp_skip_matrix_data;
static char __pyx_k_skip_matrix[] = "skip_matrix";
static PyObject *__pyx_kp_skip_matrix;
static char __pyx_k_status[] = "status";
static PyObject *__pyx_kp_status;
static char __pyx_k_get_next_matrix[] = "get_next_matrix";
static PyObject *__pyx_kp_get_next_matrix;
static char __pyx_k_rewind[] = "rewind";
static PyObject *__pyx_kp_rewind;
static char __pyx_k__read_padding[] = "_read_padding";
static PyObject *__pyx_kp__read_padding;
static char __pyx_k_add_NVT[] = "add_NVT";
static PyObject *__pyx_kp_add_NVT;
static char __pyx_k_add_matrix_type[] = "add_matrix_type";
static PyObject *__pyx_kp_add_matrix_type;
static char __pyx_k_add_frame_type[] = "add_frame_type";
static PyObject *__pyx_kp_add_frame_type;
static char __pyx_k_31[] = "clone_type_definitions";
static PyObject *__pyx_kp_31;
static char __pyx_k_clone_NVTs[] = "clone_NVTs";
static PyObject *__pyx_kp_clone_NVTs;
static char __pyx_k_clone_definitions[] = "clone_definitions";
static PyObject *__pyx_kp_clone_definitions;
static char __pyx_k_clone_frames[] = "clone_frames";
static PyObject *__pyx_kp_clone_frames;
static char __pyx_k_add_streamID[] = "add_streamID";
static PyObject *__pyx_kp_add_streamID;
static char __pyx_k_add_predefined_type[] = "add_predefined_type";
static PyObject *__pyx_kp_add_predefined_type;
static char __pyx_k_32[] = "write_all_ascii_chunks";
static PyObject *__pyx_kp_32;
static char __pyx_k_new_frame[] = "new_frame";
static PyObject *__pyx_kp_new_frame;
static char __pyx_k_33[] = "new_frame_one_matrix";
static PyObject *__pyx_kp_33;
static char __pyx_k_print_NVT[] = "print_NVT";
static PyObject *__pyx_kp_print_NVT;
static char __pyx_k_34[] = "print_general_header";
static PyObject *__pyx_kp_34;
static char __pyx_k_35[] = "print_all_ascii_chunks";
static PyObject *__pyx_kp_35;
static char __pyx_k_print_all_types[] = "print_all_types";
static PyObject *__pyx_kp_print_all_types;
static char __pyx_k_print_matrix_header[] = "print_matrix_header";
static PyObject *__pyx_kp_print_matrix_header;
static char __pyx_k_print_one_row[] = "print_one_row";
static PyObject *__pyx_kp_print_one_row;
static char __pyx_k_print_frame_header[] = "print_frame_header";
static PyObject *__pyx_kp_print_frame_header;
static char __pyx_k_print_all_stream_ID[] = "print_all_stream_ID";
static PyObject *__pyx_kp_print_all_stream_ID;
static char __pyx_k_36[] = "frame_types_to_string";
static PyObject *__pyx_kp_36;
static char __pyx_k_get_frame_types[] = "get_frame_types";
static PyObject *__pyx_kp_get_frame_types;
static char __pyx_k_37[] = "matrix_types_to_string";
static PyObject *__pyx_kp_37;
static char __pyx_k_get_matrix_types[] = "get_matrix_types";
static PyObject *__pyx_kp_get_matrix_types;
static char __pyx_k_get_NVTs[] = "get_NVTs";
static PyObject *__pyx_kp_get_NVTs;
static char __pyx_k_get_stream_IDs[] = "get_stream_IDs";
static PyObject *__pyx_kp_get_stream_IDs;
static char __pyx_k_signature[] = "signature";
static PyObject *__pyx_kp_signature;
static char __pyx_k_s[] = "s";
static PyObject *__pyx_kp_s;
static char __pyx_k_numid[] = "numid";
static PyObject *__pyx_kp_numid;
static char __pyx_k_source[] = "source";
static PyObject *__pyx_kp_source;
static char __pyx_k_treeway[] = "treeway";
static PyObject *__pyx_kp_treeway;
static char __pyx_k_value[] = "value";
static PyObject *__pyx_kp_value;
static char __pyx_k_column_names[] = "column_names";
static PyObject *__pyx_kp_column_names;
static char __pyx_k_name[] = "name";
static PyObject *__pyx_kp_name;
static char __pyx_k_components[] = "components";
static PyObject *__pyx_kp_components;
static char __pyx_k_sdiftype[] = "sdiftype";
static PyObject *__pyx_kp_sdiftype;
static char __pyx_k_data_array[] = "data_array";
static PyObject *__pyx_kp_data_array;
static char __pyx_k_filename[] = "filename";
static PyObject *__pyx_kp_filename;
static char __pyx_k_mode[] = "mode";
static PyObject *__pyx_kp_mode;
static char __pyx_k_predefined_type[] = "predefined_type";
static PyObject *__pyx_kp_predefined_type;
static char __pyx_k_pos[] = "pos";
static PyObject *__pyx_kp_pos;
static char __pyx_k_d[] = "d";
static PyObject *__pyx_kp_d;
static char __pyx_k_signatures_to_clone[] = "signatures_to_clone";
static PyObject *__pyx_kp_signatures_to_clone;
static char __pyx_k_time[] = "time";
static PyObject *__pyx_kp_time;
static char __pyx_k_streamID[] = "streamID";
static PyObject *__pyx_kp_streamID;
static char __pyx_k_frame_sig[] = "frame_sig";
static PyObject *__pyx_kp_frame_sig;
static char __pyx_k_matrix_sig[] = "matrix_sig";
static PyObject *__pyx_kp_matrix_sig;
static char __pyx_k_38[] = "os.path";
static PyObject *__pyx_kp_38;
static char __pyx_k_os[] = "os";
static PyObject *__pyx_kp_os;
static char __pyx_k_numpy[] = "numpy";
static PyObject *__pyx_kp_numpy;
static char __pyx_k_39[] = "r";
static PyObject *__pyx_kp_39;
static char __pyx_k_40[] = "w";
static PyObject *__pyx_kp_40;
static char __pyx_k_41[] = "rw";
static PyObject *__pyx_kp_41;
static char __pyx_k_42[] = "wr";
static PyObject *__pyx_kp_42;
static char __pyx_k_43[] = "char";
static PyObject *__pyx_kp_43;
static char __pyx_k_44[] = "float32";
static PyObject *__pyx_kp_44;
static char __pyx_k_45[] = "float64";
static PyObject *__pyx_kp_45;
static char __pyx_k_46[] = "int8";
static PyObject *__pyx_kp_46;
static char __pyx_k_47[] = "int16";
static PyObject *__pyx_kp_47;
static char __pyx_k_48[] = "int32";
static PyObject *__pyx_kp_48;
static char __pyx_k_49[] = "int64";
static PyObject *__pyx_kp_49;
static char __pyx_k_50[] = "uint8";
static PyObject *__pyx_kp_50;
static char __pyx_k_51[] = "uint16";
static PyObject *__pyx_kp_51;
static char __pyx_k_52[] = "uint32";
static PyObject *__pyx_kp_52;
static char __pyx_k_53[] = "uint64";
static PyObject *__pyx_kp_53;
static char __pyx_k_56[] = "RBEP";
static PyObject *__pyx_kp_56;
static char __pyx_k_55[] = "frame_types";
static PyObject *__pyx_kp_55;
static char __pyx_k_59[] = "RBEP";
static PyObject *__pyx_kp_59;
static char __pyx_k_58[] = "matrix_types";
static PyObject *__pyx_kp_58;
static char __pyx_k_54[] = "RBEP";
static PyObject *__pyx_kp_54;
static char __pyx_k_SDIF_NEWTYPES[] = "SDIF_NEWTYPES";
static PyObject *__pyx_kp_SDIF_NEWTYPES;
static char __pyx_k_61[] = "r";
static PyObject *__pyx_kp_61;
static char __pyx_k_62[] = "r";
static PyObject *__pyx_kp_62;
static char __pyx_k_63[] = "RBEP";
static PyObject *__pyx_kp_63;
static char __pyx_k_c_numpy[] = "c_numpy";
static PyObject *__pyx_kp_c_numpy;
static char __pyx_k_NPY_ULONg[] = "NPY_ULONg";
static PyObject *__pyx_kp_NPY_ULONg;
static char __pyx_k_range[] = "range";
static PyObject *__pyx_kp_range;
static char __pyx_k_append[] = "append";
static PyObject *__pyx_kp_append;
static char __pyx_k_65[] = "str2signature";
static PyObject *__pyx_kp_65;
static char __pyx_k_join[] = "join";
static PyObject *__pyx_kp_join;
static char __pyx_k_get[] = "get";
static PyObject *__pyx_kp_get;
static char __pyx_k_71[] = "frame_types";
static PyObject *__pyx_kp_71;
static char __pyx_k_72[] = "matrix_types";
static PyObject *__pyx_kp_72;
static char __pyx_k_path[] = "path";
static PyObject *__pyx_kp_path;
static char __pyx_k_split[] = "split";
static PyObject *__pyx_kp_split;
static char __pyx_k___file__[] = "__file__";
static PyObject *__pyx_kp___file__;
static char __pyx_k_sep[] = "sep";
static PyObject *__pyx_kp_sep;
static char __pyx_k_exists[] = "exists";
static PyObject *__pyx_kp_exists;
static char __pyx_k_dtype[] = "dtype";
static PyObject *__pyx_kp_dtype;
static char __pyx_k_rows[] = "rows";
static PyObject *__pyx_kp_rows;
static char __pyx_k_cols[] = "cols";
static PyObject *__pyx_kp_cols;
static char __pyx_k_StopIteration[] = "StopIteration";
static PyObject *__pyx_kp_StopIteration;
static char __pyx_k_resize[] = "resize";
static PyObject *__pyx_kp_resize;
static char __pyx_k_78[] = "r";
static PyObject *__pyx_kp_78;
static char __pyx_k_RuntimeError[] = "RuntimeError";
static PyObject *__pyx_kp_RuntimeError;
static char __pyx_k_iteritems[] = "iteritems";
static PyObject *__pyx_kp_iteritems;
static char __pyx_k_basestring[] = "basestring";
static PyObject *__pyx_kp_basestring;
static char __pyx_k_84[] = "get_predefined_frames_and_matrices";
static PyObject *__pyx_kp_84;
static char __pyx_k_ValueError[] = "ValueError";
static PyObject *__pyx_kp_ValueError;
static char __pyx_k_matrices_in_frame[] = "matrices_in_frame";
static PyObject *__pyx_kp_matrices_in_frame;
static char __pyx_k_next[] = "next";
static PyObject *__pyx_kp_next;
static char __pyx_k_86[] = "w";
static PyObject *__pyx_kp_86;
static char __pyx_k_88[] = "ColumnaA";
static PyObject *__pyx_kp_88;
static char __pyx_k_91[] = "meta";
static PyObject *__pyx_kp_91;
static char __pyx_k_92[] = "data";
static PyObject *__pyx_kp_92;
static char __pyx_k_array[] = "array";
static PyObject *__pyx_kp_array;
static PyObject *__pyx_kp_57;
static PyObject *__pyx_kp_60;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_basestring;
static PyObject *__pyx_builtin_ValueError;
static PyObject *__pyx_kp_64;
static char __pyx_k_64[] = "StreamID(numid=%d, source='%s', treeway='%s')";
static PyObject *__pyx_kp_67;
static PyObject *__pyx_kp_66;
static char __pyx_k_66[] = "1MTD(signature=%s, column_names=%s)";
static char __pyx_k_67[] = ", ";
static PyObject *__pyx_kp_68;
static char __pyx_k_68[] = "Component(sig=%s, name=%s)";
static PyObject *__pyx_kp_70;
static PyObject *__pyx_kp_69;
static char __pyx_k_69[] = "1FTD (signature='%s', components=[%s])";
static char __pyx_k_70[] = ", ";
static PyObject *__pyx_kp_73;
static PyObject *__pyx_kp_75;
static char __pyx_k_73[] = "SdifTypes.STYP";
static char __pyx_k_74[] = "";
static char __pyx_k_75[] = "Sdif initialized";
static PyObject *__pyx_kp_76;
static char __pyx_k_76[] = "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)";
static PyObject *__pyx_kp_77;
static char __pyx_k_77[] = "FrameW(signature=%s, time=%f, streamID=%d)";
static PyObject *__pyx_kp_79;
static char __pyx_k_79[] = "path not found, cannot open sdif file for reading";
static PyObject *__pyx_kp_80;
static char __pyx_k_80[] = ",";
static PyObject *__pyx_kp_81;
static PyObject *__pyx_kp_82;
static PyObject *__pyx_kp_83;
static char __pyx_k_81[] = ",";
static char __pyx_k_82[] = ",";
static char __pyx_k_83[] = ";";
static PyObject *__pyx_kp_85;
static char __pyx_k_85[] = "Definition of sdif type not found";
static PyObject *__pyx_kp_87;
static PyObject *__pyx_kp_89;
static PyObject *__pyx_kp_90;
static PyObject *__pyx_kp_93;
static PyObject *__pyx_kp_94;
static char __pyx_k_87[] = "1MTX";
static char __pyx_k_89[] = "1ABC";
static char __pyx_k_90[] = "1MTX pupu";
static char __pyx_k_93[] = "1ABC";
static char __pyx_k_94[] = "1MTX";
static PyObject *__pyx_int_15;
static char __pyx_k___getbuffer__[] = "__getbuffer__";
static PyObject *__pyx_kp___getbuffer__;
static char __pyx_k___releasebuffer__[] = "__releasebuffer__";
static PyObject *__pyx_kp___releasebuffer__;
static char __pyx_k_info[] = "info";
static PyObject *__pyx_kp_info;
static char __pyx_k_flags[] = "flags";
static PyObject *__pyx_kp_flags;
static PyObject *__pyx_kp_1;
static PyObject *__pyx_kp_2;
static PyObject *__pyx_kp_5;
static PyObject *__pyx_kp_23;
static char __pyx_k_1[] = "ndarray is not C contiguous";
static char __pyx_k_2[] = "ndarray is not Fortran contiguous";
static char __pyx_k_3[] = ">";
static char __pyx_k_4[] = "<";
static char __pyx_k_5[] = "Non-native byte order not supported";
static char __pyx_k_6[] = "b";
static char __pyx_k_7[] = "B";
static char __pyx_k_8[] = "h";
static char __pyx_k_9[] = "H";
static char __pyx_k_10[] = "i";
static char __pyx_k_11[] = "I";
static char __pyx_k_12[] = "l";
static char __pyx_k_13[] = "L";
static char __pyx_k_14[] = "q";
static char __pyx_k_15[] = "Q";
static char __pyx_k_16[] = "f";
static char __pyx_k_17[] = "d";
static char __pyx_k_18[] = "g";
static char __pyx_k_19[] = "Zf";
static char __pyx_k_20[] = "Zd";
static char __pyx_k_21[] = "Zg";
static char __pyx_k_22[] = "O";
static char __pyx_k_23[] = "unknown dtype code in numpy.pxd (%d)";
static char __pyx_k_24[] = "^";
static PyObject *__pyx_kp_25;
static PyObject *__pyx_kp_28;
static PyObject *__pyx_kp_29;
static PyObject *__pyx_kp_30;
static char __pyx_k_25[] = "Format string allocated too short, see comment in numpy.pxd";
static char __pyx_k_26[] = ">";
static char __pyx_k_27[] = "<";
static char __pyx_k_28[] = "Non-native byte order not supported";
static char __pyx_k_29[] = "Format string allocated too short.";
static char __pyx_k_30[] = "unknown dtype code in numpy.pxd (%d)";

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":65
 *     }
 * 
 * cdef inline int dtype_sdif2numpy(int typenum):             # <<<<<<<<<<<<<<
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 */

static INLINE int __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(int __pyx_v_typenum) {
  int __pyx_r;
  __Pyx_SetupRefcountContext("dtype_sdif2numpy");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":66
 * 
 * cdef inline int dtype_sdif2numpy(int typenum):
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 */
  switch (__pyx_v_typenum) {
    case 0x0004:
    __pyx_v_typenum = NPY_FLOAT;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":67
 * cdef inline int dtype_sdif2numpy(int typenum):
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 */
    case 0x0301:
    __pyx_v_typenum = NPY_BYTE;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":68
 *     if   typenum == 0x0004: typenum = c_numpy.NPY_FLOAT
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 */
    case 0x0008:
    __pyx_v_typenum = NPY_DOUBLE;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":69
 *     elif typenum == 0x0301: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 */
    case 0x0104:
    __pyx_v_typenum = NPY_INT;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":70
 *     elif typenum == 0x0008: typenum = c_numpy.NPY_DOUBLE
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 */
    case 0x0101:
    __pyx_v_typenum = NPY_BYTE;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":71
 *     elif typenum == 0x0104: typenum = c_numpy.NPY_INT
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 */
    case 0x0102:
    __pyx_v_typenum = NPY_SHORT;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":72
 *     elif typenum == 0x0101: typenum = c_numpy.NPY_BYTE
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 */
    case 0x0108:
    __pyx_v_typenum = NPY_LONG;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":73
 *     elif typenum == 0x0102: typenum = c_numpy.NPY_SHORT
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 */
    case 0x0201:
    __pyx_v_typenum = NPY_UBYTE;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":74
 *     elif typenum == 0x0108: typenum = c_numpy.NPY_LONG
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG
 */
    case 0x0202:
    __pyx_v_typenum = NPY_USHORT;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":75
 *     elif typenum == 0x0201: typenum = c_numpy.NPY_UBYTE
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT             # <<<<<<<<<<<<<<
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG
 *     return typenum
 */
    case 0x0204:
    __pyx_v_typenum = NPY_UINT;
    break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":76
 *     elif typenum == 0x0202: typenum = c_numpy.NPY_USHORT
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG             # <<<<<<<<<<<<<<
 *     return typenum
 * 
 */
    case 0x0208:
    __pyx_v_typenum = NPY_ULONG;
    break;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":77
 *     elif typenum == 0x0204: typenum = c_numpy.NPY_UINT
 *     elif typenum == 0x0208: typenum = c_numpy.NPY_ULONG
 *     return typenum             # <<<<<<<<<<<<<<
 * 
 * cdef inline int dtype_numpy2sdif(int dtype):
 */
  __pyx_r = __pyx_v_typenum;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":79
 *     return typenum
 * 
 * cdef inline int dtype_numpy2sdif(int dtype):             # <<<<<<<<<<<<<<
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 */

static INLINE int __pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(int __pyx_v_dtype) {
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("dtype_numpy2sdif");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":80
 * 
 * cdef inline int dtype_numpy2sdif(int dtype):
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_FLOAT);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0004;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":81
 * cdef inline int dtype_numpy2sdif(int dtype):
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_BYTE);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0301;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":82
 *     if   dtype == c_numpy.NPY_FLOAT : dtype = 0x0004
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_DOUBLE);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0008;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":83
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0301
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_INT);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0104;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":84
 *     elif dtype == c_numpy.NPY_DOUBLE: dtype = 0x0008
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_BYTE);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0101;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":85
 *     elif dtype == c_numpy.NPY_INT   : dtype = 0x0104
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_SHORT);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0102;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":86
 *     elif dtype == c_numpy.NPY_BYTE  : dtype = 0x0101
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_LONG);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0108;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":87
 *     elif dtype == c_numpy.NPY_SHORT : dtype = 0x0102
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_UBYTE);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0201;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":88
 *     elif dtype == c_numpy.NPY_LONG  : dtype = 0x0108
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 *     elif dtype == c_numpy.NPY_ULONg : dtype = 0x0208
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_USHORT);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0202;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":89
 *     elif dtype == c_numpy.NPY_UBYTE : dtype = 0x0201
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204             # <<<<<<<<<<<<<<
 *     elif dtype == c_numpy.NPY_ULONg : dtype = 0x0208
 *     return dtype
 */
  __pyx_t_1 = (__pyx_v_dtype == NPY_UINT);
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0204;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":90
 *     elif dtype == c_numpy.NPY_USHORT: dtype = 0x0202
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 *     elif dtype == c_numpy.NPY_ULONg : dtype = 0x0208             # <<<<<<<<<<<<<<
 *     return dtype
 * 
 */
  __pyx_t_2 = PyInt_FromLong(__pyx_v_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_c_numpy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_NPY_ULONg); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {
    __pyx_v_dtype = 0x0208;
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":91
 *     elif dtype == c_numpy.NPY_UINT  : dtype = 0x0204
 *     elif dtype == c_numpy.NPY_ULONg : dtype = 0x0208
 *     return dtype             # <<<<<<<<<<<<<<
 * 
 * cdef inline unsigned int _str2sig (char *sig):
 */
  __pyx_r = __pyx_v_dtype;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pysdif._pysdif.dtype_numpy2sdif");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":93
 *     return dtype
 * 
 * cdef inline unsigned int _str2sig (char *sig):             # <<<<<<<<<<<<<<
 *    return ((((<unsigned int>(sig[0])) & 0xff) << 24) |
 *        (((<unsigned int>(sig[1])) & 0xff) << 16) |
 */

static INLINE unsigned int __pyx_f_6pysdif_7_pysdif__str2sig(char *__pyx_v_sig) {
  unsigned int __pyx_r;
  __Pyx_SetupRefcountContext("_str2sig");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":97
 *        (((<unsigned int>(sig[1])) & 0xff) << 16) |
 *        (((<unsigned int>(sig[2])) & 0xff) << 8) |
 *        ((<unsigned int>(sig[3])) & 0xff))             # <<<<<<<<<<<<<<
 * 
 * def signature2str(SdifSignature signature):
 */
  __pyx_r = (((((((unsigned int)(__pyx_v_sig[0])) & 0xff) << 24) | ((((unsigned int)(__pyx_v_sig[1])) & 0xff) << 16)) | ((((unsigned int)(__pyx_v_sig[2])) & 0xff) << 8)) | (((unsigned int)(__pyx_v_sig[3])) & 0xff));
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":99
 *        ((<unsigned int>(sig[3])) & 0xff))
 * 
 * def signature2str(SdifSignature signature):             # <<<<<<<<<<<<<<
 *     return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_signature2str(PyObject *__pyx_self, PyObject *__pyx_arg_signature); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_signature2str[] = "signature2str(pysdif.pysdif.SdifSignature signature)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_signature2str(PyObject *__pyx_self, PyObject *__pyx_arg_signature) {
  SdifSignature __pyx_v_signature;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("signature2str");
  __pyx_self = __pyx_self;
  assert(__pyx_arg_signature); {
    __pyx_v_signature = __Pyx_PyInt_from_py_SdifSignature(__pyx_arg_signature); if (unlikely((__pyx_v_signature == (SdifSignature)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.signature2str");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":100
 * 
 * def signature2str(SdifSignature signature):
 *     return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)             # <<<<<<<<<<<<<<
 * 
 * cdef inline sig2str(SdifSignature signature):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyString_FromStringAndSize(SdifSignatureToString(__pyx_v_signature), 4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __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("pysdif._pysdif.signature2str");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":102
 *     return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)
 * 
 * cdef inline sig2str(SdifSignature signature):             # <<<<<<<<<<<<<<
 *     return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)
 * 
 */

static INLINE PyObject *__pyx_f_6pysdif_7_pysdif_sig2str(SdifSignature __pyx_v_signature) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("sig2str");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":103
 * 
 * cdef inline sig2str(SdifSignature signature):
 *     return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)             # <<<<<<<<<<<<<<
 * 
 * def str2signature(s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyString_FromStringAndSize(SdifSignatureToString(__pyx_v_signature), 4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 103; __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("pysdif._pysdif.sig2str");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":105
 *     return PyString_FromStringAndSize(SdifSignatureToString(signature), 4)
 * 
 * def str2signature(s):             # <<<<<<<<<<<<<<
 *     return _str2sig(s)
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_str2signature(PyObject *__pyx_self, PyObject *__pyx_v_s); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_str2signature[] = "str2signature(s)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_str2signature(PyObject *__pyx_self, PyObject *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  char *__pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("str2signature");
  __pyx_self = __pyx_self;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":106
 * 
 * def str2signature(s):
 *     return _str2sig(s)             # <<<<<<<<<<<<<<
 * 
 * cdef inline ndarray _array_from_matrix_data_no_copy(SdifMatrixDataT *matrix): # , int copy=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_s); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_2 = PyLong_FromUnsignedLong(__pyx_f_6pysdif_7_pysdif__str2sig(__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 106; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.str2signature");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":108
 *     return _str2sig(s)
 * 
 * cdef inline ndarray _array_from_matrix_data_no_copy(SdifMatrixDataT *matrix): # , int copy=0):             # <<<<<<<<<<<<<<
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 *     cdef npy_intp dims[2]
 */

static INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(SdifMatrixDataT *__pyx_v_matrix) {
  SdifMatrixHeaderT *__pyx_v_header;
  npy_intp __pyx_v_dims[2];
  PyArrayObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("_array_from_matrix_data_no_copy");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":109
 * 
 * cdef inline ndarray _array_from_matrix_data_no_copy(SdifMatrixDataT *matrix): # , int copy=0):
 *     cdef SdifMatrixHeaderT *header = matrix.Header             # <<<<<<<<<<<<<<
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 */
  __pyx_v_header = __pyx_v_matrix->Header;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":111
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow             # <<<<<<<<<<<<<<
 *     dims[1] = <npy_intp>header.NbCol
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)
 */
  (__pyx_v_dims[0]) = ((npy_intp)__pyx_v_header->NbRow);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":112
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol             # <<<<<<<<<<<<<<
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)
 * 
 */
  (__pyx_v_dims[1]) = ((npy_intp)__pyx_v_header->NbCol);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":113
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol
 *     return PyArray_SimpleNewFromData(2, dims, dtype_sdif2numpy(header.DataType), matrix.Data.Void)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __pyx_t_1 = PyArray_SimpleNewFromData(2, __pyx_v_dims, __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(__pyx_v_header->DataType), __pyx_v_matrix->Data.Void); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;
  goto __pyx_L0;

  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif._array_from_matrix_data_no_copy");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":116
 * 
 * 
 * cdef inline ndarray _array_from_matrix_data_copy(SdifMatrixDataT *matrix):             # <<<<<<<<<<<<<<
 *     cdef ndarray out
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 */

static INLINE PyArrayObject *__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_copy(SdifMatrixDataT *__pyx_v_matrix) {
  PyArrayObject *__pyx_v_out;
  SdifMatrixHeaderT *__pyx_v_header;
  npy_intp __pyx_v_dims[2];
  PyArrayObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("_array_from_matrix_data_copy");
  __pyx_v_out = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":118
 * cdef inline ndarray _array_from_matrix_data_copy(SdifMatrixDataT *matrix):
 *     cdef ndarray out
 *     cdef SdifMatrixHeaderT *header = matrix.Header             # <<<<<<<<<<<<<<
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 */
  __pyx_v_header = __pyx_v_matrix->Header;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":120
 *     cdef SdifMatrixHeaderT *header = matrix.Header
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow             # <<<<<<<<<<<<<<
 *     dims[1] = <npy_intp>header.NbCol
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 */
  (__pyx_v_dims[0]) = ((npy_intp)__pyx_v_header->NbRow);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":121
 *     cdef npy_intp dims[2]
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol             # <<<<<<<<<<<<<<
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])
 */
  (__pyx_v_dims[1]) = ((npy_intp)__pyx_v_header->NbCol);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":122
 *     dims[0] = <npy_intp>header.NbRow
 *     dims[1] = <npy_intp>header.NbCol
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))             # <<<<<<<<<<<<<<
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])
 *     return out
 */
  __pyx_t_1 = PyArray_SimpleNew(2, __pyx_v_dims, __pyx_f_6pysdif_7_pysdif_dtype_sdif2numpy(__pyx_v_header->DataType)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 122; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_v_out));
  __pyx_v_out = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":123
 *     dims[1] = <npy_intp>header.NbCol
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  memcpy(((void *)__pyx_v_out->data), __pyx_v_matrix->Data.Void, ((PyArray_ITEMSIZE(__pyx_v_out) * (__pyx_v_dims[0])) * (__pyx_v_dims[1])));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":124
 *     out = PyArray_SimpleNew(2, dims, dtype_sdif2numpy(header.DataType))
 *     memcpy(<void *>out.data, matrix.Data.Void, c_numpy.PyArray_ITEMSIZE(out) * dims[0] * dims[1])
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef inline SdifSignature as_signature(sig):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  __pyx_r = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif._array_from_matrix_data_copy");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":126
 *     return out
 * 
 * cdef inline SdifSignature as_signature(sig):             # <<<<<<<<<<<<<<
 *     if isinstance(sig, str):
 *         return _str2sig(sig)
 */

static INLINE SdifSignature __pyx_f_6pysdif_7_pysdif_as_signature(PyObject *__pyx_v_sig) {
  SdifSignature __pyx_r;
  int __pyx_t_1;
  char *__pyx_t_2;
  SdifSignature __pyx_t_3;
  __Pyx_SetupRefcountContext("as_signature");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":127
 * 
 * cdef inline SdifSignature as_signature(sig):
 *     if isinstance(sig, str):             # <<<<<<<<<<<<<<
 *         return _str2sig(sig)
 *     else:
 */
  __pyx_t_1 = PyObject_TypeCheck(__pyx_v_sig, ((PyTypeObject *)((PyObject*)&PyString_Type))); 
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":128
 * cdef inline SdifSignature as_signature(sig):
 *     if isinstance(sig, str):
 *         return _str2sig(sig)             # <<<<<<<<<<<<<<
 *     else:
 *         return sig
 */
    __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_sig); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_f_6pysdif_7_pysdif__str2sig(__pyx_t_2);
    goto __pyx_L0;
    goto __pyx_L3;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":130
 *         return _str2sig(sig)
 *     else:
 *         return sig             # <<<<<<<<<<<<<<
 * 
 * cdef inline PyString_from_SdifString(SdifStringT *s):
 */
    __pyx_t_3 = __Pyx_PyInt_from_py_SdifSignature(__pyx_v_sig); if (unlikely((__pyx_t_3 == (SdifSignature)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 130; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_r = __pyx_t_3;
    goto __pyx_L0;
  }
  __pyx_L3:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pysdif._pysdif.as_signature");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":132
 *         return sig
 * 
 * cdef inline PyString_from_SdifString(SdifStringT *s):             # <<<<<<<<<<<<<<
 *     """ convert a SdifStringT to a python string """
 *     return PyString_FromStringAndSize(s.str, s.SizeW)
 */

static INLINE PyObject *__pyx_f_6pysdif_7_pysdif_PyString_from_SdifString(SdifStringT *__pyx_v_s) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("PyString_from_SdifString");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":134
 * cdef inline PyString_from_SdifString(SdifStringT *s):
 *     """ convert a SdifStringT to a python string """
 *     return PyString_FromStringAndSize(s.str, s.SizeW)             # <<<<<<<<<<<<<<
 * 
 * cdef inline SdifStringT *SdifString_from_PyString(str s):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyString_FromStringAndSize(__pyx_v_s->str, __pyx_v_s->SizeW); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 134; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_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("pysdif._pysdif.PyString_from_SdifString");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":136
 *     return PyString_FromStringAndSize(s.str, s.SizeW)
 * 
 * cdef inline SdifStringT *SdifString_from_PyString(str s):             # <<<<<<<<<<<<<<
 *     cdef char *bytes = s
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 */

static INLINE SdifStringT *__pyx_f_6pysdif_7_pysdif_SdifString_from_PyString(PyObject *__pyx_v_s) {
  char *__pyx_v_bytes;
  SdifStringT *__pyx_v_sdifstr;
  SdifStringT *__pyx_r;
  char *__pyx_t_1;
  __Pyx_SetupRefcountContext("SdifString_from_PyString");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":137
 * 
 * cdef inline SdifStringT *SdifString_from_PyString(str s):
 *     cdef char *bytes = s             # <<<<<<<<<<<<<<
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 *     SdifStringAppend(sdifstr, bytes)
 */
  __pyx_t_1 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_s)); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_bytes = __pyx_t_1;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":138
 * cdef inline SdifStringT *SdifString_from_PyString(str s):
 *     cdef char *bytes = s
 *     cdef SdifStringT *sdifstr = SdifStringNew()             # <<<<<<<<<<<<<<
 *     SdifStringAppend(sdifstr, bytes)
 *     return sdifstr
 */
  __pyx_v_sdifstr = SdifStringNew();

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":139
 *     cdef char *bytes = s
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 *     SdifStringAppend(sdifstr, bytes)             # <<<<<<<<<<<<<<
 *     return sdifstr
 * 
 */
  SdifStringAppend(__pyx_v_sdifstr, __pyx_v_bytes);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":140
 *     cdef SdifStringT *sdifstr = SdifStringNew()
 *     SdifStringAppend(sdifstr, bytes)
 *     return sdifstr             # <<<<<<<<<<<<<<
 * 
 * cdef inline nvt_to_dict( SdifNameValueTableT *nvt ):
 */
  __pyx_r = __pyx_v_sdifstr;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifString_from_PyString");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":142
 *     return sdifstr
 * 
 * cdef inline nvt_to_dict( SdifNameValueTableT *nvt ):             # <<<<<<<<<<<<<<
 *     cdef int i
 *     cdef SdifUInt4      iNV
 */

static INLINE PyObject *__pyx_f_6pysdif_7_pysdif_nvt_to_dict(SdifNameValueTableT *__pyx_v_nvt) {
  int __pyx_v_i;
  SdifHashNT *__pyx_v_pNV;
  SdifHashTableT *__pyx_v_HTable;
  SdifNameValueT *__pyx_v_namevalue;
  PyObject *__pyx_v_table;
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_value;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_SetupRefcountContext("nvt_to_dict");
  __pyx_v_table = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":149
 *     cdef SdifNameValueT *namevalue
 * 
 *     HTable = nvt.NVHT             # <<<<<<<<<<<<<<
 *     table = {}
 *     for i in range(HTable.HashSize):
 */
  __pyx_v_HTable = __pyx_v_nvt->NVHT;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":150
 * 
 *     HTable = nvt.NVHT
 *     table = {}             # <<<<<<<<<<<<<<
 *     for i in range(HTable.HashSize):
 *         pNV = HTable.Table[i]
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));
  __Pyx_DECREF(__pyx_v_table);
  __pyx_v_table = ((PyObject *)__pyx_1);
  __pyx_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":151
 *     HTable = nvt.NVHT
 *     table = {}
 *     for i in range(HTable.HashSize):             # <<<<<<<<<<<<<<
 *         pNV = HTable.Table[i]
 *         while pNV:
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_v_HTable->HashSize; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":152
 *     table = {}
 *     for i in range(HTable.HashSize):
 *         pNV = HTable.Table[i]             # <<<<<<<<<<<<<<
 *         while pNV:
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 */
    __pyx_v_pNV = (__pyx_v_HTable->Table[__pyx_v_i]);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":153
 *     for i in range(HTable.HashSize):
 *         pNV = HTable.Table[i]
 *         while pNV:             # <<<<<<<<<<<<<<
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 *             name = namevalue.Name
 */
    while (1) {
      __pyx_t_2 = (__pyx_v_pNV != 0);
      if (!__pyx_t_2) break;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":154
 *         pNV = HTable.Table[i]
 *         while pNV:
 *             namevalue = <SdifNameValueT *>(pNV.Data)             # <<<<<<<<<<<<<<
 *             name = namevalue.Name
 *             value = namevalue.Value
 */
      __pyx_v_namevalue = ((SdifNameValueT *)__pyx_v_pNV->Data);

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":155
 *         while pNV:
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 *             name = namevalue.Name             # <<<<<<<<<<<<<<
 *             value = namevalue.Value
 *             table[name] = value
 */
      __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_namevalue->Name); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_name);
      __pyx_v_name = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":156
 *             namevalue = <SdifNameValueT *>(pNV.Data)
 *             name = namevalue.Name
 *             value = namevalue.Value             # <<<<<<<<<<<<<<
 *             table[name] = value
 *             pNV = pNV.Next
 */
      __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_namevalue->Value); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_v_value);
      __pyx_v_value = __pyx_t_3;
      __pyx_t_3 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":157
 *             name = namevalue.Name
 *             value = namevalue.Value
 *             table[name] = value             # <<<<<<<<<<<<<<
 *             pNV = pNV.Next
 *     return table
 */
      if (PyObject_SetItem(__pyx_v_table, __pyx_v_name, __pyx_v_value) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 157; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":158
 *             value = namevalue.Value
 *             table[name] = value
 *             pNV = pNV.Next             # <<<<<<<<<<<<<<
 *     return table
 * 
 */
      __pyx_v_pNV = __pyx_v_pNV->Next;
    }
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":159
 *             table[name] = value
 *             pNV = pNV.Next
 *     return table             # <<<<<<<<<<<<<<
 * 
 * cdef valuetables_to_dicts (SdifNameValuesLT *namevalues):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_table);
  __pyx_r = __pyx_v_table;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.nvt_to_dict");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_table);
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":161
 *     return table
 * 
 * cdef valuetables_to_dicts (SdifNameValuesLT *namevalues):             # <<<<<<<<<<<<<<
 *     """ create a list of dicts where each dict represents a value table """
 *     SdifListInitLoop(namevalues.NVTList)
 */

static  PyObject *__pyx_f_6pysdif_7_pysdif_valuetables_to_dicts(SdifNameValuesLT *__pyx_v_namevalues) {
  PyObject *__pyx_v_tables;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_SetupRefcountContext("valuetables_to_dicts");
  __pyx_v_tables = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":163
 * cdef valuetables_to_dicts (SdifNameValuesLT *namevalues):
 *     """ create a list of dicts where each dict represents a value table """
 *     SdifListInitLoop(namevalues.NVTList)             # <<<<<<<<<<<<<<
 *     tables = []
 *     while SdifListIsNext(namevalues.NVTList):
 */
  SdifListInitLoop(__pyx_v_namevalues->NVTList);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":164
 *     """ create a list of dicts where each dict represents a value table """
 *     SdifListInitLoop(namevalues.NVTList)
 *     tables = []             # <<<<<<<<<<<<<<
 *     while SdifListIsNext(namevalues.NVTList):
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_tables);
  __pyx_v_tables = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":165
 *     SdifListInitLoop(namevalues.NVTList)
 *     tables = []
 *     while SdifListIsNext(namevalues.NVTList):             # <<<<<<<<<<<<<<
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))
 */
  while (1) {
    __pyx_t_2 = SdifListIsNext(__pyx_v_namevalues->NVTList);
    if (!__pyx_t_2) break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":166
 *     tables = []
 *     while SdifListIsNext(namevalues.NVTList):
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))             # <<<<<<<<<<<<<<
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))
 *     return tables
 */
    __pyx_v_namevalues->CurrNVT = ((SdifNameValueTableT *)SdifListGetNext(__pyx_v_namevalues->NVTList));

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":167
 *     while SdifListIsNext(namevalues.NVTList):
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))             # <<<<<<<<<<<<<<
 *     return tables
 * 
 */
    __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_nvt_to_dict(__pyx_v_namevalues->CurrNVT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_Append(__pyx_v_tables, __pyx_t_1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":168
 *         namevalues.CurrNVT = <SdifNameValueTableT *>(SdifListGetNext(namevalues.NVTList))
 *         tables.append(nvt_to_dict(namevalues.CurrNVT))
 *     return tables             # <<<<<<<<<<<<<<
 * 
 * cdef streamidtable_to_list(SdifStreamIDTableT *table):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_tables);
  __pyx_r = __pyx_v_tables;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.valuetables_to_dicts");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_tables);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":170
 *     return tables
 * 
 * cdef streamidtable_to_list(SdifStreamIDTableT *table):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pID
 */

static  PyObject *__pyx_f_6pysdif_7_pysdif_streamidtable_to_list(SdifStreamIDTableT *__pyx_v_table) {
  unsigned int __pyx_v_i;
  SdifHashNT *__pyx_v_pID;
  SdifStreamIDT *__pyx_v_streamid;
  PyObject *__pyx_v_streams;
  PyObject *__pyx_v_streamid_w;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  int __pyx_t_3;
  __Pyx_SetupRefcountContext("streamidtable_to_list");
  __pyx_v_streams = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_streamid_w = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":174
 *     cdef SdifHashNT *pID
 *     cdef SdifStreamIDT *streamid
 *     streams = []             # <<<<<<<<<<<<<<
 *     for i in range(table.SIDHT.HashSize):
 *         pID = table.SIDHT.Table[i]
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_streams);
  __pyx_v_streams = ((PyObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":175
 *     cdef SdifStreamIDT *streamid
 *     streams = []
 *     for i in range(table.SIDHT.HashSize):             # <<<<<<<<<<<<<<
 *         pID = table.SIDHT.Table[i]
 *         while pID:
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_v_table->SIDHT->HashSize; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":176
 *     streams = []
 *     for i in range(table.SIDHT.HashSize):
 *         pID = table.SIDHT.Table[i]             # <<<<<<<<<<<<<<
 *         while pID:
 *             streamid = <SdifStreamIDT *>(pID.Data)
 */
    __pyx_v_pID = (__pyx_v_table->SIDHT->Table[__pyx_v_i]);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":177
 *     for i in range(table.SIDHT.HashSize):
 *         pID = table.SIDHT.Table[i]
 *         while pID:             # <<<<<<<<<<<<<<
 *             streamid = <SdifStreamIDT *>(pID.Data)
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 */
    while (1) {
      __pyx_t_3 = (__pyx_v_pID != 0);
      if (!__pyx_t_3) break;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":178
 *         pID = table.SIDHT.Table[i]
 *         while pID:
 *             streamid = <SdifStreamIDT *>(pID.Data)             # <<<<<<<<<<<<<<
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 *             streams.append(streamid_w)
 */
      __pyx_v_streamid = ((SdifStreamIDT *)__pyx_v_pID->Data);

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":179
 *         while pID:
 *             streamid = <SdifStreamIDT *>(pID.Data)
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)             # <<<<<<<<<<<<<<
 *             streams.append(streamid_w)
 *             pID = pID.Next
 */
      __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_StreamID_fromSdifStreadIDT(__pyx_v_streamid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_v_streamid_w);
      __pyx_v_streamid_w = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":180
 *             streamid = <SdifStreamIDT *>(pID.Data)
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 *             streams.append(streamid_w)             # <<<<<<<<<<<<<<
 *             pID = pID.Next
 *     return streams
 */
      __pyx_t_1 = __Pyx_PyObject_Append(__pyx_v_streams, __pyx_v_streamid_w); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":181
 *             streamid_w = StreamID_fromSdifStreadIDT(streamid)
 *             streams.append(streamid_w)
 *             pID = pID.Next             # <<<<<<<<<<<<<<
 *     return streams
 * 
 */
      __pyx_v_pID = __pyx_v_pID->Next;
    }
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":182
 *             streams.append(streamid_w)
 *             pID = pID.Next
 *     return streams             # <<<<<<<<<<<<<<
 * 
 * cdef class StreamID:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_streams);
  __pyx_r = __pyx_v_streams;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.streamidtable_to_list");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_streams);
  __Pyx_DECREF(__pyx_v_streamid_w);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":188
 *     cdef int own_this
 *     property numid:
 *         def __get__(self): return self.this.NumID             # <<<<<<<<<<<<<<
 *     property source:
 *         def __get__(self): return self.this.Source
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_5numid___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_5numid___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->this->NumID); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __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("pysdif._pysdif.StreamID.numid.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":190
 *         def __get__(self): return self.this.NumID
 *     property source:
 *         def __get__(self): return self.this.Source             # <<<<<<<<<<<<<<
 *     property treeway:
 *         def __get__(self): return self.this.TreeWay
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_6source___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_6source___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->this->Source); 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_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("pysdif._pysdif.StreamID.source.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":192
 *         def __get__(self): return self.this.Source
 *     property treeway:
 *         def __get__(self): return self.this.TreeWay             # <<<<<<<<<<<<<<
 *     def __cinit__(self, int numid, source, treeway):
 *         if numid == -1:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_7treeway___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID_7treeway___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->this->TreeWay); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __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("pysdif._pysdif.StreamID.treeway.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":193
 *     property treeway:
 *         def __get__(self): return self.this.TreeWay
 *     def __cinit__(self, int numid, source, treeway):             # <<<<<<<<<<<<<<
 *         if numid == -1:
 *             # we are a wrapper of an existing SdifStreamID
 */

static int __pyx_pf_6pysdif_7_pysdif_8StreamID___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_8StreamID___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  int __pyx_v_numid;
  PyObject *__pyx_v_source = 0;
  PyObject *__pyx_v_treeway = 0;
  int __pyx_r;
  int __pyx_t_1;
  char *__pyx_t_2;
  char *__pyx_t_3;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_numid,&__pyx_kp_source,&__pyx_kp_treeway,0};
  __Pyx_SetupRefcountContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_numid);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_treeway);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_numid = __Pyx_PyInt_AsInt(values[0]); if (unlikely((__pyx_v_numid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_source = values[1];
    __pyx_v_treeway = values[2];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_numid = __Pyx_PyInt_AsInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_numid == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_source = PyTuple_GET_ITEM(__pyx_args, 1);
    __pyx_v_treeway = PyTuple_GET_ITEM(__pyx_args, 2);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 193; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":194
 *         def __get__(self): return self.this.TreeWay
 *     def __cinit__(self, int numid, source, treeway):
 *         if numid == -1:             # <<<<<<<<<<<<<<
 *             # we are a wrapper of an existing SdifStreamID
 *             self.own_this = 0
 */
  __pyx_t_1 = (__pyx_v_numid == -1);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":196
 *         if numid == -1:
 *             # we are a wrapper of an existing SdifStreamID
 *             self.own_this = 0             # <<<<<<<<<<<<<<
 *         else:
 *             self.this = SdifCreateStreamID(<SdifUInt4>numid, source, treeway)
 */
    ((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->own_this = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":198
 *             self.own_this = 0
 *         else:
 *             self.this = SdifCreateStreamID(<SdifUInt4>numid, source, treeway)             # <<<<<<<<<<<<<<
 *             self.own_this = 1
 *     def __dealloc__(self):
 */
    __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_v_source); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_3 = __Pyx_PyBytes_AsString(__pyx_v_treeway); if (unlikely((!__pyx_t_3) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 198; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    ((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->this = SdifCreateStreamID(((SdifUInt4)__pyx_v_numid), __pyx_t_2, __pyx_t_3);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":199
 *         else:
 *             self.this = SdifCreateStreamID(<SdifUInt4>numid, source, treeway)
 *             self.own_this = 1             # <<<<<<<<<<<<<<
 *     def __dealloc__(self):
 *         if self.own_this:
 */
    ((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->own_this = 1;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":200
 *             self.this = SdifCreateStreamID(<SdifUInt4>numid, source, treeway)
 *             self.own_this = 1
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         if self.own_this:
 *             SdifKillStreamID(self.this)
 */

static void __pyx_pf_6pysdif_7_pysdif_8StreamID___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pysdif_7_pysdif_8StreamID___dealloc__(PyObject *__pyx_v_self) {
  int __pyx_t_1;
  __Pyx_SetupRefcountContext("__dealloc__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":201
 *             self.own_this = 1
 *     def __dealloc__(self):
 *         if self.own_this:             # <<<<<<<<<<<<<<
 *             SdifKillStreamID(self.this)
 *     def __repr__(self):
 */
  __pyx_t_1 = ((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->own_this;
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":202
 *     def __dealloc__(self):
 *         if self.own_this:
 *             SdifKillStreamID(self.this)             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 */
    SdifKillStreamID(((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_v_self)->this);
    goto __pyx_L5;
  }
  __pyx_L5:;

  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":203
 *         if self.own_this:
 *             SdifKillStreamID(self.this)
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8StreamID___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("__repr__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":204
 *             SdifKillStreamID(self.this)
 *     def __repr__(self):
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (             # <<<<<<<<<<<<<<
 *             self.numid,
 *             self.source,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":205
 *     def __repr__(self):
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,             # <<<<<<<<<<<<<<
 *             self.source,
 *             self.treeway)
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_numid); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":206
 *         return "StreamID(numid=%d, source='%s', treeway='%s')" % (
 *             self.numid,
 *             self.source,             # <<<<<<<<<<<<<<
 *             self.treeway)
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_source); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 206; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":207
 *             self.numid,
 *             self.source,
 *             self.treeway)             # <<<<<<<<<<<<<<
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_treeway); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 207; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 205; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(__pyx_kp_64, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 204; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":209
 *             self.treeway)
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):             # <<<<<<<<<<<<<<
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper
 *     out.this = this
 */

static  PyObject *__pyx_f_6pysdif_7_pysdif_StreamID_fromSdifStreadIDT(SdifStreamIDT *__pyx_v_this) {
  struct __pyx_obj_6pysdif_7_pysdif_StreamID *__pyx_v_out = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("StreamID_fromSdifStreadIDT");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":210
 * 
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper             # <<<<<<<<<<<<<<
 *     out.this = this
 *     out.own_this = 0
 */
  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_int_neg_1);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_neg_1);
  __Pyx_GIVEREF(__pyx_int_neg_1);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_1, 1, Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_StreamID)), ((PyObject *)__pyx_t_1), 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(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pysdif_7_pysdif_StreamID))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 210; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_out = ((struct __pyx_obj_6pysdif_7_pysdif_StreamID *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":211
 * cdef StreamID_fromSdifStreadIDT(SdifStreamIDT *this):
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper
 *     out.this = this             # <<<<<<<<<<<<<<
 *     out.own_this = 0
 *     return out
 */
  __pyx_v_out->this = __pyx_v_this;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":212
 *     cdef StreamID out = StreamID(-1, None, None)  # create a wrapper
 *     out.this = this
 *     out.own_this = 0             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_v_out->own_this = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":213
 *     out.this = this
 *     out.own_this = 0
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.StreamID_fromSdifStreadIDT");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":215
 *     return out
 * 
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):             # <<<<<<<<<<<<<<
 *     cdef SdifSignature sig = _str2sig(signature)
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 */

static  SdifMatrixTypeT *__pyx_f_6pysdif_7_pysdif_MatrixType_create(PyObject *__pyx_v_signature, PyObject *__pyx_v_column_names) {
  SdifSignature __pyx_v_sig;
  SdifMatrixTypeT *__pyx_v_mt;
  PyObject *__pyx_v_column_name;
  SdifMatrixTypeT *__pyx_r;
  char *__pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  const char* __pyx_t_5;
  __Pyx_SetupRefcountContext("MatrixType_create");
  __pyx_v_column_name = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":216
 * 
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):
 *     cdef SdifSignature sig = _str2sig(signature)             # <<<<<<<<<<<<<<
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 *     for column_name in column_names:
 */
  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_signature); if (unlikely((!__pyx_t_1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 216; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_sig = __pyx_f_6pysdif_7_pysdif__str2sig(__pyx_t_1);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":217
 * cdef SdifMatrixTypeT *MatrixType_create(signature, column_names):
 *     cdef SdifSignature sig = _str2sig(signature)
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)             # <<<<<<<<<<<<<<
 *     for column_name in column_names:
 *         SdifMatrixTypeInsertTailColumnDef(mt, column_name)
 */
  __pyx_v_mt = SdifCreateMatrixType(__pyx_v_sig, NULL);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":218
 *     cdef SdifSignature sig = _str2sig(signature)
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 *     for column_name in column_names:             # <<<<<<<<<<<<<<
 *         SdifMatrixTypeInsertTailColumnDef(mt, column_name)
 *     return mt
 */
  if (PyList_CheckExact(__pyx_v_column_names) || PyTuple_CheckExact(__pyx_v_column_names)) {
    __pyx_t_2 = 0; __pyx_t_3 = __pyx_v_column_names; __Pyx_INCREF(__pyx_t_3);
  } else {
    __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_column_names); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_3))) {
      if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
      if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
      __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
    } else {
      __pyx_t_4 = PyIter_Next(__pyx_t_3);
      if (!__pyx_t_4) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 218; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_DECREF(__pyx_v_column_name);
    __pyx_v_column_name = __pyx_t_4;
    __pyx_t_4 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":219
 *     cdef SdifMatrixTypeT *mt = SdifCreateMatrixType(sig, NULL)
 *     for column_name in column_names:
 *         SdifMatrixTypeInsertTailColumnDef(mt, column_name)             # <<<<<<<<<<<<<<
 *     return mt
 * 
 */
    __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_column_name); if (unlikely((__pyx_t_5 == (const char*)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    SdifMatrixTypeInsertTailColumnDef(__pyx_v_mt, __pyx_t_5);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":220
 *     for column_name in column_names:
 *         SdifMatrixTypeInsertTailColumnDef(mt, column_name)
 *     return mt             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_mt;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_WriteUnraisable("pysdif._pysdif.MatrixType_create");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_column_name);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":223
 * 
 * 
 * cdef SdifFrameTypeT *FrameType_create(signature, components):             # <<<<<<<<<<<<<<
 *     cdef SdifSignature sig = str2signature(signature)
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 */

static  SdifFrameTypeT *__pyx_f_6pysdif_7_pysdif_FrameType_create(PyObject *__pyx_v_signature, PyObject *__pyx_v_components) {
  SdifSignature __pyx_v_sig;
  SdifFrameTypeT *__pyx_v_ft;
  PyObject *__pyx_v_component;
  SdifFrameTypeT *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  SdifSignature __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  char *__pyx_t_7;
  __Pyx_SetupRefcountContext("FrameType_create");
  __pyx_v_component = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":224
 * 
 * cdef SdifFrameTypeT *FrameType_create(signature, components):
 *     cdef SdifSignature sig = str2signature(signature)             # <<<<<<<<<<<<<<
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_65); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_signature);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_signature);
  __Pyx_GIVEREF(__pyx_v_signature);
  __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_t_3 = __Pyx_PyInt_from_py_SdifSignature(__pyx_t_2); if (unlikely((__pyx_t_3 == (SdifSignature)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 224; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_sig = __pyx_t_3;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":225
 * cdef SdifFrameTypeT *FrameType_create(signature, components):
 *     cdef SdifSignature sig = str2signature(signature)
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)             # <<<<<<<<<<<<<<
 *     for component in components:
 *         if isinstance(component, Component):
 */
  __pyx_v_ft = SdifCreateFrameType(__pyx_v_sig, NULL);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":226
 *     cdef SdifSignature sig = str2signature(signature)
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:             # <<<<<<<<<<<<<<
 *         if isinstance(component, Component):
 *             SdifFrameTypePutComponent(ft, str2signature(component.signature), component.name)
 */
  if (PyList_CheckExact(__pyx_v_components) || PyTuple_CheckExact(__pyx_v_components)) {
    __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_components; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_components); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 226; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_v_component);
    __pyx_v_component = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":227
 *     cdef SdifFrameTypeT *ft = SdifCreateFrameType(sig, NULL)
 *     for component in components:
 *         if isinstance(component, Component):             # <<<<<<<<<<<<<<
 *             SdifFrameTypePutComponent(ft, str2signature(component.signature), component.name)
 *         else:
 */
    __pyx_t_5 = PyObject_TypeCheck(__pyx_v_component, ((PyTypeObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_Component))); 
    if (__pyx_t_5) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":228
 *     for component in components:
 *         if isinstance(component, Component):
 *             SdifFrameTypePutComponent(ft, str2signature(component.signature), component.name)             # <<<<<<<<<<<<<<
 *         else:
 *             SdifFrameTypePutComponent(ft, str2signature(component[0]), component[1])
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_65); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_1);
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_component, __pyx_kp_signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_6));
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
      __Pyx_GIVEREF(__pyx_t_1);
      __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
      __pyx_t_3 = __Pyx_PyInt_from_py_SdifSignature(__pyx_t_1); if (unlikely((__pyx_t_3 == (SdifSignature)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_component, __pyx_kp_name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_t_1); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 228; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      SdifFrameTypePutComponent(__pyx_v_ft, __pyx_t_3, __pyx_t_7);
      goto __pyx_L5;
    }
    /*else*/ {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":230
 *             SdifFrameTypePutComponent(ft, str2signature(component.signature), component.name)
 *         else:
 *             SdifFrameTypePutComponent(ft, str2signature(component[0]), component[1])             # <<<<<<<<<<<<<<
 *     return ft
 * 
 */
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_65); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_1);
      __pyx_2 = __Pyx_GetItemInt(__pyx_v_component, 0, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_2);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_2);
      __Pyx_GIVEREF(__pyx_2);
      __pyx_2 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __pyx_t_3 = __Pyx_PyInt_from_py_SdifSignature(__pyx_t_6); if (unlikely((__pyx_t_3 == (SdifSignature)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_2 = __Pyx_GetItemInt(__pyx_v_component, 1, sizeof(long), PyInt_FromLong); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_2);
      __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_2); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
      SdifFrameTypePutComponent(__pyx_v_ft, __pyx_t_3, __pyx_t_7);
    }
    __pyx_L5:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":231
 *         else:
 *             SdifFrameTypePutComponent(ft, str2signature(component[0]), component[1])
 *     return ft             # <<<<<<<<<<<<<<
 * 
 * cdef class MatrixTypeDefinition:
 */
  __pyx_r = __pyx_v_ft;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_WriteUnraisable("pysdif._pysdif.FrameType_create");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_component);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":235
 * cdef class MatrixTypeDefinition:
 *     cdef public object signature
 *     cdef public list column_names             # <<<<<<<<<<<<<<
 *     def __init__(self, signature, column_names):
 *         self.signature = signature
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_SetupRefcountContext("__set__");
  if (!(likely(PyList_CheckExact(__pyx_v_value)) || (__pyx_v_value) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names));
  ((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names = ((PyObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.column_names.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":236
 *     cdef public object signature
 *     cdef public list column_names
 *     def __init__(self, signature, column_names):             # <<<<<<<<<<<<<<
 *         self.signature = signature
 *         self.column_names = column_names
 */

static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_column_names = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_signature,&__pyx_kp_column_names,0};
  __Pyx_SetupRefcountContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_signature);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_column_names);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_signature = values[0];
    __pyx_v_column_names = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_signature = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_column_names = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 236; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__init__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":237
 *     cdef public list column_names
 *     def __init__(self, signature, column_names):
 *         self.signature = signature             # <<<<<<<<<<<<<<
 *         self.column_names = column_names
 *     def __repr__(self):
 */
  __Pyx_INCREF(__pyx_v_signature);
  __Pyx_GIVEREF(__pyx_v_signature);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->signature);
  __Pyx_DECREF(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->signature);
  ((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->signature = __pyx_v_signature;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":238
 *     def __init__(self, signature, column_names):
 *         self.signature = signature
 *         self.column_names = column_names             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, ', '.join(self.column_names))
 */
  if (!(likely(PyList_CheckExact(__pyx_v_column_names)) || (__pyx_v_column_names) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_v_column_names)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_column_names);
  __Pyx_GIVEREF(__pyx_v_column_names);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names));
  ((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names = ((PyObject *)__pyx_v_column_names);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":239
 *         self.signature = signature
 *         self.column_names = column_names
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, ', '.join(self.column_names))
 *     def __iter__(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_SetupRefcountContext("__repr__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":240
 *         self.column_names = column_names
 *     def __repr__(self):
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, ', '.join(self.column_names))             # <<<<<<<<<<<<<<
 *     def __iter__(self):
 *         return iter(self.column_names)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_kp_67, __pyx_kp_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __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 = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names));
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->signature);
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->signature);
  __Pyx_GIVEREF(((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->signature);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(__pyx_kp_66, ((PyObject *)__pyx_t_2)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 240; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":241
 *     def __repr__(self):
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, ', '.join(self.column_names))
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter(self.column_names)
 *     def __len__(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__iter__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":242
 *         return "1MTD(signature=%s, column_names=%s)" % (self.signature, ', '.join(self.column_names))
 *     def __iter__(self):
 *         return iter(self.column_names)             # <<<<<<<<<<<<<<
 *     def __len__(self):
 *         return len(self.column_names)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 242; __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("pysdif._pysdif.MatrixTypeDefinition.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":243
 *     def __iter__(self):
 *         return iter(self.column_names)
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.column_names)
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):
 */

static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  __Pyx_SetupRefcountContext("__len__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":244
 *         return iter(self.column_names)
 *     def __len__(self):
 *         return len(self.column_names)             # <<<<<<<<<<<<<<
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):
 *         return MatrixType_create(self.signature, self.column_names)
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)__pyx_v_self)->column_names)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 244; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypeDefinition.__len__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":245
 *     def __len__(self):
 *         return len(self.column_names)
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):             # <<<<<<<<<<<<<<
 *         return MatrixType_create(self.signature, self.column_names)
 * 
 */

static  SdifMatrixTypeT *__pyx_f_6pysdif_7_pysdif_20MatrixTypeDefinition_toSdifMatrixType(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *__pyx_v_self) {
  SdifMatrixTypeT *__pyx_r;
  __Pyx_SetupRefcountContext("toSdifMatrixType");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":246
 *         return len(self.column_names)
 *     cdef SdifMatrixTypeT *toSdifMatrixType(self):
 *         return MatrixType_create(self.signature, self.column_names)             # <<<<<<<<<<<<<<
 * 
 * cdef MatrixTypesTable_to_list(SdifHashTableT *t):
 */
  __pyx_r = __pyx_f_6pysdif_7_pysdif_MatrixType_create(__pyx_v_self->signature, ((PyObject *)__pyx_v_self->column_names));
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":248
 *         return MatrixType_create(self.signature, self.column_names)
 * 
 * cdef MatrixTypesTable_to_list(SdifHashTableT *t):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pName
 */

static  PyObject *__pyx_f_6pysdif_7_pysdif_MatrixTypesTable_to_list(SdifHashTableT *__pyx_v_t) {
  unsigned int __pyx_v_i;
  SdifHashNT *__pyx_v_pName;
  SdifMatrixTypeT *__pyx_v_matrix;
  SdifColumnDefT *__pyx_v_column_def;
  PyObject *__pyx_v_out = 0;
  PyObject *__pyx_v_column_names;
  PyObject *__pyx_v_signature;
  PyObject *__pyx_v_row;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  int __pyx_t_3;
  int __pyx_t_4;
  __Pyx_SetupRefcountContext("MatrixTypesTable_to_list");
  __pyx_v_column_names = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_signature = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_row = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":253
 *     cdef SdifMatrixTypeT *matrix
 *     cdef SdifColumnDefT *column_def
 *     cdef list out = []             # <<<<<<<<<<<<<<
 *     cdef list column_names
 *     for i in range(t.HashSize):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 253; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":255
 *     cdef list out = []
 *     cdef list column_names
 *     for i in range(t.HashSize):             # <<<<<<<<<<<<<<
 *         pName = t.Table[i]
 *         while pName:
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_v_t->HashSize; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":256
 *     cdef list column_names
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]             # <<<<<<<<<<<<<<
 *         while pName:
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 */
    __pyx_v_pName = (__pyx_v_t->Table[__pyx_v_i]);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":257
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]
 *         while pName:             # <<<<<<<<<<<<<<
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 */
    while (1) {
      __pyx_t_3 = (__pyx_v_pName != 0);
      if (!__pyx_t_3) break;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":258
 *         pName = t.Table[i]
 *         while pName:
 *             matrix = <SdifMatrixTypeT *>(pName.Data)             # <<<<<<<<<<<<<<
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 *                 signature = sig2str(matrix.Signature)
 */
      __pyx_v_matrix = ((SdifMatrixTypeT *)__pyx_v_pName->Data);

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":259
 *         while pName:
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 *             if not SdifListIsEmpty(matrix.ColumnUserList):             # <<<<<<<<<<<<<<
 *                 signature = sig2str(matrix.Signature)
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 */
      __pyx_t_3 = (!SdifListIsEmpty(__pyx_v_matrix->ColumnUserList));
      if (__pyx_t_3) {

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":260
 *             matrix = <SdifMatrixTypeT *>(pName.Data)
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 *                 signature = sig2str(matrix.Signature)             # <<<<<<<<<<<<<<
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 *                 column_names = []
 */
        __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_matrix->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 260; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_v_signature);
        __pyx_v_signature = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":261
 *             if not SdifListIsEmpty(matrix.ColumnUserList):
 *                 signature = sig2str(matrix.Signature)
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)             # <<<<<<<<<<<<<<
 *                 column_names = []
 *                 column_names.append(column_def.Name)
 */
        __pyx_v_column_def = ((SdifColumnDefT *)SdifListGetHead(__pyx_v_matrix->ColumnUserList));

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":262
 *                 signature = sig2str(matrix.Signature)
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 *                 column_names = []             # <<<<<<<<<<<<<<
 *                 column_names.append(column_def.Name)
 *                 while SdifListIsNext(matrix.ColumnUserList):
 */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __Pyx_DECREF(((PyObject *)__pyx_v_column_names));
        __pyx_v_column_names = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":263
 *                 column_def = <SdifColumnDefT *>SdifListGetHead(matrix.ColumnUserList)
 *                 column_names = []
 *                 column_names.append(column_def.Name)             # <<<<<<<<<<<<<<
 *                 while SdifListIsNext(matrix.ColumnUserList):
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 */
        __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_column_def->Name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_column_names), __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 263; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":264
 *                 column_names = []
 *                 column_names.append(column_def.Name)
 *                 while SdifListIsNext(matrix.ColumnUserList):             # <<<<<<<<<<<<<<
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 *                     column_names.append(column_def.Name)
 */
        while (1) {
          __pyx_t_4 = SdifListIsNext(__pyx_v_matrix->ColumnUserList);
          if (!__pyx_t_4) break;

          /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":265
 *                 column_names.append(column_def.Name)
 *                 while SdifListIsNext(matrix.ColumnUserList):
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))             # <<<<<<<<<<<<<<
 *                     column_names.append(column_def.Name)
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 */
          __pyx_v_column_def = ((SdifColumnDefT *)SdifListGetNext(__pyx_v_matrix->ColumnUserList));

          /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":266
 *                 while SdifListIsNext(matrix.ColumnUserList):
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 *                     column_names.append(column_def.Name)             # <<<<<<<<<<<<<<
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 *                 out.append(row)
 */
          __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_column_def->Name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_1);
          __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_column_names), __pyx_t_1); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        }

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":267
 *                     column_def = <SdifColumnDefT *>(SdifListGetNext(matrix.ColumnUserList))
 *                     column_names.append(column_def.Name)
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)             # <<<<<<<<<<<<<<
 *                 out.append(row)
 *             pName = pName.Next
 */
        __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_1));
        if (PyDict_SetItem(__pyx_1, __pyx_kp_signature, __pyx_v_signature) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        if (PyDict_SetItem(__pyx_1, __pyx_kp_column_names, ((PyObject *)__pyx_v_column_names)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __pyx_t_1 = PyEval_CallObjectWithKeywords(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition)), ((PyObject *)__pyx_empty_tuple), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
        __Pyx_DECREF(__pyx_v_row);
        __pyx_v_row = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":268
 *                     column_names.append(column_def.Name)
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 *                 out.append(row)             # <<<<<<<<<<<<<<
 *             pName = pName.Next
 *     return out
 */
        __pyx_t_4 = PyList_Append(((PyObject *)__pyx_v_out), __pyx_v_row); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 268; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":269
 *                 row = MatrixTypeDefinition(signature=signature, column_names=column_names)
 *                 out.append(row)
 *             pName = pName.Next             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
      __pyx_v_pName = __pyx_v_pName->Next;
    }
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":270
 *                 out.append(row)
 *             pName = pName.Next
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef class Component:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.MatrixTypesTable_to_list");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_DECREF(__pyx_v_column_names);
  __Pyx_DECREF(__pyx_v_signature);
  __Pyx_DECREF(__pyx_v_row);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":276
 *     cdef readonly str name
 *     cdef readonly unsigned int num
 *     def __init__(self, str signature, str name):             # <<<<<<<<<<<<<<
 *         self.signature = signature
 *         self.name = name
 */

static int __pyx_pf_6pysdif_7_pysdif_9Component___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_9Component___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_name = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_signature,&__pyx_kp_name,0};
  __Pyx_SetupRefcountContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_signature);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_name);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_signature = ((PyObject *)values[0]);
    __pyx_v_name = ((PyObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_signature = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_name = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.Component.__init__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signature), &PyString_Type, 1, "signature", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_name), &PyString_Type, 1, "name", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":277
 *     cdef readonly unsigned int num
 *     def __init__(self, str signature, str name):
 *         self.signature = signature             # <<<<<<<<<<<<<<
 *         self.name = name
 *         self.num = 0
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_signature));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_signature));
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->signature);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->signature));
  ((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->signature = __pyx_v_signature;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":278
 *     def __init__(self, str signature, str name):
 *         self.signature = signature
 *         self.name = name             # <<<<<<<<<<<<<<
 *         self.num = 0
 *     def __repr__(self):
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_name));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_name));
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->name);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->name));
  ((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->name = __pyx_v_name;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":279
 *         self.signature = signature
 *         self.name = name
 *         self.num = 0             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "Component(sig=%s, name=%s)" % (self.signature, self.name)
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->num = 0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.Component.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":280
 *         self.name = name
 *         self.num = 0
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Component(sig=%s, name=%s)" % (self.signature, self.name)
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_9Component___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("__repr__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":281
 *         self.num = 0
 *     def __repr__(self):
 *         return "Component(sig=%s, name=%s)" % (self.signature, self.name)             # <<<<<<<<<<<<<<
 * 
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->signature));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->signature));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->signature));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->name));
  PyTuple_SET_ITEM(__pyx_t_1, 1, ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->name));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_v_self)->name));
  __pyx_t_2 = PyNumber_Remainder(__pyx_kp_68, ((PyObject *)__pyx_t_1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 281; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Component.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":283
 *         return "Component(sig=%s, name=%s)" % (self.signature, self.name)
 * 
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):             # <<<<<<<<<<<<<<
 *     cdef Component out = Component(sig2str(c.MtrxS), c.Name)
 *     out.num = c.Num
 */

static  struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_f_6pysdif_7_pysdif_Component_from_SdifComponent(SdifComponentT *__pyx_v_c) {
  struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_v_out = 0;
  struct __pyx_obj_6pysdif_7_pysdif_Component *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_SetupRefcountContext("Component_from_SdifComponent");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":284
 * 
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):
 *     cdef Component out = Component(sig2str(c.MtrxS), c.Name)             # <<<<<<<<<<<<<<
 *     out.num = c.Num
 *     return out
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_c->MtrxS); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyBytes_FromString(__pyx_v_c->Name); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_Component)), ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pysdif_7_pysdif_Component))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 284; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_out = ((struct __pyx_obj_6pysdif_7_pysdif_Component *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":285
 * cdef Component Component_from_SdifComponent(SdifComponentT *c):
 *     cdef Component out = Component(sig2str(c.MtrxS), c.Name)
 *     out.num = c.Num             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
  __pyx_v_out->num = __pyx_v_c->Num;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":286
 *     cdef Component out = Component(sig2str(c.MtrxS), c.Name)
 *     out.num = c.Num
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef FrameTypesTable_to_list(SdifHashTableT *t):
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_6pysdif_7_pysdif_Component *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.Component_from_SdifComponent");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_out);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":288
 *     return out
 * 
 * cdef FrameTypesTable_to_list(SdifHashTableT *t):             # <<<<<<<<<<<<<<
 *     cdef unsigned int i
 *     cdef SdifHashNT *pName
 */

static  PyObject *__pyx_f_6pysdif_7_pysdif_FrameTypesTable_to_list(SdifHashTableT *__pyx_v_t) {
  unsigned int __pyx_v_i;
  SdifHashNT *__pyx_v_pName;
  SdifFrameTypeT *__pyx_v_frame;
  PyObject *__pyx_v_out = 0;
  PyObject *__pyx_v_components;
  PyObject *__pyx_v_signature;
  PyObject *__pyx_v_j;
  PyObject *__pyx_v_component;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  SdifUInt4 __pyx_t_7;
  int __pyx_t_8;
  __Pyx_SetupRefcountContext("FrameTypesTable_to_list");
  __pyx_v_components = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_signature = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_j = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_component = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":292
 *     cdef SdifHashNT *pName
 *     cdef SdifFrameTypeT *frame
 *     cdef list out = []             # <<<<<<<<<<<<<<
 * 
 *     for i in range(t.HashSize):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 292; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __pyx_v_out = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":294
 *     cdef list out = []
 * 
 *     for i in range(t.HashSize):             # <<<<<<<<<<<<<<
 *         pName = t.Table[i]
 *         while pName:
 */
  for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_v_t->HashSize; __pyx_t_2+=1) {
    __pyx_v_i = __pyx_t_2;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":295
 * 
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]             # <<<<<<<<<<<<<<
 *         while pName:
 *             frame = <SdifFrameTypeT *>(pName.Data)
 */
    __pyx_v_pName = (__pyx_v_t->Table[__pyx_v_i]);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":296
 *     for i in range(t.HashSize):
 *         pName = t.Table[i]
 *         while pName:             # <<<<<<<<<<<<<<
 *             frame = <SdifFrameTypeT *>(pName.Data)
 *             if frame.NbComponentUse > 0:
 */
    while (1) {
      __pyx_t_3 = (__pyx_v_pName != 0);
      if (!__pyx_t_3) break;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":297
 *         pName = t.Table[i]
 *         while pName:
 *             frame = <SdifFrameTypeT *>(pName.Data)             # <<<<<<<<<<<<<<
 *             if frame.NbComponentUse > 0:
 *                 components = []
 */
      __pyx_v_frame = ((SdifFrameTypeT *)__pyx_v_pName->Data);

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":298
 *         while pName:
 *             frame = <SdifFrameTypeT *>(pName.Data)
 *             if frame.NbComponentUse > 0:             # <<<<<<<<<<<<<<
 *                 components = []
 *                 signature = sig2str(frame.Signature)
 */
      __pyx_t_3 = (__pyx_v_frame->NbComponentUse > 0);
      if (__pyx_t_3) {

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":299
 *             frame = <SdifFrameTypeT *>(pName.Data)
 *             if frame.NbComponentUse > 0:
 *                 components = []             # <<<<<<<<<<<<<<
 *                 signature = sig2str(frame.Signature)
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 */
        __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 299; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_1));
        __Pyx_DECREF(__pyx_v_components);
        __pyx_v_components = ((PyObject *)__pyx_t_1);
        __pyx_t_1 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":300
 *             if frame.NbComponentUse > 0:
 *                 components = []
 *                 signature = sig2str(frame.Signature)             # <<<<<<<<<<<<<<
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 */
        __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(__pyx_v_frame->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 300; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_v_signature);
        __pyx_v_signature = __pyx_t_1;
        __pyx_t_1 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":301
 *                 components = []
 *                 signature = sig2str(frame.Signature)
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):             # <<<<<<<<<<<<<<
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 *                     components.append(component)
 */
        __pyx_t_1 = PyLong_FromUnsignedLong(((__pyx_v_frame->NbComponent - __pyx_v_frame->NbComponentUse) + 1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_5 = PyLong_FromUnsignedLong((__pyx_v_frame->NbComponent + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1);
        __Pyx_GIVEREF(__pyx_t_1);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        __pyx_t_1 = 0;
        __pyx_t_5 = 0;
        __pyx_t_5 = PyObject_Call(__pyx_builtin_range, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        if (PyList_CheckExact(__pyx_t_5) || PyTuple_CheckExact(__pyx_t_5)) {
          __pyx_t_4 = 0; __pyx_t_6 = __pyx_t_5; __Pyx_INCREF(__pyx_t_6);
        } else {
          __pyx_t_4 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
        }
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        for (;;) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_6)) break;
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
          } else if (likely(PyTuple_CheckExact(__pyx_t_6))) {
            if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
          } else {
            __pyx_t_5 = PyIter_Next(__pyx_t_6);
            if (!__pyx_t_5) {
              if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 301; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              break;
            }
            __Pyx_GOTREF(__pyx_t_5);
          }
          __Pyx_DECREF(__pyx_v_j);
          __pyx_v_j = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":302
 *                 signature = sig2str(frame.Signature)
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))             # <<<<<<<<<<<<<<
 *                     components.append(component)
 *                 out.append(FrameTypeDefinition(signature, components))
 */
          __pyx_t_7 = __Pyx_PyInt_from_py_SdifUInt4(__pyx_v_j); if (unlikely((__pyx_t_7 == (SdifUInt4)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __pyx_t_5 = ((PyObject *)__pyx_f_6pysdif_7_pysdif_Component_from_SdifComponent(SdifFrameTypeGetNthComponent(__pyx_v_frame, __pyx_t_7))); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 302; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_v_component);
          __pyx_v_component = __pyx_t_5;
          __pyx_t_5 = 0;

          /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":303
 *                 for j in range(frame.NbComponent - frame.NbComponentUse + 1, frame.NbComponent + 1):
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 *                     components.append(component)             # <<<<<<<<<<<<<<
 *                 out.append(FrameTypeDefinition(signature, components))
 *             pName = pName.Next
 */
          __pyx_t_5 = __Pyx_PyObject_Append(__pyx_v_components, __pyx_v_component); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 303; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":304
 *                     component = Component_from_SdifComponent(SdifFrameTypeGetNthComponent(frame, j))
 *                     components.append(component)
 *                 out.append(FrameTypeDefinition(signature, components))             # <<<<<<<<<<<<<<
 *             pName = pName.Next
 *     return out
 */
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        __Pyx_INCREF(__pyx_v_signature);
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_signature);
        __Pyx_GIVEREF(__pyx_v_signature);
        __Pyx_INCREF(__pyx_v_components);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_components);
        __Pyx_GIVEREF(__pyx_v_components);
        __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition)), ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __pyx_t_8 = PyList_Append(((PyObject *)__pyx_v_out), __pyx_t_5); if (unlikely(__pyx_t_8 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 304; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        goto __pyx_L7;
      }
      __pyx_L7:;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":305
 *                     components.append(component)
 *                 out.append(FrameTypeDefinition(signature, components))
 *             pName = pName.Next             # <<<<<<<<<<<<<<
 *     return out
 * 
 */
      __pyx_v_pName = __pyx_v_pName->Next;
    }
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":306
 *                 out.append(FrameTypeDefinition(signature, components))
 *             pName = pName.Next
 *     return out             # <<<<<<<<<<<<<<
 * 
 * cdef class FrameTypeDefinition:
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_out));
  __pyx_r = ((PyObject *)__pyx_v_out);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypesTable_to_list");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_out);
  __Pyx_DECREF(__pyx_v_components);
  __Pyx_DECREF(__pyx_v_signature);
  __Pyx_DECREF(__pyx_v_j);
  __Pyx_DECREF(__pyx_v_component);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":309
 * 
 * cdef class FrameTypeDefinition:
 *     cdef public str signature             # <<<<<<<<<<<<<<
 *     cdef public list components
 *     def __init__(self, signature, components):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_SetupRefcountContext("__set__");
  if (!(likely(PyString_CheckExact(__pyx_v_value)) || (__pyx_v_value) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected str, got %s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature));
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature = ((PyObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.signature.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":310
 * cdef class FrameTypeDefinition:
 *     cdef public str signature
 *     cdef public list components             # <<<<<<<<<<<<<<
 *     def __init__(self, signature, components):
 *         self.signature = signature
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_SetupRefcountContext("__set__");
  if (!(likely(PyList_CheckExact(__pyx_v_value)) || (__pyx_v_value) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_v_value)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_value);
  __Pyx_GIVEREF(__pyx_v_value);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components));
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components = ((PyObject *)__pyx_v_value);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.components.__set__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":311
 *     cdef public str signature
 *     cdef public list components
 *     def __init__(self, signature, components):             # <<<<<<<<<<<<<<
 *         self.signature = signature
 *         self.components = components
 */

static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_components = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_signature,&__pyx_kp_components,0};
  __Pyx_SetupRefcountContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_signature);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_components);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_signature = values[0];
    __pyx_v_components = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_signature = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_components = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 311; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__init__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":312
 *     cdef public list components
 *     def __init__(self, signature, components):
 *         self.signature = signature             # <<<<<<<<<<<<<<
 *         self.components = components
 *     def __repr__(self):
 */
  if (!(likely(PyString_CheckExact(__pyx_v_signature)) || (__pyx_v_signature) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected str, got %s", Py_TYPE(__pyx_v_signature)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 312; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_signature);
  __Pyx_GIVEREF(__pyx_v_signature);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature));
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature = ((PyObject *)__pyx_v_signature);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":313
 *     def __init__(self, signature, components):
 *         self.signature = signature
 *         self.components = components             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         s = [str(component) for component in self.components]
 */
  if (!(likely(PyList_CheckExact(__pyx_v_components)) || (__pyx_v_components) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected list, got %s", Py_TYPE(__pyx_v_components)->tp_name), 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 313; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_INCREF(__pyx_v_components);
  __Pyx_GIVEREF(__pyx_v_components);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components));
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components = ((PyObject *)__pyx_v_components);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":314
 *         self.signature = signature
 *         self.components = components
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         s = [str(component) for component in self.components]
 *         return "1FTD (signature='%s', components=[%s])" % (self.signature, ', '.join(s))
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_component;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  __Pyx_SetupRefcountContext("__repr__");
  __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_component = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":315
 *         self.components = components
 *     def __repr__(self):
 *         s = [str(component) for component in self.components]             # <<<<<<<<<<<<<<
 *         return "1FTD (signature='%s', components=[%s])" % (self.signature, ', '.join(s))
 *     def __iter__(self):
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  if (likely(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components) != Py_None)) {
    __pyx_t_2 = 0; __pyx_t_3 = ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components); __Pyx_INCREF(__pyx_t_3);
  } else {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
    __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
    __Pyx_DECREF(__pyx_v_component);
    __pyx_v_component = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_component);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_component);
    __Pyx_GIVEREF(__pyx_v_component);
    __pyx_t_5 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __pyx_t_6 = PyList_Append(__pyx_t_1, (PyObject*)__pyx_t_5); if (unlikely(__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 315; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_INCREF(((PyObject *)__pyx_t_1));
  __Pyx_DECREF(__pyx_v_s);
  __pyx_v_s = ((PyObject *)__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":316
 *     def __repr__(self):
 *         s = [str(component) for component in self.components]
 *         return "1FTD (signature='%s', components=[%s])" % (self.signature, ', '.join(s))             # <<<<<<<<<<<<<<
 *     def __iter__(self):
 *         return iter(self.components)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_kp_70, __pyx_kp_join); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(__pyx_v_s);
  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_s);
  __Pyx_GIVEREF(__pyx_v_s);
  __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __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_3)); __pyx_t_3 = 0;
  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature));
  __Pyx_GIVEREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->signature));
  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Remainder(__pyx_kp_69, ((PyObject *)__pyx_t_3)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __pyx_r = __pyx_t_5;
  __pyx_t_5 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_s);
  __Pyx_DECREF(__pyx_v_component);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":317
 *         s = [str(component) for component in self.components]
 *         return "1FTD (signature='%s', components=[%s])" % (self.signature, ', '.join(s))
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return iter(self.components)
 *     def __len__(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__iter__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":318
 *         return "1FTD (signature='%s', components=[%s])" % (self.signature, ', '.join(s))
 *     def __iter__(self):
 *         return iter(self.components)             # <<<<<<<<<<<<<<
 *     def __len__(self):
 *         return len(self.components)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetIter(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 318; __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("pysdif._pysdif.FrameTypeDefinition.__iter__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":319
 *     def __iter__(self):
 *         return iter(self.components)
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return len(self.components)
 * 
 */

static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  Py_ssize_t __pyx_t_1;
  __Pyx_SetupRefcountContext("__len__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":320
 *         return iter(self.components)
 *     def __len__(self):
 *         return len(self.components)             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
  __pyx_t_1 = PyObject_Length(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)__pyx_v_self)->components)); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 320; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_r = __pyx_t_1;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameTypeDefinition.__len__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":331
 * }
 * 
 * def get_predefined_frames_and_matrices(sdiftype):             # <<<<<<<<<<<<<<
 *     t = SDIF_NEWTYPES.get(sdiftype)
 *     if t:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_get_predefined_frames_and_matrices(PyObject *__pyx_self, PyObject *__pyx_v_sdiftype); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_get_predefined_frames_and_matrices[] = "get_predefined_frames_and_matrices(sdiftype)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_get_predefined_frames_and_matrices(PyObject *__pyx_self, PyObject *__pyx_v_sdiftype) {
  PyObject *__pyx_v_t;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  __Pyx_SetupRefcountContext("get_predefined_frames_and_matrices");
  __pyx_self = __pyx_self;
  __pyx_v_t = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":332
 * 
 * def get_predefined_frames_and_matrices(sdiftype):
 *     t = SDIF_NEWTYPES.get(sdiftype)             # <<<<<<<<<<<<<<
 *     if t:
 *         return t['frame_types'], t['matrix_types']
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SDIF_NEWTYPES); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_get); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_sdiftype);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_sdiftype);
  __Pyx_GIVEREF(__pyx_v_sdiftype);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_t);
  __pyx_v_t = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":333
 * def get_predefined_frames_and_matrices(sdiftype):
 *     t = SDIF_NEWTYPES.get(sdiftype)
 *     if t:             # <<<<<<<<<<<<<<
 *         return t['frame_types'], t['matrix_types']
 *     else:
 */
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_v_t); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_4) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":334
 *     t = SDIF_NEWTYPES.get(sdiftype)
 *     if t:
 *         return t['frame_types'], t['matrix_types']             # <<<<<<<<<<<<<<
 *     else:
 *         return None
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_1 = PyObject_GetItem(__pyx_v_t, __pyx_kp_71); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __pyx_2 = PyObject_GetItem(__pyx_v_t, __pyx_kp_72); if (!__pyx_2) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_2);
    __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_1);
    __Pyx_GIVEREF(__pyx_1);
    PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_2);
    __Pyx_GIVEREF(__pyx_2);
    __pyx_1 = 0;
    __pyx_2 = 0;
    __pyx_r = ((PyObject *)__pyx_t_3);
    __pyx_t_3 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":336
 *         return t['frame_types'], t['matrix_types']
 *     else:
 *         return None             # <<<<<<<<<<<<<<
 * 
 * # ----------------------------------------------------------------------
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.get_predefined_frames_and_matrices");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":340
 * # ----------------------------------------------------------------------
 * 
 * def _init():             # <<<<<<<<<<<<<<
 *     """initialize the sdif library (SdifGenInit) and initialize the numpy API"""
 *     global _g_sdif_initiated
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif__init(PyObject *__pyx_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif__init[] = "_init()\ninitialize the sdif library (SdifGenInit) and initialize the numpy API";
static PyObject *__pyx_pf_6pysdif_7_pysdif__init(PyObject *__pyx_self, PyObject *unused) {
  PyObject *__pyx_v_type_definitions_file;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  const char* __pyx_t_5;
  __Pyx_SetupRefcountContext("_init");
  __pyx_self = __pyx_self;
  __pyx_v_type_definitions_file = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":343
 *     """initialize the sdif library (SdifGenInit) and initialize the numpy API"""
 *     global _g_sdif_initiated
 *     import_array()             # <<<<<<<<<<<<<<
 *     if _g_sdif_initiated == 0:
 *         _g_sdif_initiated = 1
 */
  import_array();

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":344
 *     global _g_sdif_initiated
 *     import_array()
 *     if _g_sdif_initiated == 0:             # <<<<<<<<<<<<<<
 *         _g_sdif_initiated = 1
 *         type_definitions_file = os.path.split(__file__)[0] + os.path.sep + "SdifTypes.STYP"
 */
  __pyx_t_1 = (__pyx_v_6pysdif_7_pysdif__g_sdif_initiated == 0);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":345
 *     import_array()
 *     if _g_sdif_initiated == 0:
 *         _g_sdif_initiated = 1             # <<<<<<<<<<<<<<
 *         type_definitions_file = os.path.split(__file__)[0] + os.path.sep + "SdifTypes.STYP"
 *         if os.path.exists(type_definitions_file):
 */
    __pyx_v_6pysdif_7_pysdif__g_sdif_initiated = 1;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":346
 *     if _g_sdif_initiated == 0:
 *         _g_sdif_initiated = 1
 *         type_definitions_file = os.path.split(__file__)[0] + os.path.sep + "SdifTypes.STYP"             # <<<<<<<<<<<<<<
 *         if os.path.exists(type_definitions_file):
 *             SdifGenInit(type_definitions_file)
 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_os); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __pyx_t_2 = PyObject_GetAttr(__pyx_1, __pyx_kp_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_2, __pyx_kp_split); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp___file__); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_1);
    __Pyx_GIVEREF(__pyx_1);
    __pyx_1 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_1 = __Pyx_GetItemInt(__pyx_t_4, 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_os); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_2, __pyx_kp_path); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_t_2 = PyObject_GetAttr(__pyx_t_4, __pyx_kp_sep); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Add(__pyx_1, __pyx_t_2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_kp_73); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 346; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_v_type_definitions_file);
    __pyx_v_type_definitions_file = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":347
 *         _g_sdif_initiated = 1
 *         type_definitions_file = os.path.split(__file__)[0] + os.path.sep + "SdifTypes.STYP"
 *         if os.path.exists(type_definitions_file):             # <<<<<<<<<<<<<<
 *             SdifGenInit(type_definitions_file)
 *         else:
 */
    __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_os); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_2);
    __pyx_t_2 = PyObject_GetAttr(__pyx_2, __pyx_kp_path); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
    __pyx_t_4 = PyObject_GetAttr(__pyx_t_2, __pyx_kp_exists); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_v_type_definitions_file);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_type_definitions_file);
    __Pyx_GIVEREF(__pyx_v_type_definitions_file);
    __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 347; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_1) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":348
 *         type_definitions_file = os.path.split(__file__)[0] + os.path.sep + "SdifTypes.STYP"
 *         if os.path.exists(type_definitions_file):
 *             SdifGenInit(type_definitions_file)             # <<<<<<<<<<<<<<
 *         else:
 *             SdifGenInit("")
 */
      __pyx_t_5 = __Pyx_PyBytes_AsString(__pyx_v_type_definitions_file); if (unlikely((__pyx_t_5 == (const char*)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 348; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      SdifGenInit(__pyx_t_5);
      goto __pyx_L6;
    }
    /*else*/ {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":350
 *             SdifGenInit(type_definitions_file)
 *         else:
 *             SdifGenInit("")             # <<<<<<<<<<<<<<
 *         print "Sdif initialized"
 *     return _g_sdif_initiated
 */
      SdifGenInit(__pyx_k_74);
    }
    __pyx_L6:;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":351
 *         else:
 *             SdifGenInit("")
 *         print "Sdif initialized"             # <<<<<<<<<<<<<<
 *     return _g_sdif_initiated
 * 
 */
    if (__Pyx_PrintOne(__pyx_kp_75) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 351; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":352
 *             SdifGenInit("")
 *         print "Sdif initialized"
 *     return _g_sdif_initiated             # <<<<<<<<<<<<<<
 * 
 * def _cleanup():
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_6pysdif_7_pysdif__g_sdif_initiated); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 352; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif._init");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_type_definitions_file);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":354
 *     return _g_sdif_initiated
 * 
 * def _cleanup():             # <<<<<<<<<<<<<<
 *     SdifGenKill()
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif__cleanup(PyObject *__pyx_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif__cleanup[] = "_cleanup()";
static PyObject *__pyx_pf_6pysdif_7_pysdif__cleanup(PyObject *__pyx_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("_cleanup");
  __pyx_self = __pyx_self;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":355
 * 
 * def _cleanup():
 *     SdifGenKill()             # <<<<<<<<<<<<<<
 * 
 * # Forward declarations
 */
  SdifGenKill();

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":409
 *     cdef ndarray data
 * 
 *     def __cinit__(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         if source is not None:
 *             self.source = source
 */

static int __pyx_pf_6pysdif_7_pysdif_6Matrix___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_6Matrix___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source = 0;
  int __pyx_r;
  int __pyx_t_1;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_source,0};
  __Pyx_SetupRefcountContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)values[0]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)PyTuple_GET_ITEM(__pyx_args, 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 = 409; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 409; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":410
 * 
 *     def __cinit__(self, SdifFile source):
 *         if source is not None:             # <<<<<<<<<<<<<<
 *             self.source = source
 *             #self.header = source.this.CurrMtrxH
 */
  __pyx_t_1 = (((PyObject *)__pyx_v_source) != Py_None);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":411
 *     def __cinit__(self, SdifFile source):
 *         if source is not None:
 *             self.source = source             # <<<<<<<<<<<<<<
 *             #self.header = source.this.CurrMtrxH
 *             self.source_this = source.this
 */
    __Pyx_INCREF(((PyObject *)__pyx_v_source));
    __Pyx_GIVEREF(((PyObject *)__pyx_v_source));
    __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source));
    ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source = __pyx_v_source;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":413
 *             self.source = source
 *             #self.header = source.this.CurrMtrxH
 *             self.source_this = source.this             # <<<<<<<<<<<<<<
 *             self.data = None
 *         else:
 */
    ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this = __pyx_v_source->this;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":414
 *             #self.header = source.this.CurrMtrxH
 *             self.source_this = source.this
 *             self.data = None             # <<<<<<<<<<<<<<
 *         else:
 *             #self.header = NULL
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->data);
    __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->data));
    ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->data = ((PyArrayObject *)Py_None);
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":417
 *         else:
 *             #self.header = NULL
 *             self.source_this = NULL             # <<<<<<<<<<<<<<
 *             self.status = eMatrixOffline
 * 
 */
    ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this = NULL;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":418
 *             #self.header = NULL
 *             self.source_this = NULL
 *             self.status = eMatrixOffline             # <<<<<<<<<<<<<<
 * 
 *     property rows:
 */
    ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->status = __pyx_e_6pysdif_7_pysdif_eMatrixOffline;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":421
 * 
 *     property rows:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             #if self.header:
 *             if self.source_this:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4rows___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4rows___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":423
 *         def __get__(self):
 *             #if self.header:
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 #return self.header.NbRow
 *                 return self.source_this.CurrMtrxH.NbRow
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this != 0);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":425
 *             if self.source_this:
 *                 #return self.header.NbRow
 *                 return self.source_this.CurrMtrxH.NbRow             # <<<<<<<<<<<<<<
 *             else:
 *                 assert self.status == eMatrixOffline
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this->CurrMtrxH->NbRow); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 425; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":427
 *                 return self.source_this.CurrMtrxH.NbRow
 *             else:
 *                 assert self.status == eMatrixOffline             # <<<<<<<<<<<<<<
 *                 return len(self.data)
 *     property cols:
 */
    #ifndef PYREX_WITHOUT_ASSERTIONS
    if (unlikely(!(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->status == __pyx_e_6pysdif_7_pysdif_eMatrixOffline))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 427; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #endif

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":428
 *             else:
 *                 assert self.status == eMatrixOffline
 *                 return len(self.data)             # <<<<<<<<<<<<<<
 *     property cols:
 *         def __get__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_3 = PyObject_Length(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->data)); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 428; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.rows.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":430
 *                 return len(self.data)
 *     property cols:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             #if self.header:
 *             if self.source_this:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4cols___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_4cols___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":432
 *         def __get__(self):
 *             #if self.header:
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 #return self.header.NbCol
 *                 return self.source_this.CurrMtrxH.NbCol
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this != 0);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":434
 *             if self.source_this:
 *                 #return self.header.NbCol
 *                 return self.source_this.CurrMtrxH.NbCol             # <<<<<<<<<<<<<<
 *             else:
 *                 assert self.status == eMatrixOffline
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this->CurrMtrxH->NbCol); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 434; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":436
 *                 return self.source_this.CurrMtrxH.NbCol
 *             else:
 *                 assert self.status == eMatrixOffline             # <<<<<<<<<<<<<<
 *                 return len(self.data[0])
 *     property dtype:
 */
    #ifndef PYREX_WITHOUT_ASSERTIONS
    if (unlikely(!(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->status == __pyx_e_6pysdif_7_pysdif_eMatrixOffline))) {
      PyErr_SetNone(PyExc_AssertionError);
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 436; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    #endif

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":437
 *             else:
 *                 assert self.status == eMatrixOffline
 *                 return len(self.data[0])             # <<<<<<<<<<<<<<
 *     property dtype:
 *         def __get__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_1 = __Pyx_GetItemInt(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->data), 0, sizeof(long), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __pyx_t_3 = PyObject_Length(__pyx_1); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 437; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.cols.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":439
 *                 return len(self.data[0])
 *     property dtype:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             #if self.header:
 *             if self.source_this:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_5dtype___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_5dtype___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":441
 *         def __get__(self):
 *             #if self.header:
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this != 0);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":442
 *             #if self.header:
 *             if self.source_this:
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]             # <<<<<<<<<<<<<<
 *             else:
 *                 return self.data.dtype
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this->CurrMtrxH->DataType); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_1 = PyObject_GetItem(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES), __pyx_t_2); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 442; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_r = __pyx_1;
    __pyx_1 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":444
 *                 return _SDIF_DATATYPES[self.source_this.CurrMtrxH.DataType]
 *             else:
 *                 return self.data.dtype             # <<<<<<<<<<<<<<
 *     property signature:
 *         def __get__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->data), __pyx_kp_dtype); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 444; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.dtype.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":446
 *                 return self.data.dtype
 *     property signature:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             #if self.header:
 *             if self.source_this:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_9signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_9signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":448
 *         def __get__(self):
 *             #if self.header:
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this != 0);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":449
 *             #if self.header:
 *             if self.source_this:
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)             # <<<<<<<<<<<<<<
 *             else:
 *                 return sig2str(self._signature)
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_sig2str(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this->CurrMtrxH->Signature); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 449; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":451
 *                 return sig2str(self.source_this.CurrMtrxH.Signature)
 *             else:
 *                 return sig2str(self._signature)             # <<<<<<<<<<<<<<
 *     property numerical_signature:
 *         def __get__(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __pyx_f_6pysdif_7_pysdif_sig2str(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->_signature); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 451; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":453
 *                 return sig2str(self._signature)
 *     property numerical_signature:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             #if self.header:
 *             if self.source_this:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_19numerical_signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_19numerical_signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":455
 *         def __get__(self):
 *             #if self.header:
 *             if self.source_this:             # <<<<<<<<<<<<<<
 *                 return self.source_this.CurrMtrxH.Signature
 *             else:
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this != 0);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":456
 *             #if self.header:
 *             if self.source_this:
 *                 return self.source_this.CurrMtrxH.Signature             # <<<<<<<<<<<<<<
 *             else:
 *                 return self._signature
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_SdifSignature(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this->CurrMtrxH->Signature); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 456; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":458
 *                 return self.source_this.CurrMtrxH.Signature
 *             else:
 *                 return self._signature             # <<<<<<<<<<<<<<
 * 
 *     def get_data(self):
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = __Pyx_PyInt_to_py_SdifSignature(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->_signature); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 458; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.numerical_signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":460
 *                 return self._signature
 * 
 *     def get_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         read the data from the matrix as a numpy array
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_get_data(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_get_data[] = "Matrix.get_data(self)\n\n        read the data from the matrix as a numpy array\n        NB: the data is not copied to the array, the array\n        is only a 'view' of this data and does not own it,\n        so it is only valid until you read a new matrix. \n        If you want to keep the data, do \n        data = matrix.get_data().copy()\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_get_data(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("get_data");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":469
 *         data = matrix.get_data().copy()
 *         """
 *         if self.source.matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             self.source.read_matrix_data()
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source->matrix_status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":470
 *         """
 *         if self.source.matrix_status == eMatrixHeaderRead:
 *             self.source.read_matrix_data()             # <<<<<<<<<<<<<<
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 *     def copy(self):
 */
    ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source->__pyx_vtab)->read_matrix_data(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":471
 *         if self.source.matrix_status == eMatrixHeaderRead:
 *             self.source.read_matrix_data()
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)             # <<<<<<<<<<<<<<
 *     def copy(self):
 *         """
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this->CurrMtrxData)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 471; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.get_data");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":472
 *             self.source.read_matrix_data()
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 *     def copy(self):             # <<<<<<<<<<<<<<
 *         """
 *         create a copy of the current matrix with the data
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_copy(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_copy[] = "Matrix.copy(self)\n\n        create a copy of the current matrix with the data\n        already read and owned (placed in new_matrix.data). \n        This copied matrix does not get invalidated when a \n        new matrix is read\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_copy(PyObject *__pyx_v_self, PyObject *unused) {
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *__pyx_v_new = 0;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("copy");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":479
 *         new matrix is read
 *         """
 *         cdef Matrix new = Matrix(None)             # <<<<<<<<<<<<<<
 *         new.data = self.get_data().copy()
 *         new._signature = self.source_this.CurrMtrxH.Signature
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(Py_None);
  PyTuple_SET_ITEM(__pyx_t_1, 0, Py_None);
  __Pyx_GIVEREF(Py_None);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_Matrix)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pysdif_7_pysdif_Matrix))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 479; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_new = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":480
 *         """
 *         cdef Matrix new = Matrix(None)
 *         new.data = self.get_data().copy()             # <<<<<<<<<<<<<<
 *         new._signature = self.source_this.CurrMtrxH.Signature
 *         return new
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __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 = 480; __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_kp_copy); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __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 = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 480; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_new->data);
  __Pyx_DECREF(((PyObject *)__pyx_v_new->data));
  __pyx_v_new->data = ((PyArrayObject *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":481
 *         cdef Matrix new = Matrix(None)
 *         new.data = self.get_data().copy()
 *         new._signature = self.source_this.CurrMtrxH.Signature             # <<<<<<<<<<<<<<
 *         return new
 *     def skip(self):
 */
  __pyx_v_new->_signature = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source_this->CurrMtrxH->Signature;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":482
 *         new.data = self.get_data().copy()
 *         new._signature = self.source_this.CurrMtrxH.Signature
 *         return new             # <<<<<<<<<<<<<<
 *     def skip(self):
 *         """
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)__pyx_v_new));
  __pyx_r = ((PyObject *)__pyx_v_new);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.copy");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_new);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":483
 *         new._signature = self.source_this.CurrMtrxH.Signature
 *         return new
 *     def skip(self):             # <<<<<<<<<<<<<<
 *         """
 *         skip the matrix.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_skip(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6Matrix_skip[] = "Matrix.skip(self)\n\n        skip the matrix.\n        if only header was read, tell the Frame to skip the data\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix_skip(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_SetupRefcountContext("skip");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":488
 *         if only header was read, tell the Frame to skip the data
 *         """
 *         if self.status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             # data has not been read yet
 *             self.source.skip_matrix_data()
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":490
 *         if self.status == eMatrixHeaderRead:
 *             # data has not been read yet
 *             self.source.skip_matrix_data()             # <<<<<<<<<<<<<<
 *     def __repr__(self):
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (self.signature, self.rows, self.cols, str(self.dtype))
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_v_self)->source), __pyx_kp_skip_matrix_data); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 490; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.skip");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":491
 *             # data has not been read yet
 *             self.source.skip_matrix_data()
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (self.signature, self.rows, self.cols, str(self.dtype))
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6Matrix___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_SetupRefcountContext("__repr__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":492
 *             self.source.skip_matrix_data()
 *     def __repr__(self):
 *         return "Matrix(sig=%s, rows=%d, cols=%d, dtype=%s)" % (self.signature, self.rows, self.cols, str(self.dtype))             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_rows); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_cols); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_dtype); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_4 = 0;
  __pyx_t_4 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_5));
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Remainder(__pyx_kp_76, ((PyObject *)__pyx_t_5)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 492; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
  __pyx_r = __pyx_t_4;
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.Matrix.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":516
 *     cdef SdifFileT *source_this
 * 
 *     def __cinit__(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         self.source = source
 *         self.source_this = source.this
 */

static int __pyx_pf_6pysdif_7_pysdif_6FrameR___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_6FrameR___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source = 0;
  int __pyx_r;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_source,0};
  __Pyx_SetupRefcountContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)values[0]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)PyTuple_GET_ITEM(__pyx_args, 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 = 516; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 516; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":517
 * 
 *     def __cinit__(self, SdifFile source):
 *         self.source = source             # <<<<<<<<<<<<<<
 *         self.source_this = source.this
 *         self.header = source.this.CurrFramH
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_source));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_source));
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source));
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source = __pyx_v_source;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":518
 *     def __cinit__(self, SdifFile source):
 *         self.source = source
 *         self.source_this = source.this             # <<<<<<<<<<<<<<
 *         self.header = source.this.CurrFramH
 *     def __dealloc__(self):
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this = __pyx_v_source->this;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":519
 *         self.source = source
 *         self.source_this = source.this
 *         self.header = source.this.CurrFramH             # <<<<<<<<<<<<<<
 *     def __dealloc__(self):
 *         self.source = None
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->header = __pyx_v_source->this->CurrFramH;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":520
 *         self.source_this = source.this
 *         self.header = source.this.CurrFramH
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.source = None
 * 
 */

static void __pyx_pf_6pysdif_7_pysdif_6FrameR___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pysdif_7_pysdif_6FrameR___dealloc__(PyObject *__pyx_v_self) {
  __Pyx_SetupRefcountContext("__dealloc__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":521
 *         self.header = source.this.CurrFramH
 *     def __dealloc__(self):
 *         self.source = None             # <<<<<<<<<<<<<<
 * 
 *     property signature:
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source));
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None);

  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":524
 * 
 *     property signature:
 *         def __get__(self): #return sig2str(self.header.Signature)             # <<<<<<<<<<<<<<
 *             return sig2str(self.source_this.CurrFramH.Signature)
 *     property numerical_signature:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_9signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_9signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":525
 *     property signature:
 *         def __get__(self): #return sig2str(self.header.Signature)
 *             return sig2str(self.source_this.CurrFramH.Signature)             # <<<<<<<<<<<<<<
 *     property numerical_signature:
 *         def __get__(self): return self.source_this.CurrFramH.Signature
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrFramH->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 525; __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("pysdif._pysdif.FrameR.signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":527
 *             return sig2str(self.source_this.CurrFramH.Signature)
 *     property numerical_signature:
 *         def __get__(self): return self.source_this.CurrFramH.Signature             # <<<<<<<<<<<<<<
 *     property size:
 *         def __get__(self): return self.source_this.CurrFramH.Size
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_19numerical_signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_19numerical_signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifSignature(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrFramH->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 527; __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("pysdif._pysdif.FrameR.numerical_signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":529
 *         def __get__(self): return self.source_this.CurrFramH.Signature
 *     property size:
 *         def __get__(self): return self.source_this.CurrFramH.Size             # <<<<<<<<<<<<<<
 *     property num_matrices:
 *         def __get__(self): return self.source_this.CurrFramH.NbMatrix
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4size___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4size___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrFramH->Size); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 529; __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("pysdif._pysdif.FrameR.size.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":531
 *         def __get__(self): return self.source_this.CurrFramH.Size
 *     property num_matrices:
 *         def __get__(self): return self.source_this.CurrFramH.NbMatrix             # <<<<<<<<<<<<<<
 *     def __len__(self):
 *         return self.header.NbMatrix
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_12num_matrices___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_12num_matrices___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrFramH->NbMatrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 531; __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("pysdif._pysdif.FrameR.num_matrices.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":532
 *     property num_matrices:
 *         def __get__(self): return self.source_this.CurrFramH.NbMatrix
 *     def __len__(self):             # <<<<<<<<<<<<<<
 *         return self.header.NbMatrix
 *     property id:
 */

static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_6FrameR___len__(PyObject *__pyx_v_self); /*proto*/
static Py_ssize_t __pyx_pf_6pysdif_7_pysdif_6FrameR___len__(PyObject *__pyx_v_self) {
  Py_ssize_t __pyx_r;
  __Pyx_SetupRefcountContext("__len__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":533
 *         def __get__(self): return self.source_this.CurrFramH.NbMatrix
 *     def __len__(self):
 *         return self.header.NbMatrix             # <<<<<<<<<<<<<<
 *     property id:
 *         def __get__(self): return self.source_this.CurrFramH.NumID
 */
  __pyx_r = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->header->NbMatrix;
  goto __pyx_L0;

  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":535
 *         return self.header.NbMatrix
 *     property id:
 *         def __get__(self): return self.source_this.CurrFramH.NumID             # <<<<<<<<<<<<<<
 *     property time:
 *         def __get__(self): return self.source_this.CurrFramH.Time
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_2id___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_2id___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrFramH->NumID); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 535; __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("pysdif._pysdif.FrameR.id.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":537
 *         def __get__(self): return self.source_this.CurrFramH.NumID
 *     property time:
 *         def __get__(self): return self.source_this.CurrFramH.Time             # <<<<<<<<<<<<<<
 *     property matrix_idx:
 *         def __get__(self): return self.source.matrix_idx
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4time___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_4time___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrFramH->Time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 537; __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("pysdif._pysdif.FrameR.time.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":539
 *         def __get__(self): return self.source_this.CurrFramH.Time
 *     property matrix_idx:
 *         def __get__(self): return self.source.matrix_idx             # <<<<<<<<<<<<<<
 *     def matrix_exists(self, signature):
 *         cdef SdifSignature sig = as_signature(signature)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_10matrix_idx___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_10matrix_idx___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix_idx); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 539; __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("pysdif._pysdif.FrameR.matrix_idx.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":540
 *     property matrix_idx:
 *         def __get__(self): return self.source.matrix_idx
 *     def matrix_exists(self, signature):             # <<<<<<<<<<<<<<
 *         cdef SdifSignature sig = as_signature(signature)
 *         # TODO
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_matrix_exists(PyObject *__pyx_v_self, PyObject *__pyx_v_signature); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameR_matrix_exists[] = "FrameR.matrix_exists(self, signature)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_matrix_exists(PyObject *__pyx_v_self, PyObject *__pyx_v_signature) {
  SdifSignature __pyx_v_sig;
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("matrix_exists");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":541
 *         def __get__(self): return self.source.matrix_idx
 *     def matrix_exists(self, signature):
 *         cdef SdifSignature sig = as_signature(signature)             # <<<<<<<<<<<<<<
 *         # TODO
 *     def __iter__(self):
 */
  __pyx_v_sig = __pyx_f_6pysdif_7_pysdif_as_signature(__pyx_v_signature);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":543
 *         cdef SdifSignature sig = as_signature(signature)
 *         # TODO
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         self.source.frame_status = eFrameSomeDataRead
 *         return self
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("__iter__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":544
 *         # TODO
 *     def __iter__(self):
 *         self.source.frame_status = eFrameSomeDataRead             # <<<<<<<<<<<<<<
 *         return self
 *     def __next__(self):
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":545
 *     def __iter__(self):
 *         self.source.frame_status = eFrameSomeDataRead
 *         return self             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         """
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":546
 *         self.source.frame_status = eFrameSomeDataRead
 *         return self
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         """
 *         read next matrix and update the index
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR___next__(PyObject *__pyx_v_self); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameR___next__[] = "\n        read next matrix and update the index\n        NB: only the header of the matrix will be read, to get the data\n        you must call the method matrix.get_data() on the resulting Matrix\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR___next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_SetupRefcountContext("__next__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":553
 *         """
 *         # cdef SdifFile source = self.source
 *         if self.source.matrix_idx == self.source_this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         if self.source.matrix_status == eMatrixHeaderRead:
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix_idx == ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrFramH->NbMatrix);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":554
 *         # cdef SdifFile source = self.source
 *         if self.source.matrix_idx == self.source_this.CurrFramH.NbMatrix:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         if self.source.matrix_status == eMatrixHeaderRead:
 *             SdifFSkipMatrixData(self.source_this)
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":555
 *         if self.source.matrix_idx == self.source_this.CurrFramH.NbMatrix:
 *             raise StopIteration
 *         if self.source.matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             SdifFSkipMatrixData(self.source_this)
 *         SdifFReadMatrixHeader(self.source_this)
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix_status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":556
 *             raise StopIteration
 *         if self.source.matrix_status == eMatrixHeaderRead:
 *             SdifFSkipMatrixData(self.source_this)             # <<<<<<<<<<<<<<
 *         SdifFReadMatrixHeader(self.source_this)
 *         self.source.matrix_idx += 1
 */
    SdifFSkipMatrixData(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":557
 *         if self.source.matrix_status == eMatrixHeaderRead:
 *             SdifFSkipMatrixData(self.source_this)
 *         SdifFReadMatrixHeader(self.source_this)             # <<<<<<<<<<<<<<
 *         self.source.matrix_idx += 1
 *         self.source.matrix_status = eMatrixHeaderRead
 */
  SdifFReadMatrixHeader(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":558
 *             SdifFSkipMatrixData(self.source_this)
 *         SdifFReadMatrixHeader(self.source_this)
 *         self.source.matrix_idx += 1             # <<<<<<<<<<<<<<
 *         self.source.matrix_status = eMatrixHeaderRead
 *         return self.source.matrix
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix_idx += 1;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":559
 *         SdifFReadMatrixHeader(self.source_this)
 *         self.source.matrix_idx += 1
 *         self.source.matrix_status = eMatrixHeaderRead             # <<<<<<<<<<<<<<
 *         return self.source.matrix
 *     def get_matrix_data(self):
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":560
 *         self.source.matrix_idx += 1
 *         self.source.matrix_status = eMatrixHeaderRead
 *         return self.source.matrix             # <<<<<<<<<<<<<<
 *     def get_matrix_data(self):
 *         """
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameR.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":561
 *         self.source.matrix_status = eMatrixHeaderRead
 *         return self.source.matrix
 *     def get_matrix_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         optimized method for frames which only have one matrix.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_get_matrix_data(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameR_get_matrix_data[] = "FrameR.get_matrix_data(self)\n\n        optimized method for frames which only have one matrix.\n        \n        example:\n        \n        for frame in sdiffile:\n            if frame.signature == \"1TRC\":\n                data = frame.get_matrix_data()  # no need to iterate through matrices in 1TRC files\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameR_get_matrix_data(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("get_matrix_data");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":571
 *                 data = frame.get_matrix_data()  # no need to iterate through matrices in 1TRC files
 *         """
 *         SdifFReadMatrixHeader(self.source_this)             # <<<<<<<<<<<<<<
 *         SdifFReadMatrixData(self.source_this)
 *         self.source.matrix_idx = 1
 */
  SdifFReadMatrixHeader(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":572
 *         """
 *         SdifFReadMatrixHeader(self.source_this)
 *         SdifFReadMatrixData(self.source_this)             # <<<<<<<<<<<<<<
 *         self.source.matrix_idx = 1
 *         self.source.matrix_status = eMatrixDataRead
 */
  SdifFReadMatrixData(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":573
 *         SdifFReadMatrixHeader(self.source_this)
 *         SdifFReadMatrixData(self.source_this)
 *         self.source.matrix_idx = 1             # <<<<<<<<<<<<<<
 *         self.source.matrix_status = eMatrixDataRead
 *         self.source.frame_status = eFrameAllDataRead
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix_idx = 1;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":574
 *         SdifFReadMatrixData(self.source_this)
 *         self.source.matrix_idx = 1
 *         self.source.matrix_status = eMatrixDataRead             # <<<<<<<<<<<<<<
 *         self.source.frame_status = eFrameAllDataRead
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixDataRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":575
 *         self.source.matrix_idx = 1
 *         self.source.matrix_status = eMatrixDataRead
 *         self.source.frame_status = eFrameAllDataRead             # <<<<<<<<<<<<<<
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)
 * 
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":576
 *         self.source.matrix_status = eMatrixDataRead
 *         self.source.frame_status = eFrameAllDataRead
 *         return _array_from_matrix_data_no_copy(self.source_this.CurrMtrxData)             # <<<<<<<<<<<<<<
 * 
 * cdef class FrameW:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_v_self)->source_this->CurrMtrxData)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 576; __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("pysdif._pysdif.FrameR.get_matrix_data");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":600
 *     cdef SdifUInt4 frame_size
 *     cdef SdifUInt4 num_matrices
 *     def __repr__(self):             # <<<<<<<<<<<<<<
 *         return "FrameW(signature=%s, time=%f, streamID=%d)" % (
 *             sig2str(self.signature),
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW___repr__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW___repr__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("__repr__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":601
 *     cdef SdifUInt4 num_matrices
 *     def __repr__(self):
 *         return "FrameW(signature=%s, time=%f, streamID=%d)" % (             # <<<<<<<<<<<<<<
 *             sig2str(self.signature),
 *             self.time,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":602
 *     def __repr__(self):
 *         return "FrameW(signature=%s, time=%f, streamID=%d)" % (
 *             sig2str(self.signature),             # <<<<<<<<<<<<<<
 *             self.time,
 *             self.streamID)
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":603
 *         return "FrameW(signature=%s, time=%f, streamID=%d)" % (
 *             sig2str(self.signature),
 *             self.time,             # <<<<<<<<<<<<<<
 *             self.streamID)
 *     def add_matrix(self, signature, c_numpy.ndarray data_array):
 */
  __pyx_t_2 = PyFloat_FromDouble(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->time); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 603; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":604
 *             sig2str(self.signature),
 *             self.time,
 *             self.streamID)             # <<<<<<<<<<<<<<
 *     def add_matrix(self, signature, c_numpy.ndarray data_array):
 *         if data_array.ndim == 1:
 */
  __pyx_t_3 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->streamID); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 604; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 602; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Remainder(__pyx_kp_77, ((PyObject *)__pyx_t_4)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 601; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.__repr__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":605
 *             self.time,
 *             self.streamID)
 *     def add_matrix(self, signature, c_numpy.ndarray data_array):             # <<<<<<<<<<<<<<
 *         if data_array.ndim == 1:
 *             data_array.resize((data_array.shape[0], 1))
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_add_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_add_matrix[] = "FrameW.add_matrix(self, signature, ndarray data_array)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_add_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyArrayObject *__pyx_v_data_array = 0;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_signature,&__pyx_kp_data_array,0};
  __Pyx_SetupRefcountContext("add_matrix");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_signature);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_data_array);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("add_matrix", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_signature = values[0];
    __pyx_v_data_array = ((PyArrayObject *)values[1]);
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_signature = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_data_array = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 1));
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_matrix", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.add_matrix");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data_array), __pyx_ptype_5numpy_ndarray, 1, "data_array", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 605; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":606
 *             self.streamID)
 *     def add_matrix(self, signature, c_numpy.ndarray data_array):
 *         if data_array.ndim == 1:             # <<<<<<<<<<<<<<
 *             data_array.resize((data_array.shape[0], 1))
 *         self.signatures.append(signature)
 */
  __pyx_t_1 = (__pyx_v_data_array->nd == 1);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":607
 *     def add_matrix(self, signature, c_numpy.ndarray data_array):
 *         if data_array.ndim == 1:
 *             data_array.resize((data_array.shape[0], 1))             # <<<<<<<<<<<<<<
 *         self.signatures.append(signature)
 *         self.matrices.append(data_array)
 */
    __pyx_t_2 = PyObject_GetAttr(((PyObject *)__pyx_v_data_array), __pyx_kp_resize); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_to_py_npy_intp((__pyx_v_data_array->dimensions[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
    __Pyx_GIVEREF(__pyx_t_3);
    __Pyx_INCREF(__pyx_int_1);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_int_1);
    __Pyx_GIVEREF(__pyx_int_1);
    __pyx_t_3 = 0;
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_4));
    __Pyx_GIVEREF(((PyObject *)__pyx_t_4));
    __pyx_t_4 = 0;
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 607; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":608
 *         if data_array.ndim == 1:
 *             data_array.resize((data_array.shape[0], 1))
 *         self.signatures.append(signature)             # <<<<<<<<<<<<<<
 *         self.matrices.append(data_array)
 *         self.num_matrices += 1
 */
  __pyx_t_5 = PyList_Append(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->signatures), __pyx_v_signature); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 608; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":609
 *             data_array.resize((data_array.shape[0], 1))
 *         self.signatures.append(signature)
 *         self.matrices.append(data_array)             # <<<<<<<<<<<<<<
 *         self.num_matrices += 1
 *         self.frame_size += SdifSizeOfMatrix(
 */
  __pyx_t_5 = PyList_Append(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->matrices), ((PyObject *)__pyx_v_data_array)); if (unlikely(__pyx_t_5 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 609; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":610
 *         self.signatures.append(signature)
 *         self.matrices.append(data_array)
 *         self.num_matrices += 1             # <<<<<<<<<<<<<<
 *         self.frame_size += SdifSizeOfMatrix(
 *             #<SdifDataTypeET>(dtype_numpy2sdif(data_array.dtype.type_num)),
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->num_matrices += 1;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":611
 *         self.matrices.append(data_array)
 *         self.num_matrices += 1
 *         self.frame_size += SdifSizeOfMatrix(             # <<<<<<<<<<<<<<
 *             #<SdifDataTypeET>(dtype_numpy2sdif(data_array.dtype.type_num)),
 *             #<SdifDataTypeET>(dtype_numpy2sdif(data_array.dtype.num)),
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->frame_size += SdifSizeOfMatrix(((SdifDataTypeET)__pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_data_array->descr->type_num)), (__pyx_v_data_array->dimensions[0]), (__pyx_v_data_array->dimensions[1]));

  __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_4);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.add_matrix");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":616
 *             <SdifDataTypeET>(dtype_numpy2sdif(data_array.descr.type_num)),
 *             data_array.shape[0], data_array.shape[1]) # rows, cols
 *     def write(self):             # <<<<<<<<<<<<<<
 *         """
 *         write the current frame to disk. This function is called
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_write(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_6FrameW_write[] = "FrameW.write(self)\n\n        write the current frame to disk. This function is called\n        after add_matrix has been called (if there are any matrices in\n        the current frame). The frame is written all at once. \n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_6FrameW_write(PyObject *__pyx_v_self, PyObject *unused) {
  SdifUInt4 __pyx_v_fsz;
  SdifSignature __pyx_v_matrix_sig;
  int __pyx_v_dtype;
  PyArrayObject *__pyx_v_matrix;
  int __pyx_v_i;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  int __pyx_t_1;
  char *__pyx_t_2;
  __Pyx_SetupRefcountContext("write");
  __pyx_v_matrix = ((PyArrayObject *)Py_None); __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":629
 *         cdef int i
 *         SdifFSetCurrFrameHeader(self.sdiffile.this, self.signature, self.frame_size,
 *             self.num_matrices, self.streamID, self.time)             # <<<<<<<<<<<<<<
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)
 *         for i in range(self.num_matrices):
 */
  SdifFSetCurrFrameHeader(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->sdiffile->this, ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->signature, ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->frame_size, ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->num_matrices, ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->streamID, ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->time);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":630
 *         SdifFSetCurrFrameHeader(self.sdiffile.this, self.signature, self.frame_size,
 *             self.num_matrices, self.streamID, self.time)
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)             # <<<<<<<<<<<<<<
 *         for i in range(self.num_matrices):
 *             matrix_sig = _str2sig(self.signatures[i])
 */
  __pyx_v_fsz = SdifFWriteFrameHeader(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->sdiffile->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":631
 *             self.num_matrices, self.streamID, self.time)
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)
 *         for i in range(self.num_matrices):             # <<<<<<<<<<<<<<
 *             matrix_sig = _str2sig(self.signatures[i])
 *             matrix = self.matrices[i]
 */
  for (__pyx_t_1 = 0; __pyx_t_1 < ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->num_matrices; __pyx_t_1+=1) {
    __pyx_v_i = __pyx_t_1;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":632
 *         fsz = SdifFWriteFrameHeader(self.sdiffile.this)
 *         for i in range(self.num_matrices):
 *             matrix_sig = _str2sig(self.signatures[i])             # <<<<<<<<<<<<<<
 *             matrix = self.matrices[i]
 *             #dtype = dtype_numpy2sdif(matrix.dtype.num)
 */
    __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->signatures), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __pyx_t_2 = __Pyx_PyBytes_AsString(__pyx_1); if (unlikely((!__pyx_t_2) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 632; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_v_matrix_sig = __pyx_f_6pysdif_7_pysdif__str2sig(__pyx_t_2);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":633
 *         for i in range(self.num_matrices):
 *             matrix_sig = _str2sig(self.signatures[i])
 *             matrix = self.matrices[i]             # <<<<<<<<<<<<<<
 *             #dtype = dtype_numpy2sdif(matrix.dtype.num)
 *             dtype = dtype_numpy2sdif(matrix.descr.type_num)
 */
    __pyx_1 = __Pyx_GetItemInt_List(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->matrices), __pyx_v_i, sizeof(int), PyInt_FromLong); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    if (!(__Pyx_TypeTest(__pyx_1, __pyx_ptype_5numpy_ndarray))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 633; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_matrix));
    __pyx_v_matrix = ((PyArrayObject *)__pyx_1);
    __pyx_1 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":635
 *             matrix = self.matrices[i]
 *             #dtype = dtype_numpy2sdif(matrix.dtype.num)
 *             dtype = dtype_numpy2sdif(matrix.descr.type_num)             # <<<<<<<<<<<<<<
 *             fsz += SdifFWriteMatrix(self.sdiffile.this, matrix_sig,
 *                 <SdifDataTypeET>dtype,
 */
    __pyx_v_dtype = __pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_matrix->descr->type_num);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":639
 *                 <SdifDataTypeET>dtype,
 *                 matrix.shape[0], matrix.shape[1],   # rows, cols
 *                 matrix.data)             # <<<<<<<<<<<<<<
 *         self.sdiffile.write_status = eSdifMatrixData
 * 
 */
    __pyx_v_fsz += SdifFWriteMatrix(((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->sdiffile->this, __pyx_v_matrix_sig, ((SdifDataTypeET)__pyx_v_dtype), (__pyx_v_matrix->dimensions[0]), (__pyx_v_matrix->dimensions[1]), __pyx_v_matrix->data);
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":640
 *                 matrix.shape[0], matrix.shape[1],   # rows, cols
 *                 matrix.data)
 *         self.sdiffile.write_status = eSdifMatrixData             # <<<<<<<<<<<<<<
 * 
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig, SdifFloat8 time, SdifUInt4 streamID=0):
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_v_self)->sdiffile->write_status = __pyx_e_6pysdif_7_pysdif_eSdifMatrixData;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW.write");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":642
 *         self.sdiffile.write_status = eSdifMatrixData
 * 
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig, SdifFloat8 time, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *     cdef FrameW f = FrameW()
 *     f.sdiffile = sdiffile
 */

static  struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_f_6pysdif_7_pysdif_FrameW_new(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_sdiffile, SdifSignature __pyx_v_sig, SdifFloat8 __pyx_v_time, struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new *__pyx_optional_args) {
  SdifUInt4 __pyx_v_streamID = 0;
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_v_f = 0;
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("FrameW_new");
  if (__pyx_optional_args) {
    if (__pyx_optional_args->__pyx_n > 0) {
      __pyx_v_streamID = __pyx_optional_args->streamID;
    }
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":643
 * 
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig, SdifFloat8 time, SdifUInt4 streamID=0):
 *     cdef FrameW f = FrameW()             # <<<<<<<<<<<<<<
 *     f.sdiffile = sdiffile
 *     f.signature = sig
 */
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_FrameW)), ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pysdif_7_pysdif_FrameW))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 643; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_f = ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":644
 * cdef FrameW FrameW_new(SdifFile sdiffile, SdifSignature sig, SdifFloat8 time, SdifUInt4 streamID=0):
 *     cdef FrameW f = FrameW()
 *     f.sdiffile = sdiffile             # <<<<<<<<<<<<<<
 *     f.signature = sig
 *     f.time = time
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_sdiffile));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_sdiffile));
  __Pyx_GOTREF(__pyx_v_f->sdiffile);
  __Pyx_DECREF(((PyObject *)__pyx_v_f->sdiffile));
  __pyx_v_f->sdiffile = __pyx_v_sdiffile;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":645
 *     cdef FrameW f = FrameW()
 *     f.sdiffile = sdiffile
 *     f.signature = sig             # <<<<<<<<<<<<<<
 *     f.time = time
 *     f.streamID = streamID
 */
  __pyx_v_f->signature = __pyx_v_sig;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":646
 *     f.sdiffile = sdiffile
 *     f.signature = sig
 *     f.time = time             # <<<<<<<<<<<<<<
 *     f.streamID = streamID
 *     f.matrices = []
 */
  __pyx_v_f->time = __pyx_v_time;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":647
 *     f.signature = sig
 *     f.time = time
 *     f.streamID = streamID             # <<<<<<<<<<<<<<
 *     f.matrices = []
 *     f.signatures = []
 */
  __pyx_v_f->streamID = __pyx_v_streamID;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":648
 *     f.time = time
 *     f.streamID = streamID
 *     f.matrices = []             # <<<<<<<<<<<<<<
 *     f.signatures = []
 *     f.frame_size = SdifSizeOfFrameHeader()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 648; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_f->matrices);
  __Pyx_DECREF(((PyObject *)__pyx_v_f->matrices));
  __pyx_v_f->matrices = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":649
 *     f.streamID = streamID
 *     f.matrices = []
 *     f.signatures = []             # <<<<<<<<<<<<<<
 *     f.frame_size = SdifSizeOfFrameHeader()
 *     f.num_matrices = 0
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 649; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __Pyx_GOTREF(__pyx_v_f->signatures);
  __Pyx_DECREF(((PyObject *)__pyx_v_f->signatures));
  __pyx_v_f->signatures = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":650
 *     f.matrices = []
 *     f.signatures = []
 *     f.frame_size = SdifSizeOfFrameHeader()             # <<<<<<<<<<<<<<
 *     f.num_matrices = 0
 *     return f
 */
  __pyx_v_f->frame_size = SdifSizeOfFrameHeader();

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":651
 *     f.signatures = []
 *     f.frame_size = SdifSizeOfFrameHeader()
 *     f.num_matrices = 0             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
  __pyx_v_f->num_matrices = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":652
 *     f.frame_size = SdifSizeOfFrameHeader()
 *     f.num_matrices = 0
 *     return f             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(((PyObject *)__pyx_r));
  __Pyx_INCREF(((PyObject *)__pyx_v_f));
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)Py_None); __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.FrameW_new");
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_f);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":743
 *     cdef SdifStatusE write_status
 * 
 *     def __cinit__(self, filename, mode="r", predefined_type=None):             # <<<<<<<<<<<<<<
 *         #assert mode in _SDIF_FILEMODE
 *         if mode == "r":
 */

static int __pyx_pf_6pysdif_7_pysdif_8SdifFile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_8SdifFile___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_v_predefined_type = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_t_1 = NULL;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  const char* __pyx_t_6;
  SdifFileModeET __pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filename,&__pyx_kp_mode,&__pyx_kp_predefined_type,0};
  __Pyx_SetupRefcountContext("__cinit__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_kp_61;
    values[2] = Py_None;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_predefined_type);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__cinit__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_filename = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_predefined_type = values[2];
  } else {
    __pyx_v_mode = __pyx_kp_61;
    __pyx_v_predefined_type = Py_None;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_predefined_type = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__cinit__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":745
 *     def __cinit__(self, filename, mode="r", predefined_type=None):
 *         #assert mode in _SDIF_FILEMODE
 *         if mode == "r":             # <<<<<<<<<<<<<<
 *             if not os.path.exists(filename):
 *                 raise RuntimeError("path not found, cannot open sdif file for reading")
 */
  __pyx_t_1 = PyObject_RichCompare(__pyx_v_mode, __pyx_kp_78, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_2) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":746
 *         #assert mode in _SDIF_FILEMODE
 *         if mode == "r":
 *             if not os.path.exists(filename):             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("path not found, cannot open sdif file for reading")
 *         self.this = SdifFOpen(filename, _SDIF_FILEMODE[mode])
 */
    __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_os); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __pyx_t_1 = PyObject_GetAttr(__pyx_1, __pyx_kp_path); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
    __pyx_t_3 = PyObject_GetAttr(__pyx_t_1, __pyx_kp_exists); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_1));
    __Pyx_INCREF(__pyx_v_filename);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
    __Pyx_GIVEREF(__pyx_v_filename);
    __pyx_t_4 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_2 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_5 = (!__pyx_t_2);
    if (__pyx_t_5) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":747
 *         if mode == "r":
 *             if not os.path.exists(filename):
 *                 raise RuntimeError("path not found, cannot open sdif file for reading")             # <<<<<<<<<<<<<<
 *         self.this = SdifFOpen(filename, _SDIF_FILEMODE[mode])
 * 
 */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_INCREF(__pyx_kp_79);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_79);
      __Pyx_GIVEREF(__pyx_kp_79);
      __pyx_t_1 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_1, 0, 0);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":748
 *             if not os.path.exists(filename):
 *                 raise RuntimeError("path not found, cannot open sdif file for reading")
 *         self.this = SdifFOpen(filename, _SDIF_FILEMODE[mode])             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, filename, mode="r", predefined_type=None):
 */
  __pyx_t_6 = __Pyx_PyBytes_AsString(__pyx_v_filename); if (unlikely((__pyx_t_6 == (const char*)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_1 = PyObject_GetItem(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_FILEMODE), __pyx_v_mode); if (!__pyx_1) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __pyx_t_7 = ((SdifFileModeET)PyInt_AsLong(__pyx_1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this = SdifFOpen(__pyx_t_6, __pyx_t_7);

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__cinit__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":750
 *         self.this = SdifFOpen(filename, _SDIF_FILEMODE[mode])
 * 
 *     def __init__(self, filename, mode="r", predefined_type=None):             # <<<<<<<<<<<<<<
 *         if self.mode == eReadFile:
 *             self.init_read()
 */

static int __pyx_pf_6pysdif_7_pysdif_8SdifFile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_8SdifFile___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_filename = 0;
  PyObject *__pyx_v_mode = 0;
  PyObject *__pyx_v_predefined_type = 0;
  int __pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_filename,&__pyx_kp_mode,&__pyx_kp_predefined_type,0};
  __Pyx_SetupRefcountContext("__init__");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    values[1] = __pyx_kp_62;
    values[2] = Py_None;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_filename);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_mode);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_predefined_type);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "__init__") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_filename = values[0];
    __pyx_v_mode = values[1];
    __pyx_v_predefined_type = values[2];
  } else {
    __pyx_v_mode = __pyx_kp_62;
    __pyx_v_predefined_type = Py_None;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: __pyx_v_predefined_type = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: __pyx_v_mode = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: __pyx_v_filename = PyTuple_GET_ITEM(__pyx_args, 0);
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 1, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 750; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__init__");
  return -1;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":751
 * 
 *     def __init__(self, filename, mode="r", predefined_type=None):
 *         if self.mode == eReadFile:             # <<<<<<<<<<<<<<
 *             self.init_read()
 *             if not self.get_frame_types() and self.signature in SDIF_NEWTYPES:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(eReadFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_4) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":752
 *     def __init__(self, filename, mode="r", predefined_type=None):
 *         if self.mode == eReadFile:
 *             self.init_read()             # <<<<<<<<<<<<<<
 *             if not self.get_frame_types() and self.signature in SDIF_NEWTYPES:
 *                 self.add_predefined_type(self.signature)
 */
    ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->__pyx_vtab)->init_read(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":753
 *         if self.mode == eReadFile:
 *             self.init_read()
 *             if not self.get_frame_types() and self.signature in SDIF_NEWTYPES:             # <<<<<<<<<<<<<<
 *                 self.add_predefined_type(self.signature)
 *         elif self.mode == eWriteFile:
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_get_frame_types); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if ((!__pyx_t_4)) {
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_signature); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SDIF_NEWTYPES); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_1);
      __pyx_t_5 = (PySequence_Contains(__pyx_1, __pyx_t_2)); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 753; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = (!__pyx_t_4);
    }
    if (__pyx_t_6) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":754
 *             self.init_read()
 *             if not self.get_frame_types() and self.signature in SDIF_NEWTYPES:
 *                 self.add_predefined_type(self.signature)             # <<<<<<<<<<<<<<
 *         elif self.mode == eWriteFile:
 *             self.init_write()
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_add_predefined_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_signature); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_3);
      __Pyx_GIVEREF(__pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 754; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":755
 *             if not self.get_frame_types() and self.signature in SDIF_NEWTYPES:
 *                 self.add_predefined_type(self.signature)
 *         elif self.mode == eWriteFile:             # <<<<<<<<<<<<<<
 *             self.init_write()
 *             if predefined_type is not None and predefined_type in SDIF_NEWTYPES:
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyInt_FromLong(eWriteFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_3, __pyx_t_1, Py_EQ); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 755; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":756
 *                 self.add_predefined_type(self.signature)
 *         elif self.mode == eWriteFile:
 *             self.init_write()             # <<<<<<<<<<<<<<
 *             if predefined_type is not None and predefined_type in SDIF_NEWTYPES:
 *                 self.add_predefined_type(predefined_type)
 */
    ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->__pyx_vtab)->init_write(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":757
 *         elif self.mode == eWriteFile:
 *             self.init_write()
 *             if predefined_type is not None and predefined_type in SDIF_NEWTYPES:             # <<<<<<<<<<<<<<
 *                 self.add_predefined_type(predefined_type)
 * 
 */
    __pyx_t_6 = (__pyx_v_predefined_type != Py_None);
    if (__pyx_t_6) {
      __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_SDIF_NEWTYPES); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_1);
      __pyx_t_4 = (PySequence_Contains(__pyx_1, __pyx_v_predefined_type)); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 757; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
      __pyx_t_5 = __pyx_t_4;
    } else {
      __pyx_t_5 = __pyx_t_6;
    }
    if (__pyx_t_5) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":758
 *             self.init_write()
 *             if predefined_type is not None and predefined_type in SDIF_NEWTYPES:
 *                 self.add_predefined_type(predefined_type)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_read(self):
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_add_predefined_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_1));
      __Pyx_INCREF(__pyx_v_predefined_type);
      PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_predefined_type);
      __Pyx_GIVEREF(__pyx_v_predefined_type);
      __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 758; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L8;
    }
    __pyx_L8:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__init__");
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":760
 *                 self.add_predefined_type(predefined_type)
 * 
 *     cdef void init_read(self):             # <<<<<<<<<<<<<<
 *         SdifFReadGeneralHeader (self.this)
 *         SdifFReadAllASCIIChunks(self.this)
 */

static  void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_read(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_SetupRefcountContext("init_read");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":761
 * 
 *     cdef void init_read(self):
 *         SdifFReadGeneralHeader (self.this)             # <<<<<<<<<<<<<<
 *         SdifFReadAllASCIIChunks(self.this)
 *         self.eof = (self.this.CurrSignature == eEof)
 */
  SdifFReadGeneralHeader(__pyx_v_self->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":762
 *     cdef void init_read(self):
 *         SdifFReadGeneralHeader (self.this)
 *         SdifFReadAllASCIIChunks(self.this)             # <<<<<<<<<<<<<<
 *         self.eof = (self.this.CurrSignature == eEof)
 *         self.this.TextStream = stdout  # this is needed by the print functions
 */
  SdifFReadAllASCIIChunks(__pyx_v_self->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":763
 *         SdifFReadGeneralHeader (self.this)
 *         SdifFReadAllASCIIChunks(self.this)
 *         self.eof = (self.this.CurrSignature == eEof)             # <<<<<<<<<<<<<<
 *         self.this.TextStream = stdout  # this is needed by the print functions
 *         self.init_containers()
 */
  __pyx_v_self->eof = (__pyx_v_self->this->CurrSignature == eEof);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":764
 *         SdifFReadAllASCIIChunks(self.this)
 *         self.eof = (self.this.CurrSignature == eEof)
 *         self.this.TextStream = stdout  # this is needed by the print functions             # <<<<<<<<<<<<<<
 *         self.init_containers()
 *         self.frame_status = eFrameSignatureRead
 */
  __pyx_v_self->this->TextStream = stdout;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":765
 *         self.eof = (self.this.CurrSignature == eEof)
 *         self.this.TextStream = stdout  # this is needed by the print functions
 *         self.init_containers()             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameSignatureRead
 *         self.matrix_idx = 0
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)__pyx_v_self->__pyx_vtab)->init_containers(__pyx_v_self);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":766
 *         self.this.TextStream = stdout  # this is needed by the print functions
 *         self.init_containers()
 *         self.frame_status = eFrameSignatureRead             # <<<<<<<<<<<<<<
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":767
 *         self.init_containers()
 *         self.frame_status = eFrameSignatureRead
 *         self.matrix_idx = 0             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixNothingRead
 * 
 */
  __pyx_v_self->matrix_idx = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":768
 *         self.frame_status = eFrameSignatureRead
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_containers(self):
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead;

  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":770
 *         self.matrix_status = eMatrixNothingRead
 * 
 *     cdef void init_containers(self):             # <<<<<<<<<<<<<<
 *         self.frame = FrameR(self)
 *         self.matrix = Matrix(self)
 */

static  void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_containers(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("init_containers");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":771
 * 
 *     cdef void init_containers(self):
 *         self.frame = FrameR(self)             # <<<<<<<<<<<<<<
 *         self.matrix = Matrix(self)
 * 
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_FrameR)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (!(__Pyx_TypeTest(__pyx_t_2, __pyx_ptype_6pysdif_7_pysdif_FrameR))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 771; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_2);
  __Pyx_GOTREF(__pyx_v_self->frame);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->frame));
  __pyx_v_self->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":772
 *     cdef void init_containers(self):
 *         self.frame = FrameR(self)
 *         self.matrix = Matrix(self)             # <<<<<<<<<<<<<<
 * 
 *     cdef void init_write(self):
 */
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_self));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_self));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
  __pyx_t_1 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_Matrix)), ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  if (!(__Pyx_TypeTest(__pyx_t_1, __pyx_ptype_6pysdif_7_pysdif_Matrix))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GIVEREF(__pyx_t_1);
  __Pyx_GOTREF(__pyx_v_self->matrix);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->matrix));
  __pyx_v_self->matrix = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)__pyx_t_1);
  __pyx_t_1 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("pysdif._pysdif.SdifFile.init_containers");
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":774
 *         self.matrix = Matrix(self)
 * 
 *     cdef void init_write(self):             # <<<<<<<<<<<<<<
 *         SdifFWriteGeneralHeader(self.this)
 *         self.write_status = eSdifGeneralHeader
 */

static  void __pyx_f_6pysdif_7_pysdif_8SdifFile_init_write(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_SetupRefcountContext("init_write");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":775
 * 
 *     cdef void init_write(self):
 *         SdifFWriteGeneralHeader(self.this)             # <<<<<<<<<<<<<<
 *         self.write_status = eSdifGeneralHeader
 * 
 */
  SdifFWriteGeneralHeader(__pyx_v_self->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":776
 *     cdef void init_write(self):
 *         SdifFWriteGeneralHeader(self.this)
 *         self.write_status = eSdifGeneralHeader             # <<<<<<<<<<<<<<
 * 
 *     def __dealloc__(self):
 */
  __pyx_v_self->write_status = __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader;

  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":778
 *         self.write_status = eSdifGeneralHeader
 * 
 *     def __dealloc__(self):             # <<<<<<<<<<<<<<
 *         self.frame = None
 *         self.close()  # fails silently if already closed
 */

static void __pyx_pf_6pysdif_7_pysdif_8SdifFile___dealloc__(PyObject *__pyx_v_self); /*proto*/
static void __pyx_pf_6pysdif_7_pysdif_8SdifFile___dealloc__(PyObject *__pyx_v_self) {
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("__dealloc__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":779
 * 
 *     def __dealloc__(self):
 *         self.frame = None             # <<<<<<<<<<<<<<
 *         self.close()  # fails silently if already closed
 * 
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame);
  __Pyx_DECREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame));
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":780
 *     def __dealloc__(self):
 *         self.frame = None
 *         self.close()  # fails silently if already closed             # <<<<<<<<<<<<<<
 * 
 *     def close(self):
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_close); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 780; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__dealloc__");
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":782
 *         self.close()  # fails silently if already closed
 * 
 *     def close(self):             # <<<<<<<<<<<<<<
 *         if self.eof == SDIF_CLOSED:
 *             return
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_close(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_close[] = "SdifFile.close(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_close(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("close");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":783
 * 
 *     def close(self):
 *         if self.eof == SDIF_CLOSED:             # <<<<<<<<<<<<<<
 *             return
 *         # make sure we write the global header even if no
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->eof == __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":784
 *     def close(self):
 *         if self.eof == SDIF_CLOSED:
 *             return             # <<<<<<<<<<<<<<
 *         # make sure we write the global header even if no
 *         # new frames are written (the global chunks are automatically
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":788
 *         # new frames are written (the global chunks are automatically
 *         # written when a new frame is added to the sdiffile)
 *         if self.mode == eWriteFile:             # <<<<<<<<<<<<<<
 *             if self.write_status == eSdifGeneralHeader:
 *                 self.write_all_ascii_chunks()
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_mode); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(eWriteFile); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_RichCompare(__pyx_t_2, __pyx_t_3, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 788; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":789
 *         # written when a new frame is added to the sdiffile)
 *         if self.mode == eWriteFile:
 *             if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *                 self.write_all_ascii_chunks()
 *         SdifFClose(self.this)
 */
    __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->write_status == __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader);
    if (__pyx_t_1) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":790
 *         if self.mode == eWriteFile:
 *             if self.write_status == eSdifGeneralHeader:
 *                 self.write_all_ascii_chunks()             # <<<<<<<<<<<<<<
 *         SdifFClose(self.this)
 *         self.eof = SDIF_CLOSED
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_32); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 790; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      goto __pyx_L7;
    }
    __pyx_L7:;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":791
 *             if self.write_status == eSdifGeneralHeader:
 *                 self.write_all_ascii_chunks()
 *         SdifFClose(self.this)             # <<<<<<<<<<<<<<
 *         self.eof = SDIF_CLOSED
 * 
 */
  SdifFClose(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":792
 *                 self.write_all_ascii_chunks()
 *         SdifFClose(self.this)
 *         self.eof = SDIF_CLOSED             # <<<<<<<<<<<<<<
 * 
 *     property name:
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->eof = __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED;

  __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_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.close");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":795
 * 
 *     property name:
 *         def __get__(self): return self.this.Name             # <<<<<<<<<<<<<<
 *     property mode:
 *         def __get__(self): return self.this.Mode
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4name___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4name___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyBytes_FromString(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->Name); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 795; __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("pysdif._pysdif.SdifFile.name.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":797
 *         def __get__(self): return self.this.Name
 *     property mode:
 *         def __get__(self): return self.this.Mode             # <<<<<<<<<<<<<<
 *     property is_seekable:
 *         def __get__(self): return self.this.isSeekable
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4mode___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4mode___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->Mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 797; __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("pysdif._pysdif.SdifFile.mode.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":799
 *         def __get__(self): return self.this.Mode
 *     property is_seekable:
 *         def __get__(self): return self.this.isSeekable             # <<<<<<<<<<<<<<
 *     property numerical_signature:
 *         def __get__(self): return self.this.CurrSignature
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11is_seekable___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11is_seekable___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->isSeekable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 799; __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("pysdif._pysdif.SdifFile.is_seekable.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":801
 *         def __get__(self): return self.this.isSeekable
 *     property numerical_signature:
 *         def __get__(self): return self.this.CurrSignature             # <<<<<<<<<<<<<<
 *     property signature:
 *         def __get__(self): return sig2str(self.this.CurrSignature)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_19numerical_signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_19numerical_signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifSignature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrSignature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 801; __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("pysdif._pysdif.SdifFile.numerical_signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":803
 *         def __get__(self): return self.this.CurrSignature
 *     property signature:
 *         def __get__(self): return sig2str(self.this.CurrSignature)             # <<<<<<<<<<<<<<
 *     property prev_time:
 *         def __get__(self): return self.this.PrevTime
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrSignature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 803; __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("pysdif._pysdif.SdifFile.signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":805
 *         def __get__(self): return sig2str(self.this.CurrSignature)
 *     property prev_time:
 *         def __get__(self): return self.this.PrevTime             # <<<<<<<<<<<<<<
 *     property frame_pos:
 *         def __get__(self): return self.this.CurrFramPos
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9prev_time___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9prev_time___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->PrevTime); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 805; __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("pysdif._pysdif.SdifFile.prev_time.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":807
 *         def __get__(self): return self.this.PrevTime
 *     property frame_pos:
 *         def __get__(self): return self.this.CurrFramPos             # <<<<<<<<<<<<<<
 *     property matrix_cols:
 *         def __get__(self): return self.this.CurrMtrxH.NbCol
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9frame_pos___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_9frame_pos___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdiffPosT(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramPos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 807; __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("pysdif._pysdif.SdifFile.frame_pos.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":809
 *         def __get__(self): return self.this.CurrFramPos
 *     property matrix_cols:
 *         def __get__(self): return self.this.CurrMtrxH.NbCol             # <<<<<<<<<<<<<<
 *     property matrix_rows:
 *         def __get__(self): return self.this.CurrMtrxH.NbRow
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11matrix_cols___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11matrix_cols___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrMtrxH->NbCol); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 809; __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("pysdif._pysdif.SdifFile.matrix_cols.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":811
 *         def __get__(self): return self.this.CurrMtrxH.NbCol
 *     property matrix_rows:
 *         def __get__(self): return self.this.CurrMtrxH.NbRow             # <<<<<<<<<<<<<<
 *     property matrix_data_type:
 *         def __get__(self): return self.this.CurrMtrxH.DataType
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11matrix_rows___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_11matrix_rows___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrMtrxH->NbRow); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 811; __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("pysdif._pysdif.SdifFile.matrix_rows.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":813
 *         def __get__(self): return self.this.CurrMtrxH.NbRow
 *     property matrix_data_type:
 *         def __get__(self): return self.this.CurrMtrxH.DataType             # <<<<<<<<<<<<<<
 *     property matrices_in_frame:
 *         def __get__(self): return self.this.CurrFramH.NbMatrix
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_16matrix_data_type___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_16matrix_data_type___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrMtrxH->DataType); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 813; __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("pysdif._pysdif.SdifFile.matrix_data_type.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":815
 *         def __get__(self): return self.this.CurrMtrxH.DataType
 *     property matrices_in_frame:
 *         def __get__(self): return self.this.CurrFramH.NbMatrix             # <<<<<<<<<<<<<<
 *     property frame_id:
 *         def __get__(self): return self.this.CurrFramH.NumID
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_17matrices_in_frame___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_17matrices_in_frame___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->NbMatrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 815; __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("pysdif._pysdif.SdifFile.matrices_in_frame.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":817
 *         def __get__(self): return self.this.CurrFramH.NbMatrix
 *     property frame_id:
 *         def __get__(self): return self.this.CurrFramH.NumID             # <<<<<<<<<<<<<<
 *     property pos:
 *         def __get__(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_8frame_id___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_8frame_id___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifUInt4(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->NumID); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 817; __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("pysdif._pysdif.SdifFile.frame_id.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":819
 *         def __get__(self): return self.this.CurrFramH.NumID
 *     property pos:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef SdiffPosT pos
 *             SdifFGetPos(self.this, &pos)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___get__(PyObject *__pyx_v_self) {
  SdiffPosT __pyx_v_pos;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":821
 *         def __get__(self):
 *             cdef SdiffPosT pos
 *             SdifFGetPos(self.this, &pos)             # <<<<<<<<<<<<<<
 *             return pos
 *         def __set__(self, long pos): SdifFSetPos(self.this, &pos)
 */
  SdifFGetPos(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this, (&__pyx_v_pos));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":822
 *             cdef SdiffPosT pos
 *             SdifFGetPos(self.this, &pos)
 *             return pos             # <<<<<<<<<<<<<<
 *         def __set__(self, long pos): SdifFSetPos(self.this, &pos)
 *     property frame_numerical_signature:
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdiffPosT(__pyx_v_pos); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 822; __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("pysdif._pysdif.SdifFile.pos.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":823
 *             SdifFGetPos(self.this, &pos)
 *             return pos
 *         def __set__(self, long pos): SdifFSetPos(self.this, &pos)             # <<<<<<<<<<<<<<
 *     property frame_numerical_signature:
 *         def __get__(self): return self.this.CurrFramH.Signature
 */

static int __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos); /*proto*/
static int __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___set__(PyObject *__pyx_v_self, PyObject *__pyx_arg_pos) {
  long __pyx_v_pos;
  int __pyx_r;
  __Pyx_SetupRefcountContext("__set__");
  assert(__pyx_arg_pos); {
    __pyx_v_pos = __Pyx_PyInt_AsLong(__pyx_arg_pos); if (unlikely((__pyx_v_pos == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.pos.__set__");
  return -1;
  __pyx_L4_argument_unpacking_done:;
  SdifFSetPos(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this, (&__pyx_v_pos));

  __pyx_r = 0;
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":825
 *         def __set__(self, long pos): SdifFSetPos(self.this, &pos)
 *     property frame_numerical_signature:
 *         def __get__(self): return self.this.CurrFramH.Signature             # <<<<<<<<<<<<<<
 *     property frame_signature:
 *         def __get__(self): return sig2str(self.this.CurrFramH.Signature)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_25frame_numerical_signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_25frame_numerical_signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifSignature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 825; __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("pysdif._pysdif.SdifFile.frame_numerical_signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":827
 *         def __get__(self): return self.this.CurrFramH.Signature
 *     property frame_signature:
 *         def __get__(self): return sig2str(self.this.CurrFramH.Signature)             # <<<<<<<<<<<<<<
 *     property matrix_numerical_signature:
 *         def __get__(self): return self.this.CurrMtrxH.Signature
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_15frame_signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_15frame_signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 827; __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("pysdif._pysdif.SdifFile.frame_signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":829
 *         def __get__(self): return sig2str(self.this.CurrFramH.Signature)
 *     property matrix_numerical_signature:
 *         def __get__(self): return self.this.CurrMtrxH.Signature             # <<<<<<<<<<<<<<
 *     property matrix_signature:
 *         def __get__(self): return sig2str(self.this.CurrMtrxH.Signature)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_26matrix_numerical_signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_26matrix_numerical_signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_to_py_SdifSignature(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrMtrxH->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 829; __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("pysdif._pysdif.SdifFile.matrix_numerical_signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":831
 *         def __get__(self): return self.this.CurrMtrxH.Signature
 *     property matrix_signature:
 *         def __get__(self): return sig2str(self.this.CurrMtrxH.Signature)             # <<<<<<<<<<<<<<
 *     property time:
 *         def __get__(self): return self.this.CurrFramH.Time
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_16matrix_signature___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_16matrix_signature___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_sig2str(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrMtrxH->Signature); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 831; __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("pysdif._pysdif.SdifFile.matrix_signature.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":833
 *         def __get__(self): return sig2str(self.this.CurrMtrxH.Signature)
 *     property time:
 *         def __get__(self): return self.this.CurrFramH.Time             # <<<<<<<<<<<<<<
 *     property last_error:
 *         def __get__(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4time___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_4time___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->Time); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 833; __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("pysdif._pysdif.SdifFile.time.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":835
 *         def __get__(self): return self.this.CurrFramH.Time
 *     property last_error:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             cdef SdifErrorT* error = SdifFLastError(self.this)
 *             if error == NULL:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_10last_error___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_10last_error___get__(PyObject *__pyx_v_self) {
  SdifErrorT *__pyx_v_error;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":836
 *     property last_error:
 *         def __get__(self):
 *             cdef SdifErrorT* error = SdifFLastError(self.this)             # <<<<<<<<<<<<<<
 *             if error == NULL:
 *                 return None
 */
  __pyx_v_error = SdifFLastError(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":837
 *         def __get__(self):
 *             cdef SdifErrorT* error = SdifFLastError(self.this)
 *             if error == NULL:             # <<<<<<<<<<<<<<
 *                 return None
 *             return (error.Tag, error.Level)
 */
  __pyx_t_1 = (__pyx_v_error == NULL);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":838
 *             cdef SdifErrorT* error = SdifFLastError(self.this)
 *             if error == NULL:
 *                 return None             # <<<<<<<<<<<<<<
 *             return (error.Tag, error.Level)
 *     property frame_is_selected:
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":839
 *             if error == NULL:
 *                 return None
 *             return (error.Tag, error.Level)             # <<<<<<<<<<<<<<
 *     property frame_is_selected:
 *         def __get__(self): return SdifFCurrFrameIsSelected (self.this)
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyInt_FromLong(__pyx_v_error->Tag); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(__pyx_v_error->Level); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.last_error.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":841
 *             return (error.Tag, error.Level)
 *     property frame_is_selected:
 *         def __get__(self): return SdifFCurrFrameIsSelected (self.this)             # <<<<<<<<<<<<<<
 *     property matrix_is_selected:
 *         def __get__(self): return SdifFCurrMatrixIsSelected (self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_17frame_is_selected___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_17frame_is_selected___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(SdifFCurrFrameIsSelected(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 841; __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("pysdif._pysdif.SdifFile.frame_is_selected.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":843
 *         def __get__(self): return SdifFCurrFrameIsSelected (self.this)
 *     property matrix_is_selected:
 *         def __get__(self): return SdifFCurrMatrixIsSelected (self.this)             # <<<<<<<<<<<<<<
 *     property number_of_NVTs:
 *         def __get__(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_18matrix_is_selected___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_18matrix_is_selected___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("__get__");
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(SdifFCurrMatrixIsSelected(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 843; __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("pysdif._pysdif.SdifFile.matrix_is_selected.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":845
 *         def __get__(self): return SdifFCurrMatrixIsSelected (self.this)
 *     property number_of_NVTs:
 *         def __get__(self):             # <<<<<<<<<<<<<<
 *             if SdifNameValuesLIsNotEmpty(self.this.NameValues):
 *                 return SdifFNameValueNum(self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_14number_of_NVTs___get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_14number_of_NVTs___get__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  SdifUInt2 __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("__get__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":846
 *     property number_of_NVTs:
 *         def __get__(self):
 *             if SdifNameValuesLIsNotEmpty(self.this.NameValues):             # <<<<<<<<<<<<<<
 *                 return SdifFNameValueNum(self.this)
 *             else:
 */
  __pyx_t_1 = SdifNameValuesLIsNotEmpty(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->NameValues);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":847
 *         def __get__(self):
 *             if SdifNameValuesLIsNotEmpty(self.this.NameValues):
 *                 return SdifFNameValueNum(self.this)             # <<<<<<<<<<<<<<
 *             else:
 *                 return 0
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = PyInt_FromLong(SdifFNameValueNum(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 847; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_r = __pyx_t_2;
    __pyx_t_2 = 0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":849
 *                 return SdifFNameValueNum(self.this)
 *             else:
 *                 return 0             # <<<<<<<<<<<<<<
 *     def read_frame_header(self):
 *         """
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
  }
  __pyx_L5:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.number_of_NVTs.__get__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":850
 *             else:
 *                 return 0
 *     def read_frame_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         low level interface.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_read_frame_header(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_read_frame_header[] = "SdifFile.read_frame_header(self)\n\n        low level interface.\n        read the frame header\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_read_frame_header(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("read_frame_header");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":855
 *         read the frame header
 *         """
 *         self.finalize_frame()             # <<<<<<<<<<<<<<
 *         if self.eof == 1:
 *             return 0
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->__pyx_vtab)->finalize_frame(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":856
 *         """
 *         self.finalize_frame()
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             return 0
 *         self.frame_status = eFrameHeaderRead
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->eof == 1);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":857
 *         self.finalize_frame()
 *         if self.eof == 1:
 *             return 0             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameHeaderRead
 *         return SdifFReadFrameHeader(self.this)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":858
 *         if self.eof == 1:
 *             return 0
 *         self.frame_status = eFrameHeaderRead             # <<<<<<<<<<<<<<
 *         return SdifFReadFrameHeader(self.this)
 *     def skip_frame_data(self):
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":859
 *             return 0
 *         self.frame_status = eFrameHeaderRead
 *         return SdifFReadFrameHeader(self.this)             # <<<<<<<<<<<<<<
 *     def skip_frame_data(self):
 *         """
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(SdifFReadFrameHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 859; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.read_frame_header");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":860
 *         self.frame_status = eFrameHeaderRead
 *         return SdifFReadFrameHeader(self.this)
 *     def skip_frame_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         low level interface.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_frame_data(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_skip_frame_data[] = "SdifFile.skip_frame_data(self)\n\n        low level interface.\n        skip the frame with all the matrices it may contain.\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_frame_data(PyObject *__pyx_v_self, PyObject *unused) {
  size_t __pyx_v_bytes_read;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("skip_frame_data");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":865
 *         skip the frame with all the matrices it may contain.
 *         """
 *         assert self.frame_status == eFrameHeaderRead             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameAllDataRead
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  if (unlikely(!(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status == __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead))) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 865; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":866
 *         """
 *         assert self.frame_status == eFrameHeaderRead
 *         self.frame_status = eFrameAllDataRead             # <<<<<<<<<<<<<<
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)
 *         self.finalize_frame()
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":867
 *         assert self.frame_status == eFrameHeaderRead
 *         self.frame_status = eFrameAllDataRead
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)             # <<<<<<<<<<<<<<
 *         self.finalize_frame()
 *         return bytes_read
 */
  __pyx_v_bytes_read = SdifFSkipFrameData(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":868
 *         self.frame_status = eFrameAllDataRead
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)
 *         self.finalize_frame()             # <<<<<<<<<<<<<<
 *         return bytes_read
 * 
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->__pyx_vtab)->finalize_frame(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":869
 *         cdef size_t bytes_read = SdifFSkipFrameData (self.this)
 *         self.finalize_frame()
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void finalize_frame(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 869; __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("pysdif._pysdif.SdifFile.skip_frame_data");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":871
 *         return bytes_read
 * 
 *     cdef inline void finalize_frame(self):             # <<<<<<<<<<<<<<
 *         # here we must make sure that we have read
 *         # the whole data before we try to
 */

static INLINE void __pyx_f_6pysdif_7_pysdif_8SdifFile_finalize_frame(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_v_i;
  size_t __pyx_v_bytes_read;
  int __pyx_v_status;
  int __pyx_t_1;
  int __pyx_t_2;
  __Pyx_SetupRefcountContext("finalize_frame");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":877
 *         cdef int i
 *         cdef size_t bytes_read
 *         cdef int status = self.frame_status             # <<<<<<<<<<<<<<
 *         if status == eFrameSignatureRead:
 *             return
 */
  __pyx_v_status = __pyx_v_self->frame_status;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":878
 *         cdef size_t bytes_read
 *         cdef int status = self.frame_status
 *         if status == eFrameSignatureRead:             # <<<<<<<<<<<<<<
 *             return
 *         elif status == eFrameHeaderRead:
 */
  __pyx_t_1 = (__pyx_v_status == __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":879
 *         cdef int status = self.frame_status
 *         if status == eFrameSignatureRead:
 *             return             # <<<<<<<<<<<<<<
 *         elif status == eFrameHeaderRead:
 *             SdifFSkipFrameData(self.this)
 */
    goto __pyx_L0;
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":880
 *         if status == eFrameSignatureRead:
 *             return
 *         elif status == eFrameHeaderRead:             # <<<<<<<<<<<<<<
 *             SdifFSkipFrameData(self.this)
 *         elif status == eFrameSomeDataRead:
 */
  __pyx_t_1 = (__pyx_v_status == __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":881
 *             return
 *         elif status == eFrameHeaderRead:
 *             SdifFSkipFrameData(self.this)             # <<<<<<<<<<<<<<
 *         elif status == eFrameSomeDataRead:
 *             if self.matrix_status < eMatrixDataRead:
 */
    SdifFSkipFrameData(__pyx_v_self->this);
    goto __pyx_L3;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":882
 *         elif status == eFrameHeaderRead:
 *             SdifFSkipFrameData(self.this)
 *         elif status == eFrameSomeDataRead:             # <<<<<<<<<<<<<<
 *             if self.matrix_status < eMatrixDataRead:
 *                 SdifFSkipMatrixData(self.this)
 */
  __pyx_t_1 = (__pyx_v_status == __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":883
 *             SdifFSkipFrameData(self.this)
 *         elif status == eFrameSomeDataRead:
 *             if self.matrix_status < eMatrixDataRead:             # <<<<<<<<<<<<<<
 *                 SdifFSkipMatrixData(self.this)
 *             for i in range(self.matrix_idx, self.this.CurrFramH.NbMatrix):
 */
    __pyx_t_1 = (__pyx_v_self->matrix_status < __pyx_e_6pysdif_7_pysdif_eMatrixDataRead);
    if (__pyx_t_1) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":884
 *         elif status == eFrameSomeDataRead:
 *             if self.matrix_status < eMatrixDataRead:
 *                 SdifFSkipMatrixData(self.this)             # <<<<<<<<<<<<<<
 *             for i in range(self.matrix_idx, self.this.CurrFramH.NbMatrix):
 *                 SdifFSkipMatrix(self.this)
 */
      SdifFSkipMatrixData(__pyx_v_self->this);
      goto __pyx_L4;
    }
    __pyx_L4:;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":885
 *             if self.matrix_status < eMatrixDataRead:
 *                 SdifFSkipMatrixData(self.this)
 *             for i in range(self.matrix_idx, self.this.CurrFramH.NbMatrix):             # <<<<<<<<<<<<<<
 *                 SdifFSkipMatrix(self.this)
 *         self.matrix_idx = 0
 */
    for (__pyx_t_2 = __pyx_v_self->matrix_idx; __pyx_t_2 < __pyx_v_self->this->CurrFramH->NbMatrix; __pyx_t_2+=1) {
      __pyx_v_i = __pyx_t_2;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":886
 *                 SdifFSkipMatrixData(self.this)
 *             for i in range(self.matrix_idx, self.this.CurrFramH.NbMatrix):
 *                 SdifFSkipMatrix(self.this)             # <<<<<<<<<<<<<<
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 */
      SdifFSkipMatrix(__pyx_v_self->this);
    }
    goto __pyx_L3;
  }
  __pyx_L3:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":887
 *             for i in range(self.matrix_idx, self.this.CurrFramH.NbMatrix):
 *                 SdifFSkipMatrix(self.this)
 *         self.matrix_idx = 0             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixNothingRead
 *         self.frame_status = eFrameNothingRead
 */
  __pyx_v_self->matrix_idx = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":888
 *                 SdifFSkipMatrix(self.this)
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameNothingRead
 *         self.eof = SdifFGetSignature(self.this, &bytes_read) == eEof
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":889
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 *         self.frame_status = eFrameNothingRead             # <<<<<<<<<<<<<<
 *         self.eof = SdifFGetSignature(self.this, &bytes_read) == eEof
 * 
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameNothingRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":890
 *         self.matrix_status = eMatrixNothingRead
 *         self.frame_status = eFrameNothingRead
 *         self.eof = SdifFGetSignature(self.this, &bytes_read) == eEof             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void read_signature(self):
 */
  __pyx_v_self->eof = (SdifFGetSignature(__pyx_v_self->this, (&__pyx_v_bytes_read)) == eEof);

  __pyx_L0:;
  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":892
 *         self.eof = SdifFGetSignature(self.this, &bytes_read) == eEof
 * 
 *     cdef inline void read_signature(self):             # <<<<<<<<<<<<<<
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 */

static INLINE void __pyx_f_6pysdif_7_pysdif_8SdifFile_read_signature(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  size_t __pyx_v_NbCharRead;
  __Pyx_SetupRefcountContext("read_signature");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":894
 *     cdef inline void read_signature(self):
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameSignatureRead
 * 
 */
  __pyx_v_self->eof = (SdifFGetSignature(__pyx_v_self->this, (&__pyx_v_NbCharRead)) == eEof);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":895
 *         cdef size_t NbCharRead
 *         self.eof = SdifFGetSignature(self.this, &NbCharRead) == eEof
 *         self.frame_status = eFrameSignatureRead             # <<<<<<<<<<<<<<
 * 
 *     def read_matrix_header(self):
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead;

  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":897
 *         self.frame_status = eFrameSignatureRead
 * 
 *     def read_matrix_header(self):             # <<<<<<<<<<<<<<
 *         """
 *         low level interface.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_read_matrix_header(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_read_matrix_header[] = "SdifFile.read_matrix_header(self)\n\n        low level interface.\n        read the matrix header (signature, number of rows and columns, etc.)\n        return the number of bytes read or 0 if no more matrices\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_read_matrix_header(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("read_matrix_header");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":903
 *         return the number of bytes read or 0 if no more matrices
 *         """
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             return 0
 *         self.frame_status = eFrameSomeDataRead
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx == ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->NbMatrix);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":904
 *         """
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             return 0             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameSomeDataRead
 *         self.matrix_status = eMatrixHeaderRead
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(__pyx_int_0);
    __pyx_r = __pyx_int_0;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":905
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             return 0
 *         self.frame_status = eFrameSomeDataRead             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixHeaderRead
 *         self.matrix_idx += 1
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSomeDataRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":906
 *             return 0
 *         self.frame_status = eFrameSomeDataRead
 *         self.matrix_status = eMatrixHeaderRead             # <<<<<<<<<<<<<<
 *         self.matrix_idx += 1
 *         return SdifFReadMatrixHeader(self.this)
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":907
 *         self.frame_status = eFrameSomeDataRead
 *         self.matrix_status = eMatrixHeaderRead
 *         self.matrix_idx += 1             # <<<<<<<<<<<<<<
 *         return SdifFReadMatrixHeader(self.this)
 * 
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx += 1;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":908
 *         self.matrix_status = eMatrixHeaderRead
 *         self.matrix_idx += 1
 *         return SdifFReadMatrixHeader(self.this)             # <<<<<<<<<<<<<<
 * 
 *     cdef inline void read_matrix_data(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(SdifFReadMatrixHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 908; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.read_matrix_header");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":910
 *         return SdifFReadMatrixHeader(self.this)
 * 
 *     cdef inline void read_matrix_data(self):             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixDataRead
 *         SdifFReadMatrixData(self.this)
 */

static INLINE void __pyx_f_6pysdif_7_pysdif_8SdifFile_read_matrix_data(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  int __pyx_t_1;
  __Pyx_SetupRefcountContext("read_matrix_data");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":911
 * 
 *     cdef inline void read_matrix_data(self):
 *         self.matrix_status = eMatrixDataRead             # <<<<<<<<<<<<<<
 *         SdifFReadMatrixData(self.this)
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixDataRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":912
 *     cdef inline void read_matrix_data(self):
 *         self.matrix_status = eMatrixDataRead
 *         SdifFReadMatrixData(self.this)             # <<<<<<<<<<<<<<
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead
 */
  SdifFReadMatrixData(__pyx_v_self->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":913
 *         self.matrix_status = eMatrixDataRead
 *         SdifFReadMatrixData(self.this)
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             self.frame_status = eFrameAllDataRead
 * 
 */
  __pyx_t_1 = (__pyx_v_self->matrix_idx == __pyx_v_self->this->CurrFramH->NbMatrix);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":914
 *         SdifFReadMatrixData(self.this)
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead             # <<<<<<<<<<<<<<
 * 
 *     def skip_matrix_data(self):
 */
    __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead;
    goto __pyx_L3;
  }
  __pyx_L3:;

  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":916
 *             self.frame_status = eFrameAllDataRead
 * 
 *     def skip_matrix_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         low level interface.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_matrix_data(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_skip_matrix_data[] = "SdifFile.skip_matrix_data(self)\n\n        low level interface.\n        skip the matrix data without reading it.\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_matrix_data(PyObject *__pyx_v_self, PyObject *unused) {
  size_t __pyx_v_bytes_read;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("skip_matrix_data");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":921
 *         skip the matrix data without reading it.
 *         """
 *         self.matrix_status = eMatrixDataSkipped             # <<<<<<<<<<<<<<
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixDataSkipped;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":922
 *         """
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)             # <<<<<<<<<<<<<<
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead
 */
  __pyx_v_bytes_read = SdifFSkipMatrixData(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":923
 *         self.matrix_status = eMatrixDataSkipped
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             self.frame_status = eFrameAllDataRead
 *         return bytes_read
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx == ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->NbMatrix);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":924
 *         cdef size_t bytes_read = SdifFSkipMatrixData(self.this)
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead             # <<<<<<<<<<<<<<
 *         return bytes_read
 * 
 */
    ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":925
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def get_matrix_data(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 925; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.skip_matrix_data");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":927
 *         return bytes_read
 * 
 *     def get_matrix_data(self):             # <<<<<<<<<<<<<<
 *         """
 *         read the data of the current matrix as a numpy array
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_matrix_data(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_get_matrix_data[] = "SdifFile.get_matrix_data(self)\n\n        read the data of the current matrix as a numpy array\n        if the matrix-header was not read, it is read\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_matrix_data(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_SetupRefcountContext("get_matrix_data");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":932
 *         if the matrix-header was not read, it is read
 *         """
 *         if self.matrix_status == eMatrixNothingRead:             # <<<<<<<<<<<<<<
 *             self.read_matrix_header()
 *         self.read_matrix_data()
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_status == __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":933
 *         """
 *         if self.matrix_status == eMatrixNothingRead:
 *             self.read_matrix_header()             # <<<<<<<<<<<<<<
 *         self.read_matrix_data()
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_read_matrix_header); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 933; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":934
 *         if self.matrix_status == eMatrixNothingRead:
 *             self.read_matrix_header()
 *         self.read_matrix_data()             # <<<<<<<<<<<<<<
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 * 
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->__pyx_vtab)->read_matrix_data(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":935
 *             self.read_matrix_header()
 *         self.read_matrix_data()
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)             # <<<<<<<<<<<<<<
 * 
 *     def skip_matrix(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_3 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrMtrxData)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 935; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_r = __pyx_t_3;
  __pyx_t_3 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.get_matrix_data");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":937
 *         return _array_from_matrix_data_no_copy(self.this.CurrMtrxData)
 * 
 *     def skip_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         skip the matrix altogether. this is a low-level function
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_matrix(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_skip_matrix[] = "SdifFile.skip_matrix(self)\n\n        skip the matrix altogether. this is a low-level function\n        only used when reading the data manually.\n        If you are iterating with \n        for frame in sdiffile:\n            for matrix in frame:\n                ... etc ...\n                \n        then it is not necessary to take care of this because the\n        SdifFile makes its own book-keeping and knows if something\n        needs to be skipped or not\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_matrix(PyObject *__pyx_v_self, PyObject *unused) {
  size_t __pyx_v_bytes_read;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  __Pyx_SetupRefcountContext("skip_matrix");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":950
 *         needs to be skipped or not
 *         """
 *         cdef size_t bytes_read = SdifFSkipMatrix(self.this)             # <<<<<<<<<<<<<<
 *         self.matrix_idx += 1
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 */
  __pyx_v_bytes_read = SdifFSkipMatrix(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":951
 *         """
 *         cdef size_t bytes_read = SdifFSkipMatrix(self.this)
 *         self.matrix_idx += 1             # <<<<<<<<<<<<<<
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx += 1;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":952
 *         cdef size_t bytes_read = SdifFSkipMatrix(self.this)
 *         self.matrix_idx += 1
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             self.frame_status = eFrameAllDataRead
 *         return bytes_read
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx == ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->NbMatrix);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":953
 *         self.matrix_idx += 1
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead             # <<<<<<<<<<<<<<
 *         return bytes_read
 * 
 */
    ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameAllDataRead;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":954
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             self.frame_status = eFrameAllDataRead
 *         return bytes_read             # <<<<<<<<<<<<<<
 * 
 *     def status(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_bytes_read); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 954; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.skip_matrix");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":956
 *         return bytes_read
 * 
 *     def status(self):             # <<<<<<<<<<<<<<
 *         """
 *         return (current-frame-status, current-matrix-index, current-matrix-status)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_status(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_status[] = "SdifFile.status(self)\n\n        return (current-frame-status, current-matrix-index, current-matrix-status)\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_status(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("status");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":960
 *         return (current-frame-status, current-matrix-index, current-matrix-status)
 *         """
 *         return self.frame_status, self.matrix_idx, self.matrix_status             # <<<<<<<<<<<<<<
 * 
 *     def __iter__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyInt_FromLong(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_FromSize_t(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyInt_FromLong(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_status); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 960; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_4));
  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_3 = 0;
  __pyx_r = ((PyObject *)__pyx_t_4);
  __pyx_t_4 = 0;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.status");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":962
 *         return self.frame_status, self.matrix_idx, self.matrix_status
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 *     def __next__(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile___iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile___iter__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("__iter__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":963
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 *     def __next__(self):
 *         self.finalize_frame()
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_self);
  __pyx_r = __pyx_v_self;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":964
 *     def __iter__(self):
 *         return self
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         self.finalize_frame()
 *         if self.eof == 1:
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile___next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile___next__(PyObject *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_SetupRefcountContext("__next__");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":965
 *         return self
 *     def __next__(self):
 *         self.finalize_frame()             # <<<<<<<<<<<<<<
 *         if self.eof == 1:
 *             raise StopIteration
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->__pyx_vtab)->finalize_frame(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":966
 *     def __next__(self):
 *         self.finalize_frame()
 *         if self.eof == 1:             # <<<<<<<<<<<<<<
 *             raise StopIteration
 *         self.frame_status = eFrameHeaderRead
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->eof == 1);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":967
 *         self.finalize_frame()
 *         if self.eof == 1:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameHeaderRead
 *         SdifFReadFrameHeader(self.this)
 */
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 967; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":968
 *         if self.eof == 1:
 *             raise StopIteration
 *         self.frame_status = eFrameHeaderRead             # <<<<<<<<<<<<<<
 *         SdifFReadFrameHeader(self.this)
 *         return self.frame
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameHeaderRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":969
 *             raise StopIteration
 *         self.frame_status = eFrameHeaderRead
 *         SdifFReadFrameHeader(self.this)             # <<<<<<<<<<<<<<
 *         return self.frame
 * 
 */
  SdifFReadFrameHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":970
 *         self.frame_status = eFrameHeaderRead
 *         SdifFReadFrameHeader(self.this)
 *         return self.frame             # <<<<<<<<<<<<<<
 * 
 *     def get_next_matrix(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->frame);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.__next__");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":972
 *         return self.frame
 * 
 *     def get_next_matrix(self):             # <<<<<<<<<<<<<<
 *         """
 *         read the next matrix header and return a matrix with its
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_next_matrix(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_get_next_matrix[] = "SdifFile.get_next_matrix(self)\n\n        read the next matrix header and return a matrix with its\n        data still not read. in particular, if the previous matrix\n        was not read fully, its data is skipped\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_next_matrix(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_SetupRefcountContext("get_next_matrix");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":978
 *         was not read fully, its data is skipped
 *         """
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:             # <<<<<<<<<<<<<<
 *             return None
 *         if self.matrix_status == eMatrixHeaderRead:
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx == ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->CurrFramH->NbMatrix);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":979
 *         """
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             return None             # <<<<<<<<<<<<<<
 *         if self.matrix_status == eMatrixHeaderRead:
 *             SdifFSkipMatrixData(self.this)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_INCREF(Py_None);
    __pyx_r = Py_None;
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":980
 *         if self.matrix_idx == self.this.CurrFramH.NbMatrix:
 *             return None
 *         if self.matrix_status == eMatrixHeaderRead:             # <<<<<<<<<<<<<<
 *             SdifFSkipMatrixData(self.this)
 *         SdifFReadMatrixHeader(self.this)
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_status == __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":981
 *             return None
 *         if self.matrix_status == eMatrixHeaderRead:
 *             SdifFSkipMatrixData(self.this)             # <<<<<<<<<<<<<<
 *         SdifFReadMatrixHeader(self.this)
 *         self.matrix_idx += 1
 */
    SdifFSkipMatrixData(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":982
 *         if self.matrix_status == eMatrixHeaderRead:
 *             SdifFSkipMatrixData(self.this)
 *         SdifFReadMatrixHeader(self.this)             # <<<<<<<<<<<<<<
 *         self.matrix_idx += 1
 *         self.matrix_status = eMatrixHeaderRead
 */
  SdifFReadMatrixHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":983
 *             SdifFSkipMatrixData(self.this)
 *         SdifFReadMatrixHeader(self.this)
 *         self.matrix_idx += 1             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixHeaderRead
 *         return self.matrix
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_idx += 1;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":984
 *         SdifFReadMatrixHeader(self.this)
 *         self.matrix_idx += 1
 *         self.matrix_status = eMatrixHeaderRead             # <<<<<<<<<<<<<<
 *         return self.matrix
 * 
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixHeaderRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":985
 *         self.matrix_idx += 1
 *         self.matrix_status = eMatrixHeaderRead
 *         return self.matrix             # <<<<<<<<<<<<<<
 * 
 *     def rewind(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix));
  __pyx_r = ((PyObject *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->matrix);
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":987
 *         return self.matrix
 * 
 *     def rewind(self):             # <<<<<<<<<<<<<<
 *         """
 *         rewind the SdifFile. after this function is called, the file
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_rewind(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_rewind[] = "SdifFile.rewind(self)\n\n        rewind the SdifFile. after this function is called, the file\n        is in its starting frame (as if the file had been just open)\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_rewind(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("rewind");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":992
 *         is in its starting frame (as if the file had been just open)
 *         """
 *         SdifFRewind(self.this)             # <<<<<<<<<<<<<<
 *         self.reinit()
 * 
 */
  SdifFRewind(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":993
 *         """
 *         SdifFRewind(self.this)
 *         self.reinit()             # <<<<<<<<<<<<<<
 * 
 *     cdef void reinit(self):
 */
  ((struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile *)((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->__pyx_vtab)->reinit(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self));

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":995
 *         self.reinit()
 * 
 *     cdef void reinit(self):             # <<<<<<<<<<<<<<
 *         self.frame = None
 *         self.matrix_idx = 0
 */

static  void __pyx_f_6pysdif_7_pysdif_8SdifFile_reinit(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_self) {
  __Pyx_SetupRefcountContext("reinit");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":996
 * 
 *     cdef void reinit(self):
 *         self.frame = None             # <<<<<<<<<<<<<<
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 */
  __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(Py_None);
  __Pyx_GOTREF(__pyx_v_self->frame);
  __Pyx_DECREF(((PyObject *)__pyx_v_self->frame));
  __pyx_v_self->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":997
 *     cdef void reinit(self):
 *         self.frame = None
 *         self.matrix_idx = 0             # <<<<<<<<<<<<<<
 *         self.matrix_status = eMatrixNothingRead
 *         SdifFReadGeneralHeader(self.this)
 */
  __pyx_v_self->matrix_idx = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":998
 *         self.frame = None
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead             # <<<<<<<<<<<<<<
 *         SdifFReadGeneralHeader(self.this)
 *         SdifFReadAllASCIIChunks(self.this)
 */
  __pyx_v_self->matrix_status = __pyx_e_6pysdif_7_pysdif_eMatrixNothingRead;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":999
 *         self.matrix_idx = 0
 *         self.matrix_status = eMatrixNothingRead
 *         SdifFReadGeneralHeader(self.this)             # <<<<<<<<<<<<<<
 *         SdifFReadAllASCIIChunks(self.this)
 *         #self.read_general_header()
 */
  SdifFReadGeneralHeader(__pyx_v_self->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1000
 *         self.matrix_status = eMatrixNothingRead
 *         SdifFReadGeneralHeader(self.this)
 *         SdifFReadAllASCIIChunks(self.this)             # <<<<<<<<<<<<<<
 *         #self.read_general_header()
 *         #self.read_all_ascii_chunks()
 */
  SdifFReadAllASCIIChunks(__pyx_v_self->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1003
 *         #self.read_general_header()
 *         #self.read_all_ascii_chunks()
 *         self.eof = (self.this.CurrSignature == eEof)             # <<<<<<<<<<<<<<
 *         self.frame_status = eFrameSignatureRead
 * 
 */
  __pyx_v_self->eof = (__pyx_v_self->this->CurrSignature == eEof);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1004
 *         #self.read_all_ascii_chunks()
 *         self.eof = (self.this.CurrSignature == eEof)
 *         self.frame_status = eFrameSignatureRead             # <<<<<<<<<<<<<<
 * 
 *     def _read_padding(self):
 */
  __pyx_v_self->frame_status = __pyx_e_6pysdif_7_pysdif_eFrameSignatureRead;

  __Pyx_FinishRefcountContext();
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1006
 *         self.frame_status = eFrameSignatureRead
 * 
 *     def _read_padding(self):             # <<<<<<<<<<<<<<
 *         return SdifFReadPadding(self.this, SdifFPaddingCalculate(self.this.Stream, self.this.Pos))
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile__read_padding(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile__read_padding[] = "SdifFile._read_padding(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile__read_padding(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("_read_padding");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1007
 * 
 *     def _read_padding(self):
 *         return SdifFReadPadding(self.this, SdifFPaddingCalculate(self.this.Stream, self.this.Pos))             # <<<<<<<<<<<<<<
 * 
 *     # .......................................................................
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_FromSize_t(SdifFReadPadding(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this, SdifFPaddingCalculate(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->Stream, ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->Pos))); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1007; __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("pysdif._pysdif.SdifFile._read_padding");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1012
 *     # WRITING
 *     #
 *     def add_NVT(self, dict d):             # <<<<<<<<<<<<<<
 *         """
 *         the NVT is a place to put metadata about the file
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_NVT(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_add_NVT[] = "SdifFile.add_NVT(self, dict d)\n\n        the NVT is a place to put metadata about the file\n        it is a hash table: pairs of the sort (name: value)\n        \n        d is a python dictionary which is translated to a NVT\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_NVT(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  PyObject *__pyx_v_name;
  PyObject *__pyx_v_value;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  void *__pyx_t_3;
  void *__pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  const char* __pyx_t_7;
  const char* __pyx_t_8;
  __Pyx_SetupRefcountContext("add_NVT");
  __pyx_v_name = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_value = Py_None; __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_d), &PyDict_Type, 1, "d", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1012; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1019
 *         d is a python dictionary which is translated to a NVT
 *         """
 *         SdifNameValuesLNewTable(self.this.NameValues, _SdifNVTStreamID)             # <<<<<<<<<<<<<<
 *         for name, value in d.iteritems():
 *             value = str(value)
 */
  SdifNameValuesLNewTable(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->NameValues, 4294967293LL);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1020
 *         """
 *         SdifNameValuesLNewTable(self.this.NameValues, _SdifNVTStreamID)
 *         for name, value in d.iteritems():             # <<<<<<<<<<<<<<
 *             value = str(value)
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, name, value)
 */
  __Pyx_INCREF(((PyObject *)__pyx_v_d));
  __Pyx_XDECREF(__pyx_t_1);
  __pyx_t_1 = ((PyObject *)__pyx_v_d);
  __pyx_t_2 = 0;
  while (1) {
    if (!PyDict_Next(__pyx_t_1, (&__pyx_t_2), ((PyObject **)(&__pyx_t_3)), ((PyObject **)(&__pyx_t_4)))) break;
    __Pyx_INCREF(((PyObject *)__pyx_t_3));
    __Pyx_DECREF(__pyx_v_name);
    __pyx_v_name = ((PyObject *)__pyx_t_3);
    __Pyx_INCREF(((PyObject *)__pyx_t_4));
    __Pyx_DECREF(__pyx_v_value);
    __pyx_v_value = ((PyObject *)__pyx_t_4);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1021
 *         SdifNameValuesLNewTable(self.this.NameValues, _SdifNVTStreamID)
 *         for name, value in d.iteritems():
 *             value = str(value)             # <<<<<<<<<<<<<<
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, name, value)
 * 
 */
    __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_5));
    __Pyx_INCREF(__pyx_v_value);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_value);
    __Pyx_GIVEREF(__pyx_v_value);
    __pyx_t_6 = PyObject_Call(((PyObject *)((PyObject*)&PyString_Type)), ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1021; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_v_value);
    __pyx_v_value = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1022
 *         for name, value in d.iteritems():
 *             value = str(value)
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, name, value)             # <<<<<<<<<<<<<<
 * 
 *     def add_matrix_type(self, str signature, column_names):
 */
    __pyx_t_7 = __Pyx_PyBytes_AsString(__pyx_v_name); if (unlikely((__pyx_t_7 == (const char*)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_t_8 = __Pyx_PyBytes_AsString(__pyx_v_value); if (unlikely((__pyx_t_8 == (const char*)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1022; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    SdifNameValuesLPutCurrNVT(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->NameValues, __pyx_t_7, __pyx_t_8);
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_3);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_NVT");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_name);
  __Pyx_DECREF(__pyx_v_value);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1024
 *             SdifNameValuesLPutCurrNVT(self.this.NameValues, name, value)
 * 
 *     def add_matrix_type(self, str signature, column_names):             # <<<<<<<<<<<<<<
 *         """
 *         sdiff.add_matrix_type("1ABC", "Column1, Column2")
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_matrix_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_add_matrix_type[] = "SdifFile.add_matrix_type(self, str signature, column_names)\n\n        sdiff.add_matrix_type(\"1ABC\", \"Column1, Column2\")\n        or\n        sdiff.add_matrix_type(\"1ABC\", [\"Column1\", \"Column2\"])\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_matrix_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_column_names = 0;
  SdifMatrixTypeT *__pyx_v_mt;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_signature,&__pyx_kp_column_names,0};
  __Pyx_SetupRefcountContext("add_matrix_type");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_signature);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_column_names);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("add_matrix_type", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_matrix_type") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_signature = ((PyObject *)values[0]);
    __pyx_v_column_names = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_signature = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 0));
    __pyx_v_column_names = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_matrix_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_matrix_type");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_column_names);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signature), &PyString_Type, 1, "signature", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1024; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1030
 *         sdiff.add_matrix_type("1ABC", ["Column1", "Column2"])
 *         """
 *         if isinstance(column_names, basestring):             # <<<<<<<<<<<<<<
 *             column_names = column_names.split(",")
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 */
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_column_names, __pyx_builtin_basestring); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1031
 *         """
 *         if isinstance(column_names, basestring):
 *             column_names = column_names.split(",")             # <<<<<<<<<<<<<<
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_column_names, __pyx_kp_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_kp_80);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_80);
    __Pyx_GIVEREF(__pyx_kp_80);
    __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1031; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_v_column_names);
    __pyx_v_column_names = __pyx_t_4;
    __pyx_t_4 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1032
 *         if isinstance(column_names, basestring):
 *             column_names = column_names.split(",")
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)             # <<<<<<<<<<<<<<
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)
 *         # TODO: is this a memory leak? who destroys the MatrixType?
 */
  __pyx_v_mt = __pyx_f_6pysdif_7_pysdif_MatrixType_create(((PyObject *)__pyx_v_signature), __pyx_v_column_names);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1033
 *             column_names = column_names.split(",")
 *         cdef SdifMatrixTypeT *mt = MatrixType_create(signature, column_names)
 *         SdifPutMatrixType(self.this.MatrixTypesTable, mt)             # <<<<<<<<<<<<<<
 *         # TODO: is this a memory leak? who destroys the MatrixType?
 *         #self.frame_status = eFrameInvalid
 */
  SdifPutMatrixType(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->MatrixTypesTable, __pyx_v_mt);

  __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_4);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_matrix_type");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_column_names);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1037
 *         #self.frame_status = eFrameInvalid
 * 
 *     def add_frame_type(self, signature, components):             # <<<<<<<<<<<<<<
 *         """
 *         signature is a 4-char string
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_frame_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_add_frame_type[] = "SdifFile.add_frame_type(self, signature, components)\n\n        signature is a 4-char string\n        components is a sequence of Component or just a sequence\n        of tuples of the form (signature, name)\n        \n        alternatively it accepts the form defined in EaSDIF\n        add_frame_type(\"1NEW\", \"1NEW NewMatrix, 1FQ0 New1FQ0\")\n        \n        components are separated either by a ',' or by a ';'\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_frame_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  PyObject *__pyx_v_components = 0;
  SdifFrameTypeT *__pyx_v_ft;
  PyObject *__pyx_v_component;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_signature,&__pyx_kp_components,0};
  __Pyx_SetupRefcountContext("add_frame_type");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_signature);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_components);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("add_frame_type", 1, 2, 2, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_frame_type") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_signature = values[0];
    __pyx_v_components = values[1];
  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_signature = PyTuple_GET_ITEM(__pyx_args, 0);
    __pyx_v_components = PyTuple_GET_ITEM(__pyx_args, 1);
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_frame_type", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1037; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_frame_type");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __Pyx_INCREF(__pyx_v_components);
  __pyx_v_component = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1048
 *         components are separated either by a ',' or by a ';'
 *         """
 *         if isinstance(components, basestring):             # <<<<<<<<<<<<<<
 *             if ',' in components:
 *                 components = components.split(",")
 */
  __pyx_t_1 = PyObject_IsInstance(__pyx_v_components, __pyx_builtin_basestring); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1048; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1049
 *         """
 *         if isinstance(components, basestring):
 *             if ',' in components:             # <<<<<<<<<<<<<<
 *                 components = components.split(",")
 *             else:
 */
    __pyx_t_1 = (PySequence_Contains(__pyx_v_components, __pyx_kp_81)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1049; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    if (__pyx_t_1) {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1050
 *         if isinstance(components, basestring):
 *             if ',' in components:
 *                 components = components.split(",")             # <<<<<<<<<<<<<<
 *             else:
 *                 components = components.split(';')
 */
      __pyx_t_2 = PyObject_GetAttr(__pyx_v_components, __pyx_kp_split); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_kp_82);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_82);
      __Pyx_GIVEREF(__pyx_kp_82);
      __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1050; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_components);
      __pyx_v_components = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7;
    }
    /*else*/ {

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1052
 *                 components = components.split(",")
 *             else:
 *                 components = components.split(';')             # <<<<<<<<<<<<<<
 *             components = [component.split() for component in components]
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_components, __pyx_kp_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      __Pyx_INCREF(__pyx_kp_83);
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_83);
      __Pyx_GIVEREF(__pyx_kp_83);
      __pyx_t_2 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1052; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_v_components);
      __pyx_v_components = __pyx_t_2;
      __pyx_t_2 = 0;
    }
    __pyx_L7:;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1053
 *             else:
 *                 components = components.split(';')
 *             components = [component.split() for component in components]             # <<<<<<<<<<<<<<
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    if (PyList_CheckExact(__pyx_v_components) || PyTuple_CheckExact(__pyx_v_components)) {
      __pyx_t_5 = 0; __pyx_t_3 = __pyx_v_components; __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_5 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_components); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_5); __Pyx_INCREF(__pyx_t_4); __pyx_t_5++;
      } else {
        __pyx_t_4 = PyIter_Next(__pyx_t_3);
        if (!__pyx_t_4) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_v_component);
      __pyx_v_component = __pyx_t_4;
      __pyx_t_4 = 0;
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_component, __pyx_kp_split); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_7 = PyList_Append(__pyx_t_2, (PyObject*)__pyx_t_6); if (unlikely(__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1053; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_INCREF(((PyObject *)__pyx_t_2));
    __Pyx_DECREF(__pyx_v_components);
    __pyx_v_components = ((PyObject *)__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1054
 *                 components = components.split(';')
 *             components = [component.split() for component in components]
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)             # <<<<<<<<<<<<<<
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)
 *         # TODO: is this a memory leak? who destroys the FrameType?
 */
  __pyx_v_ft = __pyx_f_6pysdif_7_pysdif_FrameType_create(__pyx_v_signature, __pyx_v_components);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1055
 *             components = [component.split() for component in components]
 *         cdef SdifFrameTypeT *ft = FrameType_create(signature, components)
 *         SdifPutFrameType(self.this.FrameTypesTable, ft)             # <<<<<<<<<<<<<<
 *         # TODO: is this a memory leak? who destroys the FrameType?
 *         #Mself.frame_status = eFrameInvalid
 */
  SdifPutFrameType(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->FrameTypesTable, __pyx_v_ft);

  __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_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_frame_type");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_component);
  __Pyx_DECREF(__pyx_v_components);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1059
 *         #Mself.frame_status = eFrameInvalid
 * 
 *     def clone_type_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         clone the frame and matrix type definitions of source_sdiffile
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_type_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_type_definitions[] = "SdifFile.clone_type_definitions(self, SdifFile source)\n\n        clone the frame and matrix type definitions of source_sdiffile\n        NB: this must be called only for writing mode before any frame \n        has been written\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_type_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_v_frametypes;
  PyObject *__pyx_v_matrixtypes;
  PyObject *__pyx_v_frametype;
  PyObject *__pyx_v_matrixtype;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_SetupRefcountContext("clone_type_definitions");
  __pyx_v_frametypes = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matrixtypes = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frametype = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matrixtype = Py_None; __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1059; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1065
 *         has been written
 *         """
 *         frametypes = source.get_frame_types()             # <<<<<<<<<<<<<<
 *         matrixtypes = source.get_matrix_types()
 *         for frametype in frametypes:
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_source, __pyx_kp_get_frame_types); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1065; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_frametypes);
  __pyx_v_frametypes = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1066
 *         """
 *         frametypes = source.get_frame_types()
 *         matrixtypes = source.get_matrix_types()             # <<<<<<<<<<<<<<
 *         for frametype in frametypes:
 *             self.add_frame_type(frametype.signature, frametype.components)
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_source, __pyx_kp_get_matrix_types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __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 = 1066; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_v_matrixtypes);
  __pyx_v_matrixtypes = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1067
 *         frametypes = source.get_frame_types()
 *         matrixtypes = source.get_matrix_types()
 *         for frametype in frametypes:             # <<<<<<<<<<<<<<
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:
 */
  if (PyList_CheckExact(__pyx_v_frametypes) || PyTuple_CheckExact(__pyx_v_frametypes)) {
    __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_frametypes; __Pyx_INCREF(__pyx_t_1);
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frametypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_1))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_2 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_2); __pyx_t_3++;
    } else {
      __pyx_t_2 = PyIter_Next(__pyx_t_1);
      if (!__pyx_t_2) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1067; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_2);
    }
    __Pyx_DECREF(__pyx_v_frametype);
    __pyx_v_frametype = __pyx_t_2;
    __pyx_t_2 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1068
 *         matrixtypes = source.get_matrix_types()
 *         for frametype in frametypes:
 *             self.add_frame_type(frametype.signature, frametype.components)             # <<<<<<<<<<<<<<
 *         for matrixtype in matrixtypes:
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 */
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_add_frame_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyObject_GetAttr(__pyx_v_frametype, __pyx_kp_signature); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_frametype, __pyx_kp_components); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_6));
    PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4);
    __Pyx_GIVEREF(__pyx_t_4);
    PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_5);
    __pyx_t_4 = 0;
    __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1068; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1069
 *         for frametype in frametypes:
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:             # <<<<<<<<<<<<<<
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)
 *         #self.write_all_ascii_chunks()  # this is not necessary since it will be called when the first frame is written
 */
  if (PyList_CheckExact(__pyx_v_matrixtypes) || PyTuple_CheckExact(__pyx_v_matrixtypes)) {
    __pyx_t_3 = 0; __pyx_t_1 = __pyx_v_matrixtypes; __Pyx_INCREF(__pyx_t_1);
  } else {
    __pyx_t_3 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_matrixtypes); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_1))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
      __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++;
    } else {
      __pyx_t_5 = PyIter_Next(__pyx_t_1);
      if (!__pyx_t_5) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1069; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_DECREF(__pyx_v_matrixtype);
    __pyx_v_matrixtype = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1070
 *             self.add_frame_type(frametype.signature, frametype.components)
 *         for matrixtype in matrixtypes:
 *             self.add_matrix_type(matrixtype.signature, matrixtype.column_names)             # <<<<<<<<<<<<<<
 *         #self.write_all_ascii_chunks()  # this is not necessary since it will be called when the first frame is written
 * 
 */
    __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_add_matrix_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = PyObject_GetAttr(__pyx_v_matrixtype, __pyx_kp_signature); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_matrixtype, __pyx_kp_column_names); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6);
    __Pyx_GIVEREF(__pyx_t_6);
    PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
    __Pyx_GIVEREF(__pyx_t_2);
    __pyx_t_6 = 0;
    __pyx_t_2 = 0;
    __pyx_t_2 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1070; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_type_definitions");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_frametypes);
  __Pyx_DECREF(__pyx_v_matrixtypes);
  __Pyx_DECREF(__pyx_v_frametype);
  __Pyx_DECREF(__pyx_v_matrixtype);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1073
 *         #self.write_all_ascii_chunks()  # this is not necessary since it will be called when the first frame is written
 * 
 *     def clone_NVTs(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         clone the NVT from source (an open SdifFile)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_NVTs(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_NVTs[] = "SdifFile.clone_NVTs(self, SdifFile source)\n\n        clone the NVT from source (an open SdifFile)\n        \n        NB: If you do not plan to midify the type definitions included\n        in the source file, it's better to call 'clone_definitions', which\n        clones everything but the data, so you can do\n        new_sdif = SdifFile(\"out.sdif\", \"w\")\n        new_sdif.clone_definitions(old_sdif)\n        for frame in old_sdif:\n            new_frame = new_sdif.new_frame(frame.signature, frame.time)\n            ... etc ...\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_NVTs(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_v_nvt;
  PyObject *__pyx_r = NULL;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  __Pyx_SetupRefcountContext("clone_NVTs");
  __pyx_v_nvt = Py_None; __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1073; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1086
 *             ... etc ...
 *         """
 *         for nvt in source.get_NVTs():             # <<<<<<<<<<<<<<
 *             self.add_NVT(nvt)
 * 
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_source, __pyx_kp_get_NVTs); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (PyList_CheckExact(__pyx_t_3) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_1 = 0; __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_1 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    } else {
      __pyx_t_3 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_3) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1086; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_DECREF(__pyx_v_nvt);
    __pyx_v_nvt = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1087
 *         """
 *         for nvt in source.get_NVTs():
 *             self.add_NVT(nvt)             # <<<<<<<<<<<<<<
 * 
 *     def clone_definitions(self, SdifFile source):
 */
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_add_NVT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_4));
    __Pyx_INCREF(__pyx_v_nvt);
    PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_nvt);
    __Pyx_GIVEREF(__pyx_v_nvt);
    __pyx_t_5 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1087; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_NVTs");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_nvt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1089
 *             self.add_NVT(nvt)
 * 
 *     def clone_definitions(self, SdifFile source):             # <<<<<<<<<<<<<<
 *         """
 *         clone both NVT(s) and frame and matrix definitions from source,
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_definitions[] = "SdifFile.clone_definitions(self, SdifFile source)\n\n        clone both NVT(s) and frame and matrix definitions from source,\n        so after calling this function you can start creating frames\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_definitions(PyObject *__pyx_v_self, PyObject *__pyx_v_source) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  __Pyx_SetupRefcountContext("clone_definitions");
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1089; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1094
 *         so after calling this function you can start creating frames
 *         """
 *         self.clone_NVTs(source)             # <<<<<<<<<<<<<<
 *         self.clone_type_definitions(source)
 * 
 */
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_clone_NVTs); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __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 = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_source);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
  __Pyx_GIVEREF(__pyx_v_source);
  __pyx_t_3 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1094; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1095
 *         """
 *         self.clone_NVTs(source)
 *         self.clone_type_definitions(source)             # <<<<<<<<<<<<<<
 * 
 *     def clone_frames(self, SdifFile source, tuple signatures_to_clone=None):
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_31); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_v_source);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_source);
  __Pyx_GIVEREF(__pyx_v_source);
  __pyx_t_1 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1095; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __Pyx_DECREF(__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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_definitions");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1097
 *         self.clone_type_definitions(source)
 * 
 *     def clone_frames(self, SdifFile source, tuple signatures_to_clone=None):             # <<<<<<<<<<<<<<
 *         """
 *         clone all the frames in source which are included in
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_frames[] = "SdifFile.clone_frames(self, SdifFile source, tuple signatures_to_clone=None)\n\n        clone all the frames in source which are included in \n        @signatures_to_clone -- if this is not defined, clone \n        everything\n        \n        NB: the use case for this function is when you want to\n        modify some of the metadata but leave the data itself\n        unmodified\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_frames(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *__pyx_v_source = 0;
  PyObject *__pyx_v_signatures_to_clone = 0;
  PyObject *__pyx_v_frame0;
  PyObject *__pyx_v_frame1;
  PyObject *__pyx_v_matrix;
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_source,&__pyx_kp_signatures_to_clone,0};
  __Pyx_SetupRefcountContext("clone_frames");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[2] = {0,0};
    values[1] = (PyObject*)((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_signatures_to_clone);
        if (unlikely(value)) { values[1] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "clone_frames") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)values[0]);
    __pyx_v_signatures_to_clone = ((PyObject *)values[1]);
  } else {
    __pyx_v_signatures_to_clone = ((PyObject *)Py_None);
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  2: __pyx_v_signatures_to_clone = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 1));
      case  1: __pyx_v_source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)PyTuple_GET_ITEM(__pyx_args, 0));
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("clone_frames", 0, 1, 2, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_frames");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_frame0 = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frame1 = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matrix = Py_None; __Pyx_INCREF(Py_None);
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_source), __pyx_ptype_6pysdif_7_pysdif_SdifFile, 1, "source", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signatures_to_clone), &PyTuple_Type, 1, "signatures_to_clone", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1097; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1108
 *         """
 *         # TODO : optimize this method
 *         if signatures_to_clone is not None:             # <<<<<<<<<<<<<<
 *             for frame0 in source:
 *                 if frame0.signature in signatures_to_clone:
 */
  __pyx_t_1 = (__pyx_v_signatures_to_clone != ((PyObject *)Py_None));
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1109
 *         # TODO : optimize this method
 *         if signatures_to_clone is not None:
 *             for frame0 in source:             # <<<<<<<<<<<<<<
 *                 if frame0.signature in signatures_to_clone:
 *                     frame1 = self.new_frame(frame0.signature, frame0.time)
 */
    if (PyList_CheckExact(((PyObject *)__pyx_v_source)) || PyTuple_CheckExact(((PyObject *)__pyx_v_source))) {
      __pyx_t_2 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_source); __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_source)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++;
      } else {
        __pyx_t_4 = PyIter_Next(__pyx_t_3);
        if (!__pyx_t_4) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1109; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_4);
      }
      __Pyx_DECREF(__pyx_v_frame0);
      __pyx_v_frame0 = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1110
 *         if signatures_to_clone is not None:
 *             for frame0 in source:
 *                 if frame0.signature in signatures_to_clone:             # <<<<<<<<<<<<<<
 *                     frame1 = self.new_frame(frame0.signature, frame0.time)
 *                     for matrix in frame0:
 */
      __pyx_t_4 = PyObject_GetAttr(__pyx_v_frame0, __pyx_kp_signature); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_1 = (PySequence_Contains(((PyObject *)__pyx_v_signatures_to_clone), __pyx_t_4)); if (unlikely(__pyx_t_1 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_1) {

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1111
 *             for frame0 in source:
 *                 if frame0.signature in signatures_to_clone:
 *                     frame1 = self.new_frame(frame0.signature, frame0.time)             # <<<<<<<<<<<<<<
 *                     for matrix in frame0:
 *                         frame1.add_matrix(matrix.signature, matrix.get_data())
 */
        __pyx_t_4 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_new_frame); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyObject_GetAttr(__pyx_v_frame0, __pyx_kp_signature); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_frame0, __pyx_kp_time); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_7));
        PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5);
        __Pyx_GIVEREF(__pyx_t_5);
        PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_6);
        __Pyx_GIVEREF(__pyx_t_6);
        __pyx_t_5 = 0;
        __pyx_t_6 = 0;
        __pyx_t_6 = PyObject_Call(__pyx_t_4, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1111; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_v_frame1);
        __pyx_v_frame1 = __pyx_t_6;
        __pyx_t_6 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1112
 *                 if frame0.signature in signatures_to_clone:
 *                     frame1 = self.new_frame(frame0.signature, frame0.time)
 *                     for matrix in frame0:             # <<<<<<<<<<<<<<
 *                         frame1.add_matrix(matrix.signature, matrix.get_data())
 *                     frame1.write()
 */
        if (PyList_CheckExact(__pyx_v_frame0) || PyTuple_CheckExact(__pyx_v_frame0)) {
          __pyx_t_8 = 0; __pyx_t_6 = __pyx_v_frame0; __Pyx_INCREF(__pyx_t_6);
        } else {
          __pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_v_frame0); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_6);
        }
        for (;;) {
          if (likely(PyList_CheckExact(__pyx_t_6))) {
            if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
          } else if (likely(PyTuple_CheckExact(__pyx_t_6))) {
            if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
          } else {
            __pyx_t_7 = PyIter_Next(__pyx_t_6);
            if (!__pyx_t_7) {
              if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
              break;
            }
            __Pyx_GOTREF(__pyx_t_7);
          }
          __Pyx_DECREF(__pyx_v_matrix);
          __pyx_v_matrix = __pyx_t_7;
          __pyx_t_7 = 0;

          /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1113
 *                     frame1 = self.new_frame(frame0.signature, frame0.time)
 *                     for matrix in frame0:
 *                         frame1.add_matrix(matrix.signature, matrix.get_data())             # <<<<<<<<<<<<<<
 *                     frame1.write()
 *         else:
 */
          __pyx_t_7 = PyObject_GetAttr(__pyx_v_frame1, __pyx_kp_add_matrix); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_4 = PyObject_GetAttr(__pyx_v_matrix, __pyx_kp_signature); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_4);
          __pyx_t_5 = PyObject_GetAttr(__pyx_v_matrix, __pyx_kp_get_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_5);
          __pyx_t_9 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
          __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(((PyObject *)__pyx_t_5));
          PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
          __Pyx_GIVEREF(__pyx_t_4);
          PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_9);
          __Pyx_GIVEREF(__pyx_t_9);
          __pyx_t_4 = 0;
          __pyx_t_9 = 0;
          __pyx_t_9 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1113; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          __Pyx_GOTREF(__pyx_t_9);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
          __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        }
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1114
 *                     for matrix in frame0:
 *                         frame1.add_matrix(matrix.signature, matrix.get_data())
 *                     frame1.write()             # <<<<<<<<<<<<<<
 *         else:
 *             for frame0 in source:
 */
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_frame1, __pyx_kp_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_9 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1114; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
        goto __pyx_L9;
      }
      __pyx_L9:;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1116
 *                     frame1.write()
 *         else:
 *             for frame0 in source:             # <<<<<<<<<<<<<<
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:
 */
    if (PyList_CheckExact(((PyObject *)__pyx_v_source)) || PyTuple_CheckExact(((PyObject *)__pyx_v_source))) {
      __pyx_t_2 = 0; __pyx_t_3 = ((PyObject *)__pyx_v_source); __Pyx_INCREF(__pyx_t_3);
    } else {
      __pyx_t_2 = -1; __pyx_t_3 = PyObject_GetIter(((PyObject *)__pyx_v_source)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_3))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_3))) {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
        __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_9); __pyx_t_2++;
      } else {
        __pyx_t_9 = PyIter_Next(__pyx_t_3);
        if (!__pyx_t_9) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1116; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_DECREF(__pyx_v_frame0);
      __pyx_v_frame0 = __pyx_t_9;
      __pyx_t_9 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1117
 *         else:
 *             for frame0 in source:
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)             # <<<<<<<<<<<<<<
 *                 for matrix in frame0:
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())
 */
      __pyx_t_9 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_new_frame); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_6 = PyObject_GetAttr(__pyx_v_frame0, __pyx_kp_signature); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_frame0, __pyx_kp_time); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_7));
      PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6);
      __Pyx_GIVEREF(__pyx_t_6);
      PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_5);
      __Pyx_GIVEREF(__pyx_t_5);
      __pyx_t_6 = 0;
      __pyx_t_5 = 0;
      __pyx_t_5 = PyObject_Call(__pyx_t_9, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1117; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_v_frame1);
      __pyx_v_frame1 = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1118
 *             for frame0 in source:
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:             # <<<<<<<<<<<<<<
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())
 *                 frame1.write()
 */
      if (PyList_CheckExact(__pyx_v_frame0) || PyTuple_CheckExact(__pyx_v_frame0)) {
        __pyx_t_8 = 0; __pyx_t_5 = __pyx_v_frame0; __Pyx_INCREF(__pyx_t_5);
      } else {
        __pyx_t_8 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_v_frame0); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
      }
      for (;;) {
        if (likely(PyList_CheckExact(__pyx_t_5))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_5)) break;
          __pyx_t_7 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
        } else if (likely(PyTuple_CheckExact(__pyx_t_5))) {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
          __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++;
        } else {
          __pyx_t_7 = PyIter_Next(__pyx_t_5);
          if (!__pyx_t_7) {
            if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1118; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_DECREF(__pyx_v_matrix);
        __pyx_v_matrix = __pyx_t_7;
        __pyx_t_7 = 0;

        /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1119
 *                 frame1 = self.new_frame(frame0.signature, frame0.time)
 *                 for matrix in frame0:
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())             # <<<<<<<<<<<<<<
 *                 frame1.write()
 * 
 */
        __pyx_t_7 = PyObject_GetAttr(__pyx_v_frame1, __pyx_kp_add_matrix); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_9 = PyObject_GetAttr(__pyx_v_matrix, __pyx_kp_signature); if (unlikely(!__pyx_t_9)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_6 = PyObject_GetAttr(__pyx_v_matrix, __pyx_kp_get_data); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_6);
        __pyx_t_4 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
        __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_6));
        PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_9);
        __Pyx_GIVEREF(__pyx_t_9);
        PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_9 = 0;
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_6), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1120
 *                 for matrix in frame0:
 *                     frame1.add_matrix(matrix.signature, matrix.get_data())
 *                 frame1.write()             # <<<<<<<<<<<<<<
 * 
 *     def add_streamID(self, unsigned int numid, char *source, char *treeway):
 */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_frame1, __pyx_kp_write); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1120; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.clone_frames");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_frame0);
  __Pyx_DECREF(__pyx_v_frame1);
  __Pyx_DECREF(__pyx_v_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1122
 *                 frame1.write()
 * 
 *     def add_streamID(self, unsigned int numid, char *source, char *treeway):             # <<<<<<<<<<<<<<
 *         """
 *         this method is only there for completion. it seems to be only used in old
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_streamID(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_add_streamID[] = "SdifFile.add_streamID(self, unsigned int numid, char *source, char *treeway)\n\n        this method is only there for completion. it seems to be only used in old\n        sdif types\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_streamID(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  unsigned int __pyx_v_numid;
  char *__pyx_v_source;
  char *__pyx_v_treeway;
  PyObject *__pyx_r = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_numid,&__pyx_kp_source,&__pyx_kp_treeway,0};
  __Pyx_SetupRefcountContext("add_streamID");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_numid);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_source);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("add_streamID", 1, 3, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_treeway);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("add_streamID", 1, 3, 3, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_streamID") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_numid = __Pyx_PyInt_AsUnsignedInt(values[0]); if (unlikely((__pyx_v_numid == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_source = __Pyx_PyBytes_AsString(values[1]); if (unlikely((!__pyx_v_source) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_treeway = __Pyx_PyBytes_AsString(values[2]); if (unlikely((!__pyx_v_treeway) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
    goto __pyx_L5_argtuple_error;
  } else {
    __pyx_v_numid = __Pyx_PyInt_AsUnsignedInt(PyTuple_GET_ITEM(__pyx_args, 0)); if (unlikely((__pyx_v_numid == (unsigned int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_source = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely((!__pyx_v_source) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_treeway = __Pyx_PyBytes_AsString(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((!__pyx_v_treeway) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_streamID", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1122; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_streamID");
  return NULL;
  __pyx_L4_argument_unpacking_done:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1128
 *         """
 *         SdifStreamIDTablePutSID(self.this.StreamIDsTable,
 *             numid, source, treeway)             # <<<<<<<<<<<<<<
 * 
 *     def add_predefined_type(self, predefined_type='RBEP'):
 */
  SdifStreamIDTablePutSID(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->StreamIDsTable, __pyx_v_numid, __pyx_v_source, __pyx_v_treeway);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1130
 *             numid, source, treeway)
 * 
 *     def add_predefined_type(self, predefined_type='RBEP'):             # <<<<<<<<<<<<<<
 *         """
 *         Add a predefined type to this SdifFile.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_predefined_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_add_predefined_type[] = "SdifFile.add_predefined_type(self, predefined_type='RBEP')\n\n        Add a predefined type to this SdifFile.\n        This type must be already defined in the global\n        variable SDIF_NEWTYPES.\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_predefined_type(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_predefined_type = 0;
  PyObject *__pyx_v_frame_types;
  PyObject *__pyx_v_matrix_types;
  PyObject *__pyx_v_frame_type;
  PyObject *__pyx_v_matrix_type;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_predefined_type,0};
  __Pyx_SetupRefcountContext("add_predefined_type");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[1] = {0};
    values[0] = __pyx_kp_63;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_predefined_type);
        if (unlikely(value)) { values[0] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "add_predefined_type") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_predefined_type = values[0];
  } else {
    __pyx_v_predefined_type = __pyx_kp_63;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  1: __pyx_v_predefined_type = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_predefined_type", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1130; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_predefined_type");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_v_frame_types = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matrix_types = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frame_type = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matrix_type = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1136
 *         variable SDIF_NEWTYPES.
 *         """
 *         frame_types, matrix_types = get_predefined_frames_and_matrices(predefined_type)             # <<<<<<<<<<<<<<
 *         if frame_types is not None:
 *             # type exists
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_84); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_predefined_type);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_predefined_type);
  __Pyx_GIVEREF(__pyx_v_predefined_type);
  __pyx_t_2 = PyObject_Call(__pyx_1, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyTuple_CheckExact(__pyx_t_2) && likely(PyTuple_GET_SIZE(__pyx_t_2) == 2)) {
    PyObject* tuple = __pyx_t_2;
    __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
    __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_v_frame_types);
    __pyx_v_frame_types = __pyx_2;
    __pyx_2 = 0;
    __Pyx_DECREF(__pyx_v_matrix_types);
    __pyx_v_matrix_types = __pyx_3;
    __pyx_3 = 0;
  } else {
    __pyx_1 = PyObject_GetIter(__pyx_t_2); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_2 = __Pyx_UnpackItem(__pyx_1, 0); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_2);
    __pyx_3 = __Pyx_UnpackItem(__pyx_1, 1); if (unlikely(!__pyx_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_3);
    if (__Pyx_EndUnpack(__pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
    __Pyx_DECREF(__pyx_v_frame_types);
    __pyx_v_frame_types = __pyx_2;
    __pyx_2 = 0;
    __Pyx_DECREF(__pyx_v_matrix_types);
    __pyx_v_matrix_types = __pyx_3;
    __pyx_3 = 0;
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1137
 *         """
 *         frame_types, matrix_types = get_predefined_frames_and_matrices(predefined_type)
 *         if frame_types is not None:             # <<<<<<<<<<<<<<
 *             # type exists
 *             for frame_type in frame_types:
 */
  __pyx_t_3 = (__pyx_v_frame_types != Py_None);
  if (__pyx_t_3) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1139
 *         if frame_types is not None:
 *             # type exists
 *             for frame_type in frame_types:             # <<<<<<<<<<<<<<
 *                 self.add_frame_type(*frame_type)
 *             for matrix_type in matrix_types:
 */
    if (PyList_CheckExact(__pyx_v_frame_types) || PyTuple_CheckExact(__pyx_v_frame_types)) {
      __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_frame_types; __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_frame_types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_1); __pyx_t_4++;
      } else {
        __pyx_t_1 = PyIter_Next(__pyx_t_2);
        if (!__pyx_t_1) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_DECREF(__pyx_v_frame_type);
      __pyx_v_frame_type = __pyx_t_1;
      __pyx_t_1 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1140
 *             # type exists
 *             for frame_type in frame_types:
 *                 self.add_frame_type(*frame_type)             # <<<<<<<<<<<<<<
 *             for matrix_type in matrix_types:
 *                 self.add_matrix_type(*matrix_type)
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_add_frame_type); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_1 = PySequence_Tuple(__pyx_v_frame_type); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_1));
      __pyx_t_5 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_1), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1140; __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_1)); __pyx_1 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1141
 *             for frame_type in frame_types:
 *                 self.add_frame_type(*frame_type)
 *             for matrix_type in matrix_types:             # <<<<<<<<<<<<<<
 *                 self.add_matrix_type(*matrix_type)
 *         else:
 */
    if (PyList_CheckExact(__pyx_v_matrix_types) || PyTuple_CheckExact(__pyx_v_matrix_types)) {
      __pyx_t_4 = 0; __pyx_t_2 = __pyx_v_matrix_types; __Pyx_INCREF(__pyx_t_2);
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_matrix_types); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
      } else {
        __pyx_t_5 = PyIter_Next(__pyx_t_2);
        if (!__pyx_t_5) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1141; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_v_matrix_type);
      __pyx_v_matrix_type = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1142
 *                 self.add_frame_type(*frame_type)
 *             for matrix_type in matrix_types:
 *                 self.add_matrix_type(*matrix_type)             # <<<<<<<<<<<<<<
 *         else:
 *             raise ValueError("Definition of sdif type not found")
 */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_add_matrix_type); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_2 = PySequence_Tuple(__pyx_v_matrix_type); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_2));
      __pyx_t_1 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1142; __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_2)); __pyx_2 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  /*else*/ {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1144
 *                 self.add_matrix_type(*matrix_type)
 *         else:
 *             raise ValueError("Definition of sdif type not found")             # <<<<<<<<<<<<<<
 * 
 *     def write_all_ascii_chunks(self):
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_kp_85);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_85);
    __Pyx_GIVEREF(__pyx_kp_85);
    __pyx_t_1 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_1, 0, 0);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  __pyx_L6:;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_3);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.add_predefined_type");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_frame_types);
  __Pyx_DECREF(__pyx_v_matrix_types);
  __Pyx_DECREF(__pyx_v_frame_type);
  __Pyx_DECREF(__pyx_v_matrix_type);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1146
 *             raise ValueError("Definition of sdif type not found")
 * 
 *     def write_all_ascii_chunks(self):             # <<<<<<<<<<<<<<
 *         """
 *         low level interface.
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_write_all_ascii_chunks(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_write_all_ascii_chunks[] = "SdifFile.write_all_ascii_chunks(self)\n\n        low level interface.\n        Once the NVTs and matrix and frame definitions have been added to the SdifFile,\n        this methods writes them all together to disk and the SdifFile is ready to accept\n        new frames.\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_write_all_ascii_chunks(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  int __pyx_t_1;
  __Pyx_SetupRefcountContext("write_all_ascii_chunks");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1153
 *         new frames.
 *         """
 *         if self.write_status != eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             return
 *         SdifFWriteAllASCIIChunks(self.this)
 */
  __pyx_t_1 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->write_status != __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader);
  if (__pyx_t_1) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1154
 *         """
 *         if self.write_status != eSdifGeneralHeader:
 *             return             # <<<<<<<<<<<<<<
 *         SdifFWriteAllASCIIChunks(self.this)
 *         self.write_status = eSdifAllASCIIChunks
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1155
 *         if self.write_status != eSdifGeneralHeader:
 *             return
 *         SdifFWriteAllASCIIChunks(self.this)             # <<<<<<<<<<<<<<
 *         self.write_status = eSdifAllASCIIChunks
 * 
 */
  SdifFWriteAllASCIIChunks(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1156
 *             return
 *         SdifFWriteAllASCIIChunks(self.this)
 *         self.write_status = eSdifAllASCIIChunks             # <<<<<<<<<<<<<<
 * 
 *     def new_frame(self, str signature, SdifFloat8 time, SdifUInt4 streamID=0):
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->write_status = __pyx_e_6pysdif_7_pysdif_eSdifAllASCIIChunks;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1158
 *         self.write_status = eSdifAllASCIIChunks
 * 
 *     def new_frame(self, str signature, SdifFloat8 time, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *         """
 *         create a new frame with the given signature and at the given time
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_new_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_new_frame[] = "SdifFile.new_frame(self, str signature, pysdif.pysdif.SdifFloat8 time, pysdif.pysdif.SdifUInt4 streamID=0)\n\n        create a new frame with the given signature and at the given time\n        \n        new_frame = sdiffile.new_frame('1SIG', time_now)\n        new_frame.add_matrix(...)\n        new_frame.write()\n        \n        if you know that you will write only one matrix, you can call\n        \n        sdiffile.new_frame_one_matrix(frame_sig, time_now, matrix_sig, data)\n        \n        and this will do the same as the three method calls above\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_new_frame(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_signature = 0;
  SdifFloat8 __pyx_v_time;
  SdifUInt4 __pyx_v_streamID;
  PyObject *__pyx_r = NULL;
  struct __pyx_opt_args_6pysdif_7_pysdif_FrameW_new __pyx_1;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  SdifSignature __pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_signature,&__pyx_kp_time,&__pyx_kp_streamID,0};
  __Pyx_SetupRefcountContext("new_frame");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[3] = {0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_signature);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_time);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("new_frame", 0, 2, 3, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_streamID);
        if (unlikely(value)) { values[2] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "new_frame") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_signature = ((PyObject *)values[0]);
    __pyx_v_time = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    if (values[2]) {
      __pyx_v_streamID = __Pyx_PyInt_from_py_SdifUInt4(values[2]); if (unlikely((__pyx_v_streamID == (SdifUInt4)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_streamID = 0;
    }
  } else {
    __pyx_v_streamID = 0;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  3:
      __pyx_v_streamID = __Pyx_PyInt_from_py_SdifUInt4(PyTuple_GET_ITEM(__pyx_args, 2)); if (unlikely((__pyx_v_streamID == (SdifUInt4)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  2:
      __pyx_v_time = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_signature = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 0));
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("new_frame", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_signature), &PyString_Type, 1, "signature", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1158; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1175
 *         # defining the global header (ascii chunks) so verify that
 *         # we have written it
 *         assert self.mode == eWriteFile or self.mode == eReadWriteFile             # <<<<<<<<<<<<<<
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(eWriteFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyInt_FromLong(eReadWriteFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (unlikely(!__pyx_t_6)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1175; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1176
 *         # we have written it
 *         assert self.mode == eWriteFile or self.mode == eReadWriteFile
 *         if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             self.write_all_ascii_chunks()
 *         return FrameW_new(self, str2signature(signature), time, streamID)
 */
  __pyx_t_6 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->write_status == __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader);
  if (__pyx_t_6) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1177
 *         assert self.mode == eWriteFile or self.mode == eReadWriteFile
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()             # <<<<<<<<<<<<<<
 *         return FrameW_new(self, str2signature(signature), time, streamID)
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1178
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()
 *         return FrameW_new(self, str2signature(signature), time, streamID)             # <<<<<<<<<<<<<<
 * 
 *     def new_frame_one_matrix(self, str frame_sig, SdifFloat8 time, str matrix_sig, c_numpy.ndarray data_array, SdifUInt4 streamID=0):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_2 = __Pyx_GetName(__pyx_m, __pyx_kp_65); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_2);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(((PyObject *)__pyx_v_signature));
  PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_v_signature));
  __Pyx_GIVEREF(((PyObject *)__pyx_v_signature));
  __pyx_t_1 = PyObject_Call(__pyx_2, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_2); __pyx_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
  __pyx_t_7 = __Pyx_PyInt_from_py_SdifSignature(__pyx_t_1); if (unlikely((__pyx_t_7 == (SdifSignature)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_1.__pyx_n = 1;
  __pyx_1.streamID = __pyx_v_streamID;
  __pyx_t_1 = ((PyObject *)__pyx_f_6pysdif_7_pysdif_FrameW_new(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self), __pyx_t_7, __pyx_v_time, &__pyx_1)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1178; __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_2);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1180
 *         return FrameW_new(self, str2signature(signature), time, streamID)
 * 
 *     def new_frame_one_matrix(self, str frame_sig, SdifFloat8 time, str matrix_sig, c_numpy.ndarray data_array, SdifUInt4 streamID=0):             # <<<<<<<<<<<<<<
 *         """
 *         create a frame containing only one matrix and write it
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_new_frame_one_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_new_frame_one_matrix[] = "SdifFile.new_frame_one_matrix(self, str frame_sig, pysdif.pysdif.SdifFloat8 time, str matrix_sig, ndarray data_array, pysdif.pysdif.SdifUInt4 streamID=0)\n\n        create a frame containing only one matrix and write it\n        This method creates the frame, creates a new matrix\n        in the frame and writes it to disk, all at once\n        \n        NB: use this method when you want to create a frame which\n        contains only one matrix, like a 1TRC frame. It is more efficient\n        than calling new_frame, add_matrix, write (see method 'new_frame')\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_new_frame_one_matrix(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_frame_sig = 0;
  SdifFloat8 __pyx_v_time;
  PyObject *__pyx_v_matrix_sig = 0;
  PyArrayObject *__pyx_v_data_array = 0;
  SdifUInt4 __pyx_v_streamID;
  size_t __pyx_v_frame_size;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  static PyObject **__pyx_pyargnames[] = {&__pyx_kp_frame_sig,&__pyx_kp_time,&__pyx_kp_matrix_sig,&__pyx_kp_data_array,&__pyx_kp_streamID,0};
  __Pyx_SetupRefcountContext("new_frame_one_matrix");
  if (unlikely(__pyx_kwds)) {
    Py_ssize_t kw_args = PyDict_Size(__pyx_kwds);
    PyObject* values[5] = {0,0,0,0,0};
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
      case  4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
      case  3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
      case  2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
      case  1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
      case  0: break;
      default: goto __pyx_L5_argtuple_error;
    }
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  0:
      values[0] = PyDict_GetItem(__pyx_kwds, __pyx_kp_frame_sig);
      if (likely(values[0])) kw_args--;
      else goto __pyx_L5_argtuple_error;
      case  1:
      values[1] = PyDict_GetItem(__pyx_kwds, __pyx_kp_time);
      if (likely(values[1])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  2:
      values[2] = PyDict_GetItem(__pyx_kwds, __pyx_kp_matrix_sig);
      if (likely(values[2])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  3:
      values[3] = PyDict_GetItem(__pyx_kwds, __pyx_kp_data_array);
      if (likely(values[3])) kw_args--;
      else {
        __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      }
      case  4:
      if (kw_args > 1) {
        PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_kp_streamID);
        if (unlikely(value)) { values[4] = value; kw_args--; }
      }
    }
    if (unlikely(kw_args > 0)) {
      if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, PyTuple_GET_SIZE(__pyx_args), "new_frame_one_matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    }
    __pyx_v_frame_sig = ((PyObject *)values[0]);
    __pyx_v_time = __pyx_PyFloat_AsDouble(values[1]); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    __pyx_v_matrix_sig = ((PyObject *)values[2]);
    __pyx_v_data_array = ((PyArrayObject *)values[3]);
    if (values[4]) {
      __pyx_v_streamID = __Pyx_PyInt_from_py_SdifUInt4(values[4]); if (unlikely((__pyx_v_streamID == (SdifUInt4)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
    } else {
      __pyx_v_streamID = 0;
    }
  } else {
    __pyx_v_streamID = 0;
    switch (PyTuple_GET_SIZE(__pyx_args)) {
      case  5:
      __pyx_v_streamID = __Pyx_PyInt_from_py_SdifUInt4(PyTuple_GET_ITEM(__pyx_args, 4)); if (unlikely((__pyx_v_streamID == (SdifUInt4)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      case  4:
      __pyx_v_data_array = ((PyArrayObject *)PyTuple_GET_ITEM(__pyx_args, 3));
      __pyx_v_matrix_sig = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 2));
      __pyx_v_time = __pyx_PyFloat_AsDouble(PyTuple_GET_ITEM(__pyx_args, 1)); if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
      __pyx_v_frame_sig = ((PyObject *)PyTuple_GET_ITEM(__pyx_args, 0));
      break;
      default: goto __pyx_L5_argtuple_error;
    }
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("new_frame_one_matrix", 0, 4, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L3_error;}
  __pyx_L3_error:;
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame_one_matrix");
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_frame_sig), &PyString_Type, 1, "frame_sig", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_matrix_sig), &PyString_Type, 1, "matrix_sig", 1))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_data_array), __pyx_ptype_5numpy_ndarray, 1, "data_array", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1180; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1190
 *         than calling new_frame, add_matrix, write (see method 'new_frame')
 *         """
 *         assert self.mode == eWriteFile or self.mode == eReadWriteFile             # <<<<<<<<<<<<<<
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()
 */
  #ifndef PYREX_WITHOUT_ASSERTIONS
  __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_mode); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyInt_FromLong(eWriteFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_4 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (!__pyx_t_4) {
    __pyx_t_3 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_mode); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyInt_FromLong(eReadWriteFile); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_EQ); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_5 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_6 = __pyx_t_5;
  } else {
    __pyx_t_6 = __pyx_t_4;
  }
  if (unlikely(!__pyx_t_6)) {
    PyErr_SetNone(PyExc_AssertionError);
    {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1190; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  #endif

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1191
 *         """
 *         assert self.mode == eWriteFile or self.mode == eReadWriteFile
 *         if self.write_status == eSdifGeneralHeader:             # <<<<<<<<<<<<<<
 *             self.write_all_ascii_chunks()
 *         cdef size_t frame_size = SdifSizeOfFrameHeader() + SdifSizeOfMatrix(
 */
  __pyx_t_6 = (((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->write_status == __pyx_e_6pysdif_7_pysdif_eSdifGeneralHeader);
  if (__pyx_t_6) {

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1192
 *         assert self.mode == eWriteFile or self.mode == eReadWriteFile
 *         if self.write_status == eSdifGeneralHeader:
 *             self.write_all_ascii_chunks()             # <<<<<<<<<<<<<<
 *         cdef size_t frame_size = SdifSizeOfFrameHeader() + SdifSizeOfMatrix(
 *             <SdifDataTypeET>(dtype_numpy2sdif(data_array.descr.type_num)),
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_self, __pyx_kp_32); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1192; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1195
 *         cdef size_t frame_size = SdifSizeOfFrameHeader() + SdifSizeOfMatrix(
 *             <SdifDataTypeET>(dtype_numpy2sdif(data_array.descr.type_num)),
 *             data_array.shape[0], data_array.shape[1] # rows, cols             # <<<<<<<<<<<<<<
 *         )
 *         SdifFSetCurrFrameHeader(self.this, _str2sig(frame_sig), frame_size, 1, streamID, time)
 */
  __pyx_v_frame_size = (SdifSizeOfFrameHeader() + SdifSizeOfMatrix(((SdifDataTypeET)__pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_data_array->descr->type_num)), (__pyx_v_data_array->dimensions[0]), (__pyx_v_data_array->dimensions[1])));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1197
 *             data_array.shape[0], data_array.shape[1] # rows, cols
 *         )
 *         SdifFSetCurrFrameHeader(self.this, _str2sig(frame_sig), frame_size, 1, streamID, time)             # <<<<<<<<<<<<<<
 *         SdifFWriteFrameHeader(self.this)
 *         SdifFWriteMatrix(self.this,
 */
  __pyx_t_7 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_frame_sig)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1197; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  SdifFSetCurrFrameHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this, __pyx_f_6pysdif_7_pysdif__str2sig(__pyx_t_7), __pyx_v_frame_size, 1, __pyx_v_streamID, __pyx_v_time);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1198
 *         )
 *         SdifFSetCurrFrameHeader(self.this, _str2sig(frame_sig), frame_size, 1, streamID, time)
 *         SdifFWriteFrameHeader(self.this)             # <<<<<<<<<<<<<<
 *         SdifFWriteMatrix(self.this,
 *             _str2sig(matrix_sig),
 */
  SdifFWriteFrameHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1200
 *         SdifFWriteFrameHeader(self.this)
 *         SdifFWriteMatrix(self.this,
 *             _str2sig(matrix_sig),             # <<<<<<<<<<<<<<
 *             <SdifDataTypeET>dtype_numpy2sdif(data_array.descr.type_num),
 *             data_array.shape[0], data_array.shape[1],   # rows, cols
 */
  __pyx_t_7 = __Pyx_PyBytes_AsString(((PyObject *)__pyx_v_matrix_sig)); if (unlikely((!__pyx_t_7) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1200; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1203
 *             <SdifDataTypeET>dtype_numpy2sdif(data_array.descr.type_num),
 *             data_array.shape[0], data_array.shape[1],   # rows, cols
 *             data_array.data)             # <<<<<<<<<<<<<<
 *         self.write_status = eSdifMatrixData
 * 
 */
  SdifFWriteMatrix(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this, __pyx_f_6pysdif_7_pysdif__str2sig(__pyx_t_7), ((SdifDataTypeET)__pyx_f_6pysdif_7_pysdif_dtype_numpy2sdif(__pyx_v_data_array->descr->type_num)), (__pyx_v_data_array->dimensions[0]), (__pyx_v_data_array->dimensions[1]), __pyx_v_data_array->data);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1204
 *             data_array.shape[0], data_array.shape[1],   # rows, cols
 *             data_array.data)
 *         self.write_status = eSdifMatrixData             # <<<<<<<<<<<<<<
 * 
 *     # low level functions to print info
 */
  ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->write_status = __pyx_e_6pysdif_7_pysdif_eSdifMatrixData;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.new_frame_one_matrix");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1207
 * 
 *     # low level functions to print info
 *     def print_NVT(self): SdifFPrintAllNameValueNVT(self.this)             # <<<<<<<<<<<<<<
 *     def print_general_header(self): SdifFPrintGeneralHeader(self.this)
 *     def print_all_ascii_chunks(self): SdifFPrintAllASCIIChunks(self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_NVT(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_NVT[] = "SdifFile.print_NVT(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_NVT(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_NVT");
  SdifFPrintAllNameValueNVT(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1208
 *     # low level functions to print info
 *     def print_NVT(self): SdifFPrintAllNameValueNVT(self.this)
 *     def print_general_header(self): SdifFPrintGeneralHeader(self.this)             # <<<<<<<<<<<<<<
 *     def print_all_ascii_chunks(self): SdifFPrintAllASCIIChunks(self.this)
 *     def print_all_types(self): SdifFPrintAllType(self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_general_header(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_general_header[] = "SdifFile.print_general_header(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_general_header(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_general_header");
  SdifFPrintGeneralHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1209
 *     def print_NVT(self): SdifFPrintAllNameValueNVT(self.this)
 *     def print_general_header(self): SdifFPrintGeneralHeader(self.this)
 *     def print_all_ascii_chunks(self): SdifFPrintAllASCIIChunks(self.this)             # <<<<<<<<<<<<<<
 *     def print_all_types(self): SdifFPrintAllType(self.this)
 *     def print_matrix_header(self): SdifFPrintMatrixHeader(self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_ascii_chunks(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_all_ascii_chunks[] = "SdifFile.print_all_ascii_chunks(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_ascii_chunks(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_all_ascii_chunks");
  SdifFPrintAllASCIIChunks(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1210
 *     def print_general_header(self): SdifFPrintGeneralHeader(self.this)
 *     def print_all_ascii_chunks(self): SdifFPrintAllASCIIChunks(self.this)
 *     def print_all_types(self): SdifFPrintAllType(self.this)             # <<<<<<<<<<<<<<
 *     def print_matrix_header(self): SdifFPrintMatrixHeader(self.this)
 *     def print_one_row(self): SdifFPrintOneRow(self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_types(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_all_types[] = "SdifFile.print_all_types(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_types(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_all_types");
  SdifFPrintAllType(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1211
 *     def print_all_ascii_chunks(self): SdifFPrintAllASCIIChunks(self.this)
 *     def print_all_types(self): SdifFPrintAllType(self.this)
 *     def print_matrix_header(self): SdifFPrintMatrixHeader(self.this)             # <<<<<<<<<<<<<<
 *     def print_one_row(self): SdifFPrintOneRow(self.this)
 *     def print_frame_header(self): SdifFPrintFrameHeader(self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_matrix_header(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_matrix_header[] = "SdifFile.print_matrix_header(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_matrix_header(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_matrix_header");
  SdifFPrintMatrixHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1212
 *     def print_all_types(self): SdifFPrintAllType(self.this)
 *     def print_matrix_header(self): SdifFPrintMatrixHeader(self.this)
 *     def print_one_row(self): SdifFPrintOneRow(self.this)             # <<<<<<<<<<<<<<
 *     def print_frame_header(self): SdifFPrintFrameHeader(self.this)
 *     def print_all_stream_ID(self): SdifFPrintAllStreamID(self.this)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_one_row(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_one_row[] = "SdifFile.print_one_row(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_one_row(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_one_row");
  SdifFPrintOneRow(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1213
 *     def print_matrix_header(self): SdifFPrintMatrixHeader(self.this)
 *     def print_one_row(self): SdifFPrintOneRow(self.this)
 *     def print_frame_header(self): SdifFPrintFrameHeader(self.this)             # <<<<<<<<<<<<<<
 *     def print_all_stream_ID(self): SdifFPrintAllStreamID(self.this)
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_frame_header(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_frame_header[] = "SdifFile.print_frame_header(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_frame_header(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_frame_header");
  SdifFPrintFrameHeader(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1214
 *     def print_one_row(self): SdifFPrintOneRow(self.this)
 *     def print_frame_header(self): SdifFPrintFrameHeader(self.this)
 *     def print_all_stream_ID(self): SdifFPrintAllStreamID(self.this)             # <<<<<<<<<<<<<<
 * 
 *     def frame_types_to_string(self):
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_stream_ID(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_print_all_stream_ID[] = "SdifFile.print_all_stream_ID(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_stream_ID(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  __Pyx_SetupRefcountContext("print_all_stream_ID");
  SdifFPrintAllStreamID(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1216
 *     def print_all_stream_ID(self): SdifFPrintAllStreamID(self.this)
 * 
 *     def frame_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """
 *         returns a string with all frame types
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_frame_types_to_string(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_frame_types_to_string[] = "SdifFile.frame_types_to_string(self)\n\n        returns a string with all frame types\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_frame_types_to_string(PyObject *__pyx_v_self, PyObject *unused) {
  SdifStringT *__pyx_v_sdifstr;
  PyObject *__pyx_v_out;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("frame_types_to_string");
  __pyx_v_out = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1221
 *         """
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()             # <<<<<<<<<<<<<<
 *         SdifFAllFrameTypeToSdifString(self.this, sdifstr)
 *         out = PyString_from_SdifString(sdifstr)
 */
  __pyx_v_sdifstr = SdifStringNew();

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1222
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()
 *         SdifFAllFrameTypeToSdifString(self.this, sdifstr)             # <<<<<<<<<<<<<<
 *         out = PyString_from_SdifString(sdifstr)
 *         SdifStringFree(sdifstr)
 */
  SdifFAllFrameTypeToSdifString(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this, __pyx_v_sdifstr);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1223
 *         sdifstr = SdifStringNew()
 *         SdifFAllFrameTypeToSdifString(self.this, sdifstr)
 *         out = PyString_from_SdifString(sdifstr)             # <<<<<<<<<<<<<<
 *         SdifStringFree(sdifstr)
 *         return out
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_PyString_from_SdifString(__pyx_v_sdifstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1223; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_out);
  __pyx_v_out = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1224
 *         SdifFAllFrameTypeToSdifString(self.this, sdifstr)
 *         out = PyString_from_SdifString(sdifstr)
 *         SdifStringFree(sdifstr)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  SdifStringFree(__pyx_v_sdifstr);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1225
 *         out = PyString_from_SdifString(sdifstr)
 *         SdifStringFree(sdifstr)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def get_frame_types(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.frame_types_to_string");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1227
 *         return out
 * 
 *     def get_frame_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         returns a list of frame type definitions (1FTD)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_frame_types(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_get_frame_types[] = "SdifFile.get_frame_types(self)\n\n        returns a list of frame type definitions (1FTD)\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_frame_types(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("get_frame_types");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1231
 *         returns a list of frame type definitions (1FTD)
 *         """
 *         return FrameTypesTable_to_list(self.this.FrameTypesTable)             # <<<<<<<<<<<<<<
 * 
 *     def matrix_types_to_string(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_FrameTypesTable_to_list(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->FrameTypesTable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1231; __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("pysdif._pysdif.SdifFile.get_frame_types");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1233
 *         return FrameTypesTable_to_list(self.this.FrameTypesTable)
 * 
 *     def matrix_types_to_string(self):             # <<<<<<<<<<<<<<
 *         """ returns a string with all matrix types"""
 *         cdef SdifStringT *sdifstr
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_matrix_types_to_string(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_matrix_types_to_string[] = "SdifFile.matrix_types_to_string(self)\n returns a string with all matrix types";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_matrix_types_to_string(PyObject *__pyx_v_self, PyObject *unused) {
  SdifStringT *__pyx_v_sdifstr;
  PyObject *__pyx_v_out;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("matrix_types_to_string");
  __pyx_v_out = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1236
 *         """ returns a string with all matrix types"""
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()             # <<<<<<<<<<<<<<
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)
 *         out = PyString_from_SdifString(sdifstr)
 */
  __pyx_v_sdifstr = SdifStringNew();

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1237
 *         cdef SdifStringT *sdifstr
 *         sdifstr = SdifStringNew()
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)             # <<<<<<<<<<<<<<
 *         out = PyString_from_SdifString(sdifstr)
 *         SdifStringFree(sdifstr)
 */
  SdifFAllMatrixTypeToSdifString(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this, __pyx_v_sdifstr);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1238
 *         sdifstr = SdifStringNew()
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)
 *         out = PyString_from_SdifString(sdifstr)             # <<<<<<<<<<<<<<
 *         SdifStringFree(sdifstr)
 *         return out
 */
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_PyString_from_SdifString(__pyx_v_sdifstr); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_v_out);
  __pyx_v_out = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1239
 *         SdifFAllMatrixTypeToSdifString(self.this, sdifstr)
 *         out = PyString_from_SdifString(sdifstr)
 *         SdifStringFree(sdifstr)             # <<<<<<<<<<<<<<
 *         return out
 * 
 */
  SdifStringFree(__pyx_v_sdifstr);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1240
 *         out = PyString_from_SdifString(sdifstr)
 *         SdifStringFree(sdifstr)
 *         return out             # <<<<<<<<<<<<<<
 * 
 *     def get_matrix_types(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_out);
  __pyx_r = __pyx_v_out;
  goto __pyx_L0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("pysdif._pysdif.SdifFile.matrix_types_to_string");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_out);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1242
 *         return out
 * 
 *     def get_matrix_types(self):             # <<<<<<<<<<<<<<
 *         """
 *         returns a list of matrix type definitions (1MTD)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_matrix_types(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_get_matrix_types[] = "SdifFile.get_matrix_types(self)\n\n        returns a list of matrix type definitions (1MTD)\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_matrix_types(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("get_matrix_types");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1246
 *         returns a list of matrix type definitions (1MTD)
 *         """
 *         return MatrixTypesTable_to_list(self.this.MatrixTypesTable)             # <<<<<<<<<<<<<<
 * 
 *     def get_NVTs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_MatrixTypesTable_to_list(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->MatrixTypesTable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1246; __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("pysdif._pysdif.SdifFile.get_matrix_types");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1248
 *         return MatrixTypesTable_to_list(self.this.MatrixTypesTable)
 * 
 *     def get_NVTs(self):             # <<<<<<<<<<<<<<
 *         """
 *         return a list with all devined NameValueTables
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_NVTs(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_get_NVTs[] = "SdifFile.get_NVTs(self)\n\n        return a list with all devined NameValueTables \n        each NVT is converted to a python dict\n        ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_NVTs(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("get_NVTs");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1253
 *         each NVT is converted to a python dict
 *         """
 *         return valuetables_to_dicts (self.this.NameValues)             # <<<<<<<<<<<<<<
 * 
 *     def get_stream_IDs(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_valuetables_to_dicts(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->NameValues); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1253; __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("pysdif._pysdif.SdifFile.get_NVTs");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1255
 *         return valuetables_to_dicts (self.this.NameValues)
 * 
 *     def get_stream_IDs(self):             # <<<<<<<<<<<<<<
 *         return streamidtable_to_list(self.this.StreamIDsTable)
 * 
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_stream_IDs(PyObject *__pyx_v_self, PyObject *unused); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_8SdifFile_get_stream_IDs[] = "SdifFile.get_stream_IDs(self)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_stream_IDs(PyObject *__pyx_v_self, PyObject *unused) {
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  __Pyx_SetupRefcountContext("get_stream_IDs");

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1256
 * 
 *     def get_stream_IDs(self):
 *         return streamidtable_to_list(self.this.StreamIDsTable)             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_f_6pysdif_7_pysdif_streamidtable_to_list(((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)__pyx_v_self)->this->StreamIDsTable); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1256; __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("pysdif._pysdif.SdifFile.get_stream_IDs");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1261
 * # -----------------------------------------------------------------------------------------------
 * 
 * def test_bench_read_sdif1(filename):             # <<<<<<<<<<<<<<
 *     sdif_file = SdifFile(filename)
 *     cdef int n
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif1(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif1[] = "test_bench_read_sdif1(filename)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif1(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_sdif_file;
  int __pyx_v_n;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  long __pyx_t_4;
  int __pyx_t_5;
  __Pyx_SetupRefcountContext("test_bench_read_sdif1");
  __pyx_self = __pyx_self;
  __pyx_v_sdif_file = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1262
 * 
 * def test_bench_read_sdif1(filename):
 *     sdif_file = SdifFile(filename)             # <<<<<<<<<<<<<<
 *     cdef int n
 *     while sdif_file.read_frame_header():
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_SdifFile)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1262; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __pyx_v_sdif_file = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1264
 *     sdif_file = SdifFile(filename)
 *     cdef int n
 *     while sdif_file.read_frame_header():             # <<<<<<<<<<<<<<
 *         for n in range(sdif_file.matrices_in_frame):
 *             sdif_file.get_matrix_data()
 */
  while (1) {
    __pyx_t_2 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_read_frame_header); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __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 = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_3 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely(__pyx_t_3 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1264; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (!__pyx_t_3) break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1265
 *     cdef int n
 *     while sdif_file.read_frame_header():
 *         for n in range(sdif_file.matrices_in_frame):             # <<<<<<<<<<<<<<
 *             sdif_file.get_matrix_data()
 *     sdif_file.close()
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_matrices_in_frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = __Pyx_PyInt_AsLong(__pyx_t_1); if (unlikely((__pyx_t_4 == (long)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1265; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_n = __pyx_t_5;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1266
 *     while sdif_file.read_frame_header():
 *         for n in range(sdif_file.matrices_in_frame):
 *             sdif_file.get_matrix_data()             # <<<<<<<<<<<<<<
 *     sdif_file.close()
 * 
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_get_matrix_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_2 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1266; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1267
 *         for n in range(sdif_file.matrices_in_frame):
 *             sdif_file.get_matrix_data()
 *     sdif_file.close()             # <<<<<<<<<<<<<<
 * 
 * def test_bench_read_sdif2(filename):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __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 = 1267; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__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_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("pysdif._pysdif.test_bench_read_sdif1");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1269
 *     sdif_file.close()
 * 
 * def test_bench_read_sdif2(filename):             # <<<<<<<<<<<<<<
 *     # this is the slowest version
 *     sdif_file = SdifFile(filename)
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif2(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif2[] = "test_bench_read_sdif2(filename)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif2(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_sdif_file;
  PyObject *__pyx_v_frame;
  PyObject *__pyx_v_matrix;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_SetupRefcountContext("test_bench_read_sdif2");
  __pyx_self = __pyx_self;
  __pyx_v_sdif_file = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frame = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_matrix = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1271
 * def test_bench_read_sdif2(filename):
 *     # this is the slowest version
 *     sdif_file = SdifFile(filename)             # <<<<<<<<<<<<<<
 *     for frame in sdif_file:
 *         for matrix in frame:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_SdifFile)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1271; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __pyx_v_sdif_file = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1272
 *     # this is the slowest version
 *     sdif_file = SdifFile(filename)
 *     for frame in sdif_file:             # <<<<<<<<<<<<<<
 *         for matrix in frame:
 *             matrix.get_data()
 */
  if (PyList_CheckExact(__pyx_v_sdif_file) || PyTuple_CheckExact(__pyx_v_sdif_file)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_sdif_file; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_sdif_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_v_frame);
    __pyx_v_frame = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1273
 *     sdif_file = SdifFile(filename)
 *     for frame in sdif_file:
 *         for matrix in frame:             # <<<<<<<<<<<<<<
 *             matrix.get_data()
 *     sdif_file.close()
 */
    if (PyList_CheckExact(__pyx_v_frame) || PyTuple_CheckExact(__pyx_v_frame)) {
      __pyx_t_4 = 0; __pyx_t_1 = __pyx_v_frame; __Pyx_INCREF(__pyx_t_1);
    } else {
      __pyx_t_4 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_frame); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
    }
    for (;;) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
      } else if (likely(PyTuple_CheckExact(__pyx_t_1))) {
        if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_4); __Pyx_INCREF(__pyx_t_5); __pyx_t_4++;
      } else {
        __pyx_t_5 = PyIter_Next(__pyx_t_1);
        if (!__pyx_t_5) {
          if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1273; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
          break;
        }
        __Pyx_GOTREF(__pyx_t_5);
      }
      __Pyx_DECREF(__pyx_v_matrix);
      __pyx_v_matrix = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1274
 *     for frame in sdif_file:
 *         for matrix in frame:
 *             matrix.get_data()             # <<<<<<<<<<<<<<
 *     sdif_file.close()
 * 
 */
      __pyx_t_5 = PyObject_GetAttr(__pyx_v_matrix, __pyx_kp_get_data); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyObject_Call(__pyx_t_5, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1274; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1275
 *         for matrix in frame:
 *             matrix.get_data()
 *     sdif_file.close()             # <<<<<<<<<<<<<<
 * 
 * def test_bench_read_sdif6(filename):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __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 = 1275; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__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_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.test_bench_read_sdif2");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __Pyx_DECREF(__pyx_v_frame);
  __Pyx_DECREF(__pyx_v_matrix);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1277
 *     sdif_file.close()
 * 
 * def test_bench_read_sdif6(filename):             # <<<<<<<<<<<<<<
 *     """
 *     this is pure c, has no overhead at all and thus is a good
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif6(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif6[] = "test_bench_read_sdif6(filename)\n\n    this is pure c, has no overhead at all and thus is a good\n    reference to measure the other implementations.\n    at the moment, the best we get at the python \n    interpreter is 1.227 (22,7%) slower than pure c\n    ";
static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif6(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  int __pyx_v_n;
  size_t __pyx_v_char_read;
  SdifFileT *__pyx_v_f;
  int __pyx_v_eof;
  PyObject *__pyx_v_data;
  PyObject *__pyx_r = NULL;
  const char* __pyx_t_1;
  int __pyx_t_2;
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("test_bench_read_sdif6");
  __pyx_self = __pyx_self;
  __pyx_v_data = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1286
 *     cdef int n
 *     cdef size_t char_read
 *     cdef SdifFileT *f = SdifFOpen(filename, eReadFile)             # <<<<<<<<<<<<<<
 *     SdifFReadGeneralHeader(f)
 *     SdifFReadAllASCIIChunks(f)
 */
  __pyx_t_1 = __Pyx_PyBytes_AsString(__pyx_v_filename); if (unlikely((__pyx_t_1 == (const char*)NULL) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1286; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_v_f = SdifFOpen(__pyx_t_1, eReadFile);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1287
 *     cdef size_t char_read
 *     cdef SdifFileT *f = SdifFOpen(filename, eReadFile)
 *     SdifFReadGeneralHeader(f)             # <<<<<<<<<<<<<<
 *     SdifFReadAllASCIIChunks(f)
 *     cdef int eof = (f.CurrSignature == eEof)
 */
  SdifFReadGeneralHeader(__pyx_v_f);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1288
 *     cdef SdifFileT *f = SdifFOpen(filename, eReadFile)
 *     SdifFReadGeneralHeader(f)
 *     SdifFReadAllASCIIChunks(f)             # <<<<<<<<<<<<<<
 *     cdef int eof = (f.CurrSignature == eEof)
 *     while eof == 0:
 */
  SdifFReadAllASCIIChunks(__pyx_v_f);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1289
 *     SdifFReadGeneralHeader(f)
 *     SdifFReadAllASCIIChunks(f)
 *     cdef int eof = (f.CurrSignature == eEof)             # <<<<<<<<<<<<<<
 *     while eof == 0:
 *         SdifFReadFrameHeader(f)
 */
  __pyx_v_eof = (__pyx_v_f->CurrSignature == eEof);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1290
 *     SdifFReadAllASCIIChunks(f)
 *     cdef int eof = (f.CurrSignature == eEof)
 *     while eof == 0:             # <<<<<<<<<<<<<<
 *         SdifFReadFrameHeader(f)
 *         for n in range(f.CurrFramH.NbMatrix):
 */
  while (1) {
    __pyx_t_2 = (__pyx_v_eof == 0);
    if (!__pyx_t_2) break;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1291
 *     cdef int eof = (f.CurrSignature == eEof)
 *     while eof == 0:
 *         SdifFReadFrameHeader(f)             # <<<<<<<<<<<<<<
 *         for n in range(f.CurrFramH.NbMatrix):
 *             SdifFReadMatrixHeader(f)
 */
    SdifFReadFrameHeader(__pyx_v_f);

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1292
 *     while eof == 0:
 *         SdifFReadFrameHeader(f)
 *         for n in range(f.CurrFramH.NbMatrix):             # <<<<<<<<<<<<<<
 *             SdifFReadMatrixHeader(f)
 *             SdifFReadMatrixData(f)
 */
    for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_v_f->CurrFramH->NbMatrix; __pyx_t_3+=1) {
      __pyx_v_n = __pyx_t_3;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1293
 *         SdifFReadFrameHeader(f)
 *         for n in range(f.CurrFramH.NbMatrix):
 *             SdifFReadMatrixHeader(f)             # <<<<<<<<<<<<<<
 *             SdifFReadMatrixData(f)
 *             # it is not totally pure c in the sense that at this
 */
      SdifFReadMatrixHeader(__pyx_v_f);

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1294
 *         for n in range(f.CurrFramH.NbMatrix):
 *             SdifFReadMatrixHeader(f)
 *             SdifFReadMatrixData(f)             # <<<<<<<<<<<<<<
 *             # it is not totally pure c in the sense that at this
 *             # point we have a numpy array which we could use in
 */
      SdifFReadMatrixData(__pyx_v_f);

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1298
 *             # point we have a numpy array which we could use in
 *             # python.
 *             data = _array_from_matrix_data_no_copy(f.CurrMtrxData)             # <<<<<<<<<<<<<<
 *         eof = SdifFGetSignature(f, &char_read) == eEof
 *     SdifFClose(f)
 */
      __pyx_t_4 = ((PyObject *)__pyx_f_6pysdif_7_pysdif__array_from_matrix_data_no_copy(__pyx_v_f->CurrMtrxData)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1298; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_v_data);
      __pyx_v_data = __pyx_t_4;
      __pyx_t_4 = 0;
    }

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1299
 *             # python.
 *             data = _array_from_matrix_data_no_copy(f.CurrMtrxData)
 *         eof = SdifFGetSignature(f, &char_read) == eEof             # <<<<<<<<<<<<<<
 *     SdifFClose(f)
 * 
 */
    __pyx_v_eof = (SdifFGetSignature(__pyx_v_f, (&__pyx_v_char_read)) == eEof);
  }

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1300
 *             data = _array_from_matrix_data_no_copy(f.CurrMtrxData)
 *         eof = SdifFGetSignature(f, &char_read) == eEof
 *     SdifFClose(f)             # <<<<<<<<<<<<<<
 * 
 * def test_bench_read_sdif3(filename):
 */
  SdifFClose(__pyx_v_f);

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.test_bench_read_sdif6");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_data);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1302
 *     SdifFClose(f)
 * 
 * def test_bench_read_sdif3(filename):             # <<<<<<<<<<<<<<
 *     # fastest, 4 is almost the same, 2 is twice as slow...,
 *     # it should be different for frames which have
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif3(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif3[] = "test_bench_read_sdif3(filename)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif3(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_sdif_file;
  int __pyx_v_n;
  PyObject *__pyx_v_frame;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_SetupRefcountContext("test_bench_read_sdif3");
  __pyx_self = __pyx_self;
  __pyx_v_sdif_file = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frame = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1306
 *     # it should be different for frames which have
 *     # many matrices but that is really the exception.
 *     sdif_file = SdifFile(filename)             # <<<<<<<<<<<<<<
 *     cdef int n
 *     for frame in sdif_file:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_SdifFile)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1306; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __pyx_v_sdif_file = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1308
 *     sdif_file = SdifFile(filename)
 *     cdef int n
 *     for frame in sdif_file:             # <<<<<<<<<<<<<<
 *         for n in range(len(frame)):
 *             sdif_file.get_next_matrix().get_data()
 */
  if (PyList_CheckExact(__pyx_v_sdif_file) || PyTuple_CheckExact(__pyx_v_sdif_file)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_sdif_file; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_sdif_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_v_frame);
    __pyx_v_frame = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1309
 *     cdef int n
 *     for frame in sdif_file:
 *         for n in range(len(frame)):             # <<<<<<<<<<<<<<
 *             sdif_file.get_next_matrix().get_data()
 *     sdif_file.close()
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_frame); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1309; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_n = __pyx_t_5;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1310
 *     for frame in sdif_file:
 *         for n in range(len(frame)):
 *             sdif_file.get_next_matrix().get_data()             # <<<<<<<<<<<<<<
 *     sdif_file.close()
 * 
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_get_next_matrix); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_kp_get_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1310; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1311
 *         for n in range(len(frame)):
 *             sdif_file.get_next_matrix().get_data()
 *     sdif_file.close()             # <<<<<<<<<<<<<<
 * 
 * def test_bench_read_sdif4(filename):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1311; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.test_bench_read_sdif3");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __Pyx_DECREF(__pyx_v_frame);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1313
 *     sdif_file.close()
 * 
 * def test_bench_read_sdif4(filename):             # <<<<<<<<<<<<<<
 *     sdif_file = SdifFile(filename)
 *     cdef int n
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif4(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif4[] = "test_bench_read_sdif4(filename)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif4(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_sdif_file;
  int __pyx_v_n;
  PyObject *__pyx_v_frame;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  __Pyx_SetupRefcountContext("test_bench_read_sdif4");
  __pyx_self = __pyx_self;
  __pyx_v_sdif_file = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frame = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1314
 * 
 * def test_bench_read_sdif4(filename):
 *     sdif_file = SdifFile(filename)             # <<<<<<<<<<<<<<
 *     cdef int n
 *     for frame in sdif_file:
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_SdifFile)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1314; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __pyx_v_sdif_file = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1316
 *     sdif_file = SdifFile(filename)
 *     cdef int n
 *     for frame in sdif_file:             # <<<<<<<<<<<<<<
 *         for n in range(len(frame)):
 *             frame.next().get_data()
 */
  if (PyList_CheckExact(__pyx_v_sdif_file) || PyTuple_CheckExact(__pyx_v_sdif_file)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_sdif_file; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_sdif_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1316; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_v_frame);
    __pyx_v_frame = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1317
 *     cdef int n
 *     for frame in sdif_file:
 *         for n in range(len(frame)):             # <<<<<<<<<<<<<<
 *             frame.next().get_data()
 *     sdif_file.close()
 */
    __pyx_t_4 = PyObject_Length(__pyx_v_frame); if (unlikely(__pyx_t_4 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1317; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_v_n = __pyx_t_5;

      /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1318
 *     for frame in sdif_file:
 *         for n in range(len(frame)):
 *             frame.next().get_data()             # <<<<<<<<<<<<<<
 *     sdif_file.close()
 * 
 */
      __pyx_t_1 = PyObject_GetAttr(__pyx_v_frame, __pyx_kp_next); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __pyx_t_1 = PyObject_GetAttr(__pyx_t_6, __pyx_kp_get_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1318; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1319
 *         for n in range(len(frame)):
 *             frame.next().get_data()
 *     sdif_file.close()             # <<<<<<<<<<<<<<
 * 
 * def test_bench_read_sdif5(filename):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_6 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1319; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("pysdif._pysdif.test_bench_read_sdif4");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __Pyx_DECREF(__pyx_v_frame);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1321
 *     sdif_file.close()
 * 
 * def test_bench_read_sdif5(filename):             # <<<<<<<<<<<<<<
 *     # this is the fastest for common case where a frame has only one matrix
 *     # and you do not need to check the signature of each matrix
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif5(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif5[] = "test_bench_read_sdif5(filename)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif5(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_sdif_file;
  PyObject *__pyx_v_frame;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  __Pyx_SetupRefcountContext("test_bench_read_sdif5");
  __pyx_self = __pyx_self;
  __pyx_v_sdif_file = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frame = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1325
 *     # and you do not need to check the signature of each matrix
 *     # (since the matrix-header and the data are read in one function-call)
 *     sdif_file = SdifFile(filename)             # <<<<<<<<<<<<<<
 *     for frame in sdif_file:
 *         frame.get_matrix_data() # assume that there is only one matrix per frame
 */
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_SdifFile)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __pyx_v_sdif_file = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1326
 *     # (since the matrix-header and the data are read in one function-call)
 *     sdif_file = SdifFile(filename)
 *     for frame in sdif_file:             # <<<<<<<<<<<<<<
 *         frame.get_matrix_data() # assume that there is only one matrix per frame
 *     sdif_file.close()
 */
  if (PyList_CheckExact(__pyx_v_sdif_file) || PyTuple_CheckExact(__pyx_v_sdif_file)) {
    __pyx_t_3 = 0; __pyx_t_2 = __pyx_v_sdif_file; __Pyx_INCREF(__pyx_t_2);
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_sdif_file); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
  }
  for (;;) {
    if (likely(PyList_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else if (likely(PyTuple_CheckExact(__pyx_t_2))) {
      if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
      __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_1); __pyx_t_3++;
    } else {
      __pyx_t_1 = PyIter_Next(__pyx_t_2);
      if (!__pyx_t_1) {
        if (unlikely(PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        break;
      }
      __Pyx_GOTREF(__pyx_t_1);
    }
    __Pyx_DECREF(__pyx_v_frame);
    __pyx_v_frame = __pyx_t_1;
    __pyx_t_1 = 0;

    /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1327
 *     sdif_file = SdifFile(filename)
 *     for frame in sdif_file:
 *         frame.get_matrix_data() # assume that there is only one matrix per frame             # <<<<<<<<<<<<<<
 *     sdif_file.close()
 * 
 */
    __pyx_t_1 = PyObject_GetAttr(__pyx_v_frame, __pyx_kp_get_matrix_data); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_4 = PyObject_Call(__pyx_t_1, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1328
 *     for frame in sdif_file:
 *         frame.get_matrix_data() # assume that there is only one matrix per frame
 *     sdif_file.close()             # <<<<<<<<<<<<<<
 * 
 * def test_write(filename):
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_sdif_file, __pyx_kp_close); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1328; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("pysdif._pysdif.test_bench_read_sdif5");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_sdif_file);
  __Pyx_DECREF(__pyx_v_frame);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1330
 *     sdif_file.close()
 * 
 * def test_write(filename):             # <<<<<<<<<<<<<<
 *     s = SdifFile(filename, "w")
 *     s.add_matrix_type("1MTX", "ColumnaA")
 */

static PyObject *__pyx_pf_6pysdif_7_pysdif_test_write(PyObject *__pyx_self, PyObject *__pyx_v_filename); /*proto*/
static char __pyx_doc_6pysdif_7_pysdif_test_write[] = "test_write(filename)";
static PyObject *__pyx_pf_6pysdif_7_pysdif_test_write(PyObject *__pyx_self, PyObject *__pyx_v_filename) {
  PyObject *__pyx_v_s;
  PyObject *__pyx_v_m;
  PyObject *__pyx_v_frame;
  PyObject *__pyx_r = NULL;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  __Pyx_SetupRefcountContext("test_write");
  __pyx_self = __pyx_self;
  __pyx_v_s = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_m = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_frame = Py_None; __Pyx_INCREF(Py_None);

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1331
 * 
 * def test_write(filename):
 *     s = SdifFile(filename, "w")             # <<<<<<<<<<<<<<
 *     s.add_matrix_type("1MTX", "ColumnaA")
 *     s.add_frame_type("1ABC", "1MTX pupu")
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_v_filename);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_filename);
  __Pyx_GIVEREF(__pyx_v_filename);
  __Pyx_INCREF(__pyx_kp_86);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_86);
  __Pyx_GIVEREF(__pyx_kp_86);
  __pyx_t_2 = PyObject_Call(((PyObject *)((PyObject*)__pyx_ptype_6pysdif_7_pysdif_SdifFile)), ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1331; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_v_s);
  __pyx_v_s = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1332
 * def test_write(filename):
 *     s = SdifFile(filename, "w")
 *     s.add_matrix_type("1MTX", "ColumnaA")             # <<<<<<<<<<<<<<
 *     s.add_frame_type("1ABC", "1MTX pupu")
 *     s.add_NVT({"meta":"data"})
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_s, __pyx_kp_add_matrix_type); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_87);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_87);
  __Pyx_GIVEREF(__pyx_kp_87);
  __Pyx_INCREF(__pyx_kp_88);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_88);
  __Pyx_GIVEREF(__pyx_kp_88);
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1332; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1333
 *     s = SdifFile(filename, "w")
 *     s.add_matrix_type("1MTX", "ColumnaA")
 *     s.add_frame_type("1ABC", "1MTX pupu")             # <<<<<<<<<<<<<<
 *     s.add_NVT({"meta":"data"})
 *     m = numpy.array([0.0, 0.1, 0.3, 0.7, 0.4], dtype=float)
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_s, __pyx_kp_add_frame_type); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_89);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_89);
  __Pyx_GIVEREF(__pyx_kp_89);
  __Pyx_INCREF(__pyx_kp_90);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_90);
  __Pyx_GIVEREF(__pyx_kp_90);
  __pyx_t_2 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1333; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1334
 *     s.add_matrix_type("1MTX", "ColumnaA")
 *     s.add_frame_type("1ABC", "1MTX pupu")
 *     s.add_NVT({"meta":"data"})             # <<<<<<<<<<<<<<
 *     m = numpy.array([0.0, 0.1, 0.3, 0.7, 0.4], dtype=float)
 *     m.resize((5, 1))
 */
  __pyx_t_2 = PyObject_GetAttr(__pyx_v_s, __pyx_kp_add_NVT); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));
  if (PyDict_SetItem(__pyx_1, __pyx_kp_91, __pyx_kp_92) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_1));
  __pyx_1 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_2, ((PyObject *)__pyx_t_1), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1334; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1335
 *     s.add_frame_type("1ABC", "1MTX pupu")
 *     s.add_NVT({"meta":"data"})
 *     m = numpy.array([0.0, 0.1, 0.3, 0.7, 0.4], dtype=float)             # <<<<<<<<<<<<<<
 *     m.resize((5, 1))
 *     frame = s.new_frame("1ABC", 0.0)
 */
  __pyx_1 = __Pyx_GetName(__pyx_m, __pyx_kp_numpy); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  __pyx_t_3 = PyObject_GetAttr(__pyx_1, __pyx_kp_array); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;
  __pyx_t_1 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(0.10000000000000001); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(0.29999999999999999); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(0.69999999999999996); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyFloat_FromDouble(0.40000000000000002); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyList_New(5); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  PyList_SET_ITEM(__pyx_t_7, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_1);
  PyList_SET_ITEM(__pyx_t_7, 1, __pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_2);
  PyList_SET_ITEM(__pyx_t_7, 2, __pyx_t_4);
  __Pyx_GIVEREF(__pyx_t_4);
  PyList_SET_ITEM(__pyx_t_7, 3, __pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_5);
  PyList_SET_ITEM(__pyx_t_7, 4, __pyx_t_6);
  __Pyx_GIVEREF(__pyx_t_6);
  __pyx_t_1 = 0;
  __pyx_t_2 = 0;
  __pyx_t_4 = 0;
  __pyx_t_5 = 0;
  __pyx_t_6 = 0;
  __pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  PyTuple_SET_ITEM(__pyx_t_6, 0, ((PyObject *)__pyx_t_7));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_7));
  __pyx_t_7 = 0;
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));
  if (PyDict_SetItem(__pyx_1, __pyx_kp_dtype, ((PyObject *)((PyObject*)&PyFloat_Type))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_t_7 = PyEval_CallObjectWithKeywords(__pyx_t_3, ((PyObject *)__pyx_t_6), ((PyObject *)__pyx_1)); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1335; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_6)); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;
  __Pyx_DECREF(__pyx_v_m);
  __pyx_v_m = __pyx_t_7;
  __pyx_t_7 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1336
 *     s.add_NVT({"meta":"data"})
 *     m = numpy.array([0.0, 0.1, 0.3, 0.7, 0.4], dtype=float)
 *     m.resize((5, 1))             # <<<<<<<<<<<<<<
 *     frame = s.new_frame("1ABC", 0.0)
 *     frame.add_matrix("1MTX", m)
 */
  __pyx_t_7 = PyObject_GetAttr(__pyx_v_m, __pyx_kp_resize); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_6));
  __Pyx_INCREF(__pyx_int_5);
  PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_int_5);
  __Pyx_GIVEREF(__pyx_int_5);
  __Pyx_INCREF(__pyx_int_1);
  PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_int_1);
  __Pyx_GIVEREF(__pyx_int_1);
  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_3));
  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_t_6));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_6));
  __pyx_t_6 = 0;
  __pyx_t_6 = PyObject_Call(__pyx_t_7, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1336; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1337
 *     m = numpy.array([0.0, 0.1, 0.3, 0.7, 0.4], dtype=float)
 *     m.resize((5, 1))
 *     frame = s.new_frame("1ABC", 0.0)             # <<<<<<<<<<<<<<
 *     frame.add_matrix("1MTX", m)
 *     frame.write()
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_s, __pyx_kp_new_frame); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_3 = PyFloat_FromDouble(0.0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_INCREF(__pyx_kp_93);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_93);
  __Pyx_GIVEREF(__pyx_kp_93);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_t_3);
  __Pyx_GIVEREF(__pyx_t_3);
  __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1337; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_v_frame);
  __pyx_v_frame = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1338
 *     m.resize((5, 1))
 *     frame = s.new_frame("1ABC", 0.0)
 *     frame.add_matrix("1MTX", m)             # <<<<<<<<<<<<<<
 *     frame.write()
 */
  __pyx_t_3 = PyObject_GetAttr(__pyx_v_frame, __pyx_kp_add_matrix); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_7));
  __Pyx_INCREF(__pyx_kp_94);
  PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_kp_94);
  __Pyx_GIVEREF(__pyx_kp_94);
  __Pyx_INCREF(__pyx_v_m);
  PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_m);
  __Pyx_GIVEREF(__pyx_v_m);
  __pyx_t_6 = PyObject_Call(__pyx_t_3, ((PyObject *)__pyx_t_7), NULL); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1338; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(((PyObject *)__pyx_t_7)); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":1339
 *     frame = s.new_frame("1ABC", 0.0)
 *     frame.add_matrix("1MTX", m)
 *     frame.write()             # <<<<<<<<<<<<<<
 */
  __pyx_t_6 = PyObject_GetAttr(__pyx_v_frame, __pyx_kp_write); if (unlikely(!__pyx_t_6)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = PyObject_Call(__pyx_t_6, ((PyObject *)__pyx_empty_tuple), NULL); if (unlikely(!__pyx_t_7)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1339; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("pysdif._pysdif.test_write");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF(__pyx_v_s);
  __Pyx_DECREF(__pyx_v_m);
  __Pyx_DECREF(__pyx_v_frame);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":152
 *         # experimental exception made for __getbuffer__ and __releasebuffer__
 *         # -- the details of this may change.
 *         def __getbuffer__(ndarray self, Py_buffer* info, int flags):             # <<<<<<<<<<<<<<
 *             # This implementation of getbuffer is geared towards Cython
 *             # requirements, and does not yet fullfill the PEP.
 */

static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
  int __pyx_v_copy_shape;
  int __pyx_v_i;
  int __pyx_v_ndim;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  int __pyx_v_t;
  char *__pyx_v_f;
  PyArray_Descr *__pyx_v_descr = 0;
  int __pyx_v_offset;
  int __pyx_v_hasfields;
  int __pyx_r;
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  char *__pyx_t_7;
  __Pyx_SetupRefcountContext("__getbuffer__");
  if (__pyx_v_info == NULL) return 0;
  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_GIVEREF(__pyx_v_info->obj);

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":158
 *             # of flags
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 */
  __pyx_v_endian_detector = 1;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":159
 *             cdef int copy_shape, i, ndim
 *             cdef int endian_detector = 1
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 * 
 *             ndim = PyArray_NDIM(self)
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":161
 *             cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 * 
 *             ndim = PyArray_NDIM(self)             # <<<<<<<<<<<<<<
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_v_ndim = PyArray_NDIM(((PyArrayObject *)__pyx_v_self));

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":163
 *             ndim = PyArray_NDIM(self)
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 copy_shape = 1
 *             else:
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":164
 * 
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 copy_shape = 1             # <<<<<<<<<<<<<<
 *             else:
 *                 copy_shape = 0
 */
    __pyx_v_copy_shape = 1;
    goto __pyx_L5;
  }
  /*else*/ {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":166
 *                 copy_shape = 1
 *             else:
 *                 copy_shape = 0             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 */
    __pyx_v_copy_shape = 0;
  }
  __pyx_L5:;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":168
 *                 copy_shape = 0
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not C contiguous")
 */
  if (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS)) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":169
 * 
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError("ndarray is not C contiguous")
 * 
 */
    __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_C_CONTIGUOUS));
  } else {
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS);
  }
  if (__pyx_t_1) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":170
 *             if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not C contiguous")             # <<<<<<<<<<<<<<
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_2));
    __Pyx_INCREF(__pyx_kp_1);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_1);
    __Pyx_GIVEREF(__pyx_kp_1);
    __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
    __Pyx_Raise(__pyx_t_3, 0, 0);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 170; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L6;
  }
  __pyx_L6:;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":172
 *                 raise ValueError("ndarray is not C contiguous")
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)             # <<<<<<<<<<<<<<
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not Fortran contiguous")
 */
  if (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS)) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":173
 * 
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):             # <<<<<<<<<<<<<<
 *                 raise ValueError("ndarray is not Fortran contiguous")
 * 
 */
    __pyx_t_1 = (!PyArray_CHKFLAGS(((PyArrayObject *)__pyx_v_self), NPY_F_CONTIGUOUS));
  } else {
    __pyx_t_1 = ((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS);
  }
  if (__pyx_t_1) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":174
 *             if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
 *                 and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
 *                 raise ValueError("ndarray is not Fortran contiguous")             # <<<<<<<<<<<<<<
 * 
 *             info.buf = PyArray_DATA(self)
 */
    __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(((PyObject *)__pyx_t_3));
    __Pyx_INCREF(__pyx_kp_2);
    PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_kp_2);
    __Pyx_GIVEREF(__pyx_kp_2);
    __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    {__pyx_filename = __pyx_f[1]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    goto __pyx_L7;
  }
  __pyx_L7:;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":176
 *                 raise ValueError("ndarray is not Fortran contiguous")
 * 
 *             info.buf = PyArray_DATA(self)             # <<<<<<<<<<<<<<
 *             info.ndim = ndim
 *             if copy_shape:
 */
  __pyx_v_info->buf = PyArray_DATA(((PyArrayObject *)__pyx_v_self));

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":177
 * 
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim             # <<<<<<<<<<<<<<
 *             if copy_shape:
 *                 # Allocate new buffer for strides and shape info. This is allocated
 */
  __pyx_v_info->ndim = __pyx_v_ndim;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":178
 *             info.buf = PyArray_DATA(self)
 *             info.ndim = ndim
 *             if copy_shape:             # <<<<<<<<<<<<<<
 *                 # Allocate new buffer for strides and shape info. This is allocated
 *                 # as one block, strides first.
 */
  __pyx_t_4 = __pyx_v_copy_shape;
  if (__pyx_t_4) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":181
 *                 # Allocate new buffer for strides and shape info. This is allocated
 *                 # as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)             # <<<<<<<<<<<<<<
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 */
    __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * __pyx_v_ndim) * 2)));

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":182
 *                 # as one block, strides first.
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
 *                 info.shape = info.strides + ndim             # <<<<<<<<<<<<<<
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 */
    __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":183
 *                 info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2)
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):             # <<<<<<<<<<<<<<
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 */
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_v_ndim; __pyx_t_4+=1) {
      __pyx_v_i = __pyx_t_4;

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":184
 *                 info.shape = info.strides + ndim
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]             # <<<<<<<<<<<<<<
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 */
      (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":185
 *                 for i in range(ndim):
 *                     info.strides[i] = PyArray_STRIDES(self)[i]
 *                     info.shape[i] = PyArray_DIMS(self)[i]             # <<<<<<<<<<<<<<
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 */
      (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(((PyArrayObject *)__pyx_v_self))[__pyx_v_i]);
    }
    goto __pyx_L8;
  }
  /*else*/ {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":187
 *                     info.shape[i] = PyArray_DIMS(self)[i]
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)             # <<<<<<<<<<<<<<
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 */
    __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(((PyArrayObject *)__pyx_v_self)));

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":188
 *             else:
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)             # <<<<<<<<<<<<<<
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 */
    __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(((PyArrayObject *)__pyx_v_self)));
  }
  __pyx_L8:;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":189
 *                 info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL             # <<<<<<<<<<<<<<
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 */
  __pyx_v_info->suboffsets = NULL;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":190
 *                 info.shape = <Py_ssize_t*>PyArray_DIMS(self)
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)             # <<<<<<<<<<<<<<
 *             info.readonly = not PyArray_ISWRITEABLE(self)
 * 
 */
  __pyx_v_info->itemsize = PyArray_ITEMSIZE(((PyArrayObject *)__pyx_v_self));

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":191
 *             info.suboffsets = NULL
 *             info.itemsize = PyArray_ITEMSIZE(self)
 *             info.readonly = not PyArray_ISWRITEABLE(self)             # <<<<<<<<<<<<<<
 * 
 *             cdef int t
 */
  __pyx_v_info->readonly = (!PyArray_ISWRITEABLE(((PyArrayObject *)__pyx_v_self)));

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":194
 * 
 *             cdef int t
 *             cdef char* f = NULL             # <<<<<<<<<<<<<<
 *             cdef dtype descr = self.descr
 *             cdef list stack
 */
  __pyx_v_f = NULL;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":195
 *             cdef int t
 *             cdef char* f = NULL
 *             cdef dtype descr = self.descr             # <<<<<<<<<<<<<<
 *             cdef list stack
 *             cdef int offset
 */
  __Pyx_INCREF(((PyObject *)((PyArrayObject *)__pyx_v_self)->descr));
  __pyx_v_descr = ((PyArrayObject *)__pyx_v_self)->descr;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":199
 *             cdef int offset
 * 
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields and not copy_shape:
 */
  __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":201
 *             cdef bint hasfields = PyDataType_HASFIELDS(descr)
 * 
 *             if not hasfields and not copy_shape:             # <<<<<<<<<<<<<<
 *                 # do not call releasebuffer
 *                 info.obj = None
 */
  if ((!__pyx_v_hasfields)) {
    __pyx_t_1 = (!__pyx_v_copy_shape);
  } else {
    __pyx_t_1 = (!__pyx_v_hasfields);
  }
  if (__pyx_t_1) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":203
 *             if not hasfields and not copy_shape:
 *                 # do not call releasebuffer
 *                 info.obj = None             # <<<<<<<<<<<<<<
 *             else:
 *                 # need to call releasebuffer
 */
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = Py_None;
    goto __pyx_L11;
  }
  /*else*/ {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":206
 *             else:
 *                 # need to call releasebuffer
 *                 info.obj = self             # <<<<<<<<<<<<<<
 * 
 *             if not hasfields:
 */
    __Pyx_INCREF(__pyx_v_self);
    __Pyx_GIVEREF(__pyx_v_self);
    __Pyx_GOTREF(__pyx_v_info->obj);
    __Pyx_DECREF(__pyx_v_info->obj);
    __pyx_v_info->obj = __pyx_v_self;
  }
  __pyx_L11:;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":208
 *                 info.obj = self
 * 
 *             if not hasfields:             # <<<<<<<<<<<<<<
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 */
  __pyx_t_1 = (!__pyx_v_hasfields);
  if (__pyx_t_1) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":209
 * 
 *             if not hasfields:
 *                 t = descr.type_num             # <<<<<<<<<<<<<<
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 */
    __pyx_v_t = __pyx_v_descr->type_num;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":210
 *             if not hasfields:
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError("Non-native byte order not supported")
 */
    if ((__pyx_v_descr->byteorder == '>')) {
      __pyx_t_1 = __pyx_v_little_endian;
    } else {
      __pyx_t_1 = (__pyx_v_descr->byteorder == '>');
    }
    if (!__pyx_t_1) {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":211
 *                 t = descr.type_num
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *                     raise ValueError("Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 */
      if ((__pyx_v_descr->byteorder == '<')) {
        __pyx_t_5 = (!__pyx_v_little_endian);
      } else {
        __pyx_t_5 = (__pyx_v_descr->byteorder == '<');
      }
      __pyx_t_6 = __pyx_t_5;
    } else {
      __pyx_t_6 = __pyx_t_1;
    }
    if (__pyx_t_6) {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":212
 *                 if ((descr.byteorder == '>' and little_endian) or
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError("Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 */
      __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_2));
      __Pyx_INCREF(__pyx_kp_5);
      PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_5);
      __Pyx_GIVEREF(__pyx_kp_5);
      __pyx_t_3 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_2), NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;
      __Pyx_Raise(__pyx_t_3, 0, 0);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 212; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L13;
    }
    __pyx_L13:;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":213
 *                     (descr.byteorder == '<' and not little_endian)):
 *                     raise ValueError("Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_BYTE);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_6;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":214
 *                     raise ValueError("Non-native byte order not supported")
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_UBYTE);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_7;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":215
 *                 if   t == NPY_BYTE:        f = "b"
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_SHORT);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_8;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":216
 *                 elif t == NPY_UBYTE:       f = "B"
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_USHORT);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_9;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":217
 *                 elif t == NPY_SHORT:       f = "h"
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_INT);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_10;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":218
 *                 elif t == NPY_USHORT:      f = "H"
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_UINT);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_11;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":219
 *                 elif t == NPY_INT:         f = "i"
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_LONG);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_12;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":220
 *                 elif t == NPY_UINT:        f = "I"
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_ULONG);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_13;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":221
 *                 elif t == NPY_LONG:        f = "l"
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_LONGLONG);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_14;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":222
 *                 elif t == NPY_ULONG:       f = "L"
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_ULONGLONG);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_15;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":223
 *                 elif t == NPY_LONGLONG:    f = "q"
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_FLOAT);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_16;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":224
 *                 elif t == NPY_ULONGLONG:   f = "Q"
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_DOUBLE);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_17;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":225
 *                 elif t == NPY_FLOAT:       f = "f"
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_LONGDOUBLE);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_18;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":226
 *                 elif t == NPY_DOUBLE:      f = "d"
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_CFLOAT);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_19;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":227
 *                 elif t == NPY_LONGDOUBLE:  f = "g"
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"
 */
    __pyx_t_6 = (__pyx_v_t == NPY_CDOUBLE);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_20;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":228
 *                 elif t == NPY_CFLOAT:      f = "Zf"
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"             # <<<<<<<<<<<<<<
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 */
    __pyx_t_6 = (__pyx_v_t == NPY_CLONGDOUBLE);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_21;
      goto __pyx_L14;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":229
 *                 elif t == NPY_CDOUBLE:     f = "Zd"
 *                 elif t == NPY_CLONGDOUBLE: f = "Zg"
 *                 elif t == NPY_OBJECT:      f = "O"             # <<<<<<<<<<<<<<
 *                 else:
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 */
    __pyx_t_6 = (__pyx_v_t == NPY_OBJECT);
    if (__pyx_t_6) {
      __pyx_v_f = __pyx_k_22;
      goto __pyx_L14;
    }
    /*else*/ {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":231
 *                 elif t == NPY_OBJECT:      f = "O"
 *                 else:
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *                 info.format = f
 *                 return
 */
      __pyx_t_3 = PyInt_FromLong(__pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_Remainder(__pyx_kp_23, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_3));
      PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
      __Pyx_GIVEREF(__pyx_t_2);
      __pyx_t_2 = 0;
      __pyx_t_2 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_3), NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(((PyObject *)__pyx_t_3)); __pyx_t_3 = 0;
      __Pyx_Raise(__pyx_t_2, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }
    __pyx_L14:;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":232
 *                 else:
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f             # <<<<<<<<<<<<<<
 *                 return
 *             else:
 */
    __pyx_v_info->format = __pyx_v_f;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":233
 *                     raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 *                 info.format = f
 *                 return             # <<<<<<<<<<<<<<
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 */
    __pyx_r = 0;
    goto __pyx_L0;
    goto __pyx_L12;
  }
  /*else*/ {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":235
 *                 return
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)             # <<<<<<<<<<<<<<
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0
 */
    __pyx_v_info->format = ((char *)malloc(255));

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":236
 *             else:
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment             # <<<<<<<<<<<<<<
 *                 offset = 0
 *                 f = _util_dtypestring(descr, info.format + 1,
 */
    (__pyx_v_info->format[0]) = '^';

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":237
 *                 info.format = <char*>stdlib.malloc(_buffer_format_string_len)
 *                 info.format[0] = '^' # Native data types, manual alignment
 *                 offset = 0             # <<<<<<<<<<<<<<
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 */
    __pyx_v_offset = 0;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":240
 *                 f = _util_dtypestring(descr, info.format + 1,
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)             # <<<<<<<<<<<<<<
 *                 f[0] = 0 # Terminate format string
 * 
 */
    __pyx_t_7 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_7 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 238; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __pyx_v_f = __pyx_t_7;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":241
 *                                       info.format + _buffer_format_string_len,
 *                                       &offset)
 *                 f[0] = 0 # Terminate format string             # <<<<<<<<<<<<<<
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 */
    (__pyx_v_f[0]) = 0;
  }
  __pyx_L12:;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__");
  __pyx_r = -1;
  __Pyx_GOTREF(__pyx_v_info->obj);
  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
  goto __pyx_L2;
  __pyx_L0:;
  if (__pyx_v_info->obj == Py_None) {
    __Pyx_GOTREF(Py_None);
    __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
  }
  __pyx_L2:;
  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

/* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":243
 *                 f[0] = 0 # Terminate format string
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):             # <<<<<<<<<<<<<<
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 */

static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
static void __pyx_pf_5numpy_7ndarray___releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
  int __pyx_t_1;
  __Pyx_SetupRefcountContext("__releasebuffer__");

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":244
 * 
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 */
  __pyx_t_1 = PyArray_HASFIELDS(((PyArrayObject *)__pyx_v_self));
  if (__pyx_t_1) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":245
 *         def __releasebuffer__(ndarray self, Py_buffer* info):
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)             # <<<<<<<<<<<<<<
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)
 */
    free(__pyx_v_info->format);
    goto __pyx_L5;
  }
  __pyx_L5:;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":246
 *             if PyArray_HASFIELDS(self):
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):             # <<<<<<<<<<<<<<
 *                 stdlib.free(info.strides)
 *                 # info.shape was stored after info.strides in the same block
 */
  __pyx_t_1 = ((sizeof(npy_intp)) != (sizeof(Py_ssize_t)));
  if (__pyx_t_1) {

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":247
 *                 stdlib.free(info.format)
 *             if sizeof(npy_intp) != sizeof(Py_ssize_t):
 *                 stdlib.free(info.strides)             # <<<<<<<<<<<<<<
 *                 # info.shape was stored after info.strides in the same block
 * 
 */
    free(__pyx_v_info->strides);
    goto __pyx_L6;
  }
  __pyx_L6:;

  __Pyx_FinishRefcountContext();
}

/* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":690
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */

static INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
  PyArray_Descr *__pyx_v_child;
  int __pyx_v_endian_detector;
  int __pyx_v_little_endian;
  PyObject *__pyx_v_fields;
  PyObject *__pyx_v_childname;
  PyObject *__pyx_v_new_offset;
  PyObject *__pyx_v_t;
  char *__pyx_r;
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_3 = 0;
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  char *__pyx_t_9;
  __Pyx_SetupRefcountContext("_util_dtypestring");
  __pyx_v_child = ((PyArray_Descr *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_fields = ((PyObject *)Py_None); __Pyx_INCREF(Py_None);
  __pyx_v_childname = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_new_offset = Py_None; __Pyx_INCREF(Py_None);
  __pyx_v_t = Py_None; __Pyx_INCREF(Py_None);

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":697
 *     cdef int delta_offset
 *     cdef tuple i
 *     cdef int endian_detector = 1             # <<<<<<<<<<<<<<
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
 *     cdef tuple fields
 */
  __pyx_v_endian_detector = 1;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":698
 *     cdef tuple i
 *     cdef int endian_detector = 1
 *     cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)             # <<<<<<<<<<<<<<
 *     cdef tuple fields
 * 
 */
  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":701
 *     cdef tuple fields
 * 
 *     for childname in descr.names:             # <<<<<<<<<<<<<<
 *         fields = descr.fields[childname]
 *         child, new_offset = fields
 */
  if (likely(((PyObject *)__pyx_v_descr->names) != Py_None)) {
    __pyx_t_1 = 0; __pyx_t_2 = ((PyObject *)__pyx_v_descr->names); __Pyx_INCREF(__pyx_t_2);
  } else {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 701; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  }
  for (;;) {
    if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
    __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++;
    __Pyx_DECREF(__pyx_v_childname);
    __pyx_v_childname = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":702
 * 
 *     for childname in descr.names:
 *         fields = descr.fields[childname]             # <<<<<<<<<<<<<<
 *         child, new_offset = fields
 * 
 */
    __pyx_1 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (!__pyx_1) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_1);
    if (!(likely(PyTuple_CheckExact(__pyx_1)) || (__pyx_1) == Py_None || (PyErr_Format(PyExc_TypeError, "Expected tuple, got %s", Py_TYPE(__pyx_1)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 702; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(((PyObject *)__pyx_v_fields));
    __pyx_v_fields = ((PyObject *)__pyx_1);
    __pyx_1 = 0;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":703
 *     for childname in descr.names:
 *         fields = descr.fields[childname]
 *         child, new_offset = fields             # <<<<<<<<<<<<<<
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 */
    if (likely(((PyObject *)__pyx_v_fields) != Py_None) && likely(PyTuple_GET_SIZE(((PyObject *)__pyx_v_fields)) == 2)) {
      PyObject* tuple = ((PyObject *)__pyx_v_fields);
      __pyx_2 = PyTuple_GET_ITEM(tuple, 0); __Pyx_INCREF(__pyx_2);
      if (!(__Pyx_TypeTest(__pyx_2, __pyx_ptype_5numpy_dtype))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_3 = PyTuple_GET_ITEM(tuple, 1); __Pyx_INCREF(__pyx_3);
      __Pyx_DECREF(((PyObject *)__pyx_v_child));
      __pyx_v_child = ((PyArray_Descr *)__pyx_2);
      __pyx_2 = 0;
      __Pyx_DECREF(__pyx_v_new_offset);
      __pyx_v_new_offset = __pyx_3;
      __pyx_3 = 0;
    } else {
      __Pyx_UnpackTupleError(((PyObject *)__pyx_v_fields), 2);
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 703; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":705
 *         child, new_offset = fields
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:             # <<<<<<<<<<<<<<
 *             raise RuntimeError("Format string allocated too short, see comment in numpy.pxd")
 * 
 */
    __pyx_t_3 = PyInt_FromLong((__pyx_v_end - __pyx_v_f)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyNumber_Subtract(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_4, __pyx_int_15, Py_LT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 705; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_6) {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":706
 * 
 *         if (end - f) - (new_offset - offset[0]) < 15:
 *             raise RuntimeError("Format string allocated too short, see comment in numpy.pxd")             # <<<<<<<<<<<<<<
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 */
      __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_5));
      __Pyx_INCREF(__pyx_kp_25);
      PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_kp_25);
      __Pyx_GIVEREF(__pyx_kp_25);
      __pyx_t_4 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
      __Pyx_Raise(__pyx_t_4, 0, 0);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 706; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L5;
    }
    __pyx_L5:;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":708
 *             raise RuntimeError("Format string allocated too short, see comment in numpy.pxd")
 * 
 *         if ((child.byteorder == '>' and little_endian) or             # <<<<<<<<<<<<<<
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError("Non-native byte order not supported")
 */
    if ((__pyx_v_child->byteorder == '>')) {
      __pyx_t_6 = __pyx_v_little_endian;
    } else {
      __pyx_t_6 = (__pyx_v_child->byteorder == '>');
    }
    if (!__pyx_t_6) {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":709
 * 
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):             # <<<<<<<<<<<<<<
 *             raise ValueError("Non-native byte order not supported")
 *             # One could encode it in the format string and have Cython
 */
      if ((__pyx_v_child->byteorder == '<')) {
        __pyx_t_7 = (!__pyx_v_little_endian);
      } else {
        __pyx_t_7 = (__pyx_v_child->byteorder == '<');
      }
      __pyx_t_8 = __pyx_t_7;
    } else {
      __pyx_t_8 = __pyx_t_6;
    }
    if (__pyx_t_8) {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":710
 *         if ((child.byteorder == '>' and little_endian) or
 *             (child.byteorder == '<' and not little_endian)):
 *             raise ValueError("Non-native byte order not supported")             # <<<<<<<<<<<<<<
 *             # One could encode it in the format string and have Cython
 *             # complain instead, BUT: < and > in format strings also imply
 */
      __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(((PyObject *)__pyx_t_4));
      __Pyx_INCREF(__pyx_kp_28);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_28);
      __Pyx_GIVEREF(__pyx_kp_28);
      __pyx_t_5 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
      __Pyx_Raise(__pyx_t_5, 0, 0);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      {__pyx_filename = __pyx_f[1]; __pyx_lineno = 710; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      goto __pyx_L6;
    }
    __pyx_L6:;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":720
 * 
 *         # Output padding bytes
 *         while offset[0] < new_offset:             # <<<<<<<<<<<<<<
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 */
    while (1) {
      __pyx_t_5 = PyInt_FromLong((__pyx_v_offset[0])); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_t_5, __pyx_v_new_offset, Py_LT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 720; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (!__pyx_t_8) break;

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":721
 *         # Output padding bytes
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte             # <<<<<<<<<<<<<<
 *             f += 1
 *             offset[0] += 1
 */
      (__pyx_v_f[0]) = 120;

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":722
 *         while offset[0] < new_offset:
 *             f[0] = 120 # "x"; pad byte
 *             f += 1             # <<<<<<<<<<<<<<
 *             offset[0] += 1
 * 
 */
      __pyx_v_f += 1;

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":723
 *             f[0] = 120 # "x"; pad byte
 *             f += 1
 *             offset[0] += 1             # <<<<<<<<<<<<<<
 * 
 *         offset[0] += child.itemsize
 */
      (__pyx_v_offset[0]) += 1;
    }

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":725
 *             offset[0] += 1
 * 
 *         offset[0] += child.itemsize             # <<<<<<<<<<<<<<
 * 
 *         if not PyDataType_HASFIELDS(child):
 */
    (__pyx_v_offset[0]) += __pyx_v_child->elsize;

    /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":727
 *         offset[0] += child.itemsize
 * 
 *         if not PyDataType_HASFIELDS(child):             # <<<<<<<<<<<<<<
 *             t = child.type_num
 *             if end - f < 5:
 */
    __pyx_t_8 = (!PyDataType_HASFIELDS(__pyx_v_child));
    if (__pyx_t_8) {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":728
 * 
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num             # <<<<<<<<<<<<<<
 *             if end - f < 5:
 *                 raise RuntimeError("Format string allocated too short.")
 */
      __pyx_t_4 = PyInt_FromLong(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 728; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_v_t);
      __pyx_v_t = __pyx_t_4;
      __pyx_t_4 = 0;

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":729
 *         if not PyDataType_HASFIELDS(child):
 *             t = child.type_num
 *             if end - f < 5:             # <<<<<<<<<<<<<<
 *                 raise RuntimeError("Format string allocated too short.")
 * 
 */
      __pyx_t_8 = ((__pyx_v_end - __pyx_v_f) < 5);
      if (__pyx_t_8) {

        /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":730
 *             t = child.type_num
 *             if end - f < 5:
 *                 raise RuntimeError("Format string allocated too short.")             # <<<<<<<<<<<<<<
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 */
        __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_4));
        __Pyx_INCREF(__pyx_kp_29);
        PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_29);
        __Pyx_GIVEREF(__pyx_kp_29);
        __pyx_t_5 = PyObject_Call(__pyx_builtin_RuntimeError, ((PyObject *)__pyx_t_4), NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(((PyObject *)__pyx_t_4)); __pyx_t_4 = 0;
        __Pyx_Raise(__pyx_t_5, 0, 0);
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 730; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        goto __pyx_L10;
      }
      __pyx_L10:;

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":733
 * 
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 733; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 98;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":734
 *             # Until ticket #99 is fixed, use integers to avoid warnings
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"             # <<<<<<<<<<<<<<
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 734; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 66;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":735
 *             if   t == NPY_BYTE:        f[0] =  98 #"b"
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"             # <<<<<<<<<<<<<<
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 735; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 104;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":736
 *             elif t == NPY_UBYTE:       f[0] =  66 #"B"
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"             # <<<<<<<<<<<<<<
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 736; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 72;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":737
 *             elif t == NPY_SHORT:       f[0] = 104 #"h"
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"             # <<<<<<<<<<<<<<
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 737; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 105;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":738
 *             elif t == NPY_USHORT:      f[0] =  72 #"H"
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 738; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 73;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":739
 *             elif t == NPY_INT:         f[0] = 105 #"i"
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 739; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 108;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":740
 *             elif t == NPY_UINT:        f[0] =  73 #"I"
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 740; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 76;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":741
 *             elif t == NPY_LONG:        f[0] = 108 #"l"
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 741; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 113;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":742
 *             elif t == NPY_ULONG:       f[0] = 76  #"L"
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"             # <<<<<<<<<<<<<<
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 */
      __pyx_t_4 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 742; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 81;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":743
 *             elif t == NPY_LONGLONG:    f[0] = 113 #"q"
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"             # <<<<<<<<<<<<<<
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 743; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 102;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":744
 *             elif t == NPY_ULONGLONG:   f[0] = 81  #"Q"
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"             # <<<<<<<<<<<<<<
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 */
      __pyx_t_4 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 744; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 100;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":745
 *             elif t == NPY_FLOAT:       f[0] = 102 #"f"
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"             # <<<<<<<<<<<<<<
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 */
      __pyx_t_5 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 745; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 103;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":746
 *             elif t == NPY_DOUBLE:      f[0] = 100 #"d"
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf             # <<<<<<<<<<<<<<
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 */
      __pyx_t_4 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 746; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 102;
        __pyx_v_f += 1;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":747
 *             elif t == NPY_LONGDOUBLE:  f[0] = 103 #"g"
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd             # <<<<<<<<<<<<<<
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 */
      __pyx_t_5 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 100;
        __pyx_v_f += 1;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":748
 *             elif t == NPY_CFLOAT:      f[0] = 90; f[1] = 102; f += 1 # Zf
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg             # <<<<<<<<<<<<<<
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 */
      __pyx_t_4 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 748; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 90;
        (__pyx_v_f[1]) = 103;
        __pyx_v_f += 1;
        goto __pyx_L11;
      }

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":749
 *             elif t == NPY_CDOUBLE:     f[0] = 90; f[1] = 100; f += 1 # Zd
 *             elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"             # <<<<<<<<<<<<<<
 *             else:
 *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 */
      __pyx_t_5 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_5, Py_EQ); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_8 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 749; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_8) {
        (__pyx_v_f[0]) = 79;
        goto __pyx_L11;
      }
      /*else*/ {

        /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":751
 *             elif t == NPY_OBJECT:      f[0] = 79 #"O"
 *             else:
 *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)             # <<<<<<<<<<<<<<
 *             f += 1
 *         else:
 */
        __pyx_t_4 = PyNumber_Remainder(__pyx_kp_30, __pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(((PyObject *)__pyx_t_5));
        PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
        __Pyx_GIVEREF(__pyx_t_4);
        __pyx_t_4 = 0;
        __pyx_t_4 = PyObject_Call(__pyx_builtin_ValueError, ((PyObject *)__pyx_t_5), NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(((PyObject *)__pyx_t_5)); __pyx_t_5 = 0;
        __Pyx_Raise(__pyx_t_4, 0, 0);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        {__pyx_filename = __pyx_f[1]; __pyx_lineno = 751; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      }
      __pyx_L11:;

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":752
 *             else:
 *                 raise ValueError("unknown dtype code in numpy.pxd (%d)" % t)
 *             f += 1             # <<<<<<<<<<<<<<
 *         else:
 *             # Cython ignores struct boundary information ("T{...}"),
 */
      __pyx_v_f += 1;
      goto __pyx_L9;
    }
    /*else*/ {

      /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":756
 *             # Cython ignores struct boundary information ("T{...}"),
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)             # <<<<<<<<<<<<<<
 *     return f
 * 
 */
      __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 756; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
      __pyx_v_f = __pyx_t_9;
    }
    __pyx_L9:;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":757
 *             # so don't output it
 *             f = _util_dtypestring(child, f, end, offset)
 *     return f             # <<<<<<<<<<<<<<
 * 
 */
  __pyx_r = __pyx_v_f;
  goto __pyx_L0;

  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_3);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("numpy._util_dtypestring");
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_DECREF((PyObject *)__pyx_v_child);
  __Pyx_DECREF(__pyx_v_fields);
  __Pyx_DECREF(__pyx_v_childname);
  __Pyx_DECREF(__pyx_v_new_offset);
  __Pyx_DECREF(__pyx_v_t);
  __Pyx_FinishRefcountContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_StreamID(PyTypeObject *t, PyObject *a, PyObject *k) {
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  if (__pyx_pf_6pysdif_7_pysdif_8StreamID___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_StreamID(PyObject *o) {
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pysdif_7_pysdif_8StreamID___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  (*Py_TYPE(o)->tp_free)(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8StreamID_numid(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8StreamID_5numid___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8StreamID_source(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8StreamID_6source___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8StreamID_treeway(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8StreamID_7treeway___get__(o);
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_StreamID[] = {
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8StreamID___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_StreamID[] = {
  {(char *)"numid", __pyx_getprop_6pysdif_7_pysdif_8StreamID_numid, 0, 0, 0},
  {(char *)"source", __pyx_getprop_6pysdif_7_pysdif_8StreamID_source, 0, 0, 0},
  {(char *)"treeway", __pyx_getprop_6pysdif_7_pysdif_8StreamID_treeway, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_StreamID = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_StreamID = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_StreamID = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_StreamID = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_StreamID = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.StreamID"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_StreamID), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_StreamID, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_6pysdif_7_pysdif_8StreamID___repr__, /*tp_repr*/
  &__pyx_tp_as_number_StreamID, /*tp_as_number*/
  &__pyx_tp_as_sequence_StreamID, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_StreamID, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_StreamID, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_StreamID, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_StreamID, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_StreamID, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_MatrixTypeDefinition __pyx_vtable_6pysdif_7_pysdif_MatrixTypeDefinition;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_MatrixTypeDefinition(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition;
  p->signature = Py_None; Py_INCREF(Py_None);
  p->column_names = ((PyObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_MatrixTypeDefinition(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o;
  Py_XDECREF(p->signature);
  Py_XDECREF(((PyObject *)p->column_names));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_MatrixTypeDefinition(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o;
  if (p->signature) {
    e = (*v)(p->signature, a); if (e) return e;
  }
  if (p->column_names) {
    e = (*v)(p->column_names, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_MatrixTypeDefinition(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->signature);
  p->signature = Py_None; Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->column_names);
  p->column_names = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___get__(o);
}

static int __pyx_setprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition_12column_names___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_MatrixTypeDefinition[] = {
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6pysdif_7_pysdif_MatrixTypeDefinition[] = {
  {(char *)"signature", T_OBJECT, offsetof(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition, signature), 0, 0},
  {0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_MatrixTypeDefinition[] = {
  {(char *)"column_names", __pyx_getprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names, __pyx_setprop_6pysdif_7_pysdif_20MatrixTypeDefinition_column_names, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_MatrixTypeDefinition = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_MatrixTypeDefinition = {
  __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_MatrixTypeDefinition = {
  __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_MatrixTypeDefinition = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.MatrixTypeDefinition"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___repr__, /*tp_repr*/
  &__pyx_tp_as_number_MatrixTypeDefinition, /*tp_as_number*/
  &__pyx_tp_as_sequence_MatrixTypeDefinition, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_MatrixTypeDefinition, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_MatrixTypeDefinition, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("MatrixTypeDefinition(signature, column_names)"), /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_methods*/
  __pyx_members_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pysdif_7_pysdif_20MatrixTypeDefinition___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_MatrixTypeDefinition, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_Component(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_Component *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_Component *)o);
  p->signature = ((PyObject *)Py_None); Py_INCREF(Py_None);
  p->name = ((PyObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_Component(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_Component *p = (struct __pyx_obj_6pysdif_7_pysdif_Component *)o;
  Py_XDECREF(((PyObject *)p->signature));
  Py_XDECREF(((PyObject *)p->name));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_Component(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_Component *p = (struct __pyx_obj_6pysdif_7_pysdif_Component *)o;
  if (p->signature) {
    e = (*v)(p->signature, a); if (e) return e;
  }
  if (p->name) {
    e = (*v)(p->name, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_Component(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_Component *p = (struct __pyx_obj_6pysdif_7_pysdif_Component *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->signature);
  p->signature = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->name);
  p->name = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_Component[] = {
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_9Component___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6pysdif_7_pysdif_Component[] = {
  {(char *)"signature", T_OBJECT, offsetof(struct __pyx_obj_6pysdif_7_pysdif_Component, signature), READONLY, 0},
  {(char *)"name", T_OBJECT, offsetof(struct __pyx_obj_6pysdif_7_pysdif_Component, name), READONLY, 0},
  {(char *)"num", T_UINT, offsetof(struct __pyx_obj_6pysdif_7_pysdif_Component, num), READONLY, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Component = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Component = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Component = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Component = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_Component = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.Component"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_Component), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_Component, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_6pysdif_7_pysdif_9Component___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Component, /*tp_as_number*/
  &__pyx_tp_as_sequence_Component, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Component, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Component, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("Component(str signature, str name)"), /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_Component, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_Component, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_Component, /*tp_methods*/
  __pyx_members_6pysdif_7_pysdif_Component, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pysdif_7_pysdif_9Component___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_Component, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameTypeDefinition(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o);
  p->signature = ((PyObject *)Py_None); Py_INCREF(Py_None);
  p->components = ((PyObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_FrameTypeDefinition(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o;
  Py_XDECREF(((PyObject *)p->signature));
  Py_XDECREF(((PyObject *)p->components));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_FrameTypeDefinition(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o;
  if (p->signature) {
    e = (*v)(p->signature, a); if (e) return e;
  }
  if (p->components) {
    e = (*v)(p->components, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_FrameTypeDefinition(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->signature);
  p->signature = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->components);
  p->components = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___get__(o);
}

static int __pyx_setprop_6pysdif_7_pysdif_19FrameTypeDefinition_signature(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_9signature___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_components(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___get__(o);
}

static int __pyx_setprop_6pysdif_7_pysdif_19FrameTypeDefinition_components(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition_10components___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_FrameTypeDefinition[] = {
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_FrameTypeDefinition[] = {
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_signature, __pyx_setprop_6pysdif_7_pysdif_19FrameTypeDefinition_signature, 0, 0},
  {(char *)"components", __pyx_getprop_6pysdif_7_pysdif_19FrameTypeDefinition_components, __pyx_setprop_6pysdif_7_pysdif_19FrameTypeDefinition_components, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FrameTypeDefinition = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FrameTypeDefinition = {
  __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FrameTypeDefinition = {
  __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FrameTypeDefinition = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_FrameTypeDefinition = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.FrameTypeDefinition"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_FrameTypeDefinition), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___repr__, /*tp_repr*/
  &__pyx_tp_as_number_FrameTypeDefinition, /*tp_as_number*/
  &__pyx_tp_as_sequence_FrameTypeDefinition, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FrameTypeDefinition, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FrameTypeDefinition, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("FrameTypeDefinition(signature, components)"), /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___iter__, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pysdif_7_pysdif_19FrameTypeDefinition___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_FrameTypeDefinition, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameR(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_6pysdif_7_pysdif_6FrameR___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_FrameR(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pysdif_7_pysdif_6FrameR___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(((PyObject *)p->source));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_FrameR(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o;
  if (p->source) {
    e = (*v)(((PyObject*)p->source), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_FrameR(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameR *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameR *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->source);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6FrameR_9signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_numerical_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6FrameR_19numerical_signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_size(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6FrameR_4size___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_num_matrices(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6FrameR_12num_matrices___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_id(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6FrameR_2id___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_time(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6FrameR_4time___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6FrameR_matrix_idx(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6FrameR_10matrix_idx___get__(o);
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_FrameR[] = {
  {__Pyx_NAMESTR("matrix_exists"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6FrameR_matrix_exists, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6FrameR_matrix_exists)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6FrameR___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6FrameR___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6FrameR___next__)},
  {__Pyx_NAMESTR("get_matrix_data"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6FrameR_get_matrix_data, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6FrameR_get_matrix_data)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_FrameR[] = {
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_6FrameR_signature, 0, 0, 0},
  {(char *)"numerical_signature", __pyx_getprop_6pysdif_7_pysdif_6FrameR_numerical_signature, 0, 0, 0},
  {(char *)"size", __pyx_getprop_6pysdif_7_pysdif_6FrameR_size, 0, 0, 0},
  {(char *)"num_matrices", __pyx_getprop_6pysdif_7_pysdif_6FrameR_num_matrices, 0, 0, 0},
  {(char *)"id", __pyx_getprop_6pysdif_7_pysdif_6FrameR_id, 0, 0, 0},
  {(char *)"time", __pyx_getprop_6pysdif_7_pysdif_6FrameR_time, 0, 0, 0},
  {(char *)"matrix_idx", __pyx_getprop_6pysdif_7_pysdif_6FrameR_matrix_idx, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FrameR = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FrameR = {
  __pyx_pf_6pysdif_7_pysdif_6FrameR___len__, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FrameR = {
  __pyx_pf_6pysdif_7_pysdif_6FrameR___len__, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FrameR = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_FrameR = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.FrameR"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_FrameR), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_FrameR, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_FrameR, /*tp_as_number*/
  &__pyx_tp_as_sequence_FrameR, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FrameR, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FrameR, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    FrameR is really an iterator class,\n    to be able to iterate through matrices. FrameR\n    keeps a connection to its source SdifFile but all\n    managing and indexing is done by the SdifFile, to\n    keep things central. In particular, the matrices \n    resulting from calling its 'next()' method (or iterating\n    with 'for') have no connection to the FrameR and talk \n    directly to the SdifFile, which, eventually, updates\n    the FrameR if needed.\n    It is only used for reading and, in particular, one\n    would never create a FrameR but receive it as result of\n    iterating through a SdifFile\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_FrameR, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_FrameR, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6pysdif_7_pysdif_6FrameR___iter__, /*tp_iter*/
  __pyx_pf_6pysdif_7_pysdif_6FrameR___next__, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_FrameR, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_FrameR, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_FrameR, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};
static struct __pyx_vtabstruct_6pysdif_7_pysdif_SdifFile __pyx_vtable_6pysdif_7_pysdif_SdifFile;

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_SdifFile(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o);
  p->__pyx_vtab = __pyx_vtabptr_6pysdif_7_pysdif_SdifFile;
  p->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)Py_None); Py_INCREF(Py_None);
  p->matrix = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_6pysdif_7_pysdif_8SdifFile___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_SdifFile(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p = (struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o;
  {
    PyObject *etype, *eval, *etb;
    PyErr_Fetch(&etype, &eval, &etb);
    ++Py_REFCNT(o);
    __pyx_pf_6pysdif_7_pysdif_8SdifFile___dealloc__(o);
    if (PyErr_Occurred()) PyErr_WriteUnraisable(o);
    --Py_REFCNT(o);
    PyErr_Restore(etype, eval, etb);
  }
  Py_XDECREF(((PyObject *)p->frame));
  Py_XDECREF(((PyObject *)p->matrix));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_SdifFile(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p = (struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o;
  if (p->frame) {
    e = (*v)(((PyObject*)p->frame), a); if (e) return e;
  }
  if (p->matrix) {
    e = (*v)(((PyObject*)p->matrix), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_SdifFile(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_SdifFile *p = (struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->frame);
  p->frame = ((struct __pyx_obj_6pysdif_7_pysdif_FrameR *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->matrix);
  p->matrix = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_name(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_4name___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_mode(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_4mode___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_is_seekable(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_11is_seekable___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_numerical_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_19numerical_signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_9signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_prev_time(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_9prev_time___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_pos(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_9frame_pos___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_cols(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_11matrix_cols___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_rows(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_11matrix_rows___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_data_type(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_16matrix_data_type___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrices_in_frame(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_17matrices_in_frame___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_id(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_8frame_id___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_pos(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___get__(o);
}

static int __pyx_setprop_6pysdif_7_pysdif_8SdifFile_pos(PyObject *o, PyObject *v, void *x) {
  if (v) {
    return __pyx_pf_6pysdif_7_pysdif_8SdifFile_3pos___set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_numerical_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_25frame_numerical_signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_15frame_signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_numerical_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_26matrix_numerical_signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_16matrix_signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_time(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_4time___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_last_error(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_10last_error___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_is_selected(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_17frame_is_selected___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_is_selected(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_18matrix_is_selected___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_8SdifFile_number_of_NVTs(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_8SdifFile_14number_of_NVTs___get__(o);
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_SdifFile[] = {
  {__Pyx_NAMESTR("close"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_close, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_close)},
  {__Pyx_NAMESTR("read_frame_header"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_read_frame_header, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_read_frame_header)},
  {__Pyx_NAMESTR("skip_frame_data"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_frame_data, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_skip_frame_data)},
  {__Pyx_NAMESTR("read_matrix_header"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_read_matrix_header, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_read_matrix_header)},
  {__Pyx_NAMESTR("skip_matrix_data"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_matrix_data, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_skip_matrix_data)},
  {__Pyx_NAMESTR("get_matrix_data"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_matrix_data, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_get_matrix_data)},
  {__Pyx_NAMESTR("skip_matrix"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_skip_matrix, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_skip_matrix)},
  {__Pyx_NAMESTR("status"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_status, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_status)},
  {__Pyx_NAMESTR("__iter__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile___iter__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("__next__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile___next__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("get_next_matrix"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_next_matrix, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_get_next_matrix)},
  {__Pyx_NAMESTR("rewind"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_rewind, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_rewind)},
  {__Pyx_NAMESTR("_read_padding"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile__read_padding, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile__read_padding)},
  {__Pyx_NAMESTR("add_NVT"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_NVT, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_add_NVT)},
  {__Pyx_NAMESTR("add_matrix_type"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_matrix_type, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_add_matrix_type)},
  {__Pyx_NAMESTR("add_frame_type"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_frame_type, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_add_frame_type)},
  {__Pyx_NAMESTR("clone_type_definitions"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_type_definitions, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_type_definitions)},
  {__Pyx_NAMESTR("clone_NVTs"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_NVTs, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_NVTs)},
  {__Pyx_NAMESTR("clone_definitions"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_definitions, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_definitions)},
  {__Pyx_NAMESTR("clone_frames"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_clone_frames, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_clone_frames)},
  {__Pyx_NAMESTR("add_streamID"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_streamID, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_add_streamID)},
  {__Pyx_NAMESTR("add_predefined_type"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_add_predefined_type, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_add_predefined_type)},
  {__Pyx_NAMESTR("write_all_ascii_chunks"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_write_all_ascii_chunks, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_write_all_ascii_chunks)},
  {__Pyx_NAMESTR("new_frame"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_new_frame, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_new_frame)},
  {__Pyx_NAMESTR("new_frame_one_matrix"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_new_frame_one_matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_new_frame_one_matrix)},
  {__Pyx_NAMESTR("print_NVT"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_NVT, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_NVT)},
  {__Pyx_NAMESTR("print_general_header"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_general_header, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_general_header)},
  {__Pyx_NAMESTR("print_all_ascii_chunks"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_ascii_chunks, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_all_ascii_chunks)},
  {__Pyx_NAMESTR("print_all_types"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_types, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_all_types)},
  {__Pyx_NAMESTR("print_matrix_header"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_matrix_header, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_matrix_header)},
  {__Pyx_NAMESTR("print_one_row"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_one_row, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_one_row)},
  {__Pyx_NAMESTR("print_frame_header"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_frame_header, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_frame_header)},
  {__Pyx_NAMESTR("print_all_stream_ID"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_print_all_stream_ID, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_print_all_stream_ID)},
  {__Pyx_NAMESTR("frame_types_to_string"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_frame_types_to_string, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_frame_types_to_string)},
  {__Pyx_NAMESTR("get_frame_types"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_frame_types, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_get_frame_types)},
  {__Pyx_NAMESTR("matrix_types_to_string"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_matrix_types_to_string, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_matrix_types_to_string)},
  {__Pyx_NAMESTR("get_matrix_types"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_matrix_types, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_get_matrix_types)},
  {__Pyx_NAMESTR("get_NVTs"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_NVTs, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_get_NVTs)},
  {__Pyx_NAMESTR("get_stream_IDs"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_8SdifFile_get_stream_IDs, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_8SdifFile_get_stream_IDs)},
  {0, 0, 0, 0}
};

static struct PyMemberDef __pyx_members_6pysdif_7_pysdif_SdifFile[] = {
  {(char *)"eof", T_INT, offsetof(struct __pyx_obj_6pysdif_7_pysdif_SdifFile, eof), READONLY, 0},
  {0, 0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_SdifFile[] = {
  {(char *)"name", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_name, 0, 0, 0},
  {(char *)"mode", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_mode, 0, 0, 0},
  {(char *)"is_seekable", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_is_seekable, 0, 0, 0},
  {(char *)"numerical_signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_numerical_signature, 0, 0, 0},
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_signature, 0, 0, 0},
  {(char *)"prev_time", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_prev_time, 0, 0, 0},
  {(char *)"frame_pos", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_pos, 0, 0, 0},
  {(char *)"matrix_cols", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_cols, 0, 0, 0},
  {(char *)"matrix_rows", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_rows, 0, 0, 0},
  {(char *)"matrix_data_type", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_data_type, 0, 0, 0},
  {(char *)"matrices_in_frame", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrices_in_frame, 0, 0, 0},
  {(char *)"frame_id", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_id, 0, 0, 0},
  {(char *)"pos", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_pos, __pyx_setprop_6pysdif_7_pysdif_8SdifFile_pos, 0, 0},
  {(char *)"frame_numerical_signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_numerical_signature, 0, 0, 0},
  {(char *)"frame_signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_signature, 0, 0, 0},
  {(char *)"matrix_numerical_signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_numerical_signature, 0, 0, 0},
  {(char *)"matrix_signature", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_signature, 0, 0, 0},
  {(char *)"time", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_time, 0, 0, 0},
  {(char *)"last_error", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_last_error, 0, 0, 0},
  {(char *)"frame_is_selected", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_frame_is_selected, 0, 0, 0},
  {(char *)"matrix_is_selected", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_matrix_is_selected, 0, 0, 0},
  {(char *)"number_of_NVTs", __pyx_getprop_6pysdif_7_pysdif_8SdifFile_number_of_NVTs, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_SdifFile = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_SdifFile = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_SdifFile = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_SdifFile = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_SdifFile = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.SdifFile"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_SdifFile), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_SdifFile, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  0, /*tp_repr*/
  &__pyx_tp_as_number_SdifFile, /*tp_as_number*/
  &__pyx_tp_as_sequence_SdifFile, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_SdifFile, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_SdifFile, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("SdifFile(filename, mode='r', predefined_type=None)\n\n    SdifFile(filename, mode=\"r\")\n    \n    mode is \"r\":read | \"w\": write | \"wr\" or \"rw\":read-write\n    \n    this is the low level interface for reading and writing sdif files\n    it mirrors the sdif library quite transparently so that the example files\n    and utilities using it can be directly translated with it. in particular\n    it does not create any intermediate objects, even the data of the matrices\n    is a numpy array mapped to the c array read from disk, so no allocation takes\n    place. \n    \n    to read for ex. 1TRC format:\n    \n    sdif_file = SdifFile('filename.sdif')\n    sig1TRC = str2signature(\"1TRC\")\n    while not sdif_file.eof:\n        sdif_file.read_frame_header()\n        if sdif_file.frame_numerical_signature) == sig1TRC:\n            print sdif_file.time\n            for n in range(sdif_file.matrices_in_frame):\n                sdif_file.read_matrix_header()\n                if sdif_file.matrix_numerical_signature == sig1TRC:\n                    data = sdif_file.get_matrix_data() \n                    # data is now a numpy array but you must copy the data if \n                    # you intend to keep it after you have read the matrix.\n                    # One you read a new matrix, this data will be no longer valid\n                    print data\n        \n    a more natural way:\n    \n    sdif_file = SdifFile('filename.sdif')\n    for frame in sdif_file:\n        if frame.signature == \"1TRC\":\n            print frame.time\n            for matrix in frame:\n                if matrix.signature == \"1TRC\":\n                    print matrix.get_data()\n    \n    the frames and the matrices resulting from the iteration\n    are only guaranteed to be valid as long as no new frames and matrices are read\n    \n    to write a SdifFile:\n    \n    f = SdifFile('new_sdif.sdif', 'w')\n    # these are optional\n    f.add_NVT({\n        'name' : 'my name',\n        'date' : time.asctime(time.localtime())\n    })\n    f.add_frame_type('1NEW', '1ABC NewMatrix, 1FQ0 New1FQ0')\n    f.add_matrix_type('1ABC', 'Column1, Column2')\n    # now you can begin adding frames\n    frame = f.new_frame('1NEW', time_now)\n    frame.add_matrix('1ABC', array([\n        [0,     1.2],\n        [3.5,   8.13],\n        ...\n        ]))\n    frame.write()\n    \n    # say we just want to take the data from an existing\n    # sdiffile, modify it and write it back\n    in_sdif = SdifFile(\"existing-file.sdif\")\n    out_sdif = SdifFile(\"outfile.sdif\", \"w\")\n    out_sdif.clone_definitions(in_sdif)\n    for in_frame in in_sdif:\n        if in_frame.signature == \"1NEW\":\n            new_frame = out_sdif.new_frame(\"1NEW\", in_frame.time)\n            in_data = in_frame.get_matrix_data() # we know there is only one matrix\n            # multiply the second column by 0.5\n            in_data[:,1] *= 0.5\n            new_frame.add_matrix('1ABC', in_data)\n            new_frame.write()\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_SdifFile, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_SdifFile, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pf_6pysdif_7_pysdif_8SdifFile___iter__, /*tp_iter*/
  __pyx_pf_6pysdif_7_pysdif_8SdifFile___next__, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_SdifFile, /*tp_methods*/
  __pyx_members_6pysdif_7_pysdif_SdifFile, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_SdifFile, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pf_6pysdif_7_pysdif_8SdifFile___init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_SdifFile, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_Matrix(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  p->data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  if (__pyx_pf_6pysdif_7_pysdif_6Matrix___cinit__(o, a, k) < 0) {
    Py_DECREF(o); o = 0;
  }
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_Matrix(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p = (struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o;
  Py_XDECREF(((PyObject *)p->source));
  Py_XDECREF(((PyObject *)p->data));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_Matrix(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p = (struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o;
  if (p->source) {
    e = (*v)(((PyObject*)p->source), a); if (e) return e;
  }
  if (p->data) {
    e = (*v)(((PyObject*)p->data), a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_Matrix(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_Matrix *p = (struct __pyx_obj_6pysdif_7_pysdif_Matrix *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->source);
  p->source = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->data);
  p->data = ((PyArrayObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_rows(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6Matrix_4rows___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_cols(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6Matrix_4cols___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_dtype(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6Matrix_5dtype___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6Matrix_9signature___get__(o);
}

static PyObject *__pyx_getprop_6pysdif_7_pysdif_6Matrix_numerical_signature(PyObject *o, void *x) {
  return __pyx_pf_6pysdif_7_pysdif_6Matrix_19numerical_signature___get__(o);
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_Matrix[] = {
  {__Pyx_NAMESTR("get_data"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6Matrix_get_data, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6Matrix_get_data)},
  {__Pyx_NAMESTR("copy"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6Matrix_copy, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6Matrix_copy)},
  {__Pyx_NAMESTR("skip"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6Matrix_skip, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6Matrix_skip)},
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6Matrix___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_6pysdif_7_pysdif_Matrix[] = {
  {(char *)"rows", __pyx_getprop_6pysdif_7_pysdif_6Matrix_rows, 0, 0, 0},
  {(char *)"cols", __pyx_getprop_6pysdif_7_pysdif_6Matrix_cols, 0, 0, 0},
  {(char *)"dtype", __pyx_getprop_6pysdif_7_pysdif_6Matrix_dtype, 0, 0, 0},
  {(char *)"signature", __pyx_getprop_6pysdif_7_pysdif_6Matrix_signature, 0, 0, 0},
  {(char *)"numerical_signature", __pyx_getprop_6pysdif_7_pysdif_6Matrix_numerical_signature, 0, 0, 0},
  {0, 0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_Matrix = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_Matrix = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Matrix = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_Matrix = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_Matrix = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.Matrix"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_Matrix), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_Matrix, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_6pysdif_7_pysdif_6Matrix___repr__, /*tp_repr*/
  &__pyx_tp_as_number_Matrix, /*tp_as_number*/
  &__pyx_tp_as_sequence_Matrix, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Matrix, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_Matrix, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    Matrix is only a placeholder class to\n    iterate through data while reading a SdifFile\n    \n    in particular the default behaviour is that\n    when you are given a Matrix, this is only valid\n    until a new one is read.\n    \n    See the methods 'get_data' and 'copy' for a better\n    explanation of how to make the data in the Matrix \n    persistent\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_Matrix, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_Matrix, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_Matrix, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_6pysdif_7_pysdif_Matrix, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_Matrix, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static PyObject *__pyx_tp_new_6pysdif_7_pysdif_FrameW(PyTypeObject *t, PyObject *a, PyObject *k) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p;
  PyObject *o = (*t->tp_alloc)(t, 0);
  if (!o) return 0;
  p = ((struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o);
  p->sdiffile = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  p->matrices = ((PyObject *)Py_None); Py_INCREF(Py_None);
  p->signatures = ((PyObject *)Py_None); Py_INCREF(Py_None);
  return o;
}

static void __pyx_tp_dealloc_6pysdif_7_pysdif_FrameW(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o;
  Py_XDECREF(((PyObject *)p->sdiffile));
  Py_XDECREF(((PyObject *)p->matrices));
  Py_XDECREF(((PyObject *)p->signatures));
  (*Py_TYPE(o)->tp_free)(o);
}

static int __pyx_tp_traverse_6pysdif_7_pysdif_FrameW(PyObject *o, visitproc v, void *a) {
  int e;
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o;
  if (p->sdiffile) {
    e = (*v)(((PyObject*)p->sdiffile), a); if (e) return e;
  }
  if (p->matrices) {
    e = (*v)(p->matrices, a); if (e) return e;
  }
  if (p->signatures) {
    e = (*v)(p->signatures, a); if (e) return e;
  }
  return 0;
}

static int __pyx_tp_clear_6pysdif_7_pysdif_FrameW(PyObject *o) {
  struct __pyx_obj_6pysdif_7_pysdif_FrameW *p = (struct __pyx_obj_6pysdif_7_pysdif_FrameW *)o;
  PyObject* tmp;
  tmp = ((PyObject*)p->sdiffile);
  p->sdiffile = ((struct __pyx_obj_6pysdif_7_pysdif_SdifFile *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->matrices);
  p->matrices = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  tmp = ((PyObject*)p->signatures);
  p->signatures = ((PyObject *)Py_None); Py_INCREF(Py_None);
  Py_XDECREF(tmp);
  return 0;
}

static struct PyMethodDef __pyx_methods_6pysdif_7_pysdif_FrameW[] = {
  {__Pyx_NAMESTR("__repr__"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6FrameW___repr__, METH_NOARGS|METH_COEXIST, __Pyx_DOCSTR(0)},
  {__Pyx_NAMESTR("add_matrix"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6FrameW_add_matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6FrameW_add_matrix)},
  {__Pyx_NAMESTR("write"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_6FrameW_write, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_6FrameW_write)},
  {0, 0, 0, 0}
};

static PyNumberMethods __pyx_tp_as_number_FrameW = {
  0, /*nb_add*/
  0, /*nb_subtract*/
  0, /*nb_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_divide*/
  #endif
  0, /*nb_remainder*/
  0, /*nb_divmod*/
  0, /*nb_power*/
  0, /*nb_negative*/
  0, /*nb_positive*/
  0, /*nb_absolute*/
  0, /*nb_nonzero*/
  0, /*nb_invert*/
  0, /*nb_lshift*/
  0, /*nb_rshift*/
  0, /*nb_and*/
  0, /*nb_xor*/
  0, /*nb_or*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_coerce*/
  #endif
  0, /*nb_int*/
  #if PY_MAJOR_VERSION >= 3
  0, /*reserved*/
  #else
  0, /*nb_long*/
  #endif
  0, /*nb_float*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_oct*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*nb_hex*/
  #endif
  0, /*nb_inplace_add*/
  0, /*nb_inplace_subtract*/
  0, /*nb_inplace_multiply*/
  #if PY_MAJOR_VERSION < 3
  0, /*nb_inplace_divide*/
  #endif
  0, /*nb_inplace_remainder*/
  0, /*nb_inplace_power*/
  0, /*nb_inplace_lshift*/
  0, /*nb_inplace_rshift*/
  0, /*nb_inplace_and*/
  0, /*nb_inplace_xor*/
  0, /*nb_inplace_or*/
  0, /*nb_floor_divide*/
  0, /*nb_true_divide*/
  0, /*nb_inplace_floor_divide*/
  0, /*nb_inplace_true_divide*/
  #if (PY_MAJOR_VERSION >= 3) || (Py_TPFLAGS_DEFAULT & Py_TPFLAGS_HAVE_INDEX)
  0, /*nb_index*/
  #endif
};

static PySequenceMethods __pyx_tp_as_sequence_FrameW = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  0, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_FrameW = {
  0, /*mp_length*/
  0, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyBufferProcs __pyx_tp_as_buffer_FrameW = {
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getreadbuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getwritebuffer*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getsegcount*/
  #endif
  #if PY_MAJOR_VERSION < 3
  0, /*bf_getcharbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_getbuffer*/
  #endif
  #if PY_VERSION_HEX >= 0x02060000
  0, /*bf_releasebuffer*/
  #endif
};

PyTypeObject __pyx_type_6pysdif_7_pysdif_FrameW = {
  PyVarObject_HEAD_INIT(0, 0)
  __Pyx_NAMESTR("pysdif._pysdif.FrameW"), /*tp_name*/
  sizeof(struct __pyx_obj_6pysdif_7_pysdif_FrameW), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_6pysdif_7_pysdif_FrameW, /*tp_dealloc*/
  0, /*tp_print*/
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  0, /*tp_compare*/
  __pyx_pf_6pysdif_7_pysdif_6FrameW___repr__, /*tp_repr*/
  &__pyx_tp_as_number_FrameW, /*tp_as_number*/
  &__pyx_tp_as_sequence_FrameW, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_FrameW, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  &__pyx_tp_as_buffer_FrameW, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
  __Pyx_DOCSTR("\n    FrameW : class to write frames to a SdifFile\n    \n    one does not create instances of this class directly but\n    you get an instance by calling\n    frame_to_write = sdiffile.new_frame(signature, time, streamID)\n    \n    then:\n    frame_to_write.add_matrix(signature, numpy_array)\n    \n    and last:\n    frame_to_write.write()   # this writes it to the sdiffile\n    "), /*tp_doc*/
  __pyx_tp_traverse_6pysdif_7_pysdif_FrameW, /*tp_traverse*/
  __pyx_tp_clear_6pysdif_7_pysdif_FrameW, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_6pysdif_7_pysdif_FrameW, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_6pysdif_7_pysdif_FrameW, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
};

static struct PyMethodDef __pyx_methods[] = {
  {__Pyx_NAMESTR("signature2str"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_signature2str, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_signature2str)},
  {__Pyx_NAMESTR("str2signature"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_str2signature, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_str2signature)},
  {__Pyx_NAMESTR("get_predefined_frames_and_matrices"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_get_predefined_frames_and_matrices, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_get_predefined_frames_and_matrices)},
  {__Pyx_NAMESTR("_init"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif__init, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif__init)},
  {__Pyx_NAMESTR("_cleanup"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif__cleanup, METH_NOARGS, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif__cleanup)},
  {__Pyx_NAMESTR("test_bench_read_sdif1"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif1, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif1)},
  {__Pyx_NAMESTR("test_bench_read_sdif2"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif2, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif2)},
  {__Pyx_NAMESTR("test_bench_read_sdif6"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif6, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif6)},
  {__Pyx_NAMESTR("test_bench_read_sdif3"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif3, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif3)},
  {__Pyx_NAMESTR("test_bench_read_sdif4"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif4, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif4)},
  {__Pyx_NAMESTR("test_bench_read_sdif5"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_test_bench_read_sdif5, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_test_bench_read_sdif5)},
  {__Pyx_NAMESTR("test_write"), (PyCFunction)__pyx_pf_6pysdif_7_pysdif_test_write, METH_O, __Pyx_DOCSTR(__pyx_doc_6pysdif_7_pysdif_test_write)},
  {0, 0, 0, 0}
};

static void __pyx_init_filenames(void); /*proto*/

#if PY_MAJOR_VERSION >= 3
static struct PyModuleDef __pyx_moduledef = {
    PyModuleDef_HEAD_INIT,
    __Pyx_NAMESTR("_pysdif"),
    0, /* m_doc */
    -1, /* m_size */
    __pyx_methods /* m_methods */,
    NULL, /* m_reload */
    NULL, /* m_traverse */
    NULL, /* m_clear */
    NULL /* m_free */
};
#endif

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  {&__pyx_kp___main__, __pyx_k___main__, sizeof(__pyx_k___main__), 1, 1, 1},
  {&__pyx_kp___cinit__, __pyx_k___cinit__, sizeof(__pyx_k___cinit__), 1, 1, 1},
  {&__pyx_kp___dealloc__, __pyx_k___dealloc__, sizeof(__pyx_k___dealloc__), 1, 1, 1},
  {&__pyx_kp___repr__, __pyx_k___repr__, sizeof(__pyx_k___repr__), 1, 1, 1},
  {&__pyx_kp___init__, __pyx_k___init__, sizeof(__pyx_k___init__), 1, 1, 1},
  {&__pyx_kp___iter__, __pyx_k___iter__, sizeof(__pyx_k___iter__), 1, 1, 1},
  {&__pyx_kp___len__, __pyx_k___len__, sizeof(__pyx_k___len__), 1, 1, 1},
  {&__pyx_kp_get_data, __pyx_k_get_data, sizeof(__pyx_k_get_data), 1, 1, 1},
  {&__pyx_kp_copy, __pyx_k_copy, sizeof(__pyx_k_copy), 1, 1, 1},
  {&__pyx_kp_skip, __pyx_k_skip, sizeof(__pyx_k_skip), 1, 1, 1},
  {&__pyx_kp_matrix_exists, __pyx_k_matrix_exists, sizeof(__pyx_k_matrix_exists), 1, 1, 1},
  {&__pyx_kp___next__, __pyx_k___next__, sizeof(__pyx_k___next__), 1, 1, 1},
  {&__pyx_kp_get_matrix_data, __pyx_k_get_matrix_data, sizeof(__pyx_k_get_matrix_data), 1, 1, 1},
  {&__pyx_kp_add_matrix, __pyx_k_add_matrix, sizeof(__pyx_k_add_matrix), 1, 1, 1},
  {&__pyx_kp_write, __pyx_k_write, sizeof(__pyx_k_write), 1, 1, 1},
  {&__pyx_kp_close, __pyx_k_close, sizeof(__pyx_k_close), 1, 1, 1},
  {&__pyx_kp_read_frame_header, __pyx_k_read_frame_header, sizeof(__pyx_k_read_frame_header), 1, 1, 1},
  {&__pyx_kp_skip_frame_data, __pyx_k_skip_frame_data, sizeof(__pyx_k_skip_frame_data), 1, 1, 1},
  {&__pyx_kp_read_matrix_header, __pyx_k_read_matrix_header, sizeof(__pyx_k_read_matrix_header), 1, 1, 1},
  {&__pyx_kp_skip_matrix_data, __pyx_k_skip_matrix_data, sizeof(__pyx_k_skip_matrix_data), 1, 1, 1},
  {&__pyx_kp_skip_matrix, __pyx_k_skip_matrix, sizeof(__pyx_k_skip_matrix), 1, 1, 1},
  {&__pyx_kp_status, __pyx_k_status, sizeof(__pyx_k_status), 1, 1, 1},
  {&__pyx_kp_get_next_matrix, __pyx_k_get_next_matrix, sizeof(__pyx_k_get_next_matrix), 1, 1, 1},
  {&__pyx_kp_rewind, __pyx_k_rewind, sizeof(__pyx_k_rewind), 1, 1, 1},
  {&__pyx_kp__read_padding, __pyx_k__read_padding, sizeof(__pyx_k__read_padding), 1, 1, 1},
  {&__pyx_kp_add_NVT, __pyx_k_add_NVT, sizeof(__pyx_k_add_NVT), 1, 1, 1},
  {&__pyx_kp_add_matrix_type, __pyx_k_add_matrix_type, sizeof(__pyx_k_add_matrix_type), 1, 1, 1},
  {&__pyx_kp_add_frame_type, __pyx_k_add_frame_type, sizeof(__pyx_k_add_frame_type), 1, 1, 1},
  {&__pyx_kp_31, __pyx_k_31, sizeof(__pyx_k_31), 1, 1, 1},
  {&__pyx_kp_clone_NVTs, __pyx_k_clone_NVTs, sizeof(__pyx_k_clone_NVTs), 1, 1, 1},
  {&__pyx_kp_clone_definitions, __pyx_k_clone_definitions, sizeof(__pyx_k_clone_definitions), 1, 1, 1},
  {&__pyx_kp_clone_frames, __pyx_k_clone_frames, sizeof(__pyx_k_clone_frames), 1, 1, 1},
  {&__pyx_kp_add_streamID, __pyx_k_add_streamID, sizeof(__pyx_k_add_streamID), 1, 1, 1},
  {&__pyx_kp_add_predefined_type, __pyx_k_add_predefined_type, sizeof(__pyx_k_add_predefined_type), 1, 1, 1},
  {&__pyx_kp_32, __pyx_k_32, sizeof(__pyx_k_32), 1, 1, 1},
  {&__pyx_kp_new_frame, __pyx_k_new_frame, sizeof(__pyx_k_new_frame), 1, 1, 1},
  {&__pyx_kp_33, __pyx_k_33, sizeof(__pyx_k_33), 1, 1, 1},
  {&__pyx_kp_print_NVT, __pyx_k_print_NVT, sizeof(__pyx_k_print_NVT), 1, 1, 1},
  {&__pyx_kp_34, __pyx_k_34, sizeof(__pyx_k_34), 1, 1, 1},
  {&__pyx_kp_35, __pyx_k_35, sizeof(__pyx_k_35), 1, 1, 1},
  {&__pyx_kp_print_all_types, __pyx_k_print_all_types, sizeof(__pyx_k_print_all_types), 1, 1, 1},
  {&__pyx_kp_print_matrix_header, __pyx_k_print_matrix_header, sizeof(__pyx_k_print_matrix_header), 1, 1, 1},
  {&__pyx_kp_print_one_row, __pyx_k_print_one_row, sizeof(__pyx_k_print_one_row), 1, 1, 1},
  {&__pyx_kp_print_frame_header, __pyx_k_print_frame_header, sizeof(__pyx_k_print_frame_header), 1, 1, 1},
  {&__pyx_kp_print_all_stream_ID, __pyx_k_print_all_stream_ID, sizeof(__pyx_k_print_all_stream_ID), 1, 1, 1},
  {&__pyx_kp_36, __pyx_k_36, sizeof(__pyx_k_36), 1, 1, 1},
  {&__pyx_kp_get_frame_types, __pyx_k_get_frame_types, sizeof(__pyx_k_get_frame_types), 1, 1, 1},
  {&__pyx_kp_37, __pyx_k_37, sizeof(__pyx_k_37), 1, 1, 1},
  {&__pyx_kp_get_matrix_types, __pyx_k_get_matrix_types, sizeof(__pyx_k_get_matrix_types), 1, 1, 1},
  {&__pyx_kp_get_NVTs, __pyx_k_get_NVTs, sizeof(__pyx_k_get_NVTs), 1, 1, 1},
  {&__pyx_kp_get_stream_IDs, __pyx_k_get_stream_IDs, sizeof(__pyx_k_get_stream_IDs), 1, 1, 1},
  {&__pyx_kp_signature, __pyx_k_signature, sizeof(__pyx_k_signature), 1, 1, 1},
  {&__pyx_kp_s, __pyx_k_s, sizeof(__pyx_k_s), 1, 1, 1},
  {&__pyx_kp_numid, __pyx_k_numid, sizeof(__pyx_k_numid), 1, 1, 1},
  {&__pyx_kp_source, __pyx_k_source, sizeof(__pyx_k_source), 1, 1, 1},
  {&__pyx_kp_treeway, __pyx_k_treeway, sizeof(__pyx_k_treeway), 1, 1, 1},
  {&__pyx_kp_value, __pyx_k_value, sizeof(__pyx_k_value), 1, 1, 1},
  {&__pyx_kp_column_names, __pyx_k_column_names, sizeof(__pyx_k_column_names), 1, 1, 1},
  {&__pyx_kp_name, __pyx_k_name, sizeof(__pyx_k_name), 1, 1, 1},
  {&__pyx_kp_components, __pyx_k_components, sizeof(__pyx_k_components), 1, 1, 1},
  {&__pyx_kp_sdiftype, __pyx_k_sdiftype, sizeof(__pyx_k_sdiftype), 1, 1, 1},
  {&__pyx_kp_data_array, __pyx_k_data_array, sizeof(__pyx_k_data_array), 1, 1, 1},
  {&__pyx_kp_filename, __pyx_k_filename, sizeof(__pyx_k_filename), 1, 1, 1},
  {&__pyx_kp_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 1, 1, 1},
  {&__pyx_kp_predefined_type, __pyx_k_predefined_type, sizeof(__pyx_k_predefined_type), 1, 1, 1},
  {&__pyx_kp_pos, __pyx_k_pos, sizeof(__pyx_k_pos), 1, 1, 1},
  {&__pyx_kp_d, __pyx_k_d, sizeof(__pyx_k_d), 1, 1, 1},
  {&__pyx_kp_signatures_to_clone, __pyx_k_signatures_to_clone, sizeof(__pyx_k_signatures_to_clone), 1, 1, 1},
  {&__pyx_kp_time, __pyx_k_time, sizeof(__pyx_k_time), 1, 1, 1},
  {&__pyx_kp_streamID, __pyx_k_streamID, sizeof(__pyx_k_streamID), 1, 1, 1},
  {&__pyx_kp_frame_sig, __pyx_k_frame_sig, sizeof(__pyx_k_frame_sig), 1, 1, 1},
  {&__pyx_kp_matrix_sig, __pyx_k_matrix_sig, sizeof(__pyx_k_matrix_sig), 1, 1, 1},
  {&__pyx_kp_38, __pyx_k_38, sizeof(__pyx_k_38), 1, 1, 1},
  {&__pyx_kp_os, __pyx_k_os, sizeof(__pyx_k_os), 0, 1, 1},
  {&__pyx_kp_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 1, 1, 1},
  {&__pyx_kp_39, __pyx_k_39, sizeof(__pyx_k_39), 0, 1, 0},
  {&__pyx_kp_40, __pyx_k_40, sizeof(__pyx_k_40), 0, 1, 0},
  {&__pyx_kp_41, __pyx_k_41, sizeof(__pyx_k_41), 0, 1, 0},
  {&__pyx_kp_42, __pyx_k_42, sizeof(__pyx_k_42), 0, 1, 0},
  {&__pyx_kp_43, __pyx_k_43, sizeof(__pyx_k_43), 0, 1, 0},
  {&__pyx_kp_44, __pyx_k_44, sizeof(__pyx_k_44), 0, 1, 0},
  {&__pyx_kp_45, __pyx_k_45, sizeof(__pyx_k_45), 0, 1, 0},
  {&__pyx_kp_46, __pyx_k_46, sizeof(__pyx_k_46), 0, 1, 0},
  {&__pyx_kp_47, __pyx_k_47, sizeof(__pyx_k_47), 0, 1, 0},
  {&__pyx_kp_48, __pyx_k_48, sizeof(__pyx_k_48), 0, 1, 0},
  {&__pyx_kp_49, __pyx_k_49, sizeof(__pyx_k_49), 0, 1, 0},
  {&__pyx_kp_50, __pyx_k_50, sizeof(__pyx_k_50), 0, 1, 0},
  {&__pyx_kp_51, __pyx_k_51, sizeof(__pyx_k_51), 0, 1, 0},
  {&__pyx_kp_52, __pyx_k_52, sizeof(__pyx_k_52), 0, 1, 0},
  {&__pyx_kp_53, __pyx_k_53, sizeof(__pyx_k_53), 0, 1, 0},
  {&__pyx_kp_56, __pyx_k_56, sizeof(__pyx_k_56), 0, 1, 0},
  {&__pyx_kp_55, __pyx_k_55, sizeof(__pyx_k_55), 0, 1, 0},
  {&__pyx_kp_59, __pyx_k_59, sizeof(__pyx_k_59), 0, 1, 0},
  {&__pyx_kp_58, __pyx_k_58, sizeof(__pyx_k_58), 0, 1, 0},
  {&__pyx_kp_54, __pyx_k_54, sizeof(__pyx_k_54), 0, 1, 0},
  {&__pyx_kp_SDIF_NEWTYPES, __pyx_k_SDIF_NEWTYPES, sizeof(__pyx_k_SDIF_NEWTYPES), 1, 1, 1},
  {&__pyx_kp_61, __pyx_k_61, sizeof(__pyx_k_61), 0, 1, 0},
  {&__pyx_kp_62, __pyx_k_62, sizeof(__pyx_k_62), 0, 1, 0},
  {&__pyx_kp_63, __pyx_k_63, sizeof(__pyx_k_63), 0, 1, 0},
  {&__pyx_kp_c_numpy, __pyx_k_c_numpy, sizeof(__pyx_k_c_numpy), 0, 1, 1},
  {&__pyx_kp_NPY_ULONg, __pyx_k_NPY_ULONg, sizeof(__pyx_k_NPY_ULONg), 1, 1, 1},
  {&__pyx_kp_range, __pyx_k_range, sizeof(__pyx_k_range), 1, 1, 1},
  {&__pyx_kp_append, __pyx_k_append, sizeof(__pyx_k_append), 1, 1, 1},
  {&__pyx_kp_65, __pyx_k_65, sizeof(__pyx_k_65), 1, 1, 1},
  {&__pyx_kp_join, __pyx_k_join, sizeof(__pyx_k_join), 1, 1, 1},
  {&__pyx_kp_get, __pyx_k_get, sizeof(__pyx_k_get), 1, 1, 1},
  {&__pyx_kp_71, __pyx_k_71, sizeof(__pyx_k_71), 0, 1, 0},
  {&__pyx_kp_72, __pyx_k_72, sizeof(__pyx_k_72), 0, 1, 0},
  {&__pyx_kp_path, __pyx_k_path, sizeof(__pyx_k_path), 1, 1, 1},
  {&__pyx_kp_split, __pyx_k_split, sizeof(__pyx_k_split), 1, 1, 1},
  {&__pyx_kp___file__, __pyx_k___file__, sizeof(__pyx_k___file__), 1, 1, 1},
  {&__pyx_kp_sep, __pyx_k_sep, sizeof(__pyx_k_sep), 1, 1, 1},
  {&__pyx_kp_exists, __pyx_k_exists, sizeof(__pyx_k_exists), 1, 1, 1},
  {&__pyx_kp_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 1, 1, 1},
  {&__pyx_kp_rows, __pyx_k_rows, sizeof(__pyx_k_rows), 1, 1, 1},
  {&__pyx_kp_cols, __pyx_k_cols, sizeof(__pyx_k_cols), 1, 1, 1},
  {&__pyx_kp_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 1, 1, 1},
  {&__pyx_kp_resize, __pyx_k_resize, sizeof(__pyx_k_resize), 1, 1, 1},
  {&__pyx_kp_78, __pyx_k_78, sizeof(__pyx_k_78), 0, 1, 0},
  {&__pyx_kp_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 1, 1, 1},
  {&__pyx_kp_iteritems, __pyx_k_iteritems, sizeof(__pyx_k_iteritems), 1, 1, 1},
  {&__pyx_kp_basestring, __pyx_k_basestring, sizeof(__pyx_k_basestring), 1, 1, 1},
  {&__pyx_kp_84, __pyx_k_84, sizeof(__pyx_k_84), 1, 1, 1},
  {&__pyx_kp_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 1, 1, 1},
  {&__pyx_kp_matrices_in_frame, __pyx_k_matrices_in_frame, sizeof(__pyx_k_matrices_in_frame), 1, 1, 1},
  {&__pyx_kp_next, __pyx_k_next, sizeof(__pyx_k_next), 1, 1, 1},
  {&__pyx_kp_86, __pyx_k_86, sizeof(__pyx_k_86), 0, 1, 0},
  {&__pyx_kp_88, __pyx_k_88, sizeof(__pyx_k_88), 0, 1, 0},
  {&__pyx_kp_91, __pyx_k_91, sizeof(__pyx_k_91), 0, 1, 0},
  {&__pyx_kp_92, __pyx_k_92, sizeof(__pyx_k_92), 0, 1, 0},
  {&__pyx_kp_array, __pyx_k_array, sizeof(__pyx_k_array), 1, 1, 1},
  {&__pyx_kp_57, __pyx_k_57, sizeof(__pyx_k_57), 0, 0, 0},
  {&__pyx_kp_60, __pyx_k_60, sizeof(__pyx_k_60), 0, 0, 0},
  {&__pyx_kp_64, __pyx_k_64, sizeof(__pyx_k_64), 0, 0, 0},
  {&__pyx_kp_67, __pyx_k_67, sizeof(__pyx_k_67), 0, 0, 0},
  {&__pyx_kp_66, __pyx_k_66, sizeof(__pyx_k_66), 0, 0, 0},
  {&__pyx_kp_68, __pyx_k_68, sizeof(__pyx_k_68), 0, 0, 0},
  {&__pyx_kp_70, __pyx_k_70, sizeof(__pyx_k_70), 0, 0, 0},
  {&__pyx_kp_69, __pyx_k_69, sizeof(__pyx_k_69), 0, 0, 0},
  {&__pyx_kp_73, __pyx_k_73, sizeof(__pyx_k_73), 0, 0, 0},
  {&__pyx_kp_75, __pyx_k_75, sizeof(__pyx_k_75), 0, 0, 0},
  {&__pyx_kp_76, __pyx_k_76, sizeof(__pyx_k_76), 0, 0, 0},
  {&__pyx_kp_77, __pyx_k_77, sizeof(__pyx_k_77), 0, 0, 0},
  {&__pyx_kp_79, __pyx_k_79, sizeof(__pyx_k_79), 0, 0, 0},
  {&__pyx_kp_80, __pyx_k_80, sizeof(__pyx_k_80), 0, 0, 0},
  {&__pyx_kp_81, __pyx_k_81, sizeof(__pyx_k_81), 0, 0, 0},
  {&__pyx_kp_82, __pyx_k_82, sizeof(__pyx_k_82), 0, 0, 0},
  {&__pyx_kp_83, __pyx_k_83, sizeof(__pyx_k_83), 0, 0, 0},
  {&__pyx_kp_85, __pyx_k_85, sizeof(__pyx_k_85), 0, 0, 0},
  {&__pyx_kp_87, __pyx_k_87, sizeof(__pyx_k_87), 0, 0, 0},
  {&__pyx_kp_89, __pyx_k_89, sizeof(__pyx_k_89), 0, 0, 0},
  {&__pyx_kp_90, __pyx_k_90, sizeof(__pyx_k_90), 0, 0, 0},
  {&__pyx_kp_93, __pyx_k_93, sizeof(__pyx_k_93), 0, 0, 0},
  {&__pyx_kp_94, __pyx_k_94, sizeof(__pyx_k_94), 0, 0, 0},
  {&__pyx_kp___getbuffer__, __pyx_k___getbuffer__, sizeof(__pyx_k___getbuffer__), 1, 1, 1},
  {&__pyx_kp___releasebuffer__, __pyx_k___releasebuffer__, sizeof(__pyx_k___releasebuffer__), 1, 1, 1},
  {&__pyx_kp_info, __pyx_k_info, sizeof(__pyx_k_info), 1, 1, 1},
  {&__pyx_kp_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 1, 1, 1},
  {&__pyx_kp_1, __pyx_k_1, sizeof(__pyx_k_1), 0, 0, 0},
  {&__pyx_kp_2, __pyx_k_2, sizeof(__pyx_k_2), 0, 0, 0},
  {&__pyx_kp_5, __pyx_k_5, sizeof(__pyx_k_5), 0, 0, 0},
  {&__pyx_kp_23, __pyx_k_23, sizeof(__pyx_k_23), 0, 0, 0},
  {&__pyx_kp_25, __pyx_k_25, sizeof(__pyx_k_25), 0, 0, 0},
  {&__pyx_kp_28, __pyx_k_28, sizeof(__pyx_k_28), 0, 0, 0},
  {&__pyx_kp_29, __pyx_k_29, sizeof(__pyx_k_29), 0, 0, 0},
  {&__pyx_kp_30, __pyx_k_30, sizeof(__pyx_k_30), 0, 0, 0},
  {0, 0, 0, 0, 0, 0}
};
static int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_range = __Pyx_GetName(__pyx_b, __pyx_kp_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_StopIteration = __Pyx_GetName(__pyx_b, __pyx_kp_StopIteration); if (!__pyx_builtin_StopIteration) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 554; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_RuntimeError = __Pyx_GetName(__pyx_b, __pyx_kp_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 747; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_basestring = __Pyx_GetName(__pyx_b, __pyx_kp_basestring); if (!__pyx_builtin_basestring) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1030; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_builtin_ValueError = __Pyx_GetName(__pyx_b, __pyx_kp_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1144; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  return 0;
  __pyx_L1_error:;
  return -1;
}

static int __Pyx_InitGlobals(void) {
  __pyx_int_0x0301 = PyInt_FromLong(0x0301); if (unlikely(!__pyx_int_0x0301)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0004 = PyInt_FromLong(0x0004); if (unlikely(!__pyx_int_0x0004)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0008 = PyInt_FromLong(0x0008); if (unlikely(!__pyx_int_0x0008)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0101 = PyInt_FromLong(0x0101); if (unlikely(!__pyx_int_0x0101)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0102 = PyInt_FromLong(0x0102); if (unlikely(!__pyx_int_0x0102)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0104 = PyInt_FromLong(0x0104); if (unlikely(!__pyx_int_0x0104)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0108 = PyInt_FromLong(0x0108); if (unlikely(!__pyx_int_0x0108)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0201 = PyInt_FromLong(0x0201); if (unlikely(!__pyx_int_0x0201)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0202 = PyInt_FromLong(0x0202); if (unlikely(!__pyx_int_0x0202)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0204 = PyInt_FromLong(0x0204); if (unlikely(!__pyx_int_0x0204)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0x0208 = PyInt_FromLong(0x0208); if (unlikely(!__pyx_int_0x0208)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  __pyx_int_15 = PyInt_FromLong(15); if (unlikely(!__pyx_int_15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  return 0;
  __pyx_L1_error:;
  return -1;
}

#if PY_MAJOR_VERSION < 3
PyMODINIT_FUNC init_pysdif(void); /*proto*/
PyMODINIT_FUNC init_pysdif(void)
#else
PyMODINIT_FUNC PyInit__pysdif(void); /*proto*/
PyMODINIT_FUNC PyInit__pysdif(void)
#endif
{
  PyObject *__pyx_1 = 0;
  PyObject *__pyx_2 = 0;
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  __pyx_init_filenames();
  #ifdef CYTHON_REFNANNY
  void* __pyx_refchk = NULL;
  __Pyx_Refnanny = __Pyx_ImportRefcountAPI("refnanny");
  if (!__Pyx_Refnanny) {
      PyErr_Clear();
      __Pyx_Refnanny = __Pyx_ImportRefcountAPI("Cython.Runtime.refnanny");
      if (!__Pyx_Refnanny)
          Py_FatalError("failed to import refnanny module");
  }
  __pyx_refchk = __Pyx_Refnanny->NewContext("PyMODINIT_FUNC PyInit__pysdif(void)", __LINE__, __FILE__);
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #if PY_MAJOR_VERSION < 3
  __pyx_empty_bytes = PyString_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #else
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  #ifdef WITH_THREAD /* Python build with threading support? */
  PyEval_InitThreads();
  #endif
  #endif
  /*--- Module creation code ---*/
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4(__Pyx_NAMESTR("_pysdif"), __pyx_methods, 0, 0, PYTHON_API_VERSION);
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  #endif
  if (!__pyx_m) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  #if PY_MAJOR_VERSION < 3
  Py_INCREF(__pyx_m);
  #endif
  __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME));
  if (!__pyx_b) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  if (__pyx_module_is_main_pysdif___pysdif) {
    if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_kp___main__) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
  }
  /*--- Initialize various global constants etc. ---*/
  if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Builtin init code ---*/
  if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_skip_dispatch = 0;
  /*--- Global init code ---*/
  __pyx_v_6pysdif_7_pysdif__SDIF_FILEMODE = ((PyObject *)Py_None); Py_INCREF(Py_None);
  __pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES = ((PyObject *)Py_None); Py_INCREF(Py_None);
  __pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM = ((PyObject *)Py_None); Py_INCREF(Py_None);
  /*--- Function export code ---*/
  /*--- Type init code ---*/
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_StreamID) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "StreamID", (PyObject *)&__pyx_type_6pysdif_7_pysdif_StreamID) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 184; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_StreamID = &__pyx_type_6pysdif_7_pysdif_StreamID;
  __pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition = &__pyx_vtable_6pysdif_7_pysdif_MatrixTypeDefinition;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_6pysdif_7_pysdif_MatrixTypeDefinition.toSdifMatrixType = (SdifMatrixTypeT *(*)(struct __pyx_obj_6pysdif_7_pysdif_MatrixTypeDefinition *))__pyx_f_6pysdif_7_pysdif_20MatrixTypeDefinition_toSdifMatrixType;
  #else
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_MatrixTypeDefinition.toSdifMatrixType = (void(*)(void))__pyx_f_6pysdif_7_pysdif_20MatrixTypeDefinition_toSdifMatrixType;
  #endif
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition.tp_dict, __pyx_vtabptr_6pysdif_7_pysdif_MatrixTypeDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "MatrixTypeDefinition", (PyObject *)&__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_MatrixTypeDefinition = &__pyx_type_6pysdif_7_pysdif_MatrixTypeDefinition;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_Component) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Component", (PyObject *)&__pyx_type_6pysdif_7_pysdif_Component) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 272; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_Component = &__pyx_type_6pysdif_7_pysdif_Component;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FrameTypeDefinition", (PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 308; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_FrameTypeDefinition = &__pyx_type_6pysdif_7_pysdif_FrameTypeDefinition;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_FrameR) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FrameR", (PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameR) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 497; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_FrameR = &__pyx_type_6pysdif_7_pysdif_FrameR;
  __pyx_vtabptr_6pysdif_7_pysdif_SdifFile = &__pyx_vtable_6pysdif_7_pysdif_SdifFile;
  #if PY_MAJOR_VERSION >= 3
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.init_read = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_read;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.init_containers = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_containers;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.init_write = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_write;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.finalize_frame = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_finalize_frame;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.read_signature = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_read_signature;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.read_matrix_data = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_read_matrix_data;
  __pyx_vtable_6pysdif_7_pysdif_SdifFile.reinit = (void (*)(struct __pyx_obj_6pysdif_7_pysdif_SdifFile *))__pyx_f_6pysdif_7_pysdif_8SdifFile_reinit;
  #else
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_SdifFile.init_read = (void(*)(void))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_read;
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_SdifFile.init_containers = (void(*)(void))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_containers;
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_SdifFile.init_write = (void(*)(void))__pyx_f_6pysdif_7_pysdif_8SdifFile_init_write;
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_SdifFile.finalize_frame = (void(*)(void))__pyx_f_6pysdif_7_pysdif_8SdifFile_finalize_frame;
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_SdifFile.read_signature = (void(*)(void))__pyx_f_6pysdif_7_pysdif_8SdifFile_read_signature;
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_SdifFile.read_matrix_data = (void(*)(void))__pyx_f_6pysdif_7_pysdif_8SdifFile_read_matrix_data;
  *(void(**)(void))&__pyx_vtable_6pysdif_7_pysdif_SdifFile.reinit = (void(*)(void))__pyx_f_6pysdif_7_pysdif_8SdifFile_reinit;
  #endif
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_SdifFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetVtable(__pyx_type_6pysdif_7_pysdif_SdifFile.tp_dict, __pyx_vtabptr_6pysdif_7_pysdif_SdifFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "SdifFile", (PyObject *)&__pyx_type_6pysdif_7_pysdif_SdifFile) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 657; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_SdifFile = &__pyx_type_6pysdif_7_pysdif_SdifFile;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_Matrix) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "Matrix", (PyObject *)&__pyx_type_6pysdif_7_pysdif_Matrix) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 389; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_Matrix = &__pyx_type_6pysdif_7_pysdif_Matrix;
  if (PyType_Ready(&__pyx_type_6pysdif_7_pysdif_FrameW) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  if (__Pyx_SetAttrString(__pyx_m, "FrameW", (PyObject *)&__pyx_type_6pysdif_7_pysdif_FrameW) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 578; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_6pysdif_7_pysdif_FrameW = &__pyx_type_6pysdif_7_pysdif_FrameW;
  /*--- Type import code ---*/
  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr)); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 119; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject)); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 129; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject)); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 133; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject)); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  /*--- Function import code ---*/
  /*--- Execution code ---*/

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":11
 *     void import_array()
 * 
 * import os.path             # <<<<<<<<<<<<<<
 * import numpy
 * cimport numpy as c_numpy
 */
  __pyx_1 = __Pyx_Import(__pyx_kp_38, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_os, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 11; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":12
 * 
 * import os.path
 * import numpy             # <<<<<<<<<<<<<<
 * cimport numpy as c_numpy
 * from numpy cimport ndarray, npy_intp
 */
  __pyx_1 = __Pyx_Import(__pyx_kp_numpy, 0); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_1);
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_numpy, __pyx_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 12; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_1); __pyx_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":27
 * # ----------------------------------------------------------------------------------
 * 
 * cdef int SDIF_CLOSED = 2             # <<<<<<<<<<<<<<
 * cdef int _g_sdif_initiated = 0
 * 
 */
  __pyx_v_6pysdif_7_pysdif_SDIF_CLOSED = 2;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":28
 * 
 * cdef int SDIF_CLOSED = 2
 * cdef int _g_sdif_initiated = 0             # <<<<<<<<<<<<<<
 * 
 * cdef dict _SDIF_FILEMODE = {
 */
  __pyx_v_6pysdif_7_pysdif__g_sdif_initiated = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":30
 * cdef int _g_sdif_initiated = 0
 * 
 * cdef dict _SDIF_FILEMODE = {             # <<<<<<<<<<<<<<
 *     'r' : eReadFile,
 *     'w' : eWriteFile,
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":31
 * 
 * cdef dict _SDIF_FILEMODE = {
 *     'r' : eReadFile,             # <<<<<<<<<<<<<<
 *     'w' : eWriteFile,
 *     'rw': eReadWriteFile,
 */
  __pyx_t_1 = PyInt_FromLong(eReadFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 31; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_kp_39, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":32
 * cdef dict _SDIF_FILEMODE = {
 *     'r' : eReadFile,
 *     'w' : eWriteFile,             # <<<<<<<<<<<<<<
 *     'rw': eReadWriteFile,
 *     'wr': eReadWriteFile
 */
  __pyx_t_1 = PyInt_FromLong(eWriteFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 32; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_kp_40, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":33
 *     'r' : eReadFile,
 *     'w' : eWriteFile,
 *     'rw': eReadWriteFile,             # <<<<<<<<<<<<<<
 *     'wr': eReadWriteFile
 * }
 */
  __pyx_t_1 = PyInt_FromLong(eReadWriteFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 33; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_kp_41, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":35
 *     'rw': eReadWriteFile,
 *     'wr': eReadWriteFile
 * }             # <<<<<<<<<<<<<<
 * 
 * cdef dict _SDIF_DATATYPES = {
 */
  __pyx_t_1 = PyInt_FromLong(eReadWriteFile); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 35; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_kp_42, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 30; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GOTREF(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_FILEMODE));
  __Pyx_DECREF(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_FILEMODE));
  __Pyx_GIVEREF(((PyObject *)__pyx_1));
  __pyx_v_6pysdif_7_pysdif__SDIF_FILEMODE = __pyx_1;
  __pyx_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":37
 * }
 * 
 * cdef dict _SDIF_DATATYPES = {             # <<<<<<<<<<<<<<
 *     0x0301:"char",
 *     0x0004:"float32",
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":38
 * 
 * cdef dict _SDIF_DATATYPES = {
 *     0x0301:"char",             # <<<<<<<<<<<<<<
 *     0x0004:"float32",
 *     0x0008:"float64",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0301, __pyx_kp_43) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":39
 * cdef dict _SDIF_DATATYPES = {
 *     0x0301:"char",
 *     0x0004:"float32",             # <<<<<<<<<<<<<<
 *     0x0008:"float64",
 *     0x0101:"int8",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0004, __pyx_kp_44) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":40
 *     0x0301:"char",
 *     0x0004:"float32",
 *     0x0008:"float64",             # <<<<<<<<<<<<<<
 *     0x0101:"int8",
 *     0x0102:"int16",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0008, __pyx_kp_45) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":41
 *     0x0004:"float32",
 *     0x0008:"float64",
 *     0x0101:"int8",             # <<<<<<<<<<<<<<
 *     0x0102:"int16",
 *     0x0104:"int32",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0101, __pyx_kp_46) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":42
 *     0x0008:"float64",
 *     0x0101:"int8",
 *     0x0102:"int16",             # <<<<<<<<<<<<<<
 *     0x0104:"int32",
 *     0x0108:"int64",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0102, __pyx_kp_47) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":43
 *     0x0101:"int8",
 *     0x0102:"int16",
 *     0x0104:"int32",             # <<<<<<<<<<<<<<
 *     0x0108:"int64",
 *     0x0201:"uint8",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0104, __pyx_kp_48) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":44
 *     0x0102:"int16",
 *     0x0104:"int32",
 *     0x0108:"int64",             # <<<<<<<<<<<<<<
 *     0x0201:"uint8",
 *     0x0202:"uint16",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0108, __pyx_kp_49) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":45
 *     0x0104:"int32",
 *     0x0108:"int64",
 *     0x0201:"uint8",             # <<<<<<<<<<<<<<
 *     0x0202:"uint16",
 *     0x0204:"uint32",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0201, __pyx_kp_50) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":46
 *     0x0108:"int64",
 *     0x0201:"uint8",
 *     0x0202:"uint16",             # <<<<<<<<<<<<<<
 *     0x0204:"uint32",
 *     0x0208:"uint64",
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0202, __pyx_kp_51) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":47
 *     0x0201:"uint8",
 *     0x0202:"uint16",
 *     0x0204:"uint32",             # <<<<<<<<<<<<<<
 *     0x0208:"uint64",
 *     }
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0204, __pyx_kp_52) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":48
 *     0x0202:"uint16",
 *     0x0204:"uint32",
 *     0x0208:"uint64",             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0208, __pyx_kp_53) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 37; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES));
  __Pyx_DECREF(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES));
  __Pyx_GIVEREF(((PyObject *)__pyx_1));
  __pyx_v_6pysdif_7_pysdif__SDIF_DATATYPES = __pyx_1;
  __pyx_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":51
 *     }
 * 
 * cdef dict _SDIF_TO_NUMPY_TYPENUM = {             # <<<<<<<<<<<<<<
 *     0x0301:c_numpy.NPY_BYTE,
 *     0x0004:c_numpy.NPY_FLOAT,
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":52
 * 
 * cdef dict _SDIF_TO_NUMPY_TYPENUM = {
 *     0x0301:c_numpy.NPY_BYTE,             # <<<<<<<<<<<<<<
 *     0x0004:c_numpy.NPY_FLOAT,
 *     0x0008:c_numpy.NPY_DOUBLE,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 52; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0301, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":53
 * cdef dict _SDIF_TO_NUMPY_TYPENUM = {
 *     0x0301:c_numpy.NPY_BYTE,
 *     0x0004:c_numpy.NPY_FLOAT,             # <<<<<<<<<<<<<<
 *     0x0008:c_numpy.NPY_DOUBLE,
 *     0x0101:c_numpy.NPY_BYTE,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 53; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0004, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":54
 *     0x0301:c_numpy.NPY_BYTE,
 *     0x0004:c_numpy.NPY_FLOAT,
 *     0x0008:c_numpy.NPY_DOUBLE,             # <<<<<<<<<<<<<<
 *     0x0101:c_numpy.NPY_BYTE,
 *     0x0102:c_numpy.NPY_SHORT,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 54; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0008, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":55
 *     0x0004:c_numpy.NPY_FLOAT,
 *     0x0008:c_numpy.NPY_DOUBLE,
 *     0x0101:c_numpy.NPY_BYTE,             # <<<<<<<<<<<<<<
 *     0x0102:c_numpy.NPY_SHORT,
 *     0x0104:c_numpy.NPY_INT,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0101, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":56
 *     0x0008:c_numpy.NPY_DOUBLE,
 *     0x0101:c_numpy.NPY_BYTE,
 *     0x0102:c_numpy.NPY_SHORT,             # <<<<<<<<<<<<<<
 *     0x0104:c_numpy.NPY_INT,
 *     0x0108:c_numpy.NPY_LONG,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 56; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0102, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":57
 *     0x0101:c_numpy.NPY_BYTE,
 *     0x0102:c_numpy.NPY_SHORT,
 *     0x0104:c_numpy.NPY_INT,             # <<<<<<<<<<<<<<
 *     0x0108:c_numpy.NPY_LONG,
 *     0x0201:c_numpy.NPY_UBYTE,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0104, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":58
 *     0x0102:c_numpy.NPY_SHORT,
 *     0x0104:c_numpy.NPY_INT,
 *     0x0108:c_numpy.NPY_LONG,             # <<<<<<<<<<<<<<
 *     0x0201:c_numpy.NPY_UBYTE,
 *     0x0202:c_numpy.NPY_USHORT,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 58; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0108, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":59
 *     0x0104:c_numpy.NPY_INT,
 *     0x0108:c_numpy.NPY_LONG,
 *     0x0201:c_numpy.NPY_UBYTE,             # <<<<<<<<<<<<<<
 *     0x0202:c_numpy.NPY_USHORT,
 *     0x0204:c_numpy.NPY_UINT,
 */
  __pyx_t_1 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 59; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0201, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":60
 *     0x0108:c_numpy.NPY_LONG,
 *     0x0201:c_numpy.NPY_UBYTE,
 *     0x0202:c_numpy.NPY_USHORT,             # <<<<<<<<<<<<<<
 *     0x0204:c_numpy.NPY_UINT,
 *     0x0208:c_numpy.NPY_ULONG
 */
  __pyx_t_1 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 60; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0202, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":61
 *     0x0201:c_numpy.NPY_UBYTE,
 *     0x0202:c_numpy.NPY_USHORT,
 *     0x0204:c_numpy.NPY_UINT,             # <<<<<<<<<<<<<<
 *     0x0208:c_numpy.NPY_ULONG
 *     }
 */
  __pyx_t_1 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 61; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0204, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":62
 *     0x0202:c_numpy.NPY_USHORT,
 *     0x0204:c_numpy.NPY_UINT,
 *     0x0208:c_numpy.NPY_ULONG             # <<<<<<<<<<<<<<
 *     }
 * 
 */
  __pyx_t_1 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 62; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_1, __pyx_int_0x0208, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 51; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_GOTREF(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM));
  __Pyx_DECREF(((PyObject *)__pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM));
  __Pyx_GIVEREF(((PyObject *)__pyx_1));
  __pyx_v_6pysdif_7_pysdif__SDIF_TO_NUMPY_TYPENUM = __pyx_1;
  __pyx_1 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":324
 * # ----------------------------------------------------------------------
 * 
 * SDIF_NEWTYPES = {             # <<<<<<<<<<<<<<
 *     'RBEP': {
 *         'frame_types':[('RBEP', 'RBEP ReassignedBandEnhancedPartials')],
 */
  __pyx_1 = PyDict_New(); if (unlikely(!__pyx_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_1));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":325
 * 
 * SDIF_NEWTYPES = {
 *     'RBEP': {             # <<<<<<<<<<<<<<
 *         'frame_types':[('RBEP', 'RBEP ReassignedBandEnhancedPartials')],
 *         'matrix_types':[('RBEP', 'Index, Frequency, Amplitude, Phase, Bandwidth, Offset')]
 */
  __pyx_2 = PyDict_New(); if (unlikely(!__pyx_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_2));

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":326
 * SDIF_NEWTYPES = {
 *     'RBEP': {
 *         'frame_types':[('RBEP', 'RBEP ReassignedBandEnhancedPartials')],             # <<<<<<<<<<<<<<
 *         'matrix_types':[('RBEP', 'Index, Frequency, Amplitude, Phase, Bandwidth, Offset')]
 *         }
 */
  __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  __Pyx_INCREF(__pyx_kp_56);
  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_kp_56);
  __Pyx_GIVEREF(__pyx_kp_56);
  __Pyx_INCREF(__pyx_kp_57);
  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_kp_57);
  __Pyx_GIVEREF(__pyx_kp_57);
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 326; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  PyList_SET_ITEM(__pyx_t_2, 0, ((PyObject *)__pyx_t_1));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_1));
  __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_2, __pyx_kp_55, ((PyObject *)__pyx_t_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_2)); __pyx_t_2 = 0;

  /* "/Users/edu/dev/cython/pysdif/_pysdif.pyx":327
 *     'RBEP': {
 *         'frame_types':[('RBEP', 'RBEP ReassignedBandEnhancedPartials')],
 *         'matrix_types':[('RBEP', 'Index, Frequency, Amplitude, Phase, Bandwidth, Offset')]             # <<<<<<<<<<<<<<
 *         }
 * }
 */
  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_2));
  __Pyx_INCREF(__pyx_kp_59);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_kp_59);
  __Pyx_GIVEREF(__pyx_kp_59);
  __Pyx_INCREF(__pyx_kp_60);
  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_kp_60);
  __Pyx_GIVEREF(__pyx_kp_60);
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 327; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_GOTREF(((PyObject *)__pyx_t_1));
  PyList_SET_ITEM(__pyx_t_1, 0, ((PyObject *)__pyx_t_2));
  __Pyx_GIVEREF(((PyObject *)__pyx_t_2));
  __pyx_t_2 = 0;
  if (PyDict_SetItem(__pyx_2, __pyx_kp_58, ((PyObject *)__pyx_t_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 325; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_t_1)); __pyx_t_1 = 0;
  if (PyDict_SetItem(__pyx_1, __pyx_kp_54, ((PyObject *)__pyx_2)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_2)); __pyx_2 = 0;
  if (PyObject_SetAttr(__pyx_m, __pyx_kp_SDIF_NEWTYPES, ((PyObject *)__pyx_1)) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 324; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
  __Pyx_DECREF(((PyObject *)__pyx_1)); __pyx_1 = 0;

  /* "/Library/Frameworks/Python.framework/Versions/4.1.30101/lib/python2.5/site-packages/Cython-0.11.3-py2.5-macosx-10.3-i386.egg/Cython/Includes/numpy.pxd":690
 * ctypedef npy_cdouble     complex_t
 * 
 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:             # <<<<<<<<<<<<<<
 *     # Recursive utility function used in __getbuffer__ to get format
 *     # string. The new location in the format string is returned.
 */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_1);
  __Pyx_XDECREF(__pyx_2);
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  if (__pyx_m) {
    __Pyx_AddTraceback("init pysdif._pysdif");
    Py_DECREF(__pyx_m); __pyx_m = 0;
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init pysdif._pysdif");
  }
  __pyx_L0:;
  __Pyx_FinishRefcountContext();
  #if PY_MAJOR_VERSION < 3
  return;
  #else
  return __pyx_m;
  #endif
}

static const char *__pyx_filenames[] = {
  "_pysdif.pyx",
  "numpy.pxd",
};

/* Runtime support code */

static void __pyx_init_filenames(void) {
  __pyx_f = __pyx_filenames;
}

static int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (obj == Py_None || PyObject_TypeCheck(obj, type))
        return 1;
    PyErr_Format(PyExc_TypeError, "Cannot convert %s to %s",
        Py_TYPE(obj)->tp_name, type->tp_name);
    return 0;
}

static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AS_STRING(kw_name));
        #endif
}

static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *number, *more_or_less;

    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    number = (num_expected == 1) ? "" : "s";
    PyErr_Format(PyExc_TypeError,
        #if PY_VERSION_HEX < 0x02050000
            "%s() takes %s %d positional argument%s (%d given)",
        #else
            "%s() takes %s %zd positional argument%s (%zd given)",
        #endif
        func_name, more_or_less, num_expected, number, num_found);
}

static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;

    while (PyDict_Next(kwds, &pos, &key, &value)) {
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
        } else {
            #if PY_MAJOR_VERSION < 3
            if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key))) {
            #else
            if (unlikely(!PyUnicode_CheckExact(key)) && unlikely(!PyUnicode_Check(key))) {
            #endif
                goto invalid_keyword_type;
            } else {
                for (name = first_kw_arg; *name; name++) {
                    #if PY_MAJOR_VERSION >= 3
                    if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                        PyUnicode_Compare(**name, key) == 0) break;
                    #else
                    if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                        _PyString_Eq(**name, key)) break;
                    #endif
                }
                if (*name) {
                    values[name-argnames] = value;
                } else {
                    /* unexpected keyword found */
                    for (name=argnames; name != first_kw_arg; name++) {
                        if (**name == key) goto arg_passed_twice;
                        #if PY_MAJOR_VERSION >= 3
                        if (PyUnicode_GET_SIZE(**name) == PyUnicode_GET_SIZE(key) &&
                            PyUnicode_Compare(**name, key) == 0) goto arg_passed_twice;
                        #else
                        if (PyString_GET_SIZE(**name) == PyString_GET_SIZE(key) &&
                            _PyString_Eq(**name, key)) goto arg_passed_twice;
                        #endif
                    }
                    if (kwds2) {
                        if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
                    } else {
                        goto invalid_keyword;
                    }
                }
            }
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, **name);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    PyErr_Format(PyExc_TypeError,
    #if PY_MAJOR_VERSION < 3
        "%s() got an unexpected keyword argument '%s'",
        function_name, PyString_AsString(key));
    #else
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}


static INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

static INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
        #if PY_VERSION_HEX < 0x02050000
                 "need more than %d value%s to unpack", (int)index,
        #else
                 "need more than %zd value%s to unpack", index,
        #endif
                 (index == 1) ? "" : "s");
}

static INLINE void __Pyx_RaiseTooManyValuesError(void) {
    PyErr_SetString(PyExc_ValueError, "too many values to unpack");
}

static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError();
    }
}

static int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
    const char *name, int exact)
{
    if (!type) {
        PyErr_Format(PyExc_SystemError, "Missing type object");
        return 0;
    }
    if (none_allowed && obj == Py_None) return 1;
    else if (exact) {
        if (Py_TYPE(obj) == type) return 1;
    }
    else {
        if (PyObject_TypeCheck(obj, type)) return 1;
    }
    PyErr_Format(PyExc_TypeError,
        "Argument '%s' has incorrect type (expected %s, got %s)",
        name, type->tp_name, Py_TYPE(obj)->tp_name);
    return 0;
}

static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list) {
    PyObject *__import__ = 0;
    PyObject *empty_list = 0;
    PyObject *module = 0;
    PyObject *global_dict = 0;
    PyObject *empty_dict = 0;
    PyObject *list;
    __import__ = __Pyx_GetAttrString(__pyx_b, "__import__");
    if (!__import__)
        goto bad;
    if (from_list)
        list = from_list;
    else {
        empty_list = PyList_New(0);
        if (!empty_list)
            goto bad;
        list = empty_list;
    }
    global_dict = PyModule_GetDict(__pyx_m);
    if (!global_dict)
        goto bad;
    empty_dict = PyDict_New();
    if (!empty_dict)
        goto bad;
    module = PyObject_CallFunctionObjArgs(__import__,
        name, global_dict, empty_dict, list, NULL);
bad:
    Py_XDECREF(empty_list);
    Py_XDECREF(__import__);
    Py_XDECREF(empty_dict);
    return module;
}

static PyObject *__Pyx_GetName(PyObject *dict, PyObject *name) {
    PyObject *result;
    result = PyObject_GetAttr(dict, name);
    if (!result)
        PyErr_SetObject(PyExc_NameError, name);
    return result;
}

static INLINE SdifSignature __Pyx_PyInt_from_py_SdifSignature(PyObject* x) {
  /**/ if (sizeof(SdifSignature) == sizeof(char))
     return (((SdifSignature)-1) < ((SdifSignature)0)) ?
            (SdifSignature)__Pyx_PyInt_AsSignedChar(x) :
            (SdifSignature)__Pyx_PyInt_AsUnsignedChar(x);
  else if (sizeof(SdifSignature) == sizeof(short))
     return (((SdifSignature)-1) < ((SdifSignature)0)) ?
            (SdifSignature)__Pyx_PyInt_AsSignedShort(x) :
            (SdifSignature)__Pyx_PyInt_AsUnsignedShort(x);
  else if (sizeof(SdifSignature) == sizeof(int))
     return (((SdifSignature)-1) < ((SdifSignature)0)) ?
            (SdifSignature)__Pyx_PyInt_AsSignedInt(x) :
            (SdifSignature)__Pyx_PyInt_AsUnsignedInt(x);
  else if (sizeof(SdifSignature) == sizeof(long))
     return (((SdifSignature)-1) < ((SdifSignature)0)) ?
            (SdifSignature)__Pyx_PyInt_AsSignedLong(x) :
            (SdifSignature)__Pyx_PyInt_AsUnsignedLong(x);
  else if (sizeof(SdifSignature) == sizeof(PY_LONG_LONG))
     return (((SdifSignature)-1) < ((SdifSignature)0)) ?
            (SdifSignature)__Pyx_PyInt_AsSignedLongLong(x) :
            (SdifSignature)__Pyx_PyInt_AsUnsignedLongLong(x);
#if 0
  else if (sizeof(SdifSignature) > sizeof(short) &&
           sizeof(SdifSignature) < sizeof(int)) /*  __int32 ILP64 ? */
     return (((SdifSignature)-1) < ((SdifSignature)0)) ?
            (SdifSignature)__Pyx_PyInt_AsSignedInt(x) :
            (SdifSignature)__Pyx_PyInt_AsUnsignedInt(x);
#endif
  PyErr_SetString(PyExc_TypeError, "SdifSignature");
  return (SdifSignature)-1;
}

static INLINE PyObject *__Pyx_PyInt_to_py_SdifUInt4(SdifUInt4 val) {
  /**/ if (sizeof(SdifUInt4) <  sizeof(long))
      return PyInt_FromLong((long)val);
  else if (sizeof(SdifUInt4) == sizeof(long))
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ? 
            PyInt_FromLong((long)val) :
            PyLong_FromUnsignedLong((unsigned long)val);
  else /* (sizeof(SdifUInt4) >  sizeof(long)) */
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ?
            PyLong_FromLongLong((PY_LONG_LONG)val) :
            PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
}

static INLINE SdifUInt4 __Pyx_PyInt_from_py_SdifUInt4(PyObject* x) {
  /**/ if (sizeof(SdifUInt4) == sizeof(char))
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ?
            (SdifUInt4)__Pyx_PyInt_AsSignedChar(x) :
            (SdifUInt4)__Pyx_PyInt_AsUnsignedChar(x);
  else if (sizeof(SdifUInt4) == sizeof(short))
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ?
            (SdifUInt4)__Pyx_PyInt_AsSignedShort(x) :
            (SdifUInt4)__Pyx_PyInt_AsUnsignedShort(x);
  else if (sizeof(SdifUInt4) == sizeof(int))
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ?
            (SdifUInt4)__Pyx_PyInt_AsSignedInt(x) :
            (SdifUInt4)__Pyx_PyInt_AsUnsignedInt(x);
  else if (sizeof(SdifUInt4) == sizeof(long))
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ?
            (SdifUInt4)__Pyx_PyInt_AsSignedLong(x) :
            (SdifUInt4)__Pyx_PyInt_AsUnsignedLong(x);
  else if (sizeof(SdifUInt4) == sizeof(PY_LONG_LONG))
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ?
            (SdifUInt4)__Pyx_PyInt_AsSignedLongLong(x) :
            (SdifUInt4)__Pyx_PyInt_AsUnsignedLongLong(x);
#if 0
  else if (sizeof(SdifUInt4) > sizeof(short) &&
           sizeof(SdifUInt4) < sizeof(int)) /*  __int32 ILP64 ? */
     return (((SdifUInt4)-1) < ((SdifUInt4)0)) ?
            (SdifUInt4)__Pyx_PyInt_AsSignedInt(x) :
            (SdifUInt4)__Pyx_PyInt_AsUnsignedInt(x);
#endif
  PyErr_SetString(PyExc_TypeError, "SdifUInt4");
  return (SdifUInt4)-1;
}

#if PY_MAJOR_VERSION < 3
static PyObject *__Pyx_GetStdout(void) {
    PyObject *f = PySys_GetObject((char *)"stdout");
    if (!f) {
        PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
    }
    return f;
}

static int __Pyx_Print(PyObject *arg_tuple, int newline) {
    PyObject *f;
    PyObject* v;
    int i;

    if (!(f = __Pyx_GetStdout()))
        return -1;
    for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
        if (PyFile_SoftSpace(f, 1)) {
            if (PyFile_WriteString(" ", f) < 0)
                return -1;
        }
        v = PyTuple_GET_ITEM(arg_tuple, i);
        if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
            return -1;
        if (PyString_Check(v)) {
            char *s = PyString_AsString(v);
            Py_ssize_t len = PyString_Size(v);
            if (len > 0 &&
                isspace(Py_CHARMASK(s[len-1])) &&
                s[len-1] != ' ')
                    PyFile_SoftSpace(f, 0);
        }
    }
    if (newline) {
        if (PyFile_WriteString("\n", f) < 0)
            return -1;
        PyFile_SoftSpace(f, 0);
    }
    return 0;
}

#else /* Python 3 has a print function */

static int __Pyx_Print(PyObject *arg_tuple, int newline) {
    PyObject* kwargs = 0;
    PyObject* result = 0;
    PyObject* end_string;
    if (!__pyx_print) {
        __pyx_print = __Pyx_GetAttrString(__pyx_b, "print");
        if (!__pyx_print)
            return -1;
    }
    if (!newline) {
        if (!__pyx_print_kwargs) {
            __pyx_print_kwargs = PyDict_New();
            if (!__pyx_print_kwargs)
                return -1;
            end_string = PyUnicode_FromStringAndSize(" ", 1);
            if (!end_string)
                return -1;
            if (PyDict_SetItemString(__pyx_print_kwargs, "end", end_string) < 0) {
                Py_DECREF(end_string);
                return -1;
            }
            Py_DECREF(end_string);
        }
        kwargs = __pyx_print_kwargs;
    }
    result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
    if (!result)
        return -1;
    Py_DECREF(result);
    return 0;
}

#endif

#if PY_MAJOR_VERSION < 3

static int __Pyx_PrintOne(PyObject *o) {
    PyObject *f;
    if (!(f = __Pyx_GetStdout()))
        return -1;
    if (PyFile_SoftSpace(f, 0)) {
        if (PyFile_WriteString(" ", f) < 0)
            return -1;
    }
    if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
        return -1;
    if (PyFile_WriteString("\n", f) < 0)
        return -1;
    return 0;
    /* the line below is just to avoid compiler
     * compiler warnings about unused functions */
    return __Pyx_Print(NULL, 0);
}

#else /* Python 3 has a print function */

static int __Pyx_PrintOne(PyObject *o) {
    int res;
    PyObject* arg_tuple = PyTuple_New(1);
    if (unlikely(!arg_tuple))
        return -1;
    Py_INCREF(o);
    PyTuple_SET_ITEM(arg_tuple, 0, o);
    res = __Pyx_Print(arg_tuple, 1);
    Py_DECREF(arg_tuple);
    return res;
}

#endif

static INLINE PyObject *__Pyx_PyInt_to_py_SdifSignature(SdifSignature val) {
  /**/ if (sizeof(SdifSignature) <  sizeof(long))
      return PyInt_FromLong((long)val);
  else if (sizeof(SdifSignature) == sizeof(long))
     return (((SdifSignature)-1) < ((SdifSignature)0)) ? 
            PyInt_FromLong((long)val) :
            PyLong_FromUnsignedLong((unsigned long)val);
  else /* (sizeof(SdifSignature) >  sizeof(long)) */
     return (((SdifSignature)-1) < ((SdifSignature)0)) ?
            PyLong_FromLongLong((PY_LONG_LONG)val) :
            PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
}

static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb) {
    Py_XINCREF(type);
    Py_XINCREF(value);
    Py_XINCREF(tb);
    /* First, check the traceback argument, replacing None with NULL. */
    if (tb == Py_None) {
        Py_DECREF(tb);
        tb = 0;
    }
    else if (tb != NULL && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto raise_error;
    }
    /* Next, replace a missing value with None */
    if (value == NULL) {
        value = Py_None;
        Py_INCREF(value);
    }
    #if PY_VERSION_HEX < 0x02050000
    if (!PyClass_Check(type))
    #else
    if (!PyType_Check(type))
    #endif
    {
        /* Raising an instance.  The value should be a dummy. */
        if (value != Py_None) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        /* Normalize to raise <class>, <instance> */
        Py_DECREF(value);
        value = type;
        #if PY_VERSION_HEX < 0x02050000
            if (PyInstance_Check(type)) {
                type = (PyObject*) ((PyInstanceObject*)type)->in_class;
                Py_INCREF(type);
            }
            else {
                type = 0;
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception must be an old-style class or instance");
                goto raise_error;
            }
        #else
            type = (PyObject*) Py_TYPE(type);
            Py_INCREF(type);
            if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
                PyErr_SetString(PyExc_TypeError,
                    "raise: exception class must be a subclass of BaseException");
                goto raise_error;
            }
        #endif
    }
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}

static INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    PyThreadState *tstate = PyThreadState_GET();

#if PY_MAJOR_VERSION >= 3
    /* Note: this is a temporary work-around to prevent crashes in Python 3.0 */
    if ((tstate->exc_type != NULL) & (tstate->exc_type != Py_None)) {
        tmp_type = tstate->exc_type;
        tmp_value = tstate->exc_value;
        tmp_tb = tstate->exc_traceback;
        PyErr_NormalizeException(&type, &value, &tb);
        PyErr_NormalizeException(&tmp_type, &tmp_value, &tmp_tb);
        tstate->exc_type = 0;
        tstate->exc_value = 0;
        tstate->exc_traceback = 0;
        PyException_SetContext(value, tmp_value);
        Py_DECREF(tmp_type);
        Py_XDECREF(tmp_tb);
    }
#endif

    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}

static INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
    PyThreadState *tstate = PyThreadState_GET();
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;

    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}


static INLINE PyObject *__Pyx_PyInt_to_py_npy_intp(npy_intp val) {
  /**/ if (sizeof(npy_intp) <  sizeof(long))
      return PyInt_FromLong((long)val);
  else if (sizeof(npy_intp) == sizeof(long))
     return (((npy_intp)-1) < ((npy_intp)0)) ? 
            PyInt_FromLong((long)val) :
            PyLong_FromUnsignedLong((unsigned long)val);
  else /* (sizeof(npy_intp) >  sizeof(long)) */
     return (((npy_intp)-1) < ((npy_intp)0)) ?
            PyLong_FromLongLong((PY_LONG_LONG)val) :
            PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
}

static INLINE PyObject *__Pyx_PyInt_to_py_SdiffPosT(SdiffPosT val) {
  /**/ if (sizeof(SdiffPosT) <  sizeof(long))
      return PyInt_FromLong((long)val);
  else if (sizeof(SdiffPosT) == sizeof(long))
     return (((SdiffPosT)-1) < ((SdiffPosT)0)) ? 
            PyInt_FromLong((long)val) :
            PyLong_FromUnsignedLong((unsigned long)val);
  else /* (sizeof(SdiffPosT) >  sizeof(long)) */
     return (((SdiffPosT)-1) < ((SdiffPosT)0)) ?
            PyLong_FromLongLong((PY_LONG_LONG)val) :
            PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG)val);
}

static PyObject *__Pyx_UnpackItem(PyObject *iter, Py_ssize_t index) {
    PyObject *item;
    if (!(item = PyIter_Next(iter))) {
        if (!PyErr_Occurred()) {
            __Pyx_RaiseNeedMoreValuesError(index);
        }
    }
    return item;
}

static int __Pyx_EndUnpack(PyObject *iter) {
    PyObject *item;
    if ((item = PyIter_Next(iter))) {
        Py_DECREF(item);
        __Pyx_RaiseTooManyValuesError();
        return -1;
    }
    else if (!PyErr_Occurred())
        return 0;
    else
        return -1;
}

static INLINE unsigned char __Pyx_PyInt_AsUnsignedChar(PyObject* x) {
    if (sizeof(unsigned char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((unsigned char)-1) > ((unsigned char)0) && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned char" :
                    "value too large to convert to unsigned char");
            }
            return (unsigned char)-1;
        }
        return (unsigned char)val;
    }
    return (unsigned char)__Pyx_PyInt_AsUnsignedLong(x);
}

static INLINE unsigned short __Pyx_PyInt_AsUnsignedShort(PyObject* x) {
    if (sizeof(unsigned short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((unsigned short)-1) > ((unsigned short)0) && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned short" :
                    "value too large to convert to unsigned short");
            }
            return (unsigned short)-1;
        }
        return (unsigned short)val;
    }
    return (unsigned short)__Pyx_PyInt_AsUnsignedLong(x);
}

static INLINE unsigned int __Pyx_PyInt_AsUnsignedInt(PyObject* x) {
    if (sizeof(unsigned int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(unsigned int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((unsigned int)-1) > ((unsigned int)0) && unlikely(val < 0)) ?
                    "can't convert negative value to unsigned int" :
                    "value too large to convert to unsigned int");
            }
            return (unsigned int)-1;
        }
        return (unsigned int)val;
    }
    return (unsigned int)__Pyx_PyInt_AsUnsignedLong(x);
}

static INLINE char __Pyx_PyInt_AsChar(PyObject* x) {
    if (sizeof(char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((char)-1) > ((char)0) && unlikely(val < 0)) ?
                    "can't convert negative value to char" :
                    "value too large to convert to char");
            }
            return (char)-1;
        }
        return (char)val;
    }
    return (char)__Pyx_PyInt_AsLong(x);
}

static INLINE short __Pyx_PyInt_AsShort(PyObject* x) {
    if (sizeof(short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((short)-1) > ((short)0) && unlikely(val < 0)) ?
                    "can't convert negative value to short" :
                    "value too large to convert to short");
            }
            return (short)-1;
        }
        return (short)val;
    }
    return (short)__Pyx_PyInt_AsLong(x);
}

static INLINE int __Pyx_PyInt_AsInt(PyObject* x) {
    if (sizeof(int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((int)-1) > ((int)0) && unlikely(val < 0)) ?
                    "can't convert negative value to int" :
                    "value too large to convert to int");
            }
            return (int)-1;
        }
        return (int)val;
    }
    return (int)__Pyx_PyInt_AsLong(x);
}

static INLINE signed char __Pyx_PyInt_AsSignedChar(PyObject* x) {
    if (sizeof(signed char) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed char)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((signed char)-1) > ((signed char)0) && unlikely(val < 0)) ?
                    "can't convert negative value to signed char" :
                    "value too large to convert to signed char");
            }
            return (signed char)-1;
        }
        return (signed char)val;
    }
    return (signed char)__Pyx_PyInt_AsSignedLong(x);
}

static INLINE signed short __Pyx_PyInt_AsSignedShort(PyObject* x) {
    if (sizeof(signed short) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed short)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((signed short)-1) > ((signed short)0) && unlikely(val < 0)) ?
                    "can't convert negative value to signed short" :
                    "value too large to convert to signed short");
            }
            return (signed short)-1;
        }
        return (signed short)val;
    }
    return (signed short)__Pyx_PyInt_AsSignedLong(x);
}

static INLINE signed int __Pyx_PyInt_AsSignedInt(PyObject* x) {
    if (sizeof(signed int) < sizeof(long)) {
        long val = __Pyx_PyInt_AsLong(x);
        if (unlikely(val != (long)(signed int)val)) {
            if (!unlikely(val == -1 && PyErr_Occurred())) {
                PyErr_SetString(PyExc_OverflowError,
                    (((signed int)-1) > ((signed int)0) && unlikely(val < 0)) ?
                    "can't convert negative value to signed int" :
                    "value too large to convert to signed int");
            }
            return (signed int)-1;
        }
        return (signed int)val;
    }
    return (signed int)__Pyx_PyInt_AsSignedLong(x);
}

static INLINE unsigned long __Pyx_PyInt_AsUnsignedLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (((unsigned long)-1) > ((unsigned long)0) && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (unsigned long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (((unsigned long)-1) > ((unsigned long)0) && unlikely(Py_SIZE(x) < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned long");
            return (unsigned long)-1;
        }
        return (((unsigned long)-1) < ((unsigned long)0)) ?
               PyLong_AsLong(x) :
               PyLong_AsUnsignedLong(x);
    } else {
        unsigned long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned long)-1;
        val = __Pyx_PyInt_AsUnsignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE unsigned PY_LONG_LONG __Pyx_PyInt_AsUnsignedLongLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (unsigned PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (((unsigned PY_LONG_LONG)-1) > ((unsigned PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to unsigned PY_LONG_LONG");
            return (unsigned PY_LONG_LONG)-1;
        }
        return (((unsigned PY_LONG_LONG)-1) < ((unsigned PY_LONG_LONG)0)) ?
               PyLong_AsLongLong(x) :
               PyLong_AsUnsignedLongLong(x);
    } else {
        unsigned PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (unsigned PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsUnsignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE long __Pyx_PyInt_AsLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (((long)-1) > ((long)0) && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (((long)-1) > ((long)0) && unlikely(Py_SIZE(x) < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to long");
            return (long)-1;
        }
        return (((long)-1) < ((long)0)) ?
               PyLong_AsLong(x) :
               PyLong_AsUnsignedLong(x);
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (long)-1;
        val = __Pyx_PyInt_AsLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE PY_LONG_LONG __Pyx_PyInt_AsLongLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (((PY_LONG_LONG)-1) > ((PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to PY_LONG_LONG");
            return (PY_LONG_LONG)-1;
        }
        return (((PY_LONG_LONG)-1) < ((PY_LONG_LONG)0)) ?
               PyLong_AsLongLong(x) :
               PyLong_AsUnsignedLongLong(x);
    } else {
        PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE signed long __Pyx_PyInt_AsSignedLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (((signed long)-1) > ((signed long)0) && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (signed long)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (((signed long)-1) > ((signed long)0) && unlikely(Py_SIZE(x) < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed long");
            return (signed long)-1;
        }
        return (((signed long)-1) < ((signed long)0)) ?
               PyLong_AsLong(x) :
               PyLong_AsUnsignedLong(x);
    } else {
        signed long val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed long)-1;
        val = __Pyx_PyInt_AsSignedLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static INLINE signed PY_LONG_LONG __Pyx_PyInt_AsSignedLongLong(PyObject* x) {
#if PY_VERSION_HEX < 0x03000000
    if (likely(PyInt_Check(x))) {
        long val = PyInt_AS_LONG(x);
        if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(val < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (signed PY_LONG_LONG)val;
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (((signed PY_LONG_LONG)-1) > ((signed PY_LONG_LONG)0) && unlikely(Py_SIZE(x) < 0)) {
            PyErr_SetString(PyExc_OverflowError,
                            "can't convert negative value to signed PY_LONG_LONG");
            return (signed PY_LONG_LONG)-1;
        }
        return (((signed PY_LONG_LONG)-1) < ((signed PY_LONG_LONG)0)) ?
               PyLong_AsLongLong(x) :
               PyLong_AsUnsignedLongLong(x);
    } else {
        signed PY_LONG_LONG val;
        PyObject *tmp = __Pyx_PyNumber_Int(x);
        if (!tmp) return (signed PY_LONG_LONG)-1;
        val = __Pyx_PyInt_AsSignedLongLong(tmp);
        Py_DECREF(tmp);
        return val;
    }
}

static void __Pyx_WriteUnraisable(const char *name) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
}

static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
    PyObject *pycobj = 0;
    int result;
    
    pycobj = PyCObject_FromVoidPtr(vtable, 0);
    if (!pycobj)
        goto bad;
    if (PyDict_SetItemString(dict, "__pyx_vtable__", pycobj) < 0)
        goto bad;
    result = 0;
    goto done;

bad:
    result = -1;
done:
    Py_XDECREF(pycobj);
    return result;
}

#ifndef __PYX_HAVE_RT_ImportType
#define __PYX_HAVE_RT_ImportType
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
    long size)
{
    PyObject *py_module = 0;
    PyObject *result = 0;
    PyObject *py_name = 0;

    py_module = __Pyx_ImportModule(module_name);
    if (!py_module)
        goto bad;
    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(class_name);
    #else
    py_name = PyUnicode_FromString(class_name);
    #endif
    if (!py_name)
        goto bad;
    result = PyObject_GetAttr(py_module, py_name);
    Py_DECREF(py_name);
    py_name = 0;
    Py_DECREF(py_module);
    py_module = 0;
    if (!result)
        goto bad;
    if (!PyType_Check(result)) {
        PyErr_Format(PyExc_TypeError, 
            "%s.%s is not a type object",
            module_name, class_name);
        goto bad;
    }
    if (((PyTypeObject *)result)->tp_basicsize != size) {
        PyErr_Format(PyExc_ValueError, 
            "%s.%s does not appear to be the correct type object",
            module_name, class_name);
        goto bad;
    }
    return (PyTypeObject *)result;
bad:
    Py_XDECREF(py_module);
    Py_XDECREF(result);
    return 0;
}
#endif

#ifndef __PYX_HAVE_RT_ImportModule
#define __PYX_HAVE_RT_ImportModule
static PyObject *__Pyx_ImportModule(const char *name) {
    PyObject *py_name = 0;
    PyObject *py_module = 0;

    #if PY_MAJOR_VERSION < 3
    py_name = PyString_FromString(name);
    #else
    py_name = PyUnicode_FromString(name);
    #endif
    if (!py_name)
        goto bad;
    py_module = PyImport_Import(py_name);
    Py_DECREF(py_name);
    return py_module;
bad:
    Py_XDECREF(py_name);
    return 0;
}
#endif

#include "compile.h"
#include "frameobject.h"
#include "traceback.h"

static void __Pyx_AddTraceback(const char *funcname) {
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    PyObject *py_globals = 0;
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;

    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(__pyx_filename);
    #else
    py_srcfile = PyUnicode_FromString(__pyx_filename);
    #endif
    if (!py_srcfile) goto bad;
    if (__pyx_clineno) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, __pyx_clineno);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_globals = PyModule_GetDict(__pyx_m);
    if (!py_globals) goto bad;
    py_code = PyCode_New(
        0,            /*int argcount,*/
        #if PY_MAJOR_VERSION >= 3
        0,            /*int kwonlyargcount,*/
        #endif
        0,            /*int nlocals,*/
        0,            /*int stacksize,*/
        0,            /*int flags,*/
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple,  /*PyObject *consts,*/
        __pyx_empty_tuple,  /*PyObject *names,*/
        __pyx_empty_tuple,  /*PyObject *varnames,*/
        __pyx_empty_tuple,  /*PyObject *freevars,*/
        __pyx_empty_tuple,  /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        __pyx_lineno,   /*int firstlineno,*/
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    if (!py_code) goto bad;
    py_frame = PyFrame_New(
        PyThreadState_GET(), /*PyThreadState *tstate,*/
        py_code,             /*PyCodeObject *code,*/
        py_globals,          /*PyObject *globals,*/
        0                    /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    py_frame->f_lineno = __pyx_lineno;
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}

static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION < 3
        if (t->is_unicode && (!t->is_identifier)) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        #else  /* Python 3+ has unicode identifiers */
        if (t->is_identifier || (t->is_unicode && t->intern)) {
            *t->p = PyUnicode_InternFromString(t->s);
        } else if (t->is_unicode) {
            *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
        } else {
            *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
        }
        #endif
        if (!*t->p)
            return -1;
        ++t;
    }
    return 0;
}

/* Type Conversion Functions */

static INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   if (x == Py_True) return 1;
   else if ((x == Py_False) | (x == Py_None)) return 0;
   else return PyObject_IsTrue(x);
}

static INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
  PyNumberMethods *m;
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_VERSION_HEX < 0x03000000
  if (PyInt_Check(x) || PyLong_Check(x))
#else
  if (PyLong_Check(x))
#endif
    return Py_INCREF(x), x;
  m = Py_TYPE(x)->tp_as_number;
#if PY_VERSION_HEX < 0x03000000
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = PyNumber_Long(x);
  }
#else
  if (m && m->nb_int) {
    name = "int";
    res = PyNumber_Long(x);
  }
#endif
  if (res) {
#if PY_VERSION_HEX < 0x03000000
    if (!PyInt_Check(res) && !PyLong_Check(res)) {
#else
    if (!PyLong_Check(res)) {
#endif
      PyErr_Format(PyExc_TypeError,
                   "__%s__ returned non-%s (type %.200s)",
                   name, name, Py_TYPE(res)->tp_name);
      Py_DECREF(res);
      return NULL;
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}

static INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject* x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}

static INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
#if PY_VERSION_HEX < 0x02050000
   if (ival <= LONG_MAX)
       return PyInt_FromLong((long)ival);
   else {
       unsigned char *bytes = (unsigned char *) &ival;
       int one = 1; int little = (int)*(unsigned char*)&one;
       return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
   }
#else
   return PyInt_FromSize_t(ival);
#endif
}

static INLINE size_t __Pyx_PyInt_AsSize_t(PyObject* x) {
   unsigned PY_LONG_LONG val = __Pyx_PyInt_AsUnsignedLongLong(x);
   if (unlikely(val == (unsigned PY_LONG_LONG)-1 && PyErr_Occurred())) {
       return (size_t)-1;
   } else if (unlikely(val != (unsigned PY_LONG_LONG)(size_t)val)) {
       PyErr_SetString(PyExc_OverflowError,
                       "value too large to convert to size_t");
       return (size_t)-1;
   }
   return (size_t)val;
}


#endif /* Py_PYTHON_H */
