victor@0: /* Generated by Cython 0.20.2 on Fri Dec 12 12:34:51 2014 */ victor@0: victor@0: #define PY_SSIZE_T_CLEAN victor@0: #ifndef CYTHON_USE_PYLONG_INTERNALS victor@0: #ifdef PYLONG_BITS_IN_DIGIT victor@0: #define CYTHON_USE_PYLONG_INTERNALS 0 victor@0: #else victor@0: #include "pyconfig.h" victor@0: #ifdef PYLONG_BITS_IN_DIGIT victor@0: #define CYTHON_USE_PYLONG_INTERNALS 1 victor@0: #else victor@0: #define CYTHON_USE_PYLONG_INTERNALS 0 victor@0: #endif victor@0: #endif victor@0: #endif victor@0: #include "Python.h" victor@0: #ifndef Py_PYTHON_H victor@0: #error Python headers needed to compile C extensions, please install development version of Python. victor@0: #elif PY_VERSION_HEX < 0x02040000 victor@0: #error Cython requires Python 2.4+. victor@0: #else victor@0: #define CYTHON_ABI "0_20_2" victor@0: #include /* For offsetof */ victor@0: #ifndef offsetof victor@0: #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) victor@0: #endif victor@0: #if !defined(WIN32) && !defined(MS_WINDOWS) victor@0: #ifndef __stdcall victor@0: #define __stdcall victor@0: #endif victor@0: #ifndef __cdecl victor@0: #define __cdecl victor@0: #endif victor@0: #ifndef __fastcall victor@0: #define __fastcall victor@0: #endif victor@0: #endif victor@0: #ifndef DL_IMPORT victor@0: #define DL_IMPORT(t) t victor@0: #endif victor@0: #ifndef DL_EXPORT victor@0: #define DL_EXPORT(t) t victor@0: #endif victor@0: #ifndef PY_LONG_LONG victor@0: #define PY_LONG_LONG LONG_LONG victor@0: #endif victor@0: #ifndef Py_HUGE_VAL victor@0: #define Py_HUGE_VAL HUGE_VAL victor@0: #endif victor@0: #ifdef PYPY_VERSION victor@0: #define CYTHON_COMPILING_IN_PYPY 1 victor@0: #define CYTHON_COMPILING_IN_CPYTHON 0 victor@0: #else victor@0: #define CYTHON_COMPILING_IN_PYPY 0 victor@0: #define CYTHON_COMPILING_IN_CPYTHON 1 victor@0: #endif victor@0: #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 victor@0: #define Py_OptimizeFlag 0 victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: typedef int Py_ssize_t; victor@0: #define PY_SSIZE_T_MAX INT_MAX victor@0: #define PY_SSIZE_T_MIN INT_MIN victor@0: #define PY_FORMAT_SIZE_T "" victor@0: #define CYTHON_FORMAT_SSIZE_T "" victor@0: #define PyInt_FromSsize_t(z) PyInt_FromLong(z) victor@0: #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) victor@0: #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ victor@0: (PyErr_Format(PyExc_TypeError, \ victor@0: "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ victor@0: (PyObject*)0)) victor@0: #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ victor@0: !PyComplex_Check(o)) victor@0: #define PyIndex_Check __Pyx_PyIndex_Check victor@0: #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) victor@0: #define __PYX_BUILD_PY_SSIZE_T "i" victor@0: #else victor@0: #define __PYX_BUILD_PY_SSIZE_T "n" victor@0: #define CYTHON_FORMAT_SSIZE_T "z" victor@0: #define __Pyx_PyIndex_Check PyIndex_Check victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02060000 victor@0: #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) victor@0: #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) victor@0: #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) victor@0: #define PyVarObject_HEAD_INIT(type, size) \ victor@0: PyObject_HEAD_INIT(type) size, victor@0: #define PyType_Modified(t) victor@0: typedef struct { victor@0: void *buf; victor@0: PyObject *obj; victor@0: Py_ssize_t len; victor@0: Py_ssize_t itemsize; victor@0: int readonly; victor@0: int ndim; victor@0: char *format; victor@0: Py_ssize_t *shape; victor@0: Py_ssize_t *strides; victor@0: Py_ssize_t *suboffsets; victor@0: void *internal; victor@0: } Py_buffer; victor@0: #define PyBUF_SIMPLE 0 victor@0: #define PyBUF_WRITABLE 0x0001 victor@0: #define PyBUF_FORMAT 0x0004 victor@0: #define PyBUF_ND 0x0008 victor@0: #define PyBUF_STRIDES (0x0010 | PyBUF_ND) victor@0: #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) victor@0: #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) victor@0: #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) victor@0: #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) victor@0: #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) victor@0: #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) victor@0: typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); victor@0: typedef void (*releasebufferproc)(PyObject *, Py_buffer *); victor@0: #endif victor@0: #if PY_MAJOR_VERSION < 3 victor@0: #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" victor@0: #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ victor@0: PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) victor@0: #define __Pyx_DefaultClassType PyClass_Type victor@0: #else victor@0: #define __Pyx_BUILTIN_MODULE_NAME "builtins" victor@0: #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ victor@0: PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) victor@0: #define __Pyx_DefaultClassType PyType_Type victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02060000 victor@0: #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") victor@0: #endif victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define Py_TPFLAGS_CHECKTYPES 0 victor@0: #define Py_TPFLAGS_HAVE_INDEX 0 victor@0: #endif victor@0: #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) victor@0: #define Py_TPFLAGS_HAVE_NEWBUFFER 0 victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02060000 victor@0: #define Py_TPFLAGS_HAVE_VERSION_TAG 0 victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) victor@0: #define Py_TPFLAGS_IS_ABSTRACT 0 victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) victor@0: #define Py_TPFLAGS_HAVE_FINALIZE 0 victor@0: #endif victor@0: #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) victor@0: #define CYTHON_PEP393_ENABLED 1 victor@0: #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ victor@0: 0 : _PyUnicode_Ready((PyObject *)(op))) victor@0: #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) victor@0: #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) victor@0: #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) victor@0: #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) victor@0: #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) victor@0: #else victor@0: #define CYTHON_PEP393_ENABLED 0 victor@0: #define __Pyx_PyUnicode_READY(op) (0) victor@0: #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) victor@0: #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) victor@0: #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) victor@0: #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) victor@0: #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) victor@0: #endif victor@0: #if CYTHON_COMPILING_IN_PYPY victor@0: #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) victor@0: #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) victor@0: #else victor@0: #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) victor@0: #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ victor@0: PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) victor@0: #endif victor@0: #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) victor@0: #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) victor@0: #else victor@0: #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) victor@0: #endif victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define PyBaseString_Type PyUnicode_Type victor@0: #define PyStringObject PyUnicodeObject victor@0: #define PyString_Type PyUnicode_Type victor@0: #define PyString_Check PyUnicode_Check victor@0: #define PyString_CheckExact PyUnicode_CheckExact victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02060000 victor@0: #define PyBytesObject PyStringObject victor@0: #define PyBytes_Type PyString_Type victor@0: #define PyBytes_Check PyString_Check victor@0: #define PyBytes_CheckExact PyString_CheckExact victor@0: #define PyBytes_FromString PyString_FromString victor@0: #define PyBytes_FromStringAndSize PyString_FromStringAndSize victor@0: #define PyBytes_FromFormat PyString_FromFormat victor@0: #define PyBytes_DecodeEscape PyString_DecodeEscape victor@0: #define PyBytes_AsString PyString_AsString victor@0: #define PyBytes_AsStringAndSize PyString_AsStringAndSize victor@0: #define PyBytes_Size PyString_Size victor@0: #define PyBytes_AS_STRING PyString_AS_STRING victor@0: #define PyBytes_GET_SIZE PyString_GET_SIZE victor@0: #define PyBytes_Repr PyString_Repr victor@0: #define PyBytes_Concat PyString_Concat victor@0: #define PyBytes_ConcatAndDel PyString_ConcatAndDel victor@0: #endif victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) victor@0: #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) victor@0: #else victor@0: #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ victor@0: PyString_Check(obj) || PyUnicode_Check(obj)) victor@0: #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02060000 victor@0: #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) victor@0: #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) victor@0: #endif victor@0: #ifndef PySet_CheckExact victor@0: #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) victor@0: #endif victor@0: #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define PyIntObject PyLongObject victor@0: #define PyInt_Type PyLong_Type victor@0: #define PyInt_Check(op) PyLong_Check(op) victor@0: #define PyInt_CheckExact(op) PyLong_CheckExact(op) victor@0: #define PyInt_FromString PyLong_FromString victor@0: #define PyInt_FromUnicode PyLong_FromUnicode victor@0: #define PyInt_FromLong PyLong_FromLong victor@0: #define PyInt_FromSize_t PyLong_FromSize_t victor@0: #define PyInt_FromSsize_t PyLong_FromSsize_t victor@0: #define PyInt_AsLong PyLong_AsLong victor@0: #define PyInt_AS_LONG PyLong_AS_LONG victor@0: #define PyInt_AsSsize_t PyLong_AsSsize_t victor@0: #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask victor@0: #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask victor@0: #define PyNumber_Int PyNumber_Long victor@0: #endif victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define PyBoolObject PyLongObject victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x030200A4 victor@0: typedef long Py_hash_t; victor@0: #define __Pyx_PyInt_FromHash_t PyInt_FromLong victor@0: #define __Pyx_PyInt_AsHash_t PyInt_AsLong victor@0: #else victor@0: #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t victor@0: #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t victor@0: #endif victor@0: #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) victor@0: #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) victor@0: #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) victor@0: #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) victor@0: #else victor@0: #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ victor@0: (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ victor@0: (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ victor@0: (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) victor@0: #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ victor@0: (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ victor@0: (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ victor@0: (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) victor@0: #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ victor@0: (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ victor@0: (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ victor@0: (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) victor@0: #endif victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) victor@0: #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) victor@0: #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) victor@0: #else victor@0: #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) victor@0: #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) victor@0: #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: #define __Pyx_NAMESTR(n) ((char *)(n)) victor@0: #define __Pyx_DOCSTR(n) ((char *)(n)) victor@0: #else victor@0: #define __Pyx_NAMESTR(n) (n) victor@0: #define __Pyx_DOCSTR(n) (n) victor@0: #endif victor@0: #ifndef CYTHON_INLINE victor@0: #if defined(__GNUC__) victor@0: #define CYTHON_INLINE __inline__ victor@0: #elif defined(_MSC_VER) victor@0: #define CYTHON_INLINE __inline victor@0: #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L victor@0: #define CYTHON_INLINE inline victor@0: #else victor@0: #define CYTHON_INLINE victor@0: #endif victor@0: #endif victor@0: #ifndef CYTHON_RESTRICT victor@0: #if defined(__GNUC__) victor@0: #define CYTHON_RESTRICT __restrict__ victor@0: #elif defined(_MSC_VER) && _MSC_VER >= 1400 victor@0: #define CYTHON_RESTRICT __restrict victor@0: #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L victor@0: #define CYTHON_RESTRICT restrict victor@0: #else victor@0: #define CYTHON_RESTRICT victor@0: #endif victor@0: #endif victor@0: #ifdef NAN victor@0: #define __PYX_NAN() ((float) NAN) victor@0: #else victor@0: static CYTHON_INLINE float __PYX_NAN() { victor@0: /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and victor@0: a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is victor@0: a quiet NaN. */ victor@0: float value; victor@0: memset(&value, 0xFF, sizeof(value)); victor@0: return value; victor@0: } victor@0: #endif victor@0: #ifdef __cplusplus victor@0: template victor@0: void __Pyx_call_destructor(T* x) { victor@0: x->~T(); victor@0: } victor@0: #endif victor@0: victor@0: victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) victor@0: #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) victor@0: #else victor@0: #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) victor@0: #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) victor@0: #endif victor@0: victor@0: #ifndef __PYX_EXTERN_C victor@0: #ifdef __cplusplus victor@0: #define __PYX_EXTERN_C extern "C" victor@0: #else victor@0: #define __PYX_EXTERN_C extern victor@0: #endif victor@0: #endif victor@0: victor@0: #if defined(WIN32) || defined(MS_WINDOWS) victor@0: #define _USE_MATH_DEFINES victor@0: #endif victor@0: #include victor@0: #define __PYX_HAVE__MultipleOMR__Alignment__FastAlignmentArrays victor@0: #define __PYX_HAVE_API__MultipleOMR__Alignment__FastAlignmentArrays victor@0: #include "string.h" victor@0: #include "stdio.h" victor@0: #include "stdlib.h" victor@0: #include "numpy/arrayobject.h" victor@0: #include "numpy/ufuncobject.h" victor@0: #include "pythread.h" victor@0: #ifdef _OPENMP victor@0: #include victor@0: #endif /* _OPENMP */ victor@0: victor@0: #ifdef PYREX_WITHOUT_ASSERTIONS victor@0: #define CYTHON_WITHOUT_ASSERTIONS victor@0: #endif victor@0: victor@0: #ifndef CYTHON_UNUSED victor@0: # if defined(__GNUC__) victor@0: # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) victor@0: # define CYTHON_UNUSED __attribute__ ((__unused__)) victor@0: # else victor@0: # define CYTHON_UNUSED victor@0: # endif victor@0: # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) victor@0: # define CYTHON_UNUSED __attribute__ ((__unused__)) victor@0: # else victor@0: # define CYTHON_UNUSED victor@0: # endif victor@0: #endif victor@0: typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; victor@0: const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ victor@0: victor@0: #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 victor@0: #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 victor@0: #define __PYX_DEFAULT_STRING_ENCODING "" victor@0: #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString victor@0: #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize victor@0: #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ victor@0: (sizeof(type) < sizeof(Py_ssize_t)) || \ victor@0: (sizeof(type) > sizeof(Py_ssize_t) && \ victor@0: likely(v < (type)PY_SSIZE_T_MAX || \ victor@0: v == (type)PY_SSIZE_T_MAX) && \ victor@0: (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ victor@0: v == (type)PY_SSIZE_T_MIN))) || \ victor@0: (sizeof(type) == sizeof(Py_ssize_t) && \ victor@0: (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ victor@0: v == (type)PY_SSIZE_T_MAX))) ) victor@0: static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); victor@0: static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); victor@0: #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) victor@0: #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) victor@0: #define __Pyx_PyBytes_FromString PyBytes_FromString victor@0: #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize victor@0: static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString victor@0: #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize victor@0: #else victor@0: #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString victor@0: #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize victor@0: #endif victor@0: #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) victor@0: #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) victor@0: #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) victor@0: #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) victor@0: #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) victor@0: #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) victor@0: #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) victor@0: #if PY_MAJOR_VERSION < 3 victor@0: static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) victor@0: { victor@0: const Py_UNICODE *u_end = u; victor@0: while (*u_end++) ; victor@0: return (size_t)(u_end - u - 1); victor@0: } victor@0: #else victor@0: #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen victor@0: #endif victor@0: #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) victor@0: #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode victor@0: #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode victor@0: #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) victor@0: #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) victor@0: static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); victor@0: static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); victor@0: static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); victor@0: static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) victor@0: #else victor@0: #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) victor@0: #endif victor@0: #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) victor@0: #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII victor@0: static int __Pyx_sys_getdefaultencoding_not_ascii; victor@0: static int __Pyx_init_sys_getdefaultencoding_params(void) { victor@0: PyObject* sys; victor@0: PyObject* default_encoding = NULL; victor@0: PyObject* ascii_chars_u = NULL; victor@0: PyObject* ascii_chars_b = NULL; victor@0: const char* default_encoding_c; victor@0: sys = PyImport_ImportModule("sys"); victor@0: if (!sys) goto bad; victor@0: default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); victor@0: Py_DECREF(sys); victor@0: if (!default_encoding) goto bad; victor@0: default_encoding_c = PyBytes_AsString(default_encoding); victor@0: if (!default_encoding_c) goto bad; victor@0: if (strcmp(default_encoding_c, "ascii") == 0) { victor@0: __Pyx_sys_getdefaultencoding_not_ascii = 0; victor@0: } else { victor@0: char ascii_chars[128]; victor@0: int c; victor@0: for (c = 0; c < 128; c++) { victor@0: ascii_chars[c] = c; victor@0: } victor@0: __Pyx_sys_getdefaultencoding_not_ascii = 1; victor@0: ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); victor@0: if (!ascii_chars_u) goto bad; victor@0: ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); victor@0: if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { victor@0: PyErr_Format( victor@0: PyExc_ValueError, victor@0: "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", victor@0: default_encoding_c); victor@0: goto bad; victor@0: } victor@0: Py_DECREF(ascii_chars_u); victor@0: Py_DECREF(ascii_chars_b); victor@0: } victor@0: Py_DECREF(default_encoding); victor@0: return 0; victor@0: bad: victor@0: Py_XDECREF(default_encoding); victor@0: Py_XDECREF(ascii_chars_u); victor@0: Py_XDECREF(ascii_chars_b); victor@0: return -1; victor@0: } victor@0: #endif victor@0: #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 victor@0: #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) victor@0: #else victor@0: #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) victor@0: #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT victor@0: static char* __PYX_DEFAULT_STRING_ENCODING; victor@0: static int __Pyx_init_sys_getdefaultencoding_params(void) { victor@0: PyObject* sys; victor@0: PyObject* default_encoding = NULL; victor@0: char* default_encoding_c; victor@0: sys = PyImport_ImportModule("sys"); victor@0: if (!sys) goto bad; victor@0: default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); victor@0: Py_DECREF(sys); victor@0: if (!default_encoding) goto bad; victor@0: default_encoding_c = PyBytes_AsString(default_encoding); victor@0: if (!default_encoding_c) goto bad; victor@0: __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); victor@0: if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; victor@0: strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); victor@0: Py_DECREF(default_encoding); victor@0: return 0; victor@0: bad: victor@0: Py_XDECREF(default_encoding); victor@0: return -1; victor@0: } victor@0: #endif victor@0: #endif victor@0: victor@0: victor@0: /* Test for GCC > 2.95 */ victor@0: #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) victor@0: #define likely(x) __builtin_expect(!!(x), 1) victor@0: #define unlikely(x) __builtin_expect(!!(x), 0) victor@0: #else /* !__GNUC__ or GCC < 2.95 */ victor@0: #define likely(x) (x) victor@0: #define unlikely(x) (x) victor@0: #endif /* __GNUC__ */ victor@0: victor@0: static PyObject *__pyx_m; victor@0: static PyObject *__pyx_d; victor@0: static PyObject *__pyx_b; victor@0: static PyObject *__pyx_empty_tuple; victor@0: static PyObject *__pyx_empty_bytes; victor@0: static int __pyx_lineno; victor@0: static int __pyx_clineno = 0; victor@0: static const char * __pyx_cfilenm= __FILE__; victor@0: static const char *__pyx_filename; victor@0: victor@0: #if !defined(CYTHON_CCOMPLEX) victor@0: #if defined(__cplusplus) victor@0: #define CYTHON_CCOMPLEX 1 victor@0: #elif defined(_Complex_I) victor@0: #define CYTHON_CCOMPLEX 1 victor@0: #else victor@0: #define CYTHON_CCOMPLEX 0 victor@0: #endif victor@0: #endif victor@0: #if CYTHON_CCOMPLEX victor@0: #ifdef __cplusplus victor@0: #include victor@0: #else victor@0: #include victor@0: #endif victor@0: #endif victor@0: #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) victor@0: #undef _Complex_I victor@0: #define _Complex_I 1.0fj victor@0: #endif victor@0: victor@0: victor@0: static const char *__pyx_f[] = { victor@0: "FastAlignmentArrays.pyx", victor@0: "__init__.pxd", victor@0: "type.pxd", victor@0: "bool.pxd", victor@0: "complex.pxd", victor@0: }; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":723 victor@0: * # in Cython to enable them only on the right systems. victor@0: * victor@0: * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_int16 int16_t victor@0: * ctypedef npy_int32 int32_t victor@0: */ victor@0: typedef npy_int8 __pyx_t_5numpy_int8_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":724 victor@0: * victor@0: * ctypedef npy_int8 int8_t victor@0: * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_int32 int32_t victor@0: * ctypedef npy_int64 int64_t victor@0: */ victor@0: typedef npy_int16 __pyx_t_5numpy_int16_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":725 victor@0: * ctypedef npy_int8 int8_t victor@0: * ctypedef npy_int16 int16_t victor@0: * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_int64 int64_t victor@0: * #ctypedef npy_int96 int96_t victor@0: */ victor@0: typedef npy_int32 __pyx_t_5numpy_int32_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":726 victor@0: * ctypedef npy_int16 int16_t victor@0: * ctypedef npy_int32 int32_t victor@0: * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< victor@0: * #ctypedef npy_int96 int96_t victor@0: * #ctypedef npy_int128 int128_t victor@0: */ victor@0: typedef npy_int64 __pyx_t_5numpy_int64_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":730 victor@0: * #ctypedef npy_int128 int128_t victor@0: * victor@0: * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_uint16 uint16_t victor@0: * ctypedef npy_uint32 uint32_t victor@0: */ victor@0: typedef npy_uint8 __pyx_t_5numpy_uint8_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":731 victor@0: * victor@0: * ctypedef npy_uint8 uint8_t victor@0: * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_uint32 uint32_t victor@0: * ctypedef npy_uint64 uint64_t victor@0: */ victor@0: typedef npy_uint16 __pyx_t_5numpy_uint16_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":732 victor@0: * ctypedef npy_uint8 uint8_t victor@0: * ctypedef npy_uint16 uint16_t victor@0: * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_uint64 uint64_t victor@0: * #ctypedef npy_uint96 uint96_t victor@0: */ victor@0: typedef npy_uint32 __pyx_t_5numpy_uint32_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":733 victor@0: * ctypedef npy_uint16 uint16_t victor@0: * ctypedef npy_uint32 uint32_t victor@0: * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< victor@0: * #ctypedef npy_uint96 uint96_t victor@0: * #ctypedef npy_uint128 uint128_t victor@0: */ victor@0: typedef npy_uint64 __pyx_t_5numpy_uint64_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":737 victor@0: * #ctypedef npy_uint128 uint128_t victor@0: * victor@0: * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_float64 float64_t victor@0: * #ctypedef npy_float80 float80_t victor@0: */ victor@0: typedef npy_float32 __pyx_t_5numpy_float32_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":738 victor@0: * victor@0: * ctypedef npy_float32 float32_t victor@0: * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< victor@0: * #ctypedef npy_float80 float80_t victor@0: * #ctypedef npy_float128 float128_t victor@0: */ victor@0: typedef npy_float64 __pyx_t_5numpy_float64_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":747 victor@0: * # The int types are mapped a bit surprising -- victor@0: * # numpy.int corresponds to 'l' and numpy.long to 'q' victor@0: * ctypedef npy_long int_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_longlong long_t victor@0: * ctypedef npy_longlong longlong_t victor@0: */ victor@0: typedef npy_long __pyx_t_5numpy_int_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":748 victor@0: * # numpy.int corresponds to 'l' and numpy.long to 'q' victor@0: * ctypedef npy_long int_t victor@0: * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_longlong longlong_t victor@0: * victor@0: */ victor@0: typedef npy_longlong __pyx_t_5numpy_long_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":749 victor@0: * ctypedef npy_long int_t victor@0: * ctypedef npy_longlong long_t victor@0: * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< victor@0: * victor@0: * ctypedef npy_ulong uint_t victor@0: */ victor@0: typedef npy_longlong __pyx_t_5numpy_longlong_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":751 victor@0: * ctypedef npy_longlong longlong_t victor@0: * victor@0: * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_ulonglong ulong_t victor@0: * ctypedef npy_ulonglong ulonglong_t victor@0: */ victor@0: typedef npy_ulong __pyx_t_5numpy_uint_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":752 victor@0: * victor@0: * ctypedef npy_ulong uint_t victor@0: * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_ulonglong ulonglong_t victor@0: * victor@0: */ victor@0: typedef npy_ulonglong __pyx_t_5numpy_ulong_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":753 victor@0: * ctypedef npy_ulong uint_t victor@0: * ctypedef npy_ulonglong ulong_t victor@0: * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< victor@0: * victor@0: * ctypedef npy_intp intp_t victor@0: */ victor@0: typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":755 victor@0: * ctypedef npy_ulonglong ulonglong_t victor@0: * victor@0: * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_uintp uintp_t victor@0: * victor@0: */ victor@0: typedef npy_intp __pyx_t_5numpy_intp_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":756 victor@0: * victor@0: * ctypedef npy_intp intp_t victor@0: * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< victor@0: * victor@0: * ctypedef npy_double float_t victor@0: */ victor@0: typedef npy_uintp __pyx_t_5numpy_uintp_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":758 victor@0: * ctypedef npy_uintp uintp_t victor@0: * victor@0: * ctypedef npy_double float_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_double double_t victor@0: * ctypedef npy_longdouble longdouble_t victor@0: */ victor@0: typedef npy_double __pyx_t_5numpy_float_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":759 victor@0: * victor@0: * ctypedef npy_double float_t victor@0: * ctypedef npy_double double_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_longdouble longdouble_t victor@0: * victor@0: */ victor@0: typedef npy_double __pyx_t_5numpy_double_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":760 victor@0: * ctypedef npy_double float_t victor@0: * ctypedef npy_double double_t victor@0: * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< victor@0: * victor@0: * ctypedef npy_cfloat cfloat_t victor@0: */ victor@0: typedef npy_longdouble __pyx_t_5numpy_longdouble_t; victor@0: #if CYTHON_CCOMPLEX victor@0: #ifdef __cplusplus victor@0: typedef ::std::complex< float > __pyx_t_float_complex; victor@0: #else victor@0: typedef float _Complex __pyx_t_float_complex; victor@0: #endif victor@0: #else victor@0: typedef struct { float real, imag; } __pyx_t_float_complex; victor@0: #endif victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #ifdef __cplusplus victor@0: typedef ::std::complex< double > __pyx_t_double_complex; victor@0: #else victor@0: typedef double _Complex __pyx_t_double_complex; victor@0: #endif victor@0: #else victor@0: typedef struct { double real, imag; } __pyx_t_double_complex; victor@0: #endif victor@0: victor@0: victor@0: /*--- Type declarations ---*/ victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":762 victor@0: * ctypedef npy_longdouble longdouble_t victor@0: * victor@0: * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_cdouble cdouble_t victor@0: * ctypedef npy_clongdouble clongdouble_t victor@0: */ victor@0: typedef npy_cfloat __pyx_t_5numpy_cfloat_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":763 victor@0: * victor@0: * ctypedef npy_cfloat cfloat_t victor@0: * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< victor@0: * ctypedef npy_clongdouble clongdouble_t victor@0: * victor@0: */ victor@0: typedef npy_cdouble __pyx_t_5numpy_cdouble_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":764 victor@0: * ctypedef npy_cfloat cfloat_t victor@0: * ctypedef npy_cdouble cdouble_t victor@0: * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< victor@0: * victor@0: * ctypedef npy_cdouble complex_t victor@0: */ victor@0: typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":766 victor@0: * ctypedef npy_clongdouble clongdouble_t victor@0: * victor@0: * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew1(a): victor@0: */ victor@0: typedef npy_cdouble __pyx_t_5numpy_complex_t; victor@0: #ifndef CYTHON_REFNANNY victor@0: #define CYTHON_REFNANNY 0 victor@0: #endif victor@0: #if CYTHON_REFNANNY victor@0: typedef struct { victor@0: void (*INCREF)(void*, PyObject*, int); victor@0: void (*DECREF)(void*, PyObject*, int); victor@0: void (*GOTREF)(void*, PyObject*, int); victor@0: void (*GIVEREF)(void*, PyObject*, int); victor@0: void* (*SetupContext)(const char*, int, const char*); victor@0: void (*FinishContext)(void**); victor@0: } __Pyx_RefNannyAPIStruct; victor@0: static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; victor@0: static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ victor@0: #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; victor@0: #ifdef WITH_THREAD victor@0: #define __Pyx_RefNannySetupContext(name, acquire_gil) \ victor@0: if (acquire_gil) { \ victor@0: PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ victor@0: __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ victor@0: PyGILState_Release(__pyx_gilstate_save); \ victor@0: } else { \ victor@0: __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ victor@0: } victor@0: #else victor@0: #define __Pyx_RefNannySetupContext(name, acquire_gil) \ victor@0: __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) victor@0: #endif victor@0: #define __Pyx_RefNannyFinishContext() \ victor@0: __Pyx_RefNanny->FinishContext(&__pyx_refnanny) victor@0: #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) victor@0: #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) victor@0: #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) victor@0: #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) victor@0: #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) victor@0: #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) victor@0: #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) victor@0: #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) victor@0: #else victor@0: #define __Pyx_RefNannyDeclarations victor@0: #define __Pyx_RefNannySetupContext(name, acquire_gil) victor@0: #define __Pyx_RefNannyFinishContext() victor@0: #define __Pyx_INCREF(r) Py_INCREF(r) victor@0: #define __Pyx_DECREF(r) Py_DECREF(r) victor@0: #define __Pyx_GOTREF(r) victor@0: #define __Pyx_GIVEREF(r) victor@0: #define __Pyx_XINCREF(r) Py_XINCREF(r) victor@0: #define __Pyx_XDECREF(r) Py_XDECREF(r) victor@0: #define __Pyx_XGOTREF(r) victor@0: #define __Pyx_XGIVEREF(r) victor@0: #endif /* CYTHON_REFNANNY */ victor@0: #define __Pyx_XDECREF_SET(r, v) do { \ victor@0: PyObject *tmp = (PyObject *) r; \ victor@0: r = v; __Pyx_XDECREF(tmp); \ victor@0: } while (0) victor@0: #define __Pyx_DECREF_SET(r, v) do { \ victor@0: PyObject *tmp = (PyObject *) r; \ victor@0: r = v; __Pyx_DECREF(tmp); \ victor@0: } while (0) victor@0: #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) victor@0: #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) victor@0: victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { victor@0: PyTypeObject* tp = Py_TYPE(obj); victor@0: if (likely(tp->tp_getattro)) victor@0: return tp->tp_getattro(obj, attr_name); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (likely(tp->tp_getattr)) victor@0: return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); victor@0: #endif victor@0: return PyObject_GetAttr(obj, attr_name); victor@0: } victor@0: #else victor@0: #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) victor@0: #endif victor@0: victor@0: static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ victor@0: victor@0: static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, victor@0: Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ victor@0: victor@0: static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ victor@0: victor@0: static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ victor@0: PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ victor@0: const char* function_name); /*proto*/ victor@0: victor@0: static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ victor@0: victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ victor@0: #else victor@0: #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) victor@0: #endif victor@0: victor@0: static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ victor@0: victor@0: #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ victor@0: (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ victor@0: __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ victor@0: (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ victor@0: __Pyx_GetItemInt_Generic(o, to_py_func(i)))) victor@0: #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ victor@0: (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ victor@0: __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ victor@0: (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, victor@0: int wraparound, int boundscheck); victor@0: #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ victor@0: (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ victor@0: __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ victor@0: (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, victor@0: int wraparound, int boundscheck); victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, victor@0: int is_list, int wraparound, int boundscheck); victor@0: victor@0: static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, victor@0: const char *name, int exact); /*proto*/ victor@0: victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { victor@0: PyListObject* L = (PyListObject*) list; victor@0: Py_ssize_t len = Py_SIZE(list); victor@0: if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { victor@0: Py_INCREF(x); victor@0: PyList_SET_ITEM(list, len, x); victor@0: Py_SIZE(list) = len+1; victor@0: return 0; victor@0: } victor@0: return PyList_Append(list, x); victor@0: } victor@0: #else victor@0: #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) victor@0: #endif victor@0: victor@0: #include victor@0: victor@0: static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ victor@0: victor@0: static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ victor@0: victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals victor@0: #else victor@0: #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals victor@0: #endif victor@0: victor@0: static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); victor@0: victor@0: static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); victor@0: victor@0: static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ victor@0: victor@0: static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ victor@0: victor@0: static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ victor@0: static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ victor@0: victor@0: static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ victor@0: victor@0: static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); victor@0: victor@0: static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); victor@0: victor@0: #define __Pyx_CyFunction_USED 1 victor@0: #include victor@0: #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 victor@0: #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 victor@0: #define __Pyx_CYFUNCTION_CCLASS 0x04 victor@0: #define __Pyx_CyFunction_GetClosure(f) \ victor@0: (((__pyx_CyFunctionObject *) (f))->func_closure) victor@0: #define __Pyx_CyFunction_GetClassObj(f) \ victor@0: (((__pyx_CyFunctionObject *) (f))->func_classobj) victor@0: #define __Pyx_CyFunction_Defaults(type, f) \ victor@0: ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) victor@0: #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ victor@0: ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) victor@0: typedef struct { victor@0: PyCFunctionObject func; victor@0: PyObject *func_dict; victor@0: PyObject *func_weakreflist; victor@0: PyObject *func_name; victor@0: PyObject *func_qualname; victor@0: PyObject *func_doc; victor@0: PyObject *func_globals; victor@0: PyObject *func_code; victor@0: PyObject *func_closure; victor@0: PyObject *func_classobj; /* No-args super() class cell */ victor@0: void *defaults; victor@0: int defaults_pyobjects; victor@0: int flags; victor@0: PyObject *defaults_tuple; /* Const defaults tuple */ victor@0: PyObject *defaults_kwdict; /* Const kwonly defaults dict */ victor@0: PyObject *(*defaults_getter)(PyObject *); victor@0: PyObject *func_annotations; /* function annotations dict */ victor@0: } __pyx_CyFunctionObject; victor@0: static PyTypeObject *__pyx_CyFunctionType = 0; victor@0: #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ victor@0: __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) victor@0: static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, victor@0: int flags, PyObject* qualname, victor@0: PyObject *self, victor@0: PyObject *module, PyObject *globals, victor@0: PyObject* code); victor@0: static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, victor@0: size_t size, victor@0: int pyobjects); victor@0: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, victor@0: PyObject *tuple); victor@0: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, victor@0: PyObject *dict); victor@0: static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, victor@0: PyObject *dict); victor@0: static int __Pyx_CyFunction_init(void); victor@0: victor@0: static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); victor@0: victor@0: static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, victor@0: PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ victor@0: static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, victor@0: PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ victor@0: victor@0: static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ victor@0: victor@0: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); victor@0: victor@0: static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); victor@0: victor@0: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #ifdef __cplusplus victor@0: #define __Pyx_CREAL(z) ((z).real()) victor@0: #define __Pyx_CIMAG(z) ((z).imag()) victor@0: #else victor@0: #define __Pyx_CREAL(z) (__real__(z)) victor@0: #define __Pyx_CIMAG(z) (__imag__(z)) victor@0: #endif victor@0: #else victor@0: #define __Pyx_CREAL(z) ((z).real) victor@0: #define __Pyx_CIMAG(z) ((z).imag) victor@0: #endif victor@0: #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX victor@0: #define __Pyx_SET_CREAL(z,x) ((z).real(x)) victor@0: #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) victor@0: #else victor@0: #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) victor@0: #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) victor@0: #endif victor@0: victor@0: static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #define __Pyx_c_eqf(a, b) ((a)==(b)) victor@0: #define __Pyx_c_sumf(a, b) ((a)+(b)) victor@0: #define __Pyx_c_difff(a, b) ((a)-(b)) victor@0: #define __Pyx_c_prodf(a, b) ((a)*(b)) victor@0: #define __Pyx_c_quotf(a, b) ((a)/(b)) victor@0: #define __Pyx_c_negf(a) (-(a)) victor@0: #ifdef __cplusplus victor@0: #define __Pyx_c_is_zerof(z) ((z)==(float)0) victor@0: #define __Pyx_c_conjf(z) (::std::conj(z)) victor@0: #if 1 victor@0: #define __Pyx_c_absf(z) (::std::abs(z)) victor@0: #define __Pyx_c_powf(a, b) (::std::pow(a, b)) victor@0: #endif victor@0: #else victor@0: #define __Pyx_c_is_zerof(z) ((z)==0) victor@0: #define __Pyx_c_conjf(z) (conjf(z)) victor@0: #if 1 victor@0: #define __Pyx_c_absf(z) (cabsf(z)) victor@0: #define __Pyx_c_powf(a, b) (cpowf(a, b)) victor@0: #endif victor@0: #endif victor@0: #else victor@0: static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); victor@0: static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); victor@0: #if 1 victor@0: static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); victor@0: #endif victor@0: #endif victor@0: victor@0: static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #define __Pyx_c_eq(a, b) ((a)==(b)) victor@0: #define __Pyx_c_sum(a, b) ((a)+(b)) victor@0: #define __Pyx_c_diff(a, b) ((a)-(b)) victor@0: #define __Pyx_c_prod(a, b) ((a)*(b)) victor@0: #define __Pyx_c_quot(a, b) ((a)/(b)) victor@0: #define __Pyx_c_neg(a) (-(a)) victor@0: #ifdef __cplusplus victor@0: #define __Pyx_c_is_zero(z) ((z)==(double)0) victor@0: #define __Pyx_c_conj(z) (::std::conj(z)) victor@0: #if 1 victor@0: #define __Pyx_c_abs(z) (::std::abs(z)) victor@0: #define __Pyx_c_pow(a, b) (::std::pow(a, b)) victor@0: #endif victor@0: #else victor@0: #define __Pyx_c_is_zero(z) ((z)==0) victor@0: #define __Pyx_c_conj(z) (conj(z)) victor@0: #if 1 victor@0: #define __Pyx_c_abs(z) (cabs(z)) victor@0: #define __Pyx_c_pow(a, b) (cpow(a, b)) victor@0: #endif victor@0: #endif victor@0: #else victor@0: static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); victor@0: static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); victor@0: #if 1 victor@0: static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); victor@0: #endif victor@0: #endif victor@0: victor@0: static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); victor@0: victor@0: static int __Pyx_check_binary_version(void); victor@0: victor@0: #if !defined(__Pyx_PyIdentifier_FromString) victor@0: #if PY_MAJOR_VERSION < 3 victor@0: #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) victor@0: #else victor@0: #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) victor@0: #endif victor@0: #endif victor@0: victor@0: static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ victor@0: victor@0: static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ victor@0: victor@0: typedef struct { victor@0: int code_line; victor@0: PyCodeObject* code_object; victor@0: } __Pyx_CodeObjectCacheEntry; victor@0: struct __Pyx_CodeObjectCache { victor@0: int count; victor@0: int max_count; victor@0: __Pyx_CodeObjectCacheEntry* entries; victor@0: }; victor@0: static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; victor@0: static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); victor@0: static PyCodeObject *__pyx_find_code_object(int code_line); victor@0: static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); victor@0: victor@0: static void __Pyx_AddTraceback(const char *funcname, int c_line, victor@0: int py_line, const char *filename); /*proto*/ victor@0: victor@0: static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ victor@0: victor@0: victor@0: /* Module declarations from 'cpython.buffer' */ victor@0: victor@0: /* Module declarations from 'cpython.ref' */ victor@0: victor@0: /* Module declarations from 'libc.string' */ victor@0: victor@0: /* Module declarations from 'libc.stdio' */ victor@0: victor@0: /* Module declarations from 'cpython.object' */ victor@0: victor@0: /* Module declarations from '__builtin__' */ victor@0: victor@0: /* Module declarations from 'cpython.type' */ victor@0: static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; victor@0: victor@0: /* Module declarations from 'libc.stdlib' */ victor@0: victor@0: /* Module declarations from 'numpy' */ victor@0: victor@0: /* Module declarations from 'numpy' */ victor@0: static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; victor@0: static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; victor@0: static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; victor@0: static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; victor@0: static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; victor@0: static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ victor@0: victor@0: /* Module declarations from 'cpython.version' */ victor@0: victor@0: /* Module declarations from 'cpython.exc' */ victor@0: victor@0: /* Module declarations from 'cpython.module' */ victor@0: victor@0: /* Module declarations from 'cpython.mem' */ victor@0: victor@0: /* Module declarations from 'cpython.tuple' */ victor@0: victor@0: /* Module declarations from 'cpython.list' */ victor@0: victor@0: /* Module declarations from 'cpython.sequence' */ victor@0: victor@0: /* Module declarations from 'cpython.mapping' */ victor@0: victor@0: /* Module declarations from 'cpython.iterator' */ victor@0: victor@0: /* Module declarations from 'cpython.number' */ victor@0: victor@0: /* Module declarations from 'cpython.int' */ victor@0: victor@0: /* Module declarations from '__builtin__' */ victor@0: victor@0: /* Module declarations from 'cpython.bool' */ victor@0: static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; victor@0: victor@0: /* Module declarations from 'cpython.long' */ victor@0: victor@0: /* Module declarations from 'cpython.float' */ victor@0: victor@0: /* Module declarations from '__builtin__' */ victor@0: victor@0: /* Module declarations from 'cpython.complex' */ victor@0: static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; victor@0: victor@0: /* Module declarations from 'cpython.string' */ victor@0: victor@0: /* Module declarations from 'cpython.unicode' */ victor@0: victor@0: /* Module declarations from 'cpython.dict' */ victor@0: victor@0: /* Module declarations from 'cpython.instance' */ victor@0: victor@0: /* Module declarations from 'cpython.function' */ victor@0: victor@0: /* Module declarations from 'cpython.method' */ victor@0: victor@0: /* Module declarations from 'cpython.weakref' */ victor@0: victor@0: /* Module declarations from 'cpython.getargs' */ victor@0: victor@0: /* Module declarations from 'cpython.pythread' */ victor@0: victor@0: /* Module declarations from 'cpython.pystate' */ victor@0: victor@0: /* Module declarations from 'cpython.cobject' */ victor@0: victor@0: /* Module declarations from 'cpython.oldbuffer' */ victor@0: victor@0: /* Module declarations from 'cpython.set' */ victor@0: victor@0: /* Module declarations from 'cpython.bytes' */ victor@0: victor@0: /* Module declarations from 'cpython.pycapsule' */ victor@0: victor@0: /* Module declarations from 'cpython' */ victor@0: victor@0: /* Module declarations from 'MultipleOMR.Alignment.FastAlignmentArrays' */ victor@0: static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG; victor@0: static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP; victor@0: static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT; victor@0: static float __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_score; victor@0: #define __Pyx_MODULE_NAME "MultipleOMR.Alignment.FastAlignmentArrays" victor@0: int __pyx_module_is_main_MultipleOMR__Alignment__FastAlignmentArrays = 0; victor@0: victor@0: /* Implementation of 'MultipleOMR.Alignment.FastAlignmentArrays' */ victor@0: static PyObject *__pyx_builtin_range; victor@0: static PyObject *__pyx_builtin_ValueError; victor@0: static PyObject *__pyx_builtin_RuntimeError; victor@0: static PyObject *__pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays___needleman_wunsch_matrix(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_isFast); /* proto */ victor@0: static PyObject *__pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_2__needleman_wunsch_trace(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, CYTHON_UNUSED PyArrayObject *__pyx_v_s, PyArrayObject *__pyx_v_ptr); /* proto */ victor@0: static PyObject *__pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_4needleman_wunsch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_isFast); /* proto */ victor@0: static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ victor@0: static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ victor@0: static char __pyx_k_B[] = "B"; victor@0: static char __pyx_k_H[] = "H"; victor@0: static char __pyx_k_I[] = "I"; victor@0: static char __pyx_k_L[] = "L"; victor@0: static char __pyx_k_O[] = "O"; victor@0: static char __pyx_k_Q[] = "Q"; victor@0: static char __pyx_k_b[] = "b"; victor@0: static char __pyx_k_d[] = "d"; victor@0: static char __pyx_k_f[] = "f"; victor@0: static char __pyx_k_g[] = "g"; victor@0: static char __pyx_k_h[] = "h"; victor@0: static char __pyx_k_i[] = "i"; victor@0: static char __pyx_k_j[] = "j"; victor@0: static char __pyx_k_l[] = "l"; victor@0: static char __pyx_k_m[] = "m"; victor@0: static char __pyx_k_n[] = "n"; victor@0: static char __pyx_k_p[] = "p"; victor@0: static char __pyx_k_q[] = "q"; victor@0: static char __pyx_k_s[] = "s"; victor@0: static char __pyx_k_Zd[] = "Zd"; victor@0: static char __pyx_k_Zf[] = "Zf"; victor@0: static char __pyx_k_Zg[] = "Zg"; victor@0: static char __pyx_k__5[] = "*"; victor@0: static char __pyx_k_np[] = "np"; victor@0: static char __pyx_k_GAP[] = "[GAP]"; victor@0: static char __pyx_k_doc[] = "__doc__"; victor@0: static char __pyx_k_ptr[] = "ptr"; victor@0: static char __pyx_k_curr[] = "curr"; victor@0: static char __pyx_k_gap1[] = "gap1"; victor@0: static char __pyx_k_gap2[] = "gap2"; victor@0: static char __pyx_k_main[] = "__main__"; victor@0: static char __pyx_k_self[] = "self"; victor@0: static char __pyx_k_seq1[] = "seq1"; victor@0: static char __pyx_k_seq2[] = "seq2"; victor@0: static char __pyx_k_test[] = "__test__"; victor@0: static char __pyx_k_dtype[] = "dtype"; victor@0: static char __pyx_k_indel[] = "indel"; victor@0: static char __pyx_k_index[] = "index"; victor@0: static char __pyx_k_numpy[] = "numpy"; victor@0: static char __pyx_k_range[] = "range"; victor@0: static char __pyx_k_score[] = "score"; victor@0: static char __pyx_k_zeros[] = "zeros"; victor@0: static char __pyx_k_align1[] = "align1"; victor@0: static char __pyx_k_align2[] = "align2"; victor@0: static char __pyx_k_import[] = "__import__"; victor@0: static char __pyx_k_isFast[] = "isFast"; victor@0: static char __pyx_k_maxlen[] = "maxlen"; victor@0: static char __pyx_k_module[] = "__module__"; victor@0: static char __pyx_k_myseq1[] = "myseq1"; victor@0: static char __pyx_k_myseq2[] = "myseq2"; victor@0: static char __pyx_k_NWunsch[] = "NWunsch"; victor@0: static char __pyx_k_prepare[] = "__prepare__"; victor@0: static char __pyx_k_qualname[] = "__qualname__"; victor@0: static char __pyx_k_alignment[] = "alignment"; victor@0: static char __pyx_k_metaclass[] = "__metaclass__"; victor@0: static char __pyx_k_ValueError[] = "ValueError"; victor@0: static char __pyx_k_align1_gap[] = "align1_gap"; victor@0: static char __pyx_k_align2_gap[] = "align2_gap"; victor@0: static char __pyx_k_finalscore[] = "finalscore"; victor@0: static char __pyx_k_RuntimeError[] = "RuntimeError"; victor@0: static char __pyx_k_diagonalRange[] = "diagonalRange"; victor@0: static char __pyx_k_needleman_wunsch[] = "needleman_wunsch"; victor@0: static char __pyx_k_FastAlignmentArrays[] = "FastAlignmentArrays"; victor@0: static char __pyx_k_NWunsch_getSimilarity[] = "NWunsch_getSimilarity"; victor@0: static char __pyx_k_needleman_wunsch_trace[] = "__needleman_wunsch_trace"; victor@0: static char __pyx_k_needleman_wunsch_matrix[] = "__needleman_wunsch_matrix"; victor@0: static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; victor@0: static char __pyx_k_FastAlignmentArrays__needleman[] = "_FastAlignmentArrays__needleman_wunsch_matrix"; victor@0: static char __pyx_k_C_LICA_OMR_PythonV4_MultipleOMR[] = "C:\\LICA\\OMR_PythonV4\\MultipleOMR\\Alignment\\FastAlignmentArrays.pyx"; victor@0: static char __pyx_k_FastAlignmentArrays___needleman[] = "FastAlignmentArrays.__needleman_wunsch_matrix"; victor@0: static char __pyx_k_organization_Lancaster_Universi[] = "\n@organization: Lancaster University & University of Leeds\n@version: 1.0\nCreated on 11/12/2014\n\n@author: Victor Padilla\n@contact: v.padilla@lancaster.ac.uk\n\nContains an implementation of the Needleman Wunsch algorithm.\nfor two dimension arrays. It is a Cython file and should be \ncompiled using the file setupCython.py\n\npython setupCython.py build\n\nThe output will be in the build folder\nMultipleOMR\\build\\lib.win32-2.7\\MultipleOMR\n\n# if isFast==False, calculate the difference between the strings using the Needlemann Wunsch in C. \n# The score value will be between +1 to -1\n# if isFast==True, just compare the strings if they are equals (score=1) or different (score=-1)\n\n# 'isFast=true' means that the differences between foo00 and foo000 is -1\n# alignment are the sequences aligned\n# finalValue is the last value of the matrix\n# finalScore is the similarity of both sequences\n\nusage:\n\nseq1=[\"foo00\",\"abc\",\"123\"]\nseq2=[\"foo000\",\"abc\",\"1234\"]\n\nfaa=FastAlignmentArray()\nalignment,finalValue,finalScore=faa.needleman_wunsch(seq1, seq2,isFast=True)\n# finalScore=-0.333333343267\nalignment,finalValue,finalScore=faa.needleman_wunsch(seq1, seq2,isFast=False)\n# finalScore=0.722222208977\n\n"; victor@0: static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; victor@0: static char __pyx_k_FastAlignmentArrays__needleman_2[] = "_FastAlignmentArrays__needleman_wunsch_trace"; victor@0: static char __pyx_k_FastAlignmentArrays_needleman_wu[] = "FastAlignmentArrays.needleman_wunsch"; victor@0: static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; victor@0: static char __pyx_k_MultipleOMR_Alignment_FastAlignm[] = "MultipleOMR.Alignment.FastAlignmentArrays"; victor@0: static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; victor@0: static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; victor@0: static char __pyx_k_FastAlignmentArrays___needleman_2[] = "FastAlignmentArrays.__needleman_wunsch_trace"; victor@0: static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; victor@0: static PyObject *__pyx_kp_s_C_LICA_OMR_PythonV4_MultipleOMR; victor@0: static PyObject *__pyx_n_s_FastAlignmentArrays; victor@0: static PyObject *__pyx_n_s_FastAlignmentArrays___needleman; victor@0: static PyObject *__pyx_n_s_FastAlignmentArrays___needleman_2; victor@0: static PyObject *__pyx_n_s_FastAlignmentArrays__needleman; victor@0: static PyObject *__pyx_n_s_FastAlignmentArrays__needleman_2; victor@0: static PyObject *__pyx_n_s_FastAlignmentArrays_needleman_wu; victor@0: static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; victor@0: static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; victor@0: static PyObject *__pyx_kp_s_GAP; victor@0: static PyObject *__pyx_n_s_MultipleOMR_Alignment_FastAlignm; victor@0: static PyObject *__pyx_n_s_NWunsch; victor@0: static PyObject *__pyx_n_s_NWunsch_getSimilarity; victor@0: static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; victor@0: static PyObject *__pyx_n_s_RuntimeError; victor@0: static PyObject *__pyx_n_s_ValueError; victor@0: static PyObject *__pyx_kp_s__5; victor@0: static PyObject *__pyx_n_s_align1; victor@0: static PyObject *__pyx_n_s_align1_gap; victor@0: static PyObject *__pyx_n_s_align2; victor@0: static PyObject *__pyx_n_s_align2_gap; victor@0: static PyObject *__pyx_n_s_alignment; victor@0: static PyObject *__pyx_n_s_curr; victor@0: static PyObject *__pyx_n_s_diagonalRange; victor@0: static PyObject *__pyx_n_s_doc; victor@0: static PyObject *__pyx_n_s_dtype; victor@0: static PyObject *__pyx_n_s_finalscore; victor@0: static PyObject *__pyx_n_s_gap1; victor@0: static PyObject *__pyx_n_s_gap2; victor@0: static PyObject *__pyx_n_s_i; victor@0: static PyObject *__pyx_n_s_import; victor@0: static PyObject *__pyx_n_s_indel; victor@0: static PyObject *__pyx_n_s_index; victor@0: static PyObject *__pyx_n_s_isFast; victor@0: static PyObject *__pyx_n_s_j; victor@0: static PyObject *__pyx_n_s_m; victor@0: static PyObject *__pyx_n_s_main; victor@0: static PyObject *__pyx_n_s_maxlen; victor@0: static PyObject *__pyx_n_s_metaclass; victor@0: static PyObject *__pyx_n_s_module; victor@0: static PyObject *__pyx_n_s_myseq1; victor@0: static PyObject *__pyx_n_s_myseq2; victor@0: static PyObject *__pyx_n_s_n; victor@0: static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; victor@0: static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; victor@0: static PyObject *__pyx_n_s_needleman_wunsch; victor@0: static PyObject *__pyx_n_s_needleman_wunsch_matrix; victor@0: static PyObject *__pyx_n_s_needleman_wunsch_trace; victor@0: static PyObject *__pyx_n_s_np; victor@0: static PyObject *__pyx_n_s_numpy; victor@0: static PyObject *__pyx_n_s_p; victor@0: static PyObject *__pyx_n_s_prepare; victor@0: static PyObject *__pyx_n_s_ptr; victor@0: static PyObject *__pyx_n_s_q; victor@0: static PyObject *__pyx_n_s_qualname; victor@0: static PyObject *__pyx_n_s_range; victor@0: static PyObject *__pyx_n_s_s; victor@0: static PyObject *__pyx_n_s_score; victor@0: static PyObject *__pyx_n_s_self; victor@0: static PyObject *__pyx_n_s_seq1; victor@0: static PyObject *__pyx_n_s_seq2; victor@0: static PyObject *__pyx_n_s_test; victor@0: static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; victor@0: static PyObject *__pyx_n_s_zeros; victor@0: static PyObject *__pyx_int_0; victor@0: static PyObject *__pyx_int_1; victor@0: static PyObject *__pyx_int_3; victor@0: static PyObject *__pyx_int_350; victor@0: static PyObject *__pyx_int_neg_1; victor@0: static PyObject *__pyx_slice_; victor@0: static PyObject *__pyx_slice__3; victor@0: static PyObject *__pyx_tuple__2; victor@0: static PyObject *__pyx_tuple__4; victor@0: static PyObject *__pyx_tuple__6; victor@0: static PyObject *__pyx_tuple__7; victor@0: static PyObject *__pyx_tuple__8; victor@0: static PyObject *__pyx_tuple__9; victor@0: static PyObject *__pyx_tuple__10; victor@0: static PyObject *__pyx_tuple__11; victor@0: static PyObject *__pyx_tuple__12; victor@0: static PyObject *__pyx_tuple__14; victor@0: static PyObject *__pyx_tuple__16; victor@0: static PyObject *__pyx_tuple__18; victor@0: static PyObject *__pyx_codeobj__13; victor@0: static PyObject *__pyx_codeobj__15; victor@0: static PyObject *__pyx_codeobj__17; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 victor@0: * class FastAlignmentArrays: victor@0: * victor@0: * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< victor@0: * """ victor@0: * fill in the DP matrix according to the Needleman-Wunsch algorithm. victor@0: */ victor@0: victor@0: /* Python wrapper */ victor@0: static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ victor@0: static char __pyx_doc_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays___needleman_wunsch_matrix[] = "\n fill in the DP matrix according to the Needleman-Wunsch algorithm.\n Returns the matrix of scores and the matrix of pointers\n \n if isFast==False, calculate the difference between the strings using the Needlemann Wunsch in C. \n The score value will be between +1 to -1\n if isFast==True, just compare the strings if they are equals (score=1) or different (score=-1)\n "; victor@0: static PyMethodDef __pyx_mdef_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix = {__Pyx_NAMESTR("__needleman_wunsch_matrix"), (PyCFunction)__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays___needleman_wunsch_matrix)}; victor@0: static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { victor@0: CYTHON_UNUSED PyObject *__pyx_v_self = 0; victor@0: PyObject *__pyx_v_seq1 = 0; victor@0: PyObject *__pyx_v_seq2 = 0; victor@0: PyObject *__pyx_v_isFast = 0; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: PyObject *__pyx_r = 0; victor@0: __Pyx_RefNannyDeclarations victor@0: __Pyx_RefNannySetupContext("__needleman_wunsch_matrix (wrapper)", 0); victor@0: { victor@0: static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_isFast,0}; victor@0: PyObject* values[4] = {0,0,0,0}; victor@0: if (unlikely(__pyx_kwds)) { victor@0: Py_ssize_t kw_args; victor@0: const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); victor@0: switch (pos_args) { victor@0: case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); victor@0: case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); victor@0: case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); victor@0: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); victor@0: case 0: break; victor@0: default: goto __pyx_L5_argtuple_error; victor@0: } victor@0: kw_args = PyDict_Size(__pyx_kwds); victor@0: switch (pos_args) { victor@0: case 0: victor@0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; victor@0: else goto __pyx_L5_argtuple_error; victor@0: case 1: victor@0: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_matrix", 1, 4, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: case 2: victor@0: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_matrix", 1, 4, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: case 3: victor@0: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isFast)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_matrix", 1, 4, 4, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: } victor@0: if (unlikely(kw_args > 0)) { victor@0: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__needleman_wunsch_matrix") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { victor@0: goto __pyx_L5_argtuple_error; victor@0: } else { victor@0: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); victor@0: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); victor@0: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); victor@0: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); victor@0: } victor@0: __pyx_v_self = values[0]; victor@0: __pyx_v_seq1 = values[1]; victor@0: __pyx_v_seq2 = values[2]; victor@0: __pyx_v_isFast = values[3]; victor@0: } victor@0: goto __pyx_L4_argument_unpacking_done; victor@0: __pyx_L5_argtuple_error:; victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_matrix", 1, 4, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: __pyx_L3_error:; victor@0: __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return NULL; victor@0: __pyx_L4_argument_unpacking_done:; victor@0: __pyx_r = __pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays___needleman_wunsch_matrix(__pyx_self, __pyx_v_self, __pyx_v_seq1, __pyx_v_seq2, __pyx_v_isFast); victor@0: victor@0: /* function exit code */ victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: static PyObject *__pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays___needleman_wunsch_matrix(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_isFast) { victor@0: PyObject *__pyx_v_indel = NULL; victor@0: int __pyx_v_n; victor@0: int __pyx_v_m; victor@0: PyArrayObject *__pyx_v_s = 0; victor@0: PyArrayObject *__pyx_v_ptr = 0; victor@0: int __pyx_v_i; victor@0: int __pyx_v_j; victor@0: int __pyx_v_p; victor@0: int __pyx_v_q; victor@0: PyObject *__pyx_v_diagonalRange = NULL; victor@0: PyObject *__pyx_v_myseq1 = NULL; victor@0: PyObject *__pyx_v_myseq2 = NULL; victor@0: PyObject *__pyx_v_score = NULL; victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: Py_ssize_t __pyx_t_1; victor@0: PyObject *__pyx_t_2 = NULL; victor@0: PyObject *__pyx_t_3 = NULL; victor@0: PyObject *__pyx_t_4 = NULL; victor@0: PyObject *__pyx_t_5 = NULL; victor@0: long __pyx_t_6; victor@0: int __pyx_t_7; victor@0: int __pyx_t_8; victor@0: int __pyx_t_9; victor@0: int __pyx_t_10; victor@0: long __pyx_t_11; victor@0: int __pyx_t_12; victor@0: int __pyx_t_13; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("__needleman_wunsch_matrix", 0); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":67 victor@0: * """ victor@0: * victor@0: * indel = -1 # indel penalty # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef int n = len(seq1) victor@0: */ victor@0: __Pyx_INCREF(__pyx_int_neg_1); victor@0: __pyx_v_indel = __pyx_int_neg_1; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":69 victor@0: * indel = -1 # indel penalty victor@0: * victor@0: * cdef int n = len(seq1) # <<<<<<<<<<<<<< victor@0: * cdef int m = len(seq2) victor@0: * victor@0: */ victor@0: __pyx_t_1 = PyObject_Length(__pyx_v_seq1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 69; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_n = __pyx_t_1; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":70 victor@0: * victor@0: * cdef int n = len(seq1) victor@0: * cdef int m = len(seq2) # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix victor@0: */ victor@0: __pyx_t_1 = PyObject_Length(__pyx_v_seq2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 70; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_m = __pyx_t_1; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":72 victor@0: * cdef int m = len(seq2) victor@0: * victor@0: * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix # <<<<<<<<<<<<<< victor@0: * cdef np.ndarray ptr = np.zeros( (n+1, m+1), dtype=int ) # matrix of pointers victor@0: * victor@0: */ victor@0: __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_zeros); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_4 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 72; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_s = ((PyArrayObject *)__pyx_t_5); victor@0: __pyx_t_5 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":73 victor@0: * victor@0: * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix victor@0: * cdef np.ndarray ptr = np.zeros( (n+1, m+1), dtype=int ) # matrix of pointers # <<<<<<<<<<<<<< victor@0: * victor@0: * ##### INITIALIZE SCORING MATRIX (base case) ##### victor@0: */ victor@0: __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_np); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_zeros); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_m + 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_3 = 0; victor@0: __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_dtype, ((PyObject *)((PyObject*)(&PyInt_Type)))) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: if (!(likely(((__pyx_t_5) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_5, __pyx_ptype_5numpy_ndarray))))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 73; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_ptr = ((PyArrayObject *)__pyx_t_5); victor@0: __pyx_t_5 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":79 victor@0: * cdef int i victor@0: * cdef int j victor@0: * for i in range(1, n+1) : # <<<<<<<<<<<<<< victor@0: * s[i,0] = indel * i victor@0: * for j in range(1, m+1): victor@0: */ victor@0: __pyx_t_6 = (__pyx_v_n + 1); victor@0: for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { victor@0: __pyx_v_i = __pyx_t_7; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":80 victor@0: * cdef int j victor@0: * for i in range(1, n+1) : victor@0: * s[i,0] = indel * i # <<<<<<<<<<<<<< victor@0: * for j in range(1, m+1): victor@0: * s[0,j] = indel * j victor@0: */ victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_2 = PyNumber_Multiply(__pyx_v_indel, __pyx_t_5); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: __Pyx_INCREF(__pyx_int_0); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); victor@0: __Pyx_GIVEREF(__pyx_int_0); victor@0: __pyx_t_5 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_s), __pyx_t_3, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 80; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":81 victor@0: * for i in range(1, n+1) : victor@0: * s[i,0] = indel * i victor@0: * for j in range(1, m+1): # <<<<<<<<<<<<<< victor@0: * s[0,j] = indel * j victor@0: * victor@0: */ victor@0: __pyx_t_6 = (__pyx_v_m + 1); victor@0: for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { victor@0: __pyx_v_j = __pyx_t_7; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":82 victor@0: * s[i,0] = indel * i victor@0: * for j in range(1, m+1): victor@0: * s[0,j] = indel * j # <<<<<<<<<<<<<< victor@0: * victor@0: * ########## INITIALIZE TRACEBACK MATRIX ########## victor@0: */ victor@0: __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_3 = PyNumber_Multiply(__pyx_v_indel, __pyx_t_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_INCREF(__pyx_int_0); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); victor@0: __Pyx_GIVEREF(__pyx_int_0); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: __pyx_t_2 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_s), __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 82; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":87 victor@0: * victor@0: * # Tag first row by LEFT, indicating initial "-"s victor@0: * ptr[0,1:] = LEFT # <<<<<<<<<<<<<< victor@0: * victor@0: * # Tag first column by UP, indicating initial "-"s victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ptr), __pyx_tuple__2, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":90 victor@0: * victor@0: * # Tag first column by UP, indicating initial "-"s victor@0: * ptr[1:,0] = UP # <<<<<<<<<<<<<< victor@0: * victor@0: * ##################################################### victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ptr), __pyx_tuple__4, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":97 victor@0: * cdef int p victor@0: * cdef int q victor@0: * diagonalRange=350 # <<<<<<<<<<<<<< victor@0: * for i in range(1,n+1): victor@0: * p=i-diagonalRange victor@0: */ victor@0: __Pyx_INCREF(__pyx_int_350); victor@0: __pyx_v_diagonalRange = __pyx_int_350; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":98 victor@0: * cdef int q victor@0: * diagonalRange=350 victor@0: * for i in range(1,n+1): # <<<<<<<<<<<<<< victor@0: * p=i-diagonalRange victor@0: * q=i+diagonalRange victor@0: */ victor@0: __pyx_t_6 = (__pyx_v_n + 1); victor@0: for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { victor@0: __pyx_v_i = __pyx_t_7; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":99 victor@0: * diagonalRange=350 victor@0: * for i in range(1,n+1): victor@0: * p=i-diagonalRange # <<<<<<<<<<<<<< victor@0: * q=i+diagonalRange victor@0: * if(p<1): victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_v_diagonalRange); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 99; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_v_p = __pyx_t_8; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":100 victor@0: * for i in range(1,n+1): victor@0: * p=i-diagonalRange victor@0: * q=i+diagonalRange # <<<<<<<<<<<<<< victor@0: * if(p<1): victor@0: * p=1 victor@0: */ victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_diagonalRange); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 100; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_v_q = __pyx_t_8; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":101 victor@0: * p=i-diagonalRange victor@0: * q=i+diagonalRange victor@0: * if(p<1): # <<<<<<<<<<<<<< victor@0: * p=1 victor@0: * if(q>m+1): victor@0: */ victor@0: __pyx_t_9 = ((__pyx_v_p < 1) != 0); victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":102 victor@0: * q=i+diagonalRange victor@0: * if(p<1): victor@0: * p=1 # <<<<<<<<<<<<<< victor@0: * if(q>m+1): victor@0: * q=m+1 victor@0: */ victor@0: __pyx_v_p = 1; victor@0: goto __pyx_L9; victor@0: } victor@0: __pyx_L9:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":103 victor@0: * if(p<1): victor@0: * p=1 victor@0: * if(q>m+1): # <<<<<<<<<<<<<< victor@0: * q=m+1 victor@0: * for j in range(p,q): victor@0: */ victor@0: __pyx_t_9 = ((__pyx_v_q > (__pyx_v_m + 1)) != 0); victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":104 victor@0: * p=1 victor@0: * if(q>m+1): victor@0: * q=m+1 # <<<<<<<<<<<<<< victor@0: * for j in range(p,q): victor@0: * # match victor@0: */ victor@0: __pyx_v_q = (__pyx_v_m + 1); victor@0: goto __pyx_L10; victor@0: } victor@0: __pyx_L10:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":105 victor@0: * if(q>m+1): victor@0: * q=m+1 victor@0: * for j in range(p,q): # <<<<<<<<<<<<<< victor@0: * # match victor@0: * myseq1=seq1[i-1] victor@0: */ victor@0: __pyx_t_8 = __pyx_v_q; victor@0: for (__pyx_t_10 = __pyx_v_p; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) { victor@0: __pyx_v_j = __pyx_t_10; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":107 victor@0: * for j in range(p,q): victor@0: * # match victor@0: * myseq1=seq1[i-1] # <<<<<<<<<<<<<< victor@0: * myseq2=seq2[j-1] victor@0: * if isinstance(myseq1,list): victor@0: */ victor@0: __pyx_t_11 = (__pyx_v_i - 1); victor@0: __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_seq1, __pyx_t_11, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 107; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_XDECREF_SET(__pyx_v_myseq1, __pyx_t_3); victor@0: __pyx_t_3 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":108 victor@0: * # match victor@0: * myseq1=seq1[i-1] victor@0: * myseq2=seq2[j-1] # <<<<<<<<<<<<<< victor@0: * if isinstance(myseq1,list): victor@0: * myseq1=myseq1[0] victor@0: */ victor@0: __pyx_t_11 = (__pyx_v_j - 1); victor@0: __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_seq2, __pyx_t_11, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 108; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_XDECREF_SET(__pyx_v_myseq2, __pyx_t_3); victor@0: __pyx_t_3 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":109 victor@0: * myseq1=seq1[i-1] victor@0: * myseq2=seq2[j-1] victor@0: * if isinstance(myseq1,list): # <<<<<<<<<<<<<< victor@0: * myseq1=myseq1[0] victor@0: * if isinstance(myseq2,list): victor@0: */ victor@0: __pyx_t_9 = PyList_Check(__pyx_v_myseq1); victor@0: __pyx_t_12 = (__pyx_t_9 != 0); victor@0: if (__pyx_t_12) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":110 victor@0: * myseq2=seq2[j-1] victor@0: * if isinstance(myseq1,list): victor@0: * myseq1=myseq1[0] # <<<<<<<<<<<<<< victor@0: * if isinstance(myseq2,list): victor@0: * myseq2=myseq2[0] victor@0: */ victor@0: __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_myseq1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 110; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF_SET(__pyx_v_myseq1, __pyx_t_3); victor@0: __pyx_t_3 = 0; victor@0: goto __pyx_L13; victor@0: } victor@0: __pyx_L13:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":111 victor@0: * if isinstance(myseq1,list): victor@0: * myseq1=myseq1[0] victor@0: * if isinstance(myseq2,list): # <<<<<<<<<<<<<< victor@0: * myseq2=myseq2[0] victor@0: * victor@0: */ victor@0: __pyx_t_12 = PyList_Check(__pyx_v_myseq2); victor@0: __pyx_t_9 = (__pyx_t_12 != 0); victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":112 victor@0: * myseq1=myseq1[0] victor@0: * if isinstance(myseq2,list): victor@0: * myseq2=myseq2[0] # <<<<<<<<<<<<<< victor@0: * victor@0: * victor@0: */ victor@0: __pyx_t_3 = __Pyx_GetItemInt(__pyx_v_myseq2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 112; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF_SET(__pyx_v_myseq2, __pyx_t_3); victor@0: __pyx_t_3 = 0; victor@0: goto __pyx_L14; victor@0: } victor@0: __pyx_L14:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":115 victor@0: * victor@0: * victor@0: * if(myseq1== myseq2): # <<<<<<<<<<<<<< victor@0: * score=1 victor@0: * else: victor@0: */ victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_myseq1, __pyx_v_myseq2, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_9 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 115; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":116 victor@0: * victor@0: * if(myseq1== myseq2): victor@0: * score=1 # <<<<<<<<<<<<<< victor@0: * else: victor@0: * score=-1 victor@0: */ victor@0: __Pyx_INCREF(__pyx_int_1); victor@0: __Pyx_XDECREF_SET(__pyx_v_score, __pyx_int_1); victor@0: goto __pyx_L15; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":118 victor@0: * score=1 victor@0: * else: victor@0: * score=-1 # <<<<<<<<<<<<<< victor@0: * victor@0: * if len(myseq1)==0 or len(myseq2)==0: victor@0: */ victor@0: __Pyx_INCREF(__pyx_int_neg_1); victor@0: __Pyx_XDECREF_SET(__pyx_v_score, __pyx_int_neg_1); victor@0: } victor@0: __pyx_L15:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":120 victor@0: * score=-1 victor@0: * victor@0: * if len(myseq1)==0 or len(myseq2)==0: # <<<<<<<<<<<<<< victor@0: * score=0 victor@0: * victor@0: */ victor@0: __pyx_t_1 = PyObject_Length(__pyx_v_myseq1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_9 = ((__pyx_t_1 == 0) != 0); victor@0: if (!__pyx_t_9) { victor@0: __pyx_t_1 = PyObject_Length(__pyx_v_myseq2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 120; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_12 = ((__pyx_t_1 == 0) != 0); victor@0: __pyx_t_13 = __pyx_t_12; victor@0: } else { victor@0: __pyx_t_13 = __pyx_t_9; victor@0: } victor@0: if (__pyx_t_13) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":121 victor@0: * victor@0: * if len(myseq1)==0 or len(myseq2)==0: victor@0: * score=0 # <<<<<<<<<<<<<< victor@0: * victor@0: * #####For double alignment### victor@0: */ victor@0: __Pyx_INCREF(__pyx_int_0); victor@0: __Pyx_DECREF_SET(__pyx_v_score, __pyx_int_0); victor@0: goto __pyx_L16; victor@0: } victor@0: __pyx_L16:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":124 victor@0: * victor@0: * #####For double alignment### victor@0: * if isFast==False: # <<<<<<<<<<<<<< victor@0: * if len(myseq1)==0 or len(myseq2)==0: victor@0: * score=0 victor@0: */ victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_isFast, Py_False, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_13 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 124; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_13) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":125 victor@0: * #####For double alignment### victor@0: * if isFast==False: victor@0: * if len(myseq1)==0 or len(myseq2)==0: # <<<<<<<<<<<<<< victor@0: * score=0 victor@0: * else: victor@0: */ victor@0: __pyx_t_1 = PyObject_Length(__pyx_v_myseq1); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_13 = ((__pyx_t_1 == 0) != 0); victor@0: if (!__pyx_t_13) { victor@0: __pyx_t_1 = PyObject_Length(__pyx_v_myseq2); if (unlikely(__pyx_t_1 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 125; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_9 = ((__pyx_t_1 == 0) != 0); victor@0: __pyx_t_12 = __pyx_t_9; victor@0: } else { victor@0: __pyx_t_12 = __pyx_t_13; victor@0: } victor@0: if (__pyx_t_12) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":126 victor@0: * if isFast==False: victor@0: * if len(myseq1)==0 or len(myseq2)==0: victor@0: * score=0 # <<<<<<<<<<<<<< victor@0: * else: victor@0: * score=NWunsch.NWunsch_getSimilarity(myseq1,myseq2) victor@0: */ victor@0: __Pyx_INCREF(__pyx_int_0); victor@0: __Pyx_DECREF_SET(__pyx_v_score, __pyx_int_0); victor@0: goto __pyx_L18; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":128 victor@0: * score=0 victor@0: * else: victor@0: * score=NWunsch.NWunsch_getSimilarity(myseq1,myseq2) # <<<<<<<<<<<<<< victor@0: * ############################ victor@0: * victor@0: */ victor@0: __pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_NWunsch); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_NWunsch_getSimilarity); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_INCREF(__pyx_v_myseq1); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_myseq1); victor@0: __Pyx_GIVEREF(__pyx_v_myseq1); victor@0: __Pyx_INCREF(__pyx_v_myseq2); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_myseq2); victor@0: __Pyx_GIVEREF(__pyx_v_myseq2); victor@0: __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 128; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __Pyx_DECREF_SET(__pyx_v_score, __pyx_t_2); victor@0: __pyx_t_2 = 0; victor@0: } victor@0: __pyx_L18:; victor@0: goto __pyx_L17; victor@0: } victor@0: __pyx_L17:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":131 victor@0: * ############################ victor@0: * victor@0: * s[i,j] = s[i-1,j-1]+ score # <<<<<<<<<<<<<< victor@0: * victor@0: * victor@0: */ victor@0: __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_j - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_3 = 0; victor@0: __pyx_t_3 = PyObject_GetItem(((PyObject *)__pyx_v_s), __pyx_t_5); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_score); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: __pyx_t_3 = 0; victor@0: __pyx_t_2 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_s), __pyx_t_4, __pyx_t_5) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 131; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":135 victor@0: * victor@0: * # indel penalty victor@0: * if s[i-1,j] + indel > s[i,j] : # <<<<<<<<<<<<<< victor@0: * s[i,j] = s[i-1,j] + indel victor@0: * ptr[i,j] = UP victor@0: */ victor@0: __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_s), __pyx_t_2); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_v_indel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_s), __pyx_t_3); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 135; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_12) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":136 victor@0: * # indel penalty victor@0: * if s[i-1,j] + indel > s[i,j] : victor@0: * s[i,j] = s[i-1,j] + indel # <<<<<<<<<<<<<< victor@0: * ptr[i,j] = UP victor@0: * # indel penalty victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_i - 1)); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: __pyx_t_3 = 0; victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_s), __pyx_t_2); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __pyx_t_2 = PyNumber_Add(__pyx_t_5, __pyx_v_indel); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_3 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_s), __pyx_t_4, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 136; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":137 victor@0: * if s[i-1,j] + indel > s[i,j] : victor@0: * s[i,j] = s[i-1,j] + indel victor@0: * ptr[i,j] = UP # <<<<<<<<<<<<<< victor@0: * # indel penalty victor@0: * if s[i, j-1] + indel > s[i,j]: victor@0: */ victor@0: __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_3 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ptr), __pyx_t_5, __pyx_t_2) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 137; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: goto __pyx_L19; victor@0: } victor@0: __pyx_L19:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":139 victor@0: * ptr[i,j] = UP victor@0: * # indel penalty victor@0: * if s[i, j-1] + indel > s[i,j]: # <<<<<<<<<<<<<< victor@0: * s[i,j] = s[i, j-1] + indel victor@0: * ptr[i,j] = LEFT victor@0: */ victor@0: __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_5 = __Pyx_PyInt_From_long((__pyx_v_j - 1)); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_s), __pyx_t_3); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_3 = PyNumber_Add(__pyx_t_5, __pyx_v_indel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_s), __pyx_t_4); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_t_2, Py_GT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __pyx_t_12 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_12 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 139; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_12) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":140 victor@0: * # indel penalty victor@0: * if s[i, j-1] + indel > s[i,j]: victor@0: * s[i,j] = s[i, j-1] + indel # <<<<<<<<<<<<<< victor@0: * ptr[i,j] = LEFT victor@0: * victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_2 = __Pyx_PyInt_From_long((__pyx_v_j - 1)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_2 = PyObject_GetItem(((PyObject *)__pyx_v_s), __pyx_t_3); if (unlikely(__pyx_t_2 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_v_indel); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_4 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_s), __pyx_t_5, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 140; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":141 victor@0: * if s[i, j-1] + indel > s[i,j]: victor@0: * s[i,j] = s[i, j-1] + indel victor@0: * ptr[i,j] = LEFT # <<<<<<<<<<<<<< victor@0: * victor@0: * return s, ptr victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_4 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ptr), __pyx_t_2, __pyx_t_3) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 141; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: goto __pyx_L20; victor@0: } victor@0: __pyx_L20:; victor@0: } victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":143 victor@0: * ptr[i,j] = LEFT victor@0: * victor@0: * return s, ptr # <<<<<<<<<<<<<< victor@0: * victor@0: * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 143; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_INCREF(((PyObject *)__pyx_v_s)); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_s)); victor@0: __Pyx_GIVEREF(((PyObject *)__pyx_v_s)); victor@0: __Pyx_INCREF(((PyObject *)__pyx_v_ptr)); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_ptr)); victor@0: __Pyx_GIVEREF(((PyObject *)__pyx_v_ptr)); victor@0: __pyx_r = __pyx_t_3; victor@0: __pyx_t_3 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 victor@0: * class FastAlignmentArrays: victor@0: * victor@0: * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< victor@0: * """ victor@0: * fill in the DP matrix according to the Needleman-Wunsch algorithm. victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_2); victor@0: __Pyx_XDECREF(__pyx_t_3); victor@0: __Pyx_XDECREF(__pyx_t_4); victor@0: __Pyx_XDECREF(__pyx_t_5); victor@0: __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = NULL; victor@0: __pyx_L0:; victor@0: __Pyx_XDECREF(__pyx_v_indel); victor@0: __Pyx_XDECREF((PyObject *)__pyx_v_s); victor@0: __Pyx_XDECREF((PyObject *)__pyx_v_ptr); victor@0: __Pyx_XDECREF(__pyx_v_diagonalRange); victor@0: __Pyx_XDECREF(__pyx_v_myseq1); victor@0: __Pyx_XDECREF(__pyx_v_myseq2); victor@0: __Pyx_XDECREF(__pyx_v_score); victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 victor@0: * return s, ptr victor@0: * victor@0: * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< victor@0: * victor@0: * #### TRACE BEST PATH TO GET ALIGNMENT #### victor@0: */ victor@0: victor@0: /* Python wrapper */ victor@0: static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ victor@0: static PyMethodDef __pyx_mdef_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace = {__Pyx_NAMESTR("__needleman_wunsch_trace"), (PyCFunction)__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(0)}; victor@0: static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { victor@0: CYTHON_UNUSED PyObject *__pyx_v_self = 0; victor@0: PyObject *__pyx_v_seq1 = 0; victor@0: PyObject *__pyx_v_seq2 = 0; victor@0: CYTHON_UNUSED PyArrayObject *__pyx_v_s = 0; victor@0: PyArrayObject *__pyx_v_ptr = 0; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: PyObject *__pyx_r = 0; victor@0: __Pyx_RefNannyDeclarations victor@0: __Pyx_RefNannySetupContext("__needleman_wunsch_trace (wrapper)", 0); victor@0: { victor@0: static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_s,&__pyx_n_s_ptr,0}; victor@0: PyObject* values[5] = {0,0,0,0,0}; victor@0: if (unlikely(__pyx_kwds)) { victor@0: Py_ssize_t kw_args; victor@0: const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); victor@0: switch (pos_args) { victor@0: case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); victor@0: case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); victor@0: case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); victor@0: case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); victor@0: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); victor@0: case 0: break; victor@0: default: goto __pyx_L5_argtuple_error; victor@0: } victor@0: kw_args = PyDict_Size(__pyx_kwds); victor@0: switch (pos_args) { victor@0: case 0: victor@0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; victor@0: else goto __pyx_L5_argtuple_error; victor@0: case 1: victor@0: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_trace", 1, 5, 5, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: case 2: victor@0: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_trace", 1, 5, 5, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: case 3: victor@0: if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_trace", 1, 5, 5, 3); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: case 4: victor@0: if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ptr)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_trace", 1, 5, 5, 4); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: } victor@0: if (unlikely(kw_args > 0)) { victor@0: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__needleman_wunsch_trace") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { victor@0: goto __pyx_L5_argtuple_error; victor@0: } else { victor@0: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); victor@0: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); victor@0: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); victor@0: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); victor@0: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); victor@0: } victor@0: __pyx_v_self = values[0]; victor@0: __pyx_v_seq1 = values[1]; victor@0: __pyx_v_seq2 = values[2]; victor@0: __pyx_v_s = ((PyArrayObject *)values[3]); victor@0: __pyx_v_ptr = ((PyArrayObject *)values[4]); victor@0: } victor@0: goto __pyx_L4_argument_unpacking_done; victor@0: __pyx_L5_argtuple_error:; victor@0: __Pyx_RaiseArgtupleInvalid("__needleman_wunsch_trace", 1, 5, 5, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: __pyx_L3_error:; victor@0: __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_trace", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return NULL; victor@0: __pyx_L4_argument_unpacking_done:; victor@0: if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_s), __pyx_ptype_5numpy_ndarray, 1, "s", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_ptr), __pyx_ptype_5numpy_ndarray, 1, "ptr", 0))) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_r = __pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_2__needleman_wunsch_trace(__pyx_self, __pyx_v_self, __pyx_v_seq1, __pyx_v_seq2, __pyx_v_s, __pyx_v_ptr); victor@0: victor@0: /* function exit code */ victor@0: goto __pyx_L0; victor@0: __pyx_L1_error:; victor@0: __pyx_r = NULL; victor@0: __pyx_L0:; victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: static PyObject *__pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_2__needleman_wunsch_trace(CYTHON_UNUSED PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, CYTHON_UNUSED PyArrayObject *__pyx_v_s, PyArrayObject *__pyx_v_ptr) { victor@0: PyObject *__pyx_v_align1 = NULL; victor@0: PyObject *__pyx_v_align2 = NULL; victor@0: PyObject *__pyx_v_align1_gap = NULL; victor@0: PyObject *__pyx_v_align2_gap = NULL; victor@0: PyObject *__pyx_v_gap1 = NULL; victor@0: PyObject *__pyx_v_gap2 = NULL; victor@0: int __pyx_v_n; victor@0: int __pyx_v_m; victor@0: int __pyx_v_i; victor@0: int __pyx_v_j; victor@0: int __pyx_v_curr; victor@0: Py_ssize_t __pyx_v_index; victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: Py_ssize_t __pyx_t_2; victor@0: Py_ssize_t __pyx_t_3; victor@0: PyObject *__pyx_t_4 = NULL; victor@0: PyObject *__pyx_t_5 = NULL; victor@0: int __pyx_t_6; victor@0: int __pyx_t_7; victor@0: int __pyx_t_8; victor@0: int __pyx_t_9; victor@0: long __pyx_t_10; victor@0: int __pyx_t_11; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("__needleman_wunsch_trace", 0); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":148 victor@0: * victor@0: * #### TRACE BEST PATH TO GET ALIGNMENT #### victor@0: * align1 = [] # <<<<<<<<<<<<<< victor@0: * align2 = [] victor@0: * align1_gap = [] victor@0: */ victor@0: __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 148; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_v_align1 = ((PyObject*)__pyx_t_1); victor@0: __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":149 victor@0: * #### TRACE BEST PATH TO GET ALIGNMENT #### victor@0: * align1 = [] victor@0: * align2 = [] # <<<<<<<<<<<<<< victor@0: * align1_gap = [] victor@0: * align2_gap = [] victor@0: */ victor@0: __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 149; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_v_align2 = ((PyObject*)__pyx_t_1); victor@0: __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":150 victor@0: * align1 = [] victor@0: * align2 = [] victor@0: * align1_gap = [] # <<<<<<<<<<<<<< victor@0: * align2_gap = [] victor@0: * gap1=[] victor@0: */ victor@0: __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 150; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_v_align1_gap = ((PyObject*)__pyx_t_1); victor@0: __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":151 victor@0: * align2 = [] victor@0: * align1_gap = [] victor@0: * align2_gap = [] # <<<<<<<<<<<<<< victor@0: * gap1=[] victor@0: * gap2=[] victor@0: */ victor@0: __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 151; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_v_align2_gap = ((PyObject*)__pyx_t_1); victor@0: __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":152 victor@0: * align1_gap = [] victor@0: * align2_gap = [] victor@0: * gap1=[] # <<<<<<<<<<<<<< victor@0: * gap2=[] victor@0: * victor@0: */ victor@0: __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 152; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_v_gap1 = ((PyObject*)__pyx_t_1); victor@0: __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":153 victor@0: * align2_gap = [] victor@0: * gap1=[] victor@0: * gap2=[] # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef int n,m victor@0: */ victor@0: __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 153; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_v_gap2 = ((PyObject*)__pyx_t_1); victor@0: __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":156 victor@0: * victor@0: * cdef int n,m victor@0: * n, m = (len(seq1), len(seq2)) # <<<<<<<<<<<<<< victor@0: * cdef int i,j,curr victor@0: * i = n victor@0: */ victor@0: __pyx_t_2 = PyObject_Length(__pyx_v_seq1); if (unlikely(__pyx_t_2 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_3 = PyObject_Length(__pyx_v_seq2); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 156; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_n = __pyx_t_2; victor@0: __pyx_v_m = __pyx_t_3; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":158 victor@0: * n, m = (len(seq1), len(seq2)) victor@0: * cdef int i,j,curr victor@0: * i = n # <<<<<<<<<<<<<< victor@0: * j = m victor@0: * curr = ptr[i, j] victor@0: */ victor@0: __pyx_v_i = __pyx_v_n; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":159 victor@0: * cdef int i,j,curr victor@0: * i = n victor@0: * j = m # <<<<<<<<<<<<<< victor@0: * curr = ptr[i, j] victor@0: * while (i > 0 or j > 0): victor@0: */ victor@0: __pyx_v_j = __pyx_v_m; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":160 victor@0: * i = n victor@0: * j = m victor@0: * curr = ptr[i, j] # <<<<<<<<<<<<<< victor@0: * while (i > 0 or j > 0): victor@0: * ptr[i,j] += 3 victor@0: */ victor@0: __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); victor@0: __Pyx_GIVEREF(__pyx_t_1); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: __pyx_t_1 = 0; victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_ptr), __pyx_t_5); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 160; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_v_curr = __pyx_t_6; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":161 victor@0: * j = m victor@0: * curr = ptr[i, j] victor@0: * while (i > 0 or j > 0): # <<<<<<<<<<<<<< victor@0: * ptr[i,j] += 3 victor@0: * if curr == DIAG : victor@0: */ victor@0: while (1) { victor@0: __pyx_t_7 = ((__pyx_v_i > 0) != 0); victor@0: if (!__pyx_t_7) { victor@0: __pyx_t_8 = ((__pyx_v_j > 0) != 0); victor@0: __pyx_t_9 = __pyx_t_8; victor@0: } else { victor@0: __pyx_t_9 = __pyx_t_7; victor@0: } victor@0: if (!__pyx_t_9) break; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":162 victor@0: * curr = ptr[i, j] victor@0: * while (i > 0 or j > 0): victor@0: * ptr[i,j] += 3 # <<<<<<<<<<<<<< victor@0: * if curr == DIAG : victor@0: * align1.append(seq1[i-1]) victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); victor@0: __Pyx_GIVEREF(__pyx_t_5); victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_5 = 0; victor@0: __pyx_t_5 = PyObject_GetItem(((PyObject *)__pyx_v_ptr), __pyx_t_1); if (unlikely(__pyx_t_5 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_5, __pyx_int_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: if (unlikely(PyObject_SetItem(((PyObject *)__pyx_v_ptr), __pyx_t_1, __pyx_t_4) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 162; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":163 victor@0: * while (i > 0 or j > 0): victor@0: * ptr[i,j] += 3 victor@0: * if curr == DIAG : # <<<<<<<<<<<<<< victor@0: * align1.append(seq1[i-1]) victor@0: * align2.append(seq2[j-1]) victor@0: */ victor@0: __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG) != 0); victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":164 victor@0: * ptr[i,j] += 3 victor@0: * if curr == DIAG : victor@0: * align1.append(seq1[i-1]) # <<<<<<<<<<<<<< victor@0: * align2.append(seq2[j-1]) victor@0: * align1_gap.append(seq1[i-1]) victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_i - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq1, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align1, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 164; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":165 victor@0: * if curr == DIAG : victor@0: * align1.append(seq1[i-1]) victor@0: * align2.append(seq2[j-1]) # <<<<<<<<<<<<<< victor@0: * align1_gap.append(seq1[i-1]) victor@0: * align2_gap.append(seq2[j-1]) victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_j - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq2, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align2, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":166 victor@0: * align1.append(seq1[i-1]) victor@0: * align2.append(seq2[j-1]) victor@0: * align1_gap.append(seq1[i-1]) # <<<<<<<<<<<<<< victor@0: * align2_gap.append(seq2[j-1]) victor@0: * i -= 1 victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_i - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq1, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align1_gap, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 166; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":167 victor@0: * align2.append(seq2[j-1]) victor@0: * align1_gap.append(seq1[i-1]) victor@0: * align2_gap.append(seq2[j-1]) # <<<<<<<<<<<<<< victor@0: * i -= 1 victor@0: * j -= 1 victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_j - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq2, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align2_gap, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 167; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":168 victor@0: * align1_gap.append(seq1[i-1]) victor@0: * align2_gap.append(seq2[j-1]) victor@0: * i -= 1 # <<<<<<<<<<<<<< victor@0: * j -= 1 victor@0: * elif curr == LEFT: victor@0: */ victor@0: __pyx_v_i = (__pyx_v_i - 1); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":169 victor@0: * align2_gap.append(seq2[j-1]) victor@0: * i -= 1 victor@0: * j -= 1 # <<<<<<<<<<<<<< victor@0: * elif curr == LEFT: victor@0: * align1.append("*") victor@0: */ victor@0: __pyx_v_j = (__pyx_v_j - 1); victor@0: goto __pyx_L5; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":170 victor@0: * i -= 1 victor@0: * j -= 1 victor@0: * elif curr == LEFT: # <<<<<<<<<<<<<< victor@0: * align1.append("*") victor@0: * align2.append(seq2[j-1]) victor@0: */ victor@0: __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT) != 0); victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":171 victor@0: * j -= 1 victor@0: * elif curr == LEFT: victor@0: * align1.append("*") # <<<<<<<<<<<<<< victor@0: * align2.append(seq2[j-1]) victor@0: * align1_gap.append("[GAP]") victor@0: */ victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align1, __pyx_kp_s__5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 171; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":172 victor@0: * elif curr == LEFT: victor@0: * align1.append("*") victor@0: * align2.append(seq2[j-1]) # <<<<<<<<<<<<<< victor@0: * align1_gap.append("[GAP]") victor@0: * align2_gap.append(seq2[j-1]) victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_j - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq2, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align2, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 172; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":173 victor@0: * align1.append("*") victor@0: * align2.append(seq2[j-1]) victor@0: * align1_gap.append("[GAP]") # <<<<<<<<<<<<<< victor@0: * align2_gap.append(seq2[j-1]) victor@0: * j -= 1 victor@0: */ victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align1_gap, __pyx_kp_s_GAP); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 173; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":174 victor@0: * align2.append(seq2[j-1]) victor@0: * align1_gap.append("[GAP]") victor@0: * align2_gap.append(seq2[j-1]) # <<<<<<<<<<<<<< victor@0: * j -= 1 victor@0: * elif curr == UP: victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_j - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq2, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align2_gap, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 174; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":175 victor@0: * align1_gap.append("[GAP]") victor@0: * align2_gap.append(seq2[j-1]) victor@0: * j -= 1 # <<<<<<<<<<<<<< victor@0: * elif curr == UP: victor@0: * align1.append(seq1[i-1]) victor@0: */ victor@0: __pyx_v_j = (__pyx_v_j - 1); victor@0: goto __pyx_L5; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":176 victor@0: * align2_gap.append(seq2[j-1]) victor@0: * j -= 1 victor@0: * elif curr == UP: # <<<<<<<<<<<<<< victor@0: * align1.append(seq1[i-1]) victor@0: * align2.append("*") victor@0: */ victor@0: __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP) != 0); victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":177 victor@0: * j -= 1 victor@0: * elif curr == UP: victor@0: * align1.append(seq1[i-1]) # <<<<<<<<<<<<<< victor@0: * align2.append("*") victor@0: * align1_gap.append(seq1[i-1]) victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_i - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq1, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align1, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 177; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":178 victor@0: * elif curr == UP: victor@0: * align1.append(seq1[i-1]) victor@0: * align2.append("*") # <<<<<<<<<<<<<< victor@0: * align1_gap.append(seq1[i-1]) victor@0: * align2_gap.append("[GAP]") victor@0: */ victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align2, __pyx_kp_s__5); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":179 victor@0: * align1.append(seq1[i-1]) victor@0: * align2.append("*") victor@0: * align1_gap.append(seq1[i-1]) # <<<<<<<<<<<<<< victor@0: * align2_gap.append("[GAP]") victor@0: * i -= 1 victor@0: */ victor@0: __pyx_t_10 = (__pyx_v_i - 1); victor@0: __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_seq1, __pyx_t_10, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align1_gap, __pyx_t_1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 179; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":180 victor@0: * align2.append("*") victor@0: * align1_gap.append(seq1[i-1]) victor@0: * align2_gap.append("[GAP]") # <<<<<<<<<<<<<< victor@0: * i -= 1 victor@0: * victor@0: */ victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_align2_gap, __pyx_kp_s_GAP); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 180; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":181 victor@0: * align1_gap.append(seq1[i-1]) victor@0: * align2_gap.append("[GAP]") victor@0: * i -= 1 # <<<<<<<<<<<<<< victor@0: * victor@0: * curr = ptr[i,j] victor@0: */ victor@0: __pyx_v_i = (__pyx_v_i - 1); victor@0: goto __pyx_L5; victor@0: } victor@0: __pyx_L5:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":183 victor@0: * i -= 1 victor@0: * victor@0: * curr = ptr[i,j] # <<<<<<<<<<<<<< victor@0: * victor@0: * align1.reverse() victor@0: */ victor@0: __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_j); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_5); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); victor@0: __Pyx_GIVEREF(__pyx_t_1); victor@0: PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); victor@0: __Pyx_GIVEREF(__pyx_t_4); victor@0: __pyx_t_1 = 0; victor@0: __pyx_t_4 = 0; victor@0: __pyx_t_4 = PyObject_GetItem(((PyObject *)__pyx_v_ptr), __pyx_t_5); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; victor@0: __pyx_t_6 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_6 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 183; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_v_curr = __pyx_t_6; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":185 victor@0: * curr = ptr[i,j] victor@0: * victor@0: * align1.reverse() # <<<<<<<<<<<<<< victor@0: * align2.reverse() victor@0: * align1_gap.reverse() victor@0: */ victor@0: __pyx_t_11 = PyList_Reverse(__pyx_v_align1); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 185; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":186 victor@0: * victor@0: * align1.reverse() victor@0: * align2.reverse() # <<<<<<<<<<<<<< victor@0: * align1_gap.reverse() victor@0: * align2_gap.reverse() victor@0: */ victor@0: __pyx_t_11 = PyList_Reverse(__pyx_v_align2); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 186; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":187 victor@0: * align1.reverse() victor@0: * align2.reverse() victor@0: * align1_gap.reverse() # <<<<<<<<<<<<<< victor@0: * align2_gap.reverse() victor@0: * #gaps victor@0: */ victor@0: __pyx_t_11 = PyList_Reverse(__pyx_v_align1_gap); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 187; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":188 victor@0: * align2.reverse() victor@0: * align1_gap.reverse() victor@0: * align2_gap.reverse() # <<<<<<<<<<<<<< victor@0: * #gaps victor@0: * for index in range(len(align1_gap)): victor@0: */ victor@0: __pyx_t_11 = PyList_Reverse(__pyx_v_align2_gap); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 188; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":190 victor@0: * align2_gap.reverse() victor@0: * #gaps victor@0: * for index in range(len(align1_gap)): # <<<<<<<<<<<<<< victor@0: * if(align1_gap[index])=="[GAP]": victor@0: * gap1.append(index) victor@0: */ victor@0: __pyx_t_3 = PyList_GET_SIZE(__pyx_v_align1_gap); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 190; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) { victor@0: __pyx_v_index = __pyx_t_2; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":191 victor@0: * #gaps victor@0: * for index in range(len(align1_gap)): victor@0: * if(align1_gap[index])=="[GAP]": # <<<<<<<<<<<<<< victor@0: * gap1.append(index) victor@0: * victor@0: */ victor@0: __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_align1_gap, __pyx_v_index, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_GAP, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 191; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":192 victor@0: * for index in range(len(align1_gap)): victor@0: * if(align1_gap[index])=="[GAP]": victor@0: * gap1.append(index) # <<<<<<<<<<<<<< victor@0: * victor@0: * for index in range(len(align2_gap)): victor@0: */ victor@0: __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_gap1, __pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 192; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: goto __pyx_L8; victor@0: } victor@0: __pyx_L8:; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":194 victor@0: * gap1.append(index) victor@0: * victor@0: * for index in range(len(align2_gap)): # <<<<<<<<<<<<<< victor@0: * if(align2_gap[index])=="[GAP]": victor@0: * gap2.append(index) victor@0: */ victor@0: __pyx_t_3 = PyList_GET_SIZE(__pyx_v_align2_gap); if (unlikely(__pyx_t_3 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 194; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) { victor@0: __pyx_v_index = __pyx_t_2; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":195 victor@0: * victor@0: * for index in range(len(align2_gap)): victor@0: * if(align2_gap[index])=="[GAP]": # <<<<<<<<<<<<<< victor@0: * gap2.append(index) victor@0: * victor@0: */ victor@0: __pyx_t_4 = __Pyx_GetItemInt_List(__pyx_v_align2_gap, __pyx_v_index, Py_ssize_t, 1, PyInt_FromSsize_t, 1, 1, 1); if (unlikely(__pyx_t_4 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_9 = (__Pyx_PyString_Equals(__pyx_t_4, __pyx_kp_s_GAP, Py_EQ)); if (unlikely(__pyx_t_9 < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 195; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_9) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":196 victor@0: * for index in range(len(align2_gap)): victor@0: * if(align2_gap[index])=="[GAP]": victor@0: * gap2.append(index) # <<<<<<<<<<<<<< victor@0: * victor@0: * victor@0: */ victor@0: __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_index); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_11 = __Pyx_PyList_Append(__pyx_v_gap2, __pyx_t_4); if (unlikely(__pyx_t_11 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 196; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: goto __pyx_L11; victor@0: } victor@0: __pyx_L11:; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":199 victor@0: * victor@0: * victor@0: * return align1, align2,gap1,gap2 # <<<<<<<<<<<<<< victor@0: * victor@0: * victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_4 = PyTuple_New(4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 199; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_INCREF(__pyx_v_align1); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_align1); victor@0: __Pyx_GIVEREF(__pyx_v_align1); victor@0: __Pyx_INCREF(__pyx_v_align2); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_align2); victor@0: __Pyx_GIVEREF(__pyx_v_align2); victor@0: __Pyx_INCREF(__pyx_v_gap1); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_gap1); victor@0: __Pyx_GIVEREF(__pyx_v_gap1); victor@0: __Pyx_INCREF(__pyx_v_gap2); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_gap2); victor@0: __Pyx_GIVEREF(__pyx_v_gap2); victor@0: __pyx_r = __pyx_t_4; victor@0: __pyx_t_4 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 victor@0: * return s, ptr victor@0: * victor@0: * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< victor@0: * victor@0: * #### TRACE BEST PATH TO GET ALIGNMENT #### victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_XDECREF(__pyx_t_4); victor@0: __Pyx_XDECREF(__pyx_t_5); victor@0: __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_trace", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = NULL; victor@0: __pyx_L0:; victor@0: __Pyx_XDECREF(__pyx_v_align1); victor@0: __Pyx_XDECREF(__pyx_v_align2); victor@0: __Pyx_XDECREF(__pyx_v_align1_gap); victor@0: __Pyx_XDECREF(__pyx_v_align2_gap); victor@0: __Pyx_XDECREF(__pyx_v_gap1); victor@0: __Pyx_XDECREF(__pyx_v_gap2); victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 victor@0: * victor@0: * victor@0: * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< victor@0: * """ victor@0: * Computes an optimal global alignment of two sequences using the Needleman-Wunsch victor@0: */ victor@0: victor@0: /* Python wrapper */ victor@0: static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ victor@0: static char __pyx_doc_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_4needleman_wunsch[] = "\n Computes an optimal global alignment of two sequences using the Needleman-Wunsch\n algorithm\n returns the alignment and its score\n \n # if isFast==False, calculate the difference between the strings using the Needlemann Wunsch in C. \n # The score value will be between +1 to -1\n # if isFast==True, just compare the strings if they are equals (score=1) or different (score=-1)\n \n # 'isFast=true' means that the differences between foo00 and foo000 is -1\n # alignment are the sequences aligned\n # finalValue is the last value of the matrix\n # finalScore is the similarity of both sequences\n \n usage:\n \n seq1=[\"foo00\",\"abc\",\"123\"]\n seq2=[\"foo000\",\"abc\",\"1234\"]\n \n faa=FastAlignmentArray()\n alignment,finalValue,finalScore=faa.needleman_wunsch(seq1, seq2,isFast=True)\n # finalScore=-0.333333343267\n alignment,finalValue,finalScore=faa.needleman_wunsch(seq1, seq2,isFast=False)\n # finalScore=0.722222208977\n\n "; victor@0: static PyMethodDef __pyx_mdef_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch = {__Pyx_NAMESTR("needleman_wunsch"), (PyCFunction)__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch, METH_VARARGS|METH_KEYWORDS, __Pyx_DOCSTR(__pyx_doc_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_4needleman_wunsch)}; victor@0: static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { victor@0: PyObject *__pyx_v_self = 0; victor@0: PyObject *__pyx_v_seq1 = 0; victor@0: PyObject *__pyx_v_seq2 = 0; victor@0: PyObject *__pyx_v_isFast = 0; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: PyObject *__pyx_r = 0; victor@0: __Pyx_RefNannyDeclarations victor@0: __Pyx_RefNannySetupContext("needleman_wunsch (wrapper)", 0); victor@0: { victor@0: static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_isFast,0}; victor@0: PyObject* values[4] = {0,0,0,0}; victor@0: values[3] = ((PyObject *)((PyObject *)Py_True)); victor@0: if (unlikely(__pyx_kwds)) { victor@0: Py_ssize_t kw_args; victor@0: const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); victor@0: switch (pos_args) { victor@0: case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); victor@0: case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); victor@0: case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); victor@0: case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); victor@0: case 0: break; victor@0: default: goto __pyx_L5_argtuple_error; victor@0: } victor@0: kw_args = PyDict_Size(__pyx_kwds); victor@0: switch (pos_args) { victor@0: case 0: victor@0: if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; victor@0: else goto __pyx_L5_argtuple_error; victor@0: case 1: victor@0: if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("needleman_wunsch", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: case 2: victor@0: if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; victor@0: else { victor@0: __Pyx_RaiseArgtupleInvalid("needleman_wunsch", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: case 3: victor@0: if (kw_args > 0) { victor@0: PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isFast); victor@0: if (value) { values[3] = value; kw_args--; } victor@0: } victor@0: } victor@0: if (unlikely(kw_args > 0)) { victor@0: if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "needleman_wunsch") < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: } victor@0: } else { victor@0: switch (PyTuple_GET_SIZE(__pyx_args)) { victor@0: case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); victor@0: case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); victor@0: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); victor@0: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); victor@0: break; victor@0: default: goto __pyx_L5_argtuple_error; victor@0: } victor@0: } victor@0: __pyx_v_self = values[0]; victor@0: __pyx_v_seq1 = values[1]; victor@0: __pyx_v_seq2 = values[2]; victor@0: __pyx_v_isFast = values[3]; victor@0: } victor@0: goto __pyx_L4_argument_unpacking_done; victor@0: __pyx_L5_argtuple_error:; victor@0: __Pyx_RaiseArgtupleInvalid("needleman_wunsch", 0, 3, 4, PyTuple_GET_SIZE(__pyx_args)); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} victor@0: __pyx_L3_error:; victor@0: __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.needleman_wunsch", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return NULL; victor@0: __pyx_L4_argument_unpacking_done:; victor@0: __pyx_r = __pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_4needleman_wunsch(__pyx_self, __pyx_v_self, __pyx_v_seq1, __pyx_v_seq2, __pyx_v_isFast); victor@0: victor@0: /* function exit code */ victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: static PyObject *__pyx_pf_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_4needleman_wunsch(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_self, PyObject *__pyx_v_seq1, PyObject *__pyx_v_seq2, PyObject *__pyx_v_isFast) { victor@0: PyObject *__pyx_v_s = NULL; victor@0: PyObject *__pyx_v_ptr = NULL; victor@0: PyObject *__pyx_v_alignment = NULL; victor@0: int __pyx_v_maxlen; victor@0: float __pyx_v_finalscore; victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: PyObject *__pyx_t_2 = NULL; victor@0: PyObject *__pyx_t_3 = NULL; victor@0: PyObject *__pyx_t_4 = NULL; victor@0: PyObject *(*__pyx_t_5)(PyObject *); victor@0: Py_ssize_t __pyx_t_6; victor@0: Py_ssize_t __pyx_t_7; victor@0: int __pyx_t_8; victor@0: float __pyx_t_9; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("needleman_wunsch", 0); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":229 victor@0: * victor@0: * """ victor@0: * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast) # <<<<<<<<<<<<<< victor@0: * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) victor@0: * cdef int maxlen=len(seq1) victor@0: */ victor@0: __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FastAlignmentArrays__needleman); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_INCREF(__pyx_v_seq1); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq1); victor@0: __Pyx_GIVEREF(__pyx_v_seq1); victor@0: __Pyx_INCREF(__pyx_v_seq2); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_seq2); victor@0: __Pyx_GIVEREF(__pyx_v_seq2); victor@0: __Pyx_INCREF(__pyx_v_isFast); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_isFast); victor@0: __Pyx_GIVEREF(__pyx_v_isFast); victor@0: __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { victor@0: PyObject* sequence = __pyx_t_3; victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: Py_ssize_t size = Py_SIZE(sequence); victor@0: #else victor@0: Py_ssize_t size = PySequence_Size(sequence); victor@0: #endif victor@0: if (unlikely(size != 2)) { victor@0: if (size > 2) __Pyx_RaiseTooManyValuesError(2); victor@0: else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); victor@0: {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: if (likely(PyTuple_CheckExact(sequence))) { victor@0: __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); victor@0: __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); victor@0: } else { victor@0: __pyx_t_2 = PyList_GET_ITEM(sequence, 0); victor@0: __pyx_t_1 = PyList_GET_ITEM(sequence, 1); victor@0: } victor@0: __Pyx_INCREF(__pyx_t_2); victor@0: __Pyx_INCREF(__pyx_t_1); victor@0: #else victor@0: __pyx_t_2 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_1 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: #endif victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: } else { victor@0: Py_ssize_t index = -1; victor@0: __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; victor@0: index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: if (__Pyx_IternextUnpackEndCheck(__pyx_t_5(__pyx_t_4), 2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_5 = NULL; victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: goto __pyx_L4_unpacking_done; victor@0: __pyx_L3_unpacking_failed:; victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_5 = NULL; victor@0: if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); victor@0: {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_L4_unpacking_done:; victor@0: } victor@0: __pyx_v_s = __pyx_t_2; victor@0: __pyx_t_2 = 0; victor@0: __pyx_v_ptr = __pyx_t_1; victor@0: __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":230 victor@0: * """ victor@0: * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast) victor@0: * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) # <<<<<<<<<<<<<< victor@0: * cdef int maxlen=len(seq1) victor@0: * if len(seq2)>len(seq1): victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_self, __pyx_n_s_FastAlignmentArrays__needleman_2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_1 = PyTuple_New(4); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __Pyx_INCREF(__pyx_v_seq1); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq1); victor@0: __Pyx_GIVEREF(__pyx_v_seq1); victor@0: __Pyx_INCREF(__pyx_v_seq2); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_seq2); victor@0: __Pyx_GIVEREF(__pyx_v_seq2); victor@0: __Pyx_INCREF(__pyx_v_s); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_s); victor@0: __Pyx_GIVEREF(__pyx_v_s); victor@0: __Pyx_INCREF(__pyx_v_ptr); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_ptr); victor@0: __Pyx_GIVEREF(__pyx_v_ptr); victor@0: __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_1, NULL); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 230; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: __pyx_v_alignment = __pyx_t_2; victor@0: __pyx_t_2 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":231 victor@0: * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast) victor@0: * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) victor@0: * cdef int maxlen=len(seq1) # <<<<<<<<<<<<<< victor@0: * if len(seq2)>len(seq1): victor@0: * maxlen=len(seq2) victor@0: */ victor@0: __pyx_t_6 = PyObject_Length(__pyx_v_seq1); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 231; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_maxlen = __pyx_t_6; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":232 victor@0: * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) victor@0: * cdef int maxlen=len(seq1) victor@0: * if len(seq2)>len(seq1): # <<<<<<<<<<<<<< victor@0: * maxlen=len(seq2) victor@0: * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen victor@0: */ victor@0: __pyx_t_6 = PyObject_Length(__pyx_v_seq2); if (unlikely(__pyx_t_6 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_7 = PyObject_Length(__pyx_v_seq1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 232; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_8 = ((__pyx_t_6 > __pyx_t_7) != 0); victor@0: if (__pyx_t_8) { victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":233 victor@0: * cdef int maxlen=len(seq1) victor@0: * if len(seq2)>len(seq1): victor@0: * maxlen=len(seq2) # <<<<<<<<<<<<<< victor@0: * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen victor@0: * return alignment, s[len(seq1), len(seq2)],finalscore victor@0: */ victor@0: __pyx_t_7 = PyObject_Length(__pyx_v_seq2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 233; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_maxlen = __pyx_t_7; victor@0: goto __pyx_L5; victor@0: } victor@0: __pyx_L5:; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":234 victor@0: * if len(seq2)>len(seq1): victor@0: * maxlen=len(seq2) victor@0: * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen # <<<<<<<<<<<<<< victor@0: * return alignment, s[len(seq1), len(seq2)],finalscore victor@0: * victor@0: */ victor@0: __pyx_t_7 = PyObject_Length(__pyx_v_seq1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_7 = PyObject_Length(__pyx_v_seq2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_1 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); victor@0: __Pyx_GIVEREF(__pyx_t_1); victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_1 = 0; victor@0: __pyx_t_1 = PyObject_GetItem(__pyx_v_s, __pyx_t_3); if (unlikely(__pyx_t_1 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_maxlen); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_9 = __pyx_PyFloat_AsFloat(__pyx_t_2); if (unlikely((__pyx_t_9 == (float)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 234; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __pyx_v_finalscore = __pyx_t_9; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":235 victor@0: * maxlen=len(seq2) victor@0: * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen victor@0: * return alignment, s[len(seq1), len(seq2)],finalscore # <<<<<<<<<<<<<< victor@0: * victor@0: * victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_7 = PyObject_Length(__pyx_v_seq1); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_2 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __pyx_t_7 = PyObject_Length(__pyx_v_seq2); if (unlikely(__pyx_t_7 == -1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_t_3 = PyInt_FromSsize_t(__pyx_t_7); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); victor@0: __Pyx_GIVEREF(__pyx_t_2); victor@0: PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: __pyx_t_2 = 0; victor@0: __pyx_t_3 = 0; victor@0: __pyx_t_3 = PyObject_GetItem(__pyx_v_s, __pyx_t_1); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: __pyx_t_1 = PyFloat_FromDouble(__pyx_v_finalscore); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 235; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_INCREF(__pyx_v_alignment); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_alignment); victor@0: __Pyx_GIVEREF(__pyx_v_alignment); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); victor@0: __Pyx_GIVEREF(__pyx_t_1); victor@0: __pyx_t_3 = 0; victor@0: __pyx_t_1 = 0; victor@0: __pyx_r = __pyx_t_2; victor@0: __pyx_t_2 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 victor@0: * victor@0: * victor@0: * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< victor@0: * """ victor@0: * Computes an optimal global alignment of two sequences using the Needleman-Wunsch victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_XDECREF(__pyx_t_2); victor@0: __Pyx_XDECREF(__pyx_t_3); victor@0: __Pyx_XDECREF(__pyx_t_4); victor@0: __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.needleman_wunsch", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = NULL; victor@0: __pyx_L0:; victor@0: __Pyx_XDECREF(__pyx_v_s); victor@0: __Pyx_XDECREF(__pyx_v_ptr); victor@0: __Pyx_XDECREF(__pyx_v_alignment); victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194 victor@0: * # experimental exception made for __getbuffer__ and __releasebuffer__ victor@0: * # -- the details of this may change. victor@0: * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< victor@0: * # This implementation of getbuffer is geared towards Cython victor@0: * # requirements, and does not yet fullfill the PEP. victor@0: */ victor@0: victor@0: /* Python wrapper */ victor@0: static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/ victor@0: static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { victor@0: int __pyx_r; victor@0: __Pyx_RefNannyDeclarations victor@0: __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); victor@0: __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); victor@0: victor@0: /* function exit code */ victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { victor@0: int __pyx_v_copy_shape; victor@0: int __pyx_v_i; victor@0: int __pyx_v_ndim; victor@0: int __pyx_v_endian_detector; victor@0: int __pyx_v_little_endian; victor@0: int __pyx_v_t; victor@0: char *__pyx_v_f; victor@0: PyArray_Descr *__pyx_v_descr = 0; victor@0: int __pyx_v_offset; victor@0: int __pyx_v_hasfields; victor@0: int __pyx_r; victor@0: __Pyx_RefNannyDeclarations victor@0: int __pyx_t_1; victor@0: int __pyx_t_2; victor@0: int __pyx_t_3; victor@0: PyObject *__pyx_t_4 = NULL; victor@0: int __pyx_t_5; victor@0: int __pyx_t_6; victor@0: int __pyx_t_7; victor@0: PyObject *__pyx_t_8 = NULL; victor@0: char *__pyx_t_9; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("__getbuffer__", 0); victor@0: if (__pyx_v_info != NULL) { victor@0: __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); victor@0: __Pyx_GIVEREF(__pyx_v_info->obj); victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":200 victor@0: * # of flags victor@0: * victor@0: * if info == NULL: return # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef int copy_shape, i, ndim victor@0: */ victor@0: __pyx_t_1 = ((__pyx_v_info == NULL) != 0); victor@0: if (__pyx_t_1) { victor@0: __pyx_r = 0; victor@0: goto __pyx_L0; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":203 victor@0: * victor@0: * cdef int copy_shape, i, ndim victor@0: * cdef int endian_detector = 1 # <<<<<<<<<<<<<< victor@0: * cdef bint little_endian = ((&endian_detector)[0] != 0) victor@0: * victor@0: */ victor@0: __pyx_v_endian_detector = 1; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":204 victor@0: * cdef int copy_shape, i, ndim victor@0: * cdef int endian_detector = 1 victor@0: * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< victor@0: * victor@0: * ndim = PyArray_NDIM(self) victor@0: */ victor@0: __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":206 victor@0: * cdef bint little_endian = ((&endian_detector)[0] != 0) victor@0: * victor@0: * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< victor@0: * victor@0: * if sizeof(npy_intp) != sizeof(Py_ssize_t): victor@0: */ victor@0: __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":208 victor@0: * ndim = PyArray_NDIM(self) victor@0: * victor@0: * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< victor@0: * copy_shape = 1 victor@0: * else: victor@0: */ victor@0: __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":209 victor@0: * victor@0: * if sizeof(npy_intp) != sizeof(Py_ssize_t): victor@0: * copy_shape = 1 # <<<<<<<<<<<<<< victor@0: * else: victor@0: * copy_shape = 0 victor@0: */ victor@0: __pyx_v_copy_shape = 1; victor@0: goto __pyx_L4; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":211 victor@0: * copy_shape = 1 victor@0: * else: victor@0: * copy_shape = 0 # <<<<<<<<<<<<<< victor@0: * victor@0: * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) victor@0: */ victor@0: __pyx_v_copy_shape = 0; victor@0: } victor@0: __pyx_L4:; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":213 victor@0: * copy_shape = 0 victor@0: * victor@0: * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< victor@0: * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): victor@0: * raise ValueError(u"ndarray is not C contiguous") victor@0: */ victor@0: __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":214 victor@0: * victor@0: * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) victor@0: * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< victor@0: * raise ValueError(u"ndarray is not C contiguous") victor@0: * victor@0: */ victor@0: __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); victor@0: __pyx_t_3 = __pyx_t_2; victor@0: } else { victor@0: __pyx_t_3 = __pyx_t_1; victor@0: } victor@0: if (__pyx_t_3) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215 victor@0: * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) victor@0: * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): victor@0: * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< victor@0: * victor@0: * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_Raise(__pyx_t_4, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":217 victor@0: * raise ValueError(u"ndarray is not C contiguous") victor@0: * victor@0: * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< victor@0: * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): victor@0: * raise ValueError(u"ndarray is not Fortran contiguous") victor@0: */ victor@0: __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); victor@0: if (__pyx_t_3) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":218 victor@0: * victor@0: * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) victor@0: * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< victor@0: * raise ValueError(u"ndarray is not Fortran contiguous") victor@0: * victor@0: */ victor@0: __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); victor@0: __pyx_t_2 = __pyx_t_1; victor@0: } else { victor@0: __pyx_t_2 = __pyx_t_3; victor@0: } victor@0: if (__pyx_t_2) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219 victor@0: * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) victor@0: * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): victor@0: * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< victor@0: * victor@0: * info.buf = PyArray_DATA(self) victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_Raise(__pyx_t_4, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":221 victor@0: * raise ValueError(u"ndarray is not Fortran contiguous") victor@0: * victor@0: * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< victor@0: * info.ndim = ndim victor@0: * if copy_shape: victor@0: */ victor@0: __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":222 victor@0: * victor@0: * info.buf = PyArray_DATA(self) victor@0: * info.ndim = ndim # <<<<<<<<<<<<<< victor@0: * if copy_shape: victor@0: * # Allocate new buffer for strides and shape info. victor@0: */ victor@0: __pyx_v_info->ndim = __pyx_v_ndim; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":223 victor@0: * info.buf = PyArray_DATA(self) victor@0: * info.ndim = ndim victor@0: * if copy_shape: # <<<<<<<<<<<<<< victor@0: * # Allocate new buffer for strides and shape info. victor@0: * # This is allocated as one block, strides first. victor@0: */ victor@0: __pyx_t_2 = (__pyx_v_copy_shape != 0); victor@0: if (__pyx_t_2) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":226 victor@0: * # Allocate new buffer for strides and shape info. victor@0: * # This is allocated as one block, strides first. victor@0: * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) # <<<<<<<<<<<<<< victor@0: * info.shape = info.strides + ndim victor@0: * for i in range(ndim): victor@0: */ victor@0: __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":227 victor@0: * # This is allocated as one block, strides first. victor@0: * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) victor@0: * info.shape = info.strides + ndim # <<<<<<<<<<<<<< victor@0: * for i in range(ndim): victor@0: * info.strides[i] = PyArray_STRIDES(self)[i] victor@0: */ victor@0: __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":228 victor@0: * info.strides = stdlib.malloc(sizeof(Py_ssize_t) * ndim * 2) victor@0: * info.shape = info.strides + ndim victor@0: * for i in range(ndim): # <<<<<<<<<<<<<< victor@0: * info.strides[i] = PyArray_STRIDES(self)[i] victor@0: * info.shape[i] = PyArray_DIMS(self)[i] victor@0: */ victor@0: __pyx_t_5 = __pyx_v_ndim; victor@0: for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { victor@0: __pyx_v_i = __pyx_t_6; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":229 victor@0: * info.shape = info.strides + ndim victor@0: * for i in range(ndim): victor@0: * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< victor@0: * info.shape[i] = PyArray_DIMS(self)[i] victor@0: * else: victor@0: */ victor@0: (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":230 victor@0: * for i in range(ndim): victor@0: * info.strides[i] = PyArray_STRIDES(self)[i] victor@0: * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< victor@0: * else: victor@0: * info.strides = PyArray_STRIDES(self) victor@0: */ victor@0: (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); victor@0: } victor@0: goto __pyx_L7; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":232 victor@0: * info.shape[i] = PyArray_DIMS(self)[i] victor@0: * else: victor@0: * info.strides = PyArray_STRIDES(self) # <<<<<<<<<<<<<< victor@0: * info.shape = PyArray_DIMS(self) victor@0: * info.suboffsets = NULL victor@0: */ victor@0: __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":233 victor@0: * else: victor@0: * info.strides = PyArray_STRIDES(self) victor@0: * info.shape = PyArray_DIMS(self) # <<<<<<<<<<<<<< victor@0: * info.suboffsets = NULL victor@0: * info.itemsize = PyArray_ITEMSIZE(self) victor@0: */ victor@0: __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); victor@0: } victor@0: __pyx_L7:; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":234 victor@0: * info.strides = PyArray_STRIDES(self) victor@0: * info.shape = PyArray_DIMS(self) victor@0: * info.suboffsets = NULL # <<<<<<<<<<<<<< victor@0: * info.itemsize = PyArray_ITEMSIZE(self) victor@0: * info.readonly = not PyArray_ISWRITEABLE(self) victor@0: */ victor@0: __pyx_v_info->suboffsets = NULL; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":235 victor@0: * info.shape = PyArray_DIMS(self) victor@0: * info.suboffsets = NULL victor@0: * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< victor@0: * info.readonly = not PyArray_ISWRITEABLE(self) victor@0: * victor@0: */ victor@0: __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":236 victor@0: * info.suboffsets = NULL victor@0: * info.itemsize = PyArray_ITEMSIZE(self) victor@0: * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef int t victor@0: */ victor@0: __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":239 victor@0: * victor@0: * cdef int t victor@0: * cdef char* f = NULL # <<<<<<<<<<<<<< victor@0: * cdef dtype descr = self.descr victor@0: * cdef list stack victor@0: */ victor@0: __pyx_v_f = NULL; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":240 victor@0: * cdef int t victor@0: * cdef char* f = NULL victor@0: * cdef dtype descr = self.descr # <<<<<<<<<<<<<< victor@0: * cdef list stack victor@0: * cdef int offset victor@0: */ victor@0: __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); victor@0: __Pyx_INCREF(__pyx_t_4); victor@0: __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); victor@0: __pyx_t_4 = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":244 victor@0: * cdef int offset victor@0: * victor@0: * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< victor@0: * victor@0: * if not hasfields and not copy_shape: victor@0: */ victor@0: __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":246 victor@0: * cdef bint hasfields = PyDataType_HASFIELDS(descr) victor@0: * victor@0: * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< victor@0: * # do not call releasebuffer victor@0: * info.obj = None victor@0: */ victor@0: __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); victor@0: if (__pyx_t_2) { victor@0: __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); victor@0: __pyx_t_1 = __pyx_t_3; victor@0: } else { victor@0: __pyx_t_1 = __pyx_t_2; victor@0: } victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":248 victor@0: * if not hasfields and not copy_shape: victor@0: * # do not call releasebuffer victor@0: * info.obj = None # <<<<<<<<<<<<<< victor@0: * else: victor@0: * # need to call releasebuffer victor@0: */ victor@0: __Pyx_INCREF(Py_None); victor@0: __Pyx_GIVEREF(Py_None); victor@0: __Pyx_GOTREF(__pyx_v_info->obj); victor@0: __Pyx_DECREF(__pyx_v_info->obj); victor@0: __pyx_v_info->obj = Py_None; victor@0: goto __pyx_L10; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":251 victor@0: * else: victor@0: * # need to call releasebuffer victor@0: * info.obj = self # <<<<<<<<<<<<<< victor@0: * victor@0: * if not hasfields: victor@0: */ victor@0: __Pyx_INCREF(((PyObject *)__pyx_v_self)); victor@0: __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); victor@0: __Pyx_GOTREF(__pyx_v_info->obj); victor@0: __Pyx_DECREF(__pyx_v_info->obj); victor@0: __pyx_v_info->obj = ((PyObject *)__pyx_v_self); victor@0: } victor@0: __pyx_L10:; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":253 victor@0: * info.obj = self victor@0: * victor@0: * if not hasfields: # <<<<<<<<<<<<<< victor@0: * t = descr.type_num victor@0: * if ((descr.byteorder == c'>' and little_endian) or victor@0: */ victor@0: __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":254 victor@0: * victor@0: * if not hasfields: victor@0: * t = descr.type_num # <<<<<<<<<<<<<< victor@0: * if ((descr.byteorder == c'>' and little_endian) or victor@0: * (descr.byteorder == c'<' and not little_endian)): victor@0: */ victor@0: __pyx_t_5 = __pyx_v_descr->type_num; victor@0: __pyx_v_t = __pyx_t_5; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":255 victor@0: * if not hasfields: victor@0: * t = descr.type_num victor@0: * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< victor@0: * (descr.byteorder == c'<' and not little_endian)): victor@0: * raise ValueError(u"Non-native byte order not supported") victor@0: */ victor@0: __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); victor@0: if (__pyx_t_1) { victor@0: __pyx_t_2 = (__pyx_v_little_endian != 0); victor@0: } else { victor@0: __pyx_t_2 = __pyx_t_1; victor@0: } victor@0: if (!__pyx_t_2) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":256 victor@0: * t = descr.type_num victor@0: * if ((descr.byteorder == c'>' and little_endian) or victor@0: * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< victor@0: * raise ValueError(u"Non-native byte order not supported") victor@0: * if t == NPY_BYTE: f = "b" victor@0: */ victor@0: __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); victor@0: if (__pyx_t_1) { victor@0: __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); victor@0: __pyx_t_7 = __pyx_t_3; victor@0: } else { victor@0: __pyx_t_7 = __pyx_t_1; victor@0: } victor@0: __pyx_t_1 = __pyx_t_7; victor@0: } else { victor@0: __pyx_t_1 = __pyx_t_2; victor@0: } victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257 victor@0: * if ((descr.byteorder == c'>' and little_endian) or victor@0: * (descr.byteorder == c'<' and not little_endian)): victor@0: * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< victor@0: * if t == NPY_BYTE: f = "b" victor@0: * elif t == NPY_UBYTE: f = "B" victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_Raise(__pyx_t_4, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274 victor@0: * elif t == NPY_CDOUBLE: f = "Zd" victor@0: * elif t == NPY_CLONGDOUBLE: f = "Zg" victor@0: * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< victor@0: * else: victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) victor@0: */ victor@0: switch (__pyx_v_t) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":258 victor@0: * (descr.byteorder == c'<' and not little_endian)): victor@0: * raise ValueError(u"Non-native byte order not supported") victor@0: * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_UBYTE: f = "B" victor@0: * elif t == NPY_SHORT: f = "h" victor@0: */ victor@0: case NPY_BYTE: victor@0: __pyx_v_f = __pyx_k_b; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":259 victor@0: * raise ValueError(u"Non-native byte order not supported") victor@0: * if t == NPY_BYTE: f = "b" victor@0: * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_SHORT: f = "h" victor@0: * elif t == NPY_USHORT: f = "H" victor@0: */ victor@0: case NPY_UBYTE: victor@0: __pyx_v_f = __pyx_k_B; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":260 victor@0: * if t == NPY_BYTE: f = "b" victor@0: * elif t == NPY_UBYTE: f = "B" victor@0: * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_USHORT: f = "H" victor@0: * elif t == NPY_INT: f = "i" victor@0: */ victor@0: case NPY_SHORT: victor@0: __pyx_v_f = __pyx_k_h; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":261 victor@0: * elif t == NPY_UBYTE: f = "B" victor@0: * elif t == NPY_SHORT: f = "h" victor@0: * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_INT: f = "i" victor@0: * elif t == NPY_UINT: f = "I" victor@0: */ victor@0: case NPY_USHORT: victor@0: __pyx_v_f = __pyx_k_H; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":262 victor@0: * elif t == NPY_SHORT: f = "h" victor@0: * elif t == NPY_USHORT: f = "H" victor@0: * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_UINT: f = "I" victor@0: * elif t == NPY_LONG: f = "l" victor@0: */ victor@0: case NPY_INT: victor@0: __pyx_v_f = __pyx_k_i; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":263 victor@0: * elif t == NPY_USHORT: f = "H" victor@0: * elif t == NPY_INT: f = "i" victor@0: * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_LONG: f = "l" victor@0: * elif t == NPY_ULONG: f = "L" victor@0: */ victor@0: case NPY_UINT: victor@0: __pyx_v_f = __pyx_k_I; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":264 victor@0: * elif t == NPY_INT: f = "i" victor@0: * elif t == NPY_UINT: f = "I" victor@0: * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_ULONG: f = "L" victor@0: * elif t == NPY_LONGLONG: f = "q" victor@0: */ victor@0: case NPY_LONG: victor@0: __pyx_v_f = __pyx_k_l; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":265 victor@0: * elif t == NPY_UINT: f = "I" victor@0: * elif t == NPY_LONG: f = "l" victor@0: * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_LONGLONG: f = "q" victor@0: * elif t == NPY_ULONGLONG: f = "Q" victor@0: */ victor@0: case NPY_ULONG: victor@0: __pyx_v_f = __pyx_k_L; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":266 victor@0: * elif t == NPY_LONG: f = "l" victor@0: * elif t == NPY_ULONG: f = "L" victor@0: * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_ULONGLONG: f = "Q" victor@0: * elif t == NPY_FLOAT: f = "f" victor@0: */ victor@0: case NPY_LONGLONG: victor@0: __pyx_v_f = __pyx_k_q; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":267 victor@0: * elif t == NPY_ULONG: f = "L" victor@0: * elif t == NPY_LONGLONG: f = "q" victor@0: * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_FLOAT: f = "f" victor@0: * elif t == NPY_DOUBLE: f = "d" victor@0: */ victor@0: case NPY_ULONGLONG: victor@0: __pyx_v_f = __pyx_k_Q; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":268 victor@0: * elif t == NPY_LONGLONG: f = "q" victor@0: * elif t == NPY_ULONGLONG: f = "Q" victor@0: * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_DOUBLE: f = "d" victor@0: * elif t == NPY_LONGDOUBLE: f = "g" victor@0: */ victor@0: case NPY_FLOAT: victor@0: __pyx_v_f = __pyx_k_f; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":269 victor@0: * elif t == NPY_ULONGLONG: f = "Q" victor@0: * elif t == NPY_FLOAT: f = "f" victor@0: * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_LONGDOUBLE: f = "g" victor@0: * elif t == NPY_CFLOAT: f = "Zf" victor@0: */ victor@0: case NPY_DOUBLE: victor@0: __pyx_v_f = __pyx_k_d; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":270 victor@0: * elif t == NPY_FLOAT: f = "f" victor@0: * elif t == NPY_DOUBLE: f = "d" victor@0: * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_CFLOAT: f = "Zf" victor@0: * elif t == NPY_CDOUBLE: f = "Zd" victor@0: */ victor@0: case NPY_LONGDOUBLE: victor@0: __pyx_v_f = __pyx_k_g; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":271 victor@0: * elif t == NPY_DOUBLE: f = "d" victor@0: * elif t == NPY_LONGDOUBLE: f = "g" victor@0: * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_CDOUBLE: f = "Zd" victor@0: * elif t == NPY_CLONGDOUBLE: f = "Zg" victor@0: */ victor@0: case NPY_CFLOAT: victor@0: __pyx_v_f = __pyx_k_Zf; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":272 victor@0: * elif t == NPY_LONGDOUBLE: f = "g" victor@0: * elif t == NPY_CFLOAT: f = "Zf" victor@0: * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_CLONGDOUBLE: f = "Zg" victor@0: * elif t == NPY_OBJECT: f = "O" victor@0: */ victor@0: case NPY_CDOUBLE: victor@0: __pyx_v_f = __pyx_k_Zd; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":273 victor@0: * elif t == NPY_CFLOAT: f = "Zf" victor@0: * elif t == NPY_CDOUBLE: f = "Zd" victor@0: * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_OBJECT: f = "O" victor@0: * else: victor@0: */ victor@0: case NPY_CLONGDOUBLE: victor@0: __pyx_v_f = __pyx_k_Zg; victor@0: break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274 victor@0: * elif t == NPY_CDOUBLE: f = "Zd" victor@0: * elif t == NPY_CLONGDOUBLE: f = "Zg" victor@0: * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< victor@0: * else: victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) victor@0: */ victor@0: case NPY_OBJECT: victor@0: __pyx_v_f = __pyx_k_O; victor@0: break; victor@0: default: victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":276 victor@0: * elif t == NPY_OBJECT: f = "O" victor@0: * else: victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< victor@0: * info.format = f victor@0: * return victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_8 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_4); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_8); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); victor@0: __Pyx_GIVEREF(__pyx_t_8); victor@0: __pyx_t_8 = 0; victor@0: __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_8); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __Pyx_Raise(__pyx_t_8, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: break; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":277 victor@0: * else: victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) victor@0: * info.format = f # <<<<<<<<<<<<<< victor@0: * return victor@0: * else: victor@0: */ victor@0: __pyx_v_info->format = __pyx_v_f; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":278 victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) victor@0: * info.format = f victor@0: * return # <<<<<<<<<<<<<< victor@0: * else: victor@0: * info.format = stdlib.malloc(_buffer_format_string_len) victor@0: */ victor@0: __pyx_r = 0; victor@0: goto __pyx_L0; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":280 victor@0: * return victor@0: * else: victor@0: * info.format = stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< victor@0: * info.format[0] = c'^' # Native data types, manual alignment victor@0: * offset = 0 victor@0: */ victor@0: __pyx_v_info->format = ((char *)malloc(255)); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":281 victor@0: * else: victor@0: * info.format = stdlib.malloc(_buffer_format_string_len) victor@0: * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< victor@0: * offset = 0 victor@0: * f = _util_dtypestring(descr, info.format + 1, victor@0: */ victor@0: (__pyx_v_info->format[0]) = '^'; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":282 victor@0: * info.format = stdlib.malloc(_buffer_format_string_len) victor@0: * info.format[0] = c'^' # Native data types, manual alignment victor@0: * offset = 0 # <<<<<<<<<<<<<< victor@0: * f = _util_dtypestring(descr, info.format + 1, victor@0: * info.format + _buffer_format_string_len, victor@0: */ victor@0: __pyx_v_offset = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":283 victor@0: * info.format[0] = c'^' # Native data types, manual alignment victor@0: * offset = 0 victor@0: * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< victor@0: * info.format + _buffer_format_string_len, victor@0: * &offset) victor@0: */ victor@0: __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 255), (&__pyx_v_offset)); if (unlikely(__pyx_t_9 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 283; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_f = __pyx_t_9; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":286 victor@0: * info.format + _buffer_format_string_len, victor@0: * &offset) victor@0: * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< victor@0: * victor@0: * def __releasebuffer__(ndarray self, Py_buffer* info): victor@0: */ victor@0: (__pyx_v_f[0]) = '\x00'; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194 victor@0: * # experimental exception made for __getbuffer__ and __releasebuffer__ victor@0: * # -- the details of this may change. victor@0: * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< victor@0: * # This implementation of getbuffer is geared towards Cython victor@0: * # requirements, and does not yet fullfill the PEP. victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_r = 0; victor@0: goto __pyx_L0; victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_4); victor@0: __Pyx_XDECREF(__pyx_t_8); victor@0: __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = -1; victor@0: if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { victor@0: __Pyx_GOTREF(__pyx_v_info->obj); victor@0: __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; victor@0: } victor@0: goto __pyx_L2; victor@0: __pyx_L0:; victor@0: if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { victor@0: __Pyx_GOTREF(Py_None); victor@0: __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; victor@0: } victor@0: __pyx_L2:; victor@0: __Pyx_XDECREF((PyObject *)__pyx_v_descr); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288 victor@0: * f[0] = c'\0' # Terminate format string victor@0: * victor@0: * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< victor@0: * if PyArray_HASFIELDS(self): victor@0: * stdlib.free(info.format) victor@0: */ victor@0: victor@0: /* Python wrapper */ victor@0: static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ victor@0: static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { victor@0: __Pyx_RefNannyDeclarations victor@0: __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); victor@0: __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); victor@0: victor@0: /* function exit code */ victor@0: __Pyx_RefNannyFinishContext(); victor@0: } victor@0: victor@0: static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { victor@0: __Pyx_RefNannyDeclarations victor@0: int __pyx_t_1; victor@0: __Pyx_RefNannySetupContext("__releasebuffer__", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":289 victor@0: * victor@0: * def __releasebuffer__(ndarray self, Py_buffer* info): victor@0: * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< victor@0: * stdlib.free(info.format) victor@0: * if sizeof(npy_intp) != sizeof(Py_ssize_t): victor@0: */ victor@0: __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":290 victor@0: * def __releasebuffer__(ndarray self, Py_buffer* info): victor@0: * if PyArray_HASFIELDS(self): victor@0: * stdlib.free(info.format) # <<<<<<<<<<<<<< victor@0: * if sizeof(npy_intp) != sizeof(Py_ssize_t): victor@0: * stdlib.free(info.strides) victor@0: */ victor@0: free(__pyx_v_info->format); victor@0: goto __pyx_L3; victor@0: } victor@0: __pyx_L3:; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":291 victor@0: * if PyArray_HASFIELDS(self): victor@0: * stdlib.free(info.format) victor@0: * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< victor@0: * stdlib.free(info.strides) victor@0: * # info.shape was stored after info.strides in the same block victor@0: */ victor@0: __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":292 victor@0: * stdlib.free(info.format) victor@0: * if sizeof(npy_intp) != sizeof(Py_ssize_t): victor@0: * stdlib.free(info.strides) # <<<<<<<<<<<<<< victor@0: * # info.shape was stored after info.strides in the same block victor@0: * victor@0: */ victor@0: free(__pyx_v_info->strides); victor@0: goto __pyx_L4; victor@0: } victor@0: __pyx_L4:; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288 victor@0: * f[0] = c'\0' # Terminate format string victor@0: * victor@0: * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< victor@0: * if PyArray_HASFIELDS(self): victor@0: * stdlib.free(info.format) victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __Pyx_RefNannyFinishContext(); victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768 victor@0: * ctypedef npy_cdouble complex_t victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(1, a) victor@0: * victor@0: */ victor@0: victor@0: static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":769 victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew1(a): victor@0: * return PyArray_MultiIterNew(1, a) # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew2(a, b): victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 769; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_r = __pyx_t_1; victor@0: __pyx_t_1 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768 victor@0: * ctypedef npy_cdouble complex_t victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(1, a) victor@0: * victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = 0; victor@0: __pyx_L0:; victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771 victor@0: * return PyArray_MultiIterNew(1, a) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(2, a, b) victor@0: * victor@0: */ victor@0: victor@0: static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":772 victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew2(a, b): victor@0: * return PyArray_MultiIterNew(2, a, b) # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew3(a, b, c): victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 772; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_r = __pyx_t_1; victor@0: __pyx_t_1 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771 victor@0: * return PyArray_MultiIterNew(1, a) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(2, a, b) victor@0: * victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = 0; victor@0: __pyx_L0:; victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774 victor@0: * return PyArray_MultiIterNew(2, a, b) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(3, a, b, c) victor@0: * victor@0: */ victor@0: victor@0: static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":775 victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew3(a, b, c): victor@0: * return PyArray_MultiIterNew(3, a, b, c) # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew4(a, b, c, d): victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 775; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_r = __pyx_t_1; victor@0: __pyx_t_1 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774 victor@0: * return PyArray_MultiIterNew(2, a, b) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(3, a, b, c) victor@0: * victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = 0; victor@0: __pyx_L0:; victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777 victor@0: * return PyArray_MultiIterNew(3, a, b, c) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(4, a, b, c, d) victor@0: * victor@0: */ victor@0: victor@0: static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) { victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":778 victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew4(a, b, c, d): victor@0: * return PyArray_MultiIterNew(4, a, b, c, d) # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 778; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_r = __pyx_t_1; victor@0: __pyx_t_1 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777 victor@0: * return PyArray_MultiIterNew(3, a, b, c) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(4, a, b, c, d) victor@0: * victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = 0; victor@0: __pyx_L0:; victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780 victor@0: * return PyArray_MultiIterNew(4, a, b, c, d) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(5, a, b, c, d, e) victor@0: * victor@0: */ victor@0: victor@0: static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) { victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":781 victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): victor@0: * return PyArray_MultiIterNew(5, a, b, c, d, e) # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 781; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: __pyx_r = __pyx_t_1; victor@0: __pyx_t_1 = 0; victor@0: goto __pyx_L0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780 victor@0: * return PyArray_MultiIterNew(4, a, b, c, d) victor@0: * victor@0: * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< victor@0: * return PyArray_MultiIterNew(5, a, b, c, d, e) victor@0: * victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = 0; victor@0: __pyx_L0:; victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783 victor@0: * return PyArray_MultiIterNew(5, a, b, c, d, e) victor@0: * victor@0: * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< victor@0: * # Recursive utility function used in __getbuffer__ to get format victor@0: * # string. The new location in the format string is returned. victor@0: */ victor@0: victor@0: static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) { victor@0: PyArray_Descr *__pyx_v_child = 0; victor@0: int __pyx_v_endian_detector; victor@0: int __pyx_v_little_endian; victor@0: PyObject *__pyx_v_fields = 0; victor@0: PyObject *__pyx_v_childname = NULL; victor@0: PyObject *__pyx_v_new_offset = NULL; victor@0: PyObject *__pyx_v_t = NULL; victor@0: char *__pyx_r; victor@0: __Pyx_RefNannyDeclarations victor@0: PyObject *__pyx_t_1 = NULL; victor@0: Py_ssize_t __pyx_t_2; victor@0: PyObject *__pyx_t_3 = NULL; victor@0: PyObject *__pyx_t_4 = NULL; victor@0: int __pyx_t_5; victor@0: int __pyx_t_6; victor@0: int __pyx_t_7; victor@0: int __pyx_t_8; victor@0: int __pyx_t_9; victor@0: long __pyx_t_10; victor@0: char *__pyx_t_11; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannySetupContext("_util_dtypestring", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":790 victor@0: * cdef int delta_offset victor@0: * cdef tuple i victor@0: * cdef int endian_detector = 1 # <<<<<<<<<<<<<< victor@0: * cdef bint little_endian = ((&endian_detector)[0] != 0) victor@0: * cdef tuple fields victor@0: */ victor@0: __pyx_v_endian_detector = 1; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":791 victor@0: * cdef tuple i victor@0: * cdef int endian_detector = 1 victor@0: * cdef bint little_endian = ((&endian_detector)[0] != 0) # <<<<<<<<<<<<<< victor@0: * cdef tuple fields victor@0: * victor@0: */ victor@0: __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":794 victor@0: * cdef tuple fields victor@0: * victor@0: * for childname in descr.names: # <<<<<<<<<<<<<< victor@0: * fields = descr.fields[childname] victor@0: * child, new_offset = fields victor@0: */ victor@0: if (unlikely(__pyx_v_descr->names == Py_None)) { victor@0: PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; victor@0: for (;;) { victor@0: if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #else victor@0: __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #endif victor@0: __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); victor@0: __pyx_t_3 = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":795 victor@0: * victor@0: * for childname in descr.names: victor@0: * fields = descr.fields[childname] # <<<<<<<<<<<<<< victor@0: * child, new_offset = fields victor@0: * victor@0: */ victor@0: __pyx_t_3 = PyObject_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(__pyx_t_3 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 795; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); victor@0: __pyx_t_3 = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":796 victor@0: * for childname in descr.names: victor@0: * fields = descr.fields[childname] victor@0: * child, new_offset = fields # <<<<<<<<<<<<<< victor@0: * victor@0: * if (end - f) - (new_offset - offset[0]) < 15: victor@0: */ victor@0: if (likely(__pyx_v_fields != Py_None)) { victor@0: PyObject* sequence = __pyx_v_fields; victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: Py_ssize_t size = Py_SIZE(sequence); victor@0: #else victor@0: Py_ssize_t size = PySequence_Size(sequence); victor@0: #endif victor@0: if (unlikely(size != 2)) { victor@0: if (size > 2) __Pyx_RaiseTooManyValuesError(2); victor@0: else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); victor@0: __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); victor@0: __Pyx_INCREF(__pyx_t_3); victor@0: __Pyx_INCREF(__pyx_t_4); victor@0: #else victor@0: __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: #endif victor@0: } else { victor@0: __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); victor@0: __pyx_t_3 = 0; victor@0: __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); victor@0: __pyx_t_4 = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":798 victor@0: * child, new_offset = fields victor@0: * victor@0: * if (end - f) - (new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< victor@0: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") victor@0: * victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 798; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); victor@0: if (__pyx_t_6) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799 victor@0: * victor@0: * if (end - f) - (new_offset - offset[0]) < 15: victor@0: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< victor@0: * victor@0: * if ((child.byteorder == c'>' and little_endian) or victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_Raise(__pyx_t_3, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":801 victor@0: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") victor@0: * victor@0: * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< victor@0: * (child.byteorder == c'<' and not little_endian)): victor@0: * raise ValueError(u"Non-native byte order not supported") victor@0: */ victor@0: __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); victor@0: if (__pyx_t_6) { victor@0: __pyx_t_7 = (__pyx_v_little_endian != 0); victor@0: } else { victor@0: __pyx_t_7 = __pyx_t_6; victor@0: } victor@0: if (!__pyx_t_7) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":802 victor@0: * victor@0: * if ((child.byteorder == c'>' and little_endian) or victor@0: * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< victor@0: * raise ValueError(u"Non-native byte order not supported") victor@0: * # One could encode it in the format string and have Cython victor@0: */ victor@0: __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); victor@0: if (__pyx_t_6) { victor@0: __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); victor@0: __pyx_t_9 = __pyx_t_8; victor@0: } else { victor@0: __pyx_t_9 = __pyx_t_6; victor@0: } victor@0: __pyx_t_6 = __pyx_t_9; victor@0: } else { victor@0: __pyx_t_6 = __pyx_t_7; victor@0: } victor@0: if (__pyx_t_6) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803 victor@0: * if ((child.byteorder == c'>' and little_endian) or victor@0: * (child.byteorder == c'<' and not little_endian)): victor@0: * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< victor@0: * # One could encode it in the format string and have Cython victor@0: * # complain instead, BUT: < and > in format strings also imply victor@0: */ victor@0: __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_Raise(__pyx_t_3, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":813 victor@0: * victor@0: * # Output padding bytes victor@0: * while offset[0] < new_offset: # <<<<<<<<<<<<<< victor@0: * f[0] = 120 # "x"; pad byte victor@0: * f += 1 victor@0: */ victor@0: while (1) { victor@0: __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 813; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (!__pyx_t_6) break; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":814 victor@0: * # Output padding bytes victor@0: * while offset[0] < new_offset: victor@0: * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< victor@0: * f += 1 victor@0: * offset[0] += 1 victor@0: */ victor@0: (__pyx_v_f[0]) = 120; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":815 victor@0: * while offset[0] < new_offset: victor@0: * f[0] = 120 # "x"; pad byte victor@0: * f += 1 # <<<<<<<<<<<<<< victor@0: * offset[0] += 1 victor@0: * victor@0: */ victor@0: __pyx_v_f = (__pyx_v_f + 1); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":816 victor@0: * f[0] = 120 # "x"; pad byte victor@0: * f += 1 victor@0: * offset[0] += 1 # <<<<<<<<<<<<<< victor@0: * victor@0: * offset[0] += child.itemsize victor@0: */ victor@0: __pyx_t_10 = 0; victor@0: (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":818 victor@0: * offset[0] += 1 victor@0: * victor@0: * offset[0] += child.itemsize # <<<<<<<<<<<<<< victor@0: * victor@0: * if not PyDataType_HASFIELDS(child): victor@0: */ victor@0: __pyx_t_10 = 0; victor@0: (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":820 victor@0: * offset[0] += child.itemsize victor@0: * victor@0: * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< victor@0: * t = child.type_num victor@0: * if end - f < 5: victor@0: */ victor@0: __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); victor@0: if (__pyx_t_6) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":821 victor@0: * victor@0: * if not PyDataType_HASFIELDS(child): victor@0: * t = child.type_num # <<<<<<<<<<<<<< victor@0: * if end - f < 5: victor@0: * raise RuntimeError(u"Format string allocated too short.") victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 821; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); victor@0: __pyx_t_4 = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":822 victor@0: * if not PyDataType_HASFIELDS(child): victor@0: * t = child.type_num victor@0: * if end - f < 5: # <<<<<<<<<<<<<< victor@0: * raise RuntimeError(u"Format string allocated too short.") victor@0: * victor@0: */ victor@0: __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); victor@0: if (__pyx_t_6) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823 victor@0: * t = child.type_num victor@0: * if end - f < 5: victor@0: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< victor@0: * victor@0: * # Until ticket #99 is fixed, use integers to avoid warnings victor@0: */ victor@0: __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __Pyx_Raise(__pyx_t_4, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":826 victor@0: * victor@0: * # Until ticket #99 is fixed, use integers to avoid warnings victor@0: * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_UBYTE: f[0] = 66 #"B" victor@0: * elif t == NPY_SHORT: f[0] = 104 #"h" victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_BYTE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 826; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 98; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":827 victor@0: * # Until ticket #99 is fixed, use integers to avoid warnings victor@0: * if t == NPY_BYTE: f[0] = 98 #"b" victor@0: * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_SHORT: f[0] = 104 #"h" victor@0: * elif t == NPY_USHORT: f[0] = 72 #"H" victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_UBYTE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 827; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 66; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":828 victor@0: * if t == NPY_BYTE: f[0] = 98 #"b" victor@0: * elif t == NPY_UBYTE: f[0] = 66 #"B" victor@0: * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_USHORT: f[0] = 72 #"H" victor@0: * elif t == NPY_INT: f[0] = 105 #"i" victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_SHORT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 828; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 104; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":829 victor@0: * elif t == NPY_UBYTE: f[0] = 66 #"B" victor@0: * elif t == NPY_SHORT: f[0] = 104 #"h" victor@0: * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_INT: f[0] = 105 #"i" victor@0: * elif t == NPY_UINT: f[0] = 73 #"I" victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_USHORT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 829; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 72; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":830 victor@0: * elif t == NPY_SHORT: f[0] = 104 #"h" victor@0: * elif t == NPY_USHORT: f[0] = 72 #"H" victor@0: * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_UINT: f[0] = 73 #"I" victor@0: * elif t == NPY_LONG: f[0] = 108 #"l" victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_INT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 830; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 105; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":831 victor@0: * elif t == NPY_USHORT: f[0] = 72 #"H" victor@0: * elif t == NPY_INT: f[0] = 105 #"i" victor@0: * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_LONG: f[0] = 108 #"l" victor@0: * elif t == NPY_ULONG: f[0] = 76 #"L" victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_UINT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 831; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 73; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":832 victor@0: * elif t == NPY_INT: f[0] = 105 #"i" victor@0: * elif t == NPY_UINT: f[0] = 73 #"I" victor@0: * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_ULONG: f[0] = 76 #"L" victor@0: * elif t == NPY_LONGLONG: f[0] = 113 #"q" victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_LONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 832; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 108; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":833 victor@0: * elif t == NPY_UINT: f[0] = 73 #"I" victor@0: * elif t == NPY_LONG: f[0] = 108 #"l" victor@0: * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_LONGLONG: f[0] = 113 #"q" victor@0: * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_ULONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 833; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 76; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":834 victor@0: * elif t == NPY_LONG: f[0] = 108 #"l" victor@0: * elif t == NPY_ULONG: f[0] = 76 #"L" victor@0: * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" victor@0: * elif t == NPY_FLOAT: f[0] = 102 #"f" victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 834; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 113; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":835 victor@0: * elif t == NPY_ULONG: f[0] = 76 #"L" victor@0: * elif t == NPY_LONGLONG: f[0] = 113 #"q" victor@0: * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_FLOAT: f[0] = 102 #"f" victor@0: * elif t == NPY_DOUBLE: f[0] = 100 #"d" victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 835; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 81; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":836 victor@0: * elif t == NPY_LONGLONG: f[0] = 113 #"q" victor@0: * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" victor@0: * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_DOUBLE: f[0] = 100 #"d" victor@0: * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_FLOAT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 836; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 102; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":837 victor@0: * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" victor@0: * elif t == NPY_FLOAT: f[0] = 102 #"f" victor@0: * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" victor@0: * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 837; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 100; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":838 victor@0: * elif t == NPY_FLOAT: f[0] = 102 #"f" victor@0: * elif t == NPY_DOUBLE: f[0] = 100 #"d" victor@0: * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< victor@0: * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf victor@0: * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 838; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 103; victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":839 victor@0: * elif t == NPY_DOUBLE: f[0] = 100 #"d" victor@0: * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" victor@0: * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< victor@0: * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd victor@0: * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 839; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 90; victor@0: (__pyx_v_f[1]) = 102; victor@0: __pyx_v_f = (__pyx_v_f + 1); victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":840 victor@0: * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" victor@0: * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf victor@0: * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< victor@0: * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg victor@0: * elif t == NPY_OBJECT: f[0] = 79 #"O" victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 840; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 90; victor@0: (__pyx_v_f[1]) = 100; victor@0: __pyx_v_f = (__pyx_v_f + 1); victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":841 victor@0: * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf victor@0: * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd victor@0: * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< victor@0: * elif t == NPY_OBJECT: f[0] = 79 #"O" victor@0: * else: victor@0: */ victor@0: __pyx_t_3 = PyInt_FromLong(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 841; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 90; victor@0: (__pyx_v_f[1]) = 103; victor@0: __pyx_v_f = (__pyx_v_f + 1); victor@0: goto __pyx_L11; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":842 victor@0: * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd victor@0: * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg victor@0: * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< victor@0: * else: victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) victor@0: */ victor@0: __pyx_t_4 = PyInt_FromLong(NPY_OBJECT); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 842; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: if (__pyx_t_6) { victor@0: (__pyx_v_f[0]) = 79; victor@0: goto __pyx_L11; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":844 victor@0: * elif t == NPY_OBJECT: f[0] = 79 #"O" victor@0: * else: victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< victor@0: * f += 1 victor@0: * else: victor@0: */ victor@0: __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_4); victor@0: PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); victor@0: __Pyx_GIVEREF(__pyx_t_3); victor@0: __pyx_t_3 = 0; victor@0: __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_3); victor@0: __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; victor@0: __Pyx_Raise(__pyx_t_3, 0, 0, 0); victor@0: __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; victor@0: {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: __pyx_L11:; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":845 victor@0: * else: victor@0: * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) victor@0: * f += 1 # <<<<<<<<<<<<<< victor@0: * else: victor@0: * # Cython ignores struct boundary information ("T{...}"), victor@0: */ victor@0: __pyx_v_f = (__pyx_v_f + 1); victor@0: goto __pyx_L9; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":849 victor@0: * # Cython ignores struct boundary information ("T{...}"), victor@0: * # so don't output it victor@0: * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< victor@0: * return f victor@0: * victor@0: */ victor@0: __pyx_t_11 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_11 == NULL)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 849; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_v_f = __pyx_t_11; victor@0: } victor@0: __pyx_L9:; victor@0: } victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":850 victor@0: * # so don't output it victor@0: * f = _util_dtypestring(child, f, end, offset) victor@0: * return f # <<<<<<<<<<<<<< victor@0: * victor@0: * victor@0: */ victor@0: __pyx_r = __pyx_v_f; victor@0: goto __pyx_L0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783 victor@0: * return PyArray_MultiIterNew(5, a, b, c, d, e) victor@0: * victor@0: * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< victor@0: * # Recursive utility function used in __getbuffer__ to get format victor@0: * # string. The new location in the format string is returned. victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_XDECREF(__pyx_t_3); victor@0: __Pyx_XDECREF(__pyx_t_4); victor@0: __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: __pyx_r = NULL; victor@0: __pyx_L0:; victor@0: __Pyx_XDECREF((PyObject *)__pyx_v_child); victor@0: __Pyx_XDECREF(__pyx_v_fields); victor@0: __Pyx_XDECREF(__pyx_v_childname); victor@0: __Pyx_XDECREF(__pyx_v_new_offset); victor@0: __Pyx_XDECREF(__pyx_v_t); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966 victor@0: * victor@0: * victor@0: * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< victor@0: * cdef PyObject* baseptr victor@0: * if base is None: victor@0: */ victor@0: victor@0: static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { victor@0: PyObject *__pyx_v_baseptr; victor@0: __Pyx_RefNannyDeclarations victor@0: int __pyx_t_1; victor@0: int __pyx_t_2; victor@0: __Pyx_RefNannySetupContext("set_array_base", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":968 victor@0: * cdef inline void set_array_base(ndarray arr, object base): victor@0: * cdef PyObject* baseptr victor@0: * if base is None: # <<<<<<<<<<<<<< victor@0: * baseptr = NULL victor@0: * else: victor@0: */ victor@0: __pyx_t_1 = (__pyx_v_base == Py_None); victor@0: __pyx_t_2 = (__pyx_t_1 != 0); victor@0: if (__pyx_t_2) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":969 victor@0: * cdef PyObject* baseptr victor@0: * if base is None: victor@0: * baseptr = NULL # <<<<<<<<<<<<<< victor@0: * else: victor@0: * Py_INCREF(base) # important to do this before decref below! victor@0: */ victor@0: __pyx_v_baseptr = NULL; victor@0: goto __pyx_L3; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":971 victor@0: * baseptr = NULL victor@0: * else: victor@0: * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< victor@0: * baseptr = base victor@0: * Py_XDECREF(arr.base) victor@0: */ victor@0: Py_INCREF(__pyx_v_base); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":972 victor@0: * else: victor@0: * Py_INCREF(base) # important to do this before decref below! victor@0: * baseptr = base # <<<<<<<<<<<<<< victor@0: * Py_XDECREF(arr.base) victor@0: * arr.base = baseptr victor@0: */ victor@0: __pyx_v_baseptr = ((PyObject *)__pyx_v_base); victor@0: } victor@0: __pyx_L3:; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":973 victor@0: * Py_INCREF(base) # important to do this before decref below! victor@0: * baseptr = base victor@0: * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< victor@0: * arr.base = baseptr victor@0: * victor@0: */ victor@0: Py_XDECREF(__pyx_v_arr->base); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":974 victor@0: * baseptr = base victor@0: * Py_XDECREF(arr.base) victor@0: * arr.base = baseptr # <<<<<<<<<<<<<< victor@0: * victor@0: * cdef inline object get_array_base(ndarray arr): victor@0: */ victor@0: __pyx_v_arr->base = __pyx_v_baseptr; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966 victor@0: * victor@0: * victor@0: * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< victor@0: * cdef PyObject* baseptr victor@0: * if base is None: victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __Pyx_RefNannyFinishContext(); victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976 victor@0: * arr.base = baseptr victor@0: * victor@0: * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< victor@0: * if arr.base is NULL: victor@0: * return None victor@0: */ victor@0: victor@0: static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { victor@0: PyObject *__pyx_r = NULL; victor@0: __Pyx_RefNannyDeclarations victor@0: int __pyx_t_1; victor@0: __Pyx_RefNannySetupContext("get_array_base", 0); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":977 victor@0: * victor@0: * cdef inline object get_array_base(ndarray arr): victor@0: * if arr.base is NULL: # <<<<<<<<<<<<<< victor@0: * return None victor@0: * else: victor@0: */ victor@0: __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); victor@0: if (__pyx_t_1) { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":978 victor@0: * cdef inline object get_array_base(ndarray arr): victor@0: * if arr.base is NULL: victor@0: * return None # <<<<<<<<<<<<<< victor@0: * else: victor@0: * return arr.base victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __Pyx_INCREF(Py_None); victor@0: __pyx_r = Py_None; victor@0: goto __pyx_L0; victor@0: } victor@0: /*else*/ { victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":980 victor@0: * return None victor@0: * else: victor@0: * return arr.base # <<<<<<<<<<<<<< victor@0: */ victor@0: __Pyx_XDECREF(__pyx_r); victor@0: __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); victor@0: __pyx_r = ((PyObject *)__pyx_v_arr->base); victor@0: goto __pyx_L0; victor@0: } victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976 victor@0: * arr.base = baseptr victor@0: * victor@0: * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< victor@0: * if arr.base is NULL: victor@0: * return None victor@0: */ victor@0: victor@0: /* function exit code */ victor@0: __pyx_L0:; victor@0: __Pyx_XGIVEREF(__pyx_r); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return __pyx_r; victor@0: } victor@0: victor@0: static PyMethodDef __pyx_methods[] = { victor@0: {0, 0, 0, 0} victor@0: }; victor@0: victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: static struct PyModuleDef __pyx_moduledef = { victor@0: #if PY_VERSION_HEX < 0x03020000 victor@0: { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, victor@0: #else victor@0: PyModuleDef_HEAD_INIT, victor@0: #endif victor@0: __Pyx_NAMESTR("FastAlignmentArrays"), victor@0: __Pyx_DOCSTR(__pyx_k_organization_Lancaster_Universi), /* m_doc */ victor@0: -1, /* m_size */ victor@0: __pyx_methods /* m_methods */, victor@0: NULL, /* m_reload */ victor@0: NULL, /* m_traverse */ victor@0: NULL, /* m_clear */ victor@0: NULL /* m_free */ victor@0: }; victor@0: #endif victor@0: victor@0: static __Pyx_StringTabEntry __pyx_string_tab[] = { victor@0: {&__pyx_kp_s_C_LICA_OMR_PythonV4_MultipleOMR, __pyx_k_C_LICA_OMR_PythonV4_MultipleOMR, sizeof(__pyx_k_C_LICA_OMR_PythonV4_MultipleOMR), 0, 0, 1, 0}, victor@0: {&__pyx_n_s_FastAlignmentArrays, __pyx_k_FastAlignmentArrays, sizeof(__pyx_k_FastAlignmentArrays), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_FastAlignmentArrays___needleman, __pyx_k_FastAlignmentArrays___needleman, sizeof(__pyx_k_FastAlignmentArrays___needleman), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_FastAlignmentArrays___needleman_2, __pyx_k_FastAlignmentArrays___needleman_2, sizeof(__pyx_k_FastAlignmentArrays___needleman_2), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_FastAlignmentArrays__needleman, __pyx_k_FastAlignmentArrays__needleman, sizeof(__pyx_k_FastAlignmentArrays__needleman), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_FastAlignmentArrays__needleman_2, __pyx_k_FastAlignmentArrays__needleman_2, sizeof(__pyx_k_FastAlignmentArrays__needleman_2), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_FastAlignmentArrays_needleman_wu, __pyx_k_FastAlignmentArrays_needleman_wu, sizeof(__pyx_k_FastAlignmentArrays_needleman_wu), 0, 0, 1, 1}, victor@0: {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0}, victor@0: {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0}, victor@0: {&__pyx_kp_s_GAP, __pyx_k_GAP, sizeof(__pyx_k_GAP), 0, 0, 1, 0}, victor@0: {&__pyx_n_s_MultipleOMR_Alignment_FastAlignm, __pyx_k_MultipleOMR_Alignment_FastAlignm, sizeof(__pyx_k_MultipleOMR_Alignment_FastAlignm), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_NWunsch, __pyx_k_NWunsch, sizeof(__pyx_k_NWunsch), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_NWunsch_getSimilarity, __pyx_k_NWunsch_getSimilarity, sizeof(__pyx_k_NWunsch_getSimilarity), 0, 0, 1, 1}, victor@0: {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0}, victor@0: {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, victor@0: {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, victor@0: {&__pyx_n_s_align1, __pyx_k_align1, sizeof(__pyx_k_align1), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_align1_gap, __pyx_k_align1_gap, sizeof(__pyx_k_align1_gap), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_align2, __pyx_k_align2, sizeof(__pyx_k_align2), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_align2_gap, __pyx_k_align2_gap, sizeof(__pyx_k_align2_gap), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_curr, __pyx_k_curr, sizeof(__pyx_k_curr), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_diagonalRange, __pyx_k_diagonalRange, sizeof(__pyx_k_diagonalRange), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_finalscore, __pyx_k_finalscore, sizeof(__pyx_k_finalscore), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_gap1, __pyx_k_gap1, sizeof(__pyx_k_gap1), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_gap2, __pyx_k_gap2, sizeof(__pyx_k_gap2), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_indel, __pyx_k_indel, sizeof(__pyx_k_indel), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_isFast, __pyx_k_isFast, sizeof(__pyx_k_isFast), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_maxlen, __pyx_k_maxlen, sizeof(__pyx_k_maxlen), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_myseq1, __pyx_k_myseq1, sizeof(__pyx_k_myseq1), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_myseq2, __pyx_k_myseq2, sizeof(__pyx_k_myseq2), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, victor@0: {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0}, victor@0: {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0}, victor@0: {&__pyx_n_s_needleman_wunsch, __pyx_k_needleman_wunsch, sizeof(__pyx_k_needleman_wunsch), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_needleman_wunsch_matrix, __pyx_k_needleman_wunsch_matrix, sizeof(__pyx_k_needleman_wunsch_matrix), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_needleman_wunsch_trace, __pyx_k_needleman_wunsch_trace, sizeof(__pyx_k_needleman_wunsch_trace), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_score, __pyx_k_score, sizeof(__pyx_k_score), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_seq1, __pyx_k_seq1, sizeof(__pyx_k_seq1), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_seq2, __pyx_k_seq2, sizeof(__pyx_k_seq2), 0, 0, 1, 1}, victor@0: {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, victor@0: {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0}, victor@0: {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, victor@0: {0, 0, 0, 0, 0, 0, 0} victor@0: }; victor@0: static int __Pyx_InitCachedBuiltins(void) { victor@0: __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 79; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: return 0; victor@0: __pyx_L1_error:; victor@0: return -1; victor@0: } victor@0: victor@0: static int __Pyx_InitCachedConstants(void) { victor@0: __Pyx_RefNannyDeclarations victor@0: __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":87 victor@0: * victor@0: * # Tag first row by LEFT, indicating initial "-"s victor@0: * ptr[0,1:] = LEFT # <<<<<<<<<<<<<< victor@0: * victor@0: * # Tag first column by UP, indicating initial "-"s victor@0: */ victor@0: __pyx_slice_ = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice_)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_slice_); victor@0: __Pyx_GIVEREF(__pyx_slice_); victor@0: __pyx_tuple__2 = PyTuple_Pack(2, __pyx_int_0, __pyx_slice_); if (unlikely(!__pyx_tuple__2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 87; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__2); victor@0: __Pyx_GIVEREF(__pyx_tuple__2); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":90 victor@0: * victor@0: * # Tag first column by UP, indicating initial "-"s victor@0: * ptr[1:,0] = UP # <<<<<<<<<<<<<< victor@0: * victor@0: * ##################################################### victor@0: */ victor@0: __pyx_slice__3 = PySlice_New(__pyx_int_1, Py_None, Py_None); if (unlikely(!__pyx_slice__3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_slice__3); victor@0: __Pyx_GIVEREF(__pyx_slice__3); victor@0: __pyx_tuple__4 = PyTuple_Pack(2, __pyx_slice__3, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 90; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__4); victor@0: __Pyx_GIVEREF(__pyx_tuple__4); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215 victor@0: * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) victor@0: * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): victor@0: * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< victor@0: * victor@0: * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) victor@0: */ victor@0: __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__6)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__6); victor@0: __Pyx_GIVEREF(__pyx_tuple__6); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219 victor@0: * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) victor@0: * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): victor@0: * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< victor@0: * victor@0: * info.buf = PyArray_DATA(self) victor@0: */ victor@0: __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__7)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__7); victor@0: __Pyx_GIVEREF(__pyx_tuple__7); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257 victor@0: * if ((descr.byteorder == c'>' and little_endian) or victor@0: * (descr.byteorder == c'<' and not little_endian)): victor@0: * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< victor@0: * if t == NPY_BYTE: f = "b" victor@0: * elif t == NPY_UBYTE: f = "B" victor@0: */ victor@0: __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__8)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__8); victor@0: __Pyx_GIVEREF(__pyx_tuple__8); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799 victor@0: * victor@0: * if (end - f) - (new_offset - offset[0]) < 15: victor@0: * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< victor@0: * victor@0: * if ((child.byteorder == c'>' and little_endian) or victor@0: */ victor@0: __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__9)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__9); victor@0: __Pyx_GIVEREF(__pyx_tuple__9); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803 victor@0: * if ((child.byteorder == c'>' and little_endian) or victor@0: * (child.byteorder == c'<' and not little_endian)): victor@0: * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< victor@0: * # One could encode it in the format string and have Cython victor@0: * # complain instead, BUT: < and > in format strings also imply victor@0: */ victor@0: __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__10)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__10); victor@0: __Pyx_GIVEREF(__pyx_tuple__10); victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823 victor@0: * t = child.type_num victor@0: * if end - f < 5: victor@0: * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< victor@0: * victor@0: * # Until ticket #99 is fixed, use integers to avoid warnings victor@0: */ victor@0: __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__11)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__11); victor@0: __Pyx_GIVEREF(__pyx_tuple__11); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 victor@0: * class FastAlignmentArrays: victor@0: * victor@0: * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< victor@0: * """ victor@0: * fill in the DP matrix according to the Needleman-Wunsch algorithm. victor@0: */ victor@0: __pyx_tuple__12 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_seq1, __pyx_n_s_seq2, __pyx_n_s_isFast, __pyx_n_s_indel, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_s, __pyx_n_s_ptr, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_p, __pyx_n_s_q, __pyx_n_s_diagonalRange, __pyx_n_s_myseq1, __pyx_n_s_myseq2, __pyx_n_s_score); if (unlikely(!__pyx_tuple__12)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__12); victor@0: __Pyx_GIVEREF(__pyx_tuple__12); victor@0: __pyx_codeobj__13 = (PyObject*)__Pyx_PyCode_New(4, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__12, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_LICA_OMR_PythonV4_MultipleOMR, __pyx_n_s_needleman_wunsch_matrix, 57, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__13)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 victor@0: * return s, ptr victor@0: * victor@0: * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< victor@0: * victor@0: * #### TRACE BEST PATH TO GET ALIGNMENT #### victor@0: */ victor@0: __pyx_tuple__14 = PyTuple_Pack(17, __pyx_n_s_self, __pyx_n_s_seq1, __pyx_n_s_seq2, __pyx_n_s_s, __pyx_n_s_ptr, __pyx_n_s_align1, __pyx_n_s_align2, __pyx_n_s_align1_gap, __pyx_n_s_align2_gap, __pyx_n_s_gap1, __pyx_n_s_gap2, __pyx_n_s_n, __pyx_n_s_m, __pyx_n_s_i, __pyx_n_s_j, __pyx_n_s_curr, __pyx_n_s_index); if (unlikely(!__pyx_tuple__14)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__14); victor@0: __Pyx_GIVEREF(__pyx_tuple__14); victor@0: __pyx_codeobj__15 = (PyObject*)__Pyx_PyCode_New(5, 0, 17, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__14, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_LICA_OMR_PythonV4_MultipleOMR, __pyx_n_s_needleman_wunsch_trace, 145, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__15)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 victor@0: * victor@0: * victor@0: * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< victor@0: * """ victor@0: * Computes an optimal global alignment of two sequences using the Needleman-Wunsch victor@0: */ victor@0: __pyx_tuple__16 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_seq1, __pyx_n_s_seq2, __pyx_n_s_isFast, __pyx_n_s_s, __pyx_n_s_ptr, __pyx_n_s_alignment, __pyx_n_s_maxlen, __pyx_n_s_finalscore); if (unlikely(!__pyx_tuple__16)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__16); victor@0: __Pyx_GIVEREF(__pyx_tuple__16); victor@0: __pyx_codeobj__17 = (PyObject*)__Pyx_PyCode_New(4, 0, 9, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__16, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_C_LICA_OMR_PythonV4_MultipleOMR, __pyx_n_s_needleman_wunsch, 202, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__17)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_tuple__18 = PyTuple_Pack(1, ((PyObject *)Py_True)); if (unlikely(!__pyx_tuple__18)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_tuple__18); victor@0: __Pyx_GIVEREF(__pyx_tuple__18); victor@0: __Pyx_RefNannyFinishContext(); victor@0: return 0; victor@0: __pyx_L1_error:; victor@0: __Pyx_RefNannyFinishContext(); victor@0: return -1; victor@0: } victor@0: victor@0: static int __Pyx_InitGlobals(void) { victor@0: if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: __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;} victor@0: __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;} victor@0: __pyx_int_3 = PyInt_FromLong(3); if (unlikely(!__pyx_int_3)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_int_350 = PyInt_FromLong(350); if (unlikely(!__pyx_int_350)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __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;} victor@0: return 0; victor@0: __pyx_L1_error:; victor@0: return -1; victor@0: } victor@0: victor@0: #if PY_MAJOR_VERSION < 3 victor@0: PyMODINIT_FUNC initFastAlignmentArrays(void); /*proto*/ victor@0: PyMODINIT_FUNC initFastAlignmentArrays(void) victor@0: #else victor@0: PyMODINIT_FUNC PyInit_FastAlignmentArrays(void); /*proto*/ victor@0: PyMODINIT_FUNC PyInit_FastAlignmentArrays(void) victor@0: #endif victor@0: { victor@0: PyObject *__pyx_t_1 = NULL; victor@0: PyObject *__pyx_t_2 = NULL; victor@0: int __pyx_lineno = 0; victor@0: const char *__pyx_filename = NULL; victor@0: int __pyx_clineno = 0; victor@0: __Pyx_RefNannyDeclarations victor@0: #if CYTHON_REFNANNY victor@0: __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); victor@0: if (!__Pyx_RefNanny) { victor@0: PyErr_Clear(); victor@0: __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); victor@0: if (!__Pyx_RefNanny) victor@0: Py_FatalError("failed to import 'refnanny' module"); victor@0: } victor@0: #endif victor@0: __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_FastAlignmentArrays(void)", 0); victor@0: if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __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;} victor@0: __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;} victor@0: #ifdef __Pyx_CyFunction_USED victor@0: if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #endif victor@0: #ifdef __Pyx_FusedFunction_USED victor@0: if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #endif victor@0: #ifdef __Pyx_Generator_USED victor@0: if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #endif victor@0: /*--- Library function declarations ---*/ victor@0: /*--- Threads initialization code ---*/ victor@0: #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS victor@0: #ifdef WITH_THREAD /* Python build with threading support? */ victor@0: PyEval_InitThreads(); victor@0: #endif victor@0: #endif victor@0: /*--- Module creation code ---*/ victor@0: #if PY_MAJOR_VERSION < 3 victor@0: __pyx_m = Py_InitModule4(__Pyx_NAMESTR("FastAlignmentArrays"), __pyx_methods, __Pyx_DOCSTR(__pyx_k_organization_Lancaster_Universi), 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m); victor@0: #else victor@0: __pyx_m = PyModule_Create(&__pyx_moduledef); victor@0: #endif victor@0: if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: Py_INCREF(__pyx_d); victor@0: __pyx_b = PyImport_AddModule(__Pyx_NAMESTR(__Pyx_BUILTIN_MODULE_NAME)); if (unlikely(!__pyx_b)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #if CYTHON_COMPILING_IN_PYPY victor@0: Py_INCREF(__pyx_b); victor@0: #endif victor@0: if (__Pyx_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: /*--- Initialize various global constants etc. ---*/ victor@0: if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) victor@0: if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: #endif victor@0: if (__pyx_module_is_main_MultipleOMR__Alignment__FastAlignmentArrays) { victor@0: if (__Pyx_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; victor@0: } victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: { victor@0: PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: if (!PyDict_GetItemString(modules, "MultipleOMR.Alignment.FastAlignmentArrays")) { victor@0: if (unlikely(PyDict_SetItemString(modules, "MultipleOMR.Alignment.FastAlignmentArrays", __pyx_m) < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: } victor@0: } victor@0: #endif victor@0: /*--- Builtin init code ---*/ victor@0: if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: /*--- Constants init code ---*/ victor@0: if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: /*--- Global init code ---*/ victor@0: /*--- Variable export code ---*/ victor@0: /*--- Function export code ---*/ victor@0: /*--- Type init code ---*/ victor@0: /*--- Type import code ---*/ victor@0: __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", victor@0: #if CYTHON_COMPILING_IN_PYPY victor@0: sizeof(PyTypeObject), victor@0: #else victor@0: sizeof(PyHeapTypeObject), victor@0: #endif victor@0: 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 155; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 165; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 169; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 178; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) {__pyx_filename = __pyx_f[1]; __pyx_lineno = 861; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) {__pyx_filename = __pyx_f[3]; __pyx_lineno = 8; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) {__pyx_filename = __pyx_f[4]; __pyx_lineno = 15; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: /*--- Variable import code ---*/ victor@0: /*--- Function import code ---*/ victor@0: /*--- Execution code ---*/ victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":40 victor@0: * ''' victor@0: * victor@0: * import numpy as np # <<<<<<<<<<<<<< victor@0: * cimport numpy as np victor@0: * victor@0: */ victor@0: __pyx_t_1 = __Pyx_Import(__pyx_n_s_numpy, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: if (PyDict_SetItem(__pyx_d, __pyx_n_s_np, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 40; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":43 victor@0: * cimport numpy as np victor@0: * victor@0: * import NWunsch # <<<<<<<<<<<<<< victor@0: * victor@0: * # -*- coding: utf-8 -*- victor@0: */ victor@0: __pyx_t_1 = __Pyx_Import(__pyx_n_s_NWunsch, 0, -1); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: if (PyDict_SetItem(__pyx_d, __pyx_n_s_NWunsch, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 43; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":50 victor@0: * victor@0: * # the three directions you can go in the traceback: victor@0: * cdef int DIAG = 0 # <<<<<<<<<<<<<< victor@0: * cdef int UP = 1 victor@0: * cdef int LEFT = 2 victor@0: */ victor@0: __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":51 victor@0: * # the three directions you can go in the traceback: victor@0: * cdef int DIAG = 0 victor@0: * cdef int UP = 1 # <<<<<<<<<<<<<< victor@0: * cdef int LEFT = 2 victor@0: * cdef float score=0 victor@0: */ victor@0: __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP = 1; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":52 victor@0: * cdef int DIAG = 0 victor@0: * cdef int UP = 1 victor@0: * cdef int LEFT = 2 # <<<<<<<<<<<<<< victor@0: * cdef float score=0 victor@0: * victor@0: */ victor@0: __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT = 2; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":53 victor@0: * cdef int UP = 1 victor@0: * cdef int LEFT = 2 victor@0: * cdef float score=0 # <<<<<<<<<<<<<< victor@0: * victor@0: * class FastAlignmentArrays: victor@0: */ victor@0: __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_score = 0.0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":55 victor@0: * cdef float score=0 victor@0: * victor@0: * class FastAlignmentArrays: # <<<<<<<<<<<<<< victor@0: * victor@0: * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): victor@0: */ victor@0: __pyx_t_1 = __Pyx_Py3MetaclassPrepare((PyObject *) NULL, __pyx_empty_tuple, __pyx_n_s_FastAlignmentArrays, __pyx_n_s_FastAlignmentArrays, (PyObject *) NULL, __pyx_n_s_MultipleOMR_Alignment_FastAlignm, (PyObject *) NULL); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 victor@0: * class FastAlignmentArrays: victor@0: * victor@0: * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< victor@0: * """ victor@0: * fill in the DP matrix according to the Needleman-Wunsch algorithm. victor@0: */ victor@0: __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix, 0, __pyx_n_s_FastAlignmentArrays___needleman, NULL, __pyx_n_s_MultipleOMR_Alignment_FastAlignm, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__13)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_FastAlignmentArrays__needleman, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 57; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 victor@0: * return s, ptr victor@0: * victor@0: * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< victor@0: * victor@0: * #### TRACE BEST PATH TO GET ALIGNMENT #### victor@0: */ victor@0: __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace, 0, __pyx_n_s_FastAlignmentArrays___needleman_2, NULL, __pyx_n_s_MultipleOMR_Alignment_FastAlignm, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__15)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_FastAlignmentArrays__needleman_2, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 145; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 victor@0: * victor@0: * victor@0: * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< victor@0: * """ victor@0: * Computes an optimal global alignment of two sequences using the Needleman-Wunsch victor@0: */ victor@0: __pyx_t_2 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch, 0, __pyx_n_s_FastAlignmentArrays_needleman_wu, NULL, __pyx_n_s_MultipleOMR_Alignment_FastAlignm, PyModule_GetDict(__pyx_m), ((PyObject *)__pyx_codeobj__17)); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__18); victor@0: if (PyObject_SetItem(__pyx_t_1, __pyx_n_s_needleman_wunsch, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":55 victor@0: * cdef float score=0 victor@0: * victor@0: * class FastAlignmentArrays: # <<<<<<<<<<<<<< victor@0: * victor@0: * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): victor@0: */ victor@0: __pyx_t_2 = __Pyx_Py3ClassCreate(((PyObject*)&__Pyx_DefaultClassType), __pyx_n_s_FastAlignmentArrays, __pyx_empty_tuple, __pyx_t_1, NULL, 0, 1); if (unlikely(!__pyx_t_2)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_2); victor@0: if (PyDict_SetItem(__pyx_d, __pyx_n_s_FastAlignmentArrays, __pyx_t_2) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 55; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":1 victor@0: * ''' # <<<<<<<<<<<<<< victor@0: * @organization: Lancaster University & University of Leeds victor@0: * @version: 1.0 victor@0: */ victor@0: __pyx_t_1 = PyDict_New(); if (unlikely(!__pyx_t_1)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_GOTREF(__pyx_t_1); victor@0: if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} victor@0: __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; victor@0: victor@0: /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976 victor@0: * arr.base = baseptr victor@0: * victor@0: * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< victor@0: * if arr.base is NULL: victor@0: * return None victor@0: */ victor@0: goto __pyx_L0; victor@0: __pyx_L1_error:; victor@0: __Pyx_XDECREF(__pyx_t_1); victor@0: __Pyx_XDECREF(__pyx_t_2); victor@0: if (__pyx_m) { victor@0: __Pyx_AddTraceback("init MultipleOMR.Alignment.FastAlignmentArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); victor@0: Py_DECREF(__pyx_m); __pyx_m = 0; victor@0: } else if (!PyErr_Occurred()) { victor@0: PyErr_SetString(PyExc_ImportError, "init MultipleOMR.Alignment.FastAlignmentArrays"); victor@0: } victor@0: __pyx_L0:; victor@0: __Pyx_RefNannyFinishContext(); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: return; victor@0: #else victor@0: return __pyx_m; victor@0: #endif victor@0: } victor@0: victor@0: /* Runtime support code */ victor@0: #if CYTHON_REFNANNY victor@0: static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { victor@0: PyObject *m = NULL, *p = NULL; victor@0: void *r = NULL; victor@0: m = PyImport_ImportModule((char *)modname); victor@0: if (!m) goto end; victor@0: p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); victor@0: if (!p) goto end; victor@0: r = PyLong_AsVoidPtr(p); victor@0: end: victor@0: Py_XDECREF(p); victor@0: Py_XDECREF(m); victor@0: return (__Pyx_RefNannyAPIStruct *)r; victor@0: } victor@0: #endif /* CYTHON_REFNANNY */ victor@0: victor@0: static PyObject *__Pyx_GetBuiltinName(PyObject *name) { victor@0: PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); victor@0: if (unlikely(!result)) { victor@0: PyErr_Format(PyExc_NameError, victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: "name '%U' is not defined", name); victor@0: #else victor@0: "name '%.200s' is not defined", PyString_AS_STRING(name)); victor@0: #endif victor@0: } victor@0: return result; victor@0: } victor@0: victor@0: static void __Pyx_RaiseArgtupleInvalid( victor@0: const char* func_name, victor@0: int exact, victor@0: Py_ssize_t num_min, victor@0: Py_ssize_t num_max, victor@0: Py_ssize_t num_found) victor@0: { victor@0: Py_ssize_t num_expected; victor@0: const char *more_or_less; victor@0: if (num_found < num_min) { victor@0: num_expected = num_min; victor@0: more_or_less = "at least"; victor@0: } else { victor@0: num_expected = num_max; victor@0: more_or_less = "at most"; victor@0: } victor@0: if (exact) { victor@0: more_or_less = "exactly"; victor@0: } victor@0: PyErr_Format(PyExc_TypeError, victor@0: "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", victor@0: func_name, more_or_less, num_expected, victor@0: (num_expected == 1) ? "" : "s", num_found); victor@0: } victor@0: victor@0: static void __Pyx_RaiseDoubleKeywordsError( victor@0: const char* func_name, victor@0: PyObject* kw_name) victor@0: { victor@0: PyErr_Format(PyExc_TypeError, victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: "%s() got multiple values for keyword argument '%U'", func_name, kw_name); victor@0: #else victor@0: "%s() got multiple values for keyword argument '%s'", func_name, victor@0: PyString_AsString(kw_name)); victor@0: #endif victor@0: } victor@0: victor@0: static int __Pyx_ParseOptionalKeywords( victor@0: PyObject *kwds, victor@0: PyObject **argnames[], victor@0: PyObject *kwds2, victor@0: PyObject *values[], victor@0: Py_ssize_t num_pos_args, victor@0: const char* function_name) victor@0: { victor@0: PyObject *key = 0, *value = 0; victor@0: Py_ssize_t pos = 0; victor@0: PyObject*** name; victor@0: PyObject*** first_kw_arg = argnames + num_pos_args; victor@0: while (PyDict_Next(kwds, &pos, &key, &value)) { victor@0: name = first_kw_arg; victor@0: while (*name && (**name != key)) name++; victor@0: if (*name) { victor@0: values[name-argnames] = value; victor@0: continue; victor@0: } victor@0: name = first_kw_arg; victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { victor@0: while (*name) { victor@0: if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) victor@0: && _PyString_Eq(**name, key)) { victor@0: values[name-argnames] = value; victor@0: break; victor@0: } victor@0: name++; victor@0: } victor@0: if (*name) continue; victor@0: else { victor@0: PyObject*** argname = argnames; victor@0: while (argname != first_kw_arg) { victor@0: if ((**argname == key) || ( victor@0: (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) victor@0: && _PyString_Eq(**argname, key))) { victor@0: goto arg_passed_twice; victor@0: } victor@0: argname++; victor@0: } victor@0: } victor@0: } else victor@0: #endif victor@0: if (likely(PyUnicode_Check(key))) { victor@0: while (*name) { victor@0: int cmp = (**name == key) ? 0 : victor@0: #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 victor@0: (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : victor@0: #endif victor@0: PyUnicode_Compare(**name, key); victor@0: if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; victor@0: if (cmp == 0) { victor@0: values[name-argnames] = value; victor@0: break; victor@0: } victor@0: name++; victor@0: } victor@0: if (*name) continue; victor@0: else { victor@0: PyObject*** argname = argnames; victor@0: while (argname != first_kw_arg) { victor@0: int cmp = (**argname == key) ? 0 : victor@0: #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 victor@0: (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : victor@0: #endif victor@0: PyUnicode_Compare(**argname, key); victor@0: if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; victor@0: if (cmp == 0) goto arg_passed_twice; victor@0: argname++; victor@0: } victor@0: } victor@0: } else victor@0: goto invalid_keyword_type; victor@0: if (kwds2) { victor@0: if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; victor@0: } else { victor@0: goto invalid_keyword; victor@0: } victor@0: } victor@0: return 0; victor@0: arg_passed_twice: victor@0: __Pyx_RaiseDoubleKeywordsError(function_name, key); victor@0: goto bad; victor@0: invalid_keyword_type: victor@0: PyErr_Format(PyExc_TypeError, victor@0: "%.200s() keywords must be strings", function_name); victor@0: goto bad; victor@0: invalid_keyword: victor@0: PyErr_Format(PyExc_TypeError, victor@0: #if PY_MAJOR_VERSION < 3 victor@0: "%.200s() got an unexpected keyword argument '%.200s'", victor@0: function_name, PyString_AsString(key)); victor@0: #else victor@0: "%s() got an unexpected keyword argument '%U'", victor@0: function_name, key); victor@0: #endif victor@0: bad: victor@0: return -1; victor@0: } victor@0: victor@0: static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { victor@0: PyObject *result; victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: result = PyDict_GetItem(__pyx_d, name); victor@0: if (result) { victor@0: Py_INCREF(result); victor@0: } else { victor@0: #else victor@0: result = PyObject_GetItem(__pyx_d, name); victor@0: if (!result) { victor@0: PyErr_Clear(); victor@0: #endif victor@0: result = __Pyx_GetBuiltinName(name); victor@0: } victor@0: return result; victor@0: } victor@0: victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { victor@0: PyObject *result; victor@0: ternaryfunc call = func->ob_type->tp_call; victor@0: if (unlikely(!call)) victor@0: return PyObject_Call(func, arg, kw); victor@0: #if PY_VERSION_HEX >= 0x02060000 victor@0: if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) victor@0: return NULL; victor@0: #endif victor@0: result = (*call)(func, arg, kw); victor@0: #if PY_VERSION_HEX >= 0x02060000 victor@0: Py_LeaveRecursiveCall(); victor@0: #endif victor@0: if (unlikely(!result) && unlikely(!PyErr_Occurred())) { victor@0: PyErr_SetString( victor@0: PyExc_SystemError, victor@0: "NULL result without error in PyObject_Call"); victor@0: } victor@0: return result; victor@0: } victor@0: #endif victor@0: victor@0: static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { victor@0: if (unlikely(!type)) { victor@0: PyErr_SetString(PyExc_SystemError, "Missing type object"); victor@0: return 0; victor@0: } victor@0: if (likely(PyObject_TypeCheck(obj, type))) victor@0: return 1; victor@0: PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", victor@0: Py_TYPE(obj)->tp_name, type->tp_name); victor@0: return 0; victor@0: } victor@0: victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { victor@0: PyObject *r; victor@0: if (!j) return NULL; victor@0: r = PyObject_GetItem(o, j); victor@0: Py_DECREF(j); victor@0: return r; victor@0: } victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, victor@0: int wraparound, int boundscheck) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); victor@0: if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { victor@0: PyObject *r = PyList_GET_ITEM(o, i); victor@0: Py_INCREF(r); victor@0: return r; victor@0: } victor@0: return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); victor@0: #else victor@0: return PySequence_GetItem(o, i); victor@0: #endif victor@0: } victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, victor@0: int wraparound, int boundscheck) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); victor@0: if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { victor@0: PyObject *r = PyTuple_GET_ITEM(o, i); victor@0: Py_INCREF(r); victor@0: return r; victor@0: } victor@0: return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); victor@0: #else victor@0: return PySequence_GetItem(o, i); victor@0: #endif victor@0: } victor@0: static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, victor@0: int is_list, int wraparound, int boundscheck) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: if (is_list || PyList_CheckExact(o)) { victor@0: Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); victor@0: if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { victor@0: PyObject *r = PyList_GET_ITEM(o, n); victor@0: Py_INCREF(r); victor@0: return r; victor@0: } victor@0: } victor@0: else if (PyTuple_CheckExact(o)) { victor@0: Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); victor@0: if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { victor@0: PyObject *r = PyTuple_GET_ITEM(o, n); victor@0: Py_INCREF(r); victor@0: return r; victor@0: } victor@0: } else { victor@0: PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; victor@0: if (likely(m && m->sq_item)) { victor@0: if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { victor@0: Py_ssize_t l = m->sq_length(o); victor@0: if (likely(l >= 0)) { victor@0: i += l; victor@0: } else { victor@0: if (PyErr_ExceptionMatches(PyExc_OverflowError)) victor@0: PyErr_Clear(); victor@0: else victor@0: return NULL; victor@0: } victor@0: } victor@0: return m->sq_item(o, i); victor@0: } victor@0: } victor@0: #else victor@0: if (is_list || PySequence_Check(o)) { victor@0: return PySequence_GetItem(o, i); victor@0: } victor@0: #endif victor@0: return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); victor@0: } victor@0: victor@0: static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { victor@0: PyErr_Format(PyExc_TypeError, victor@0: "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", victor@0: name, type->tp_name, Py_TYPE(obj)->tp_name); victor@0: } victor@0: static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, victor@0: const char *name, int exact) victor@0: { victor@0: if (unlikely(!type)) { victor@0: PyErr_SetString(PyExc_SystemError, "Missing type object"); victor@0: return 0; victor@0: } victor@0: if (none_allowed && obj == Py_None) return 1; victor@0: else if (exact) { victor@0: if (likely(Py_TYPE(obj) == type)) return 1; victor@0: #if PY_MAJOR_VERSION == 2 victor@0: else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; victor@0: #endif victor@0: } victor@0: else { victor@0: if (likely(PyObject_TypeCheck(obj, type))) return 1; victor@0: } victor@0: __Pyx_RaiseArgumentTypeInvalid(name, obj, type); victor@0: return 0; victor@0: } victor@0: victor@0: static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { victor@0: #if CYTHON_COMPILING_IN_PYPY victor@0: return PyObject_RichCompareBool(s1, s2, equals); victor@0: #else victor@0: if (s1 == s2) { victor@0: return (equals == Py_EQ); victor@0: } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { victor@0: const char *ps1, *ps2; victor@0: Py_ssize_t length = PyBytes_GET_SIZE(s1); victor@0: if (length != PyBytes_GET_SIZE(s2)) victor@0: return (equals == Py_NE); victor@0: ps1 = PyBytes_AS_STRING(s1); victor@0: ps2 = PyBytes_AS_STRING(s2); victor@0: if (ps1[0] != ps2[0]) { victor@0: return (equals == Py_NE); victor@0: } else if (length == 1) { victor@0: return (equals == Py_EQ); victor@0: } else { victor@0: int result = memcmp(ps1, ps2, (size_t)length); victor@0: return (equals == Py_EQ) ? (result == 0) : (result != 0); victor@0: } victor@0: } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { victor@0: return (equals == Py_NE); victor@0: } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { victor@0: return (equals == Py_NE); victor@0: } else { victor@0: int result; victor@0: PyObject* py_result = PyObject_RichCompare(s1, s2, equals); victor@0: if (!py_result) victor@0: return -1; victor@0: result = __Pyx_PyObject_IsTrue(py_result); victor@0: Py_DECREF(py_result); victor@0: return result; victor@0: } victor@0: #endif victor@0: } victor@0: victor@0: static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { victor@0: #if CYTHON_COMPILING_IN_PYPY victor@0: return PyObject_RichCompareBool(s1, s2, equals); victor@0: #else victor@0: #if PY_MAJOR_VERSION < 3 victor@0: PyObject* owned_ref = NULL; victor@0: #endif victor@0: int s1_is_unicode, s2_is_unicode; victor@0: if (s1 == s2) { victor@0: goto return_eq; victor@0: } victor@0: s1_is_unicode = PyUnicode_CheckExact(s1); victor@0: s2_is_unicode = PyUnicode_CheckExact(s2); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { victor@0: owned_ref = PyUnicode_FromObject(s2); victor@0: if (unlikely(!owned_ref)) victor@0: return -1; victor@0: s2 = owned_ref; victor@0: s2_is_unicode = 1; victor@0: } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { victor@0: owned_ref = PyUnicode_FromObject(s1); victor@0: if (unlikely(!owned_ref)) victor@0: return -1; victor@0: s1 = owned_ref; victor@0: s1_is_unicode = 1; victor@0: } else if (((!s2_is_unicode) & (!s1_is_unicode))) { victor@0: return __Pyx_PyBytes_Equals(s1, s2, equals); victor@0: } victor@0: #endif victor@0: if (s1_is_unicode & s2_is_unicode) { victor@0: Py_ssize_t length; victor@0: int kind; victor@0: void *data1, *data2; victor@0: #if CYTHON_PEP393_ENABLED victor@0: if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) victor@0: return -1; victor@0: #endif victor@0: length = __Pyx_PyUnicode_GET_LENGTH(s1); victor@0: if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { victor@0: goto return_ne; victor@0: } victor@0: kind = __Pyx_PyUnicode_KIND(s1); victor@0: if (kind != __Pyx_PyUnicode_KIND(s2)) { victor@0: goto return_ne; victor@0: } victor@0: data1 = __Pyx_PyUnicode_DATA(s1); victor@0: data2 = __Pyx_PyUnicode_DATA(s2); victor@0: if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { victor@0: goto return_ne; victor@0: } else if (length == 1) { victor@0: goto return_eq; victor@0: } else { victor@0: int result = memcmp(data1, data2, (size_t)(length * kind)); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: Py_XDECREF(owned_ref); victor@0: #endif victor@0: return (equals == Py_EQ) ? (result == 0) : (result != 0); victor@0: } victor@0: } else if ((s1 == Py_None) & s2_is_unicode) { victor@0: goto return_ne; victor@0: } else if ((s2 == Py_None) & s1_is_unicode) { victor@0: goto return_ne; victor@0: } else { victor@0: int result; victor@0: PyObject* py_result = PyObject_RichCompare(s1, s2, equals); victor@0: if (!py_result) victor@0: return -1; victor@0: result = __Pyx_PyObject_IsTrue(py_result); victor@0: Py_DECREF(py_result); victor@0: return result; victor@0: } victor@0: return_eq: victor@0: #if PY_MAJOR_VERSION < 3 victor@0: Py_XDECREF(owned_ref); victor@0: #endif victor@0: return (equals == Py_EQ); victor@0: return_ne: victor@0: #if PY_MAJOR_VERSION < 3 victor@0: Py_XDECREF(owned_ref); victor@0: #endif victor@0: return (equals == Py_NE); victor@0: #endif victor@0: } victor@0: victor@0: static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { victor@0: PyErr_Format(PyExc_ValueError, victor@0: "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); victor@0: } victor@0: victor@0: static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { victor@0: PyErr_Format(PyExc_ValueError, victor@0: "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", victor@0: index, (index == 1) ? "" : "s"); victor@0: } victor@0: victor@0: static CYTHON_INLINE int __Pyx_IterFinish(void) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: PyThreadState *tstate = PyThreadState_GET(); victor@0: PyObject* exc_type = tstate->curexc_type; victor@0: if (unlikely(exc_type)) { victor@0: if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { victor@0: PyObject *exc_value, *exc_tb; victor@0: exc_value = tstate->curexc_value; victor@0: exc_tb = tstate->curexc_traceback; victor@0: tstate->curexc_type = 0; victor@0: tstate->curexc_value = 0; victor@0: tstate->curexc_traceback = 0; victor@0: Py_DECREF(exc_type); victor@0: Py_XDECREF(exc_value); victor@0: Py_XDECREF(exc_tb); victor@0: return 0; victor@0: } else { victor@0: return -1; victor@0: } victor@0: } victor@0: return 0; victor@0: #else victor@0: if (unlikely(PyErr_Occurred())) { victor@0: if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { victor@0: PyErr_Clear(); victor@0: return 0; victor@0: } else { victor@0: return -1; victor@0: } victor@0: } victor@0: return 0; victor@0: #endif victor@0: } victor@0: victor@0: static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { victor@0: if (unlikely(retval)) { victor@0: Py_DECREF(retval); victor@0: __Pyx_RaiseTooManyValuesError(expected); victor@0: return -1; victor@0: } else { victor@0: return __Pyx_IterFinish(); victor@0: } victor@0: return 0; victor@0: } victor@0: victor@0: static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: PyObject *tmp_type, *tmp_value, *tmp_tb; victor@0: PyThreadState *tstate = PyThreadState_GET(); victor@0: tmp_type = tstate->curexc_type; victor@0: tmp_value = tstate->curexc_value; victor@0: tmp_tb = tstate->curexc_traceback; victor@0: tstate->curexc_type = type; victor@0: tstate->curexc_value = value; victor@0: tstate->curexc_traceback = tb; victor@0: Py_XDECREF(tmp_type); victor@0: Py_XDECREF(tmp_value); victor@0: Py_XDECREF(tmp_tb); victor@0: #else victor@0: PyErr_Restore(type, value, tb); victor@0: #endif victor@0: } victor@0: static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON victor@0: PyThreadState *tstate = PyThreadState_GET(); victor@0: *type = tstate->curexc_type; victor@0: *value = tstate->curexc_value; victor@0: *tb = tstate->curexc_traceback; victor@0: tstate->curexc_type = 0; victor@0: tstate->curexc_value = 0; victor@0: tstate->curexc_traceback = 0; victor@0: #else victor@0: PyErr_Fetch(type, value, tb); victor@0: #endif victor@0: } victor@0: victor@0: #if PY_MAJOR_VERSION < 3 victor@0: static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, victor@0: CYTHON_UNUSED PyObject *cause) { victor@0: Py_XINCREF(type); victor@0: if (!value || value == Py_None) victor@0: value = NULL; victor@0: else victor@0: Py_INCREF(value); victor@0: if (!tb || tb == Py_None) victor@0: tb = NULL; victor@0: else { victor@0: Py_INCREF(tb); victor@0: if (!PyTraceBack_Check(tb)) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "raise: arg 3 must be a traceback or None"); victor@0: goto raise_error; victor@0: } victor@0: } victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: if (PyClass_Check(type)) { victor@0: #else victor@0: if (PyType_Check(type)) { victor@0: #endif victor@0: #if CYTHON_COMPILING_IN_PYPY victor@0: if (!value) { victor@0: Py_INCREF(Py_None); victor@0: value = Py_None; victor@0: } victor@0: #endif victor@0: PyErr_NormalizeException(&type, &value, &tb); victor@0: } else { victor@0: if (value) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "instance exception may not have a separate value"); victor@0: goto raise_error; victor@0: } victor@0: value = type; victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: if (PyInstance_Check(type)) { victor@0: type = (PyObject*) ((PyInstanceObject*)type)->in_class; victor@0: Py_INCREF(type); victor@0: } else { victor@0: type = 0; victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "raise: exception must be an old-style class or instance"); victor@0: goto raise_error; victor@0: } victor@0: #else victor@0: type = (PyObject*) Py_TYPE(type); victor@0: Py_INCREF(type); victor@0: if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "raise: exception class must be a subclass of BaseException"); victor@0: goto raise_error; victor@0: } victor@0: #endif victor@0: } victor@0: __Pyx_ErrRestore(type, value, tb); victor@0: return; victor@0: raise_error: victor@0: Py_XDECREF(value); victor@0: Py_XDECREF(type); victor@0: Py_XDECREF(tb); victor@0: return; victor@0: } victor@0: #else /* Python 3+ */ victor@0: static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { victor@0: PyObject* owned_instance = NULL; victor@0: if (tb == Py_None) { victor@0: tb = 0; victor@0: } else if (tb && !PyTraceBack_Check(tb)) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "raise: arg 3 must be a traceback or None"); victor@0: goto bad; victor@0: } victor@0: if (value == Py_None) victor@0: value = 0; victor@0: if (PyExceptionInstance_Check(type)) { victor@0: if (value) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "instance exception may not have a separate value"); victor@0: goto bad; victor@0: } victor@0: value = type; victor@0: type = (PyObject*) Py_TYPE(value); victor@0: } else if (PyExceptionClass_Check(type)) { victor@0: PyObject *instance_class = NULL; victor@0: if (value && PyExceptionInstance_Check(value)) { victor@0: instance_class = (PyObject*) Py_TYPE(value); victor@0: if (instance_class != type) { victor@0: if (PyObject_IsSubclass(instance_class, type)) { victor@0: type = instance_class; victor@0: } else { victor@0: instance_class = NULL; victor@0: } victor@0: } victor@0: } victor@0: if (!instance_class) { victor@0: PyObject *args; victor@0: if (!value) victor@0: args = PyTuple_New(0); victor@0: else if (PyTuple_Check(value)) { victor@0: Py_INCREF(value); victor@0: args = value; victor@0: } else victor@0: args = PyTuple_Pack(1, value); victor@0: if (!args) victor@0: goto bad; victor@0: owned_instance = PyObject_Call(type, args, NULL); victor@0: Py_DECREF(args); victor@0: if (!owned_instance) victor@0: goto bad; victor@0: value = owned_instance; victor@0: if (!PyExceptionInstance_Check(value)) { victor@0: PyErr_Format(PyExc_TypeError, victor@0: "calling %R should have returned an instance of " victor@0: "BaseException, not %R", victor@0: type, Py_TYPE(value)); victor@0: goto bad; victor@0: } victor@0: } victor@0: } else { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "raise: exception class must be a subclass of BaseException"); victor@0: goto bad; victor@0: } victor@0: #if PY_VERSION_HEX >= 0x03030000 victor@0: if (cause) { victor@0: #else victor@0: if (cause && cause != Py_None) { victor@0: #endif victor@0: PyObject *fixed_cause; victor@0: if (cause == Py_None) { victor@0: fixed_cause = NULL; victor@0: } else if (PyExceptionClass_Check(cause)) { victor@0: fixed_cause = PyObject_CallObject(cause, NULL); victor@0: if (fixed_cause == NULL) victor@0: goto bad; victor@0: } else if (PyExceptionInstance_Check(cause)) { victor@0: fixed_cause = cause; victor@0: Py_INCREF(fixed_cause); victor@0: } else { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "exception causes must derive from " victor@0: "BaseException"); victor@0: goto bad; victor@0: } victor@0: PyException_SetCause(value, fixed_cause); victor@0: } victor@0: PyErr_SetObject(type, value); victor@0: if (tb) { victor@0: PyThreadState *tstate = PyThreadState_GET(); victor@0: PyObject* tmp_tb = tstate->curexc_traceback; victor@0: if (tb != tmp_tb) { victor@0: Py_INCREF(tb); victor@0: tstate->curexc_traceback = tb; victor@0: Py_XDECREF(tmp_tb); victor@0: } victor@0: } victor@0: bad: victor@0: Py_XDECREF(owned_instance); victor@0: return; victor@0: } victor@0: #endif victor@0: victor@0: static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { victor@0: PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); victor@0: } victor@0: victor@0: static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { victor@0: PyObject* fake_module; victor@0: PyTypeObject* cached_type = NULL; victor@0: fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); victor@0: if (!fake_module) return NULL; victor@0: Py_INCREF(fake_module); victor@0: cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); victor@0: if (cached_type) { victor@0: if (!PyType_Check((PyObject*)cached_type)) { victor@0: PyErr_Format(PyExc_TypeError, victor@0: "Shared Cython type %.200s is not a type object", victor@0: type->tp_name); victor@0: goto bad; victor@0: } victor@0: if (cached_type->tp_basicsize != type->tp_basicsize) { victor@0: PyErr_Format(PyExc_TypeError, victor@0: "Shared Cython type %.200s has the wrong size, try recompiling", victor@0: type->tp_name); victor@0: goto bad; victor@0: } victor@0: } else { victor@0: if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; victor@0: PyErr_Clear(); victor@0: if (PyType_Ready(type) < 0) goto bad; victor@0: if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) victor@0: goto bad; victor@0: Py_INCREF(type); victor@0: cached_type = type; victor@0: } victor@0: done: victor@0: Py_DECREF(fake_module); victor@0: return cached_type; victor@0: bad: victor@0: Py_XDECREF(cached_type); victor@0: cached_type = NULL; victor@0: goto done; victor@0: } victor@0: victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) victor@0: { victor@0: if (unlikely(op->func_doc == NULL)) { victor@0: if (op->func.m_ml->ml_doc) { victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); victor@0: #else victor@0: op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); victor@0: #endif victor@0: if (unlikely(op->func_doc == NULL)) victor@0: return NULL; victor@0: } else { victor@0: Py_INCREF(Py_None); victor@0: return Py_None; victor@0: } victor@0: } victor@0: Py_INCREF(op->func_doc); victor@0: return op->func_doc; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) victor@0: { victor@0: PyObject *tmp = op->func_doc; victor@0: if (value == NULL) victor@0: value = Py_None; /* Mark as deleted */ victor@0: Py_INCREF(value); victor@0: op->func_doc = value; victor@0: Py_XDECREF(tmp); victor@0: return 0; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) victor@0: { victor@0: if (unlikely(op->func_name == NULL)) { victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); victor@0: #else victor@0: op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); victor@0: #endif victor@0: if (unlikely(op->func_name == NULL)) victor@0: return NULL; victor@0: } victor@0: Py_INCREF(op->func_name); victor@0: return op->func_name; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) victor@0: { victor@0: PyObject *tmp; victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: if (unlikely(value == NULL || !PyUnicode_Check(value))) { victor@0: #else victor@0: if (unlikely(value == NULL || !PyString_Check(value))) { victor@0: #endif victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "__name__ must be set to a string object"); victor@0: return -1; victor@0: } victor@0: tmp = op->func_name; victor@0: Py_INCREF(value); victor@0: op->func_name = value; victor@0: Py_XDECREF(tmp); victor@0: return 0; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) victor@0: { victor@0: Py_INCREF(op->func_qualname); victor@0: return op->func_qualname; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) victor@0: { victor@0: PyObject *tmp; victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: if (unlikely(value == NULL || !PyUnicode_Check(value))) { victor@0: #else victor@0: if (unlikely(value == NULL || !PyString_Check(value))) { victor@0: #endif victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "__qualname__ must be set to a string object"); victor@0: return -1; victor@0: } victor@0: tmp = op->func_qualname; victor@0: Py_INCREF(value); victor@0: op->func_qualname = value; victor@0: Py_XDECREF(tmp); victor@0: return 0; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) victor@0: { victor@0: PyObject *self; victor@0: self = m->func_closure; victor@0: if (self == NULL) victor@0: self = Py_None; victor@0: Py_INCREF(self); victor@0: return self; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) victor@0: { victor@0: if (unlikely(op->func_dict == NULL)) { victor@0: op->func_dict = PyDict_New(); victor@0: if (unlikely(op->func_dict == NULL)) victor@0: return NULL; victor@0: } victor@0: Py_INCREF(op->func_dict); victor@0: return op->func_dict; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) victor@0: { victor@0: PyObject *tmp; victor@0: if (unlikely(value == NULL)) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "function's dictionary may not be deleted"); victor@0: return -1; victor@0: } victor@0: if (unlikely(!PyDict_Check(value))) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "setting function's dictionary to a non-dict"); victor@0: return -1; victor@0: } victor@0: tmp = op->func_dict; victor@0: Py_INCREF(value); victor@0: op->func_dict = value; victor@0: Py_XDECREF(tmp); victor@0: return 0; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) victor@0: { victor@0: Py_INCREF(op->func_globals); victor@0: return op->func_globals; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) victor@0: { victor@0: Py_INCREF(Py_None); victor@0: return Py_None; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) victor@0: { victor@0: PyObject* result = (op->func_code) ? op->func_code : Py_None; victor@0: Py_INCREF(result); victor@0: return result; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { victor@0: PyObject *res = op->defaults_getter((PyObject *) op); victor@0: if (unlikely(!res)) victor@0: return -1; victor@0: op->defaults_tuple = PyTuple_GET_ITEM(res, 0); victor@0: Py_INCREF(op->defaults_tuple); victor@0: op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); victor@0: Py_INCREF(op->defaults_kwdict); victor@0: Py_DECREF(res); victor@0: return 0; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { victor@0: PyObject* tmp; victor@0: if (!value) { victor@0: value = Py_None; victor@0: } else if (value != Py_None && !PyTuple_Check(value)) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "__defaults__ must be set to a tuple object"); victor@0: return -1; victor@0: } victor@0: Py_INCREF(value); victor@0: tmp = op->defaults_tuple; victor@0: op->defaults_tuple = value; victor@0: Py_XDECREF(tmp); victor@0: return 0; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { victor@0: PyObject* result = op->defaults_tuple; victor@0: if (unlikely(!result)) { victor@0: if (op->defaults_getter) { victor@0: if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; victor@0: result = op->defaults_tuple; victor@0: } else { victor@0: result = Py_None; victor@0: } victor@0: } victor@0: Py_INCREF(result); victor@0: return result; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { victor@0: PyObject* tmp; victor@0: if (!value) { victor@0: value = Py_None; victor@0: } else if (value != Py_None && !PyDict_Check(value)) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "__kwdefaults__ must be set to a dict object"); victor@0: return -1; victor@0: } victor@0: Py_INCREF(value); victor@0: tmp = op->defaults_kwdict; victor@0: op->defaults_kwdict = value; victor@0: Py_XDECREF(tmp); victor@0: return 0; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { victor@0: PyObject* result = op->defaults_kwdict; victor@0: if (unlikely(!result)) { victor@0: if (op->defaults_getter) { victor@0: if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; victor@0: result = op->defaults_kwdict; victor@0: } else { victor@0: result = Py_None; victor@0: } victor@0: } victor@0: Py_INCREF(result); victor@0: return result; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { victor@0: PyObject* tmp; victor@0: if (!value || value == Py_None) { victor@0: value = NULL; victor@0: } else if (!PyDict_Check(value)) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "__annotations__ must be set to a dict object"); victor@0: return -1; victor@0: } victor@0: Py_XINCREF(value); victor@0: tmp = op->func_annotations; victor@0: op->func_annotations = value; victor@0: Py_XDECREF(tmp); victor@0: return 0; victor@0: } victor@0: static PyObject * victor@0: __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { victor@0: PyObject* result = op->func_annotations; victor@0: if (unlikely(!result)) { victor@0: result = PyDict_New(); victor@0: if (unlikely(!result)) return NULL; victor@0: op->func_annotations = result; victor@0: } victor@0: Py_INCREF(result); victor@0: return result; victor@0: } victor@0: static PyGetSetDef __pyx_CyFunction_getsets[] = { victor@0: {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, victor@0: {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, victor@0: {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, victor@0: {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, victor@0: {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, victor@0: {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, victor@0: {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, victor@0: {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, victor@0: {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, victor@0: {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, victor@0: {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, victor@0: {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, victor@0: {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, victor@0: {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, victor@0: {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, victor@0: {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, victor@0: {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, victor@0: {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, victor@0: {0, 0, 0, 0, 0} victor@0: }; victor@0: #ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ victor@0: #define PY_WRITE_RESTRICTED WRITE_RESTRICTED victor@0: #endif victor@0: static PyMemberDef __pyx_CyFunction_members[] = { victor@0: {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, victor@0: {0, 0, 0, 0, 0} victor@0: }; victor@0: static PyObject * victor@0: __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) victor@0: { victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: return PyUnicode_FromString(m->func.m_ml->ml_name); victor@0: #else victor@0: return PyString_FromString(m->func.m_ml->ml_name); victor@0: #endif victor@0: } victor@0: static PyMethodDef __pyx_CyFunction_methods[] = { victor@0: {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, victor@0: {0, 0, 0, 0} victor@0: }; victor@0: static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, victor@0: PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { victor@0: __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); victor@0: if (op == NULL) victor@0: return NULL; victor@0: op->flags = flags; victor@0: op->func_weakreflist = NULL; victor@0: op->func.m_ml = ml; victor@0: op->func.m_self = (PyObject *) op; victor@0: Py_XINCREF(closure); victor@0: op->func_closure = closure; victor@0: Py_XINCREF(module); victor@0: op->func.m_module = module; victor@0: op->func_dict = NULL; victor@0: op->func_name = NULL; victor@0: Py_INCREF(qualname); victor@0: op->func_qualname = qualname; victor@0: op->func_doc = NULL; victor@0: op->func_classobj = NULL; victor@0: op->func_globals = globals; victor@0: Py_INCREF(op->func_globals); victor@0: Py_XINCREF(code); victor@0: op->func_code = code; victor@0: op->defaults_pyobjects = 0; victor@0: op->defaults = NULL; victor@0: op->defaults_tuple = NULL; victor@0: op->defaults_kwdict = NULL; victor@0: op->defaults_getter = NULL; victor@0: op->func_annotations = NULL; victor@0: PyObject_GC_Track(op); victor@0: return (PyObject *) op; victor@0: } victor@0: static int victor@0: __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) victor@0: { victor@0: Py_CLEAR(m->func_closure); victor@0: Py_CLEAR(m->func.m_module); victor@0: Py_CLEAR(m->func_dict); victor@0: Py_CLEAR(m->func_name); victor@0: Py_CLEAR(m->func_qualname); victor@0: Py_CLEAR(m->func_doc); victor@0: Py_CLEAR(m->func_globals); victor@0: Py_CLEAR(m->func_code); victor@0: Py_CLEAR(m->func_classobj); victor@0: Py_CLEAR(m->defaults_tuple); victor@0: Py_CLEAR(m->defaults_kwdict); victor@0: Py_CLEAR(m->func_annotations); victor@0: if (m->defaults) { victor@0: PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); victor@0: int i; victor@0: for (i = 0; i < m->defaults_pyobjects; i++) victor@0: Py_XDECREF(pydefaults[i]); victor@0: PyMem_Free(m->defaults); victor@0: m->defaults = NULL; victor@0: } victor@0: return 0; victor@0: } victor@0: static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) victor@0: { victor@0: PyObject_GC_UnTrack(m); victor@0: if (m->func_weakreflist != NULL) victor@0: PyObject_ClearWeakRefs((PyObject *) m); victor@0: __Pyx_CyFunction_clear(m); victor@0: PyObject_GC_Del(m); victor@0: } victor@0: static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) victor@0: { victor@0: Py_VISIT(m->func_closure); victor@0: Py_VISIT(m->func.m_module); victor@0: Py_VISIT(m->func_dict); victor@0: Py_VISIT(m->func_name); victor@0: Py_VISIT(m->func_qualname); victor@0: Py_VISIT(m->func_doc); victor@0: Py_VISIT(m->func_globals); victor@0: Py_VISIT(m->func_code); victor@0: Py_VISIT(m->func_classobj); victor@0: Py_VISIT(m->defaults_tuple); victor@0: Py_VISIT(m->defaults_kwdict); victor@0: if (m->defaults) { victor@0: PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); victor@0: int i; victor@0: for (i = 0; i < m->defaults_pyobjects; i++) victor@0: Py_VISIT(pydefaults[i]); victor@0: } victor@0: return 0; victor@0: } victor@0: static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) victor@0: { victor@0: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; victor@0: if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { victor@0: Py_INCREF(func); victor@0: return func; victor@0: } victor@0: if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { victor@0: if (type == NULL) victor@0: type = (PyObject *)(Py_TYPE(obj)); victor@0: return PyMethod_New(func, victor@0: type, (PyObject *)(Py_TYPE(type))); victor@0: } victor@0: if (obj == Py_None) victor@0: obj = NULL; victor@0: return PyMethod_New(func, obj, type); victor@0: } victor@0: static PyObject* victor@0: __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) victor@0: { victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: return PyUnicode_FromFormat("", victor@0: op->func_qualname, (void *)op); victor@0: #else victor@0: return PyString_FromFormat("", victor@0: PyString_AsString(op->func_qualname), (void *)op); victor@0: #endif victor@0: } victor@0: #if CYTHON_COMPILING_IN_PYPY victor@0: static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { victor@0: PyCFunctionObject* f = (PyCFunctionObject*)func; victor@0: PyCFunction meth = PyCFunction_GET_FUNCTION(func); victor@0: PyObject *self = PyCFunction_GET_SELF(func); victor@0: Py_ssize_t size; victor@0: switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { victor@0: case METH_VARARGS: victor@0: if (likely(kw == NULL) || PyDict_Size(kw) == 0) victor@0: return (*meth)(self, arg); victor@0: break; victor@0: case METH_VARARGS | METH_KEYWORDS: victor@0: return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); victor@0: case METH_NOARGS: victor@0: if (likely(kw == NULL) || PyDict_Size(kw) == 0) { victor@0: size = PyTuple_GET_SIZE(arg); victor@0: if (size == 0) victor@0: return (*meth)(self, NULL); victor@0: PyErr_Format(PyExc_TypeError, victor@0: "%.200s() takes no arguments (%zd given)", victor@0: f->m_ml->ml_name, size); victor@0: return NULL; victor@0: } victor@0: break; victor@0: case METH_O: victor@0: if (likely(kw == NULL) || PyDict_Size(kw) == 0) { victor@0: size = PyTuple_GET_SIZE(arg); victor@0: if (size == 1) victor@0: return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); victor@0: PyErr_Format(PyExc_TypeError, victor@0: "%.200s() takes exactly one argument (%zd given)", victor@0: f->m_ml->ml_name, size); victor@0: return NULL; victor@0: } victor@0: break; victor@0: default: victor@0: PyErr_SetString(PyExc_SystemError, "Bad call flags in " victor@0: "__Pyx_CyFunction_Call. METH_OLDARGS is no " victor@0: "longer supported!"); victor@0: return NULL; victor@0: } victor@0: PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", victor@0: f->m_ml->ml_name); victor@0: return NULL; victor@0: } victor@0: #else victor@0: static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { victor@0: return PyCFunction_Call(func, arg, kw); victor@0: } victor@0: #endif victor@0: static PyTypeObject __pyx_CyFunctionType_type = { victor@0: PyVarObject_HEAD_INIT(0, 0) victor@0: __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ victor@0: sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ victor@0: 0, /*tp_itemsize*/ victor@0: (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ victor@0: 0, /*tp_print*/ victor@0: 0, /*tp_getattr*/ victor@0: 0, /*tp_setattr*/ victor@0: #if PY_MAJOR_VERSION < 3 victor@0: 0, /*tp_compare*/ victor@0: #else victor@0: 0, /*reserved*/ victor@0: #endif victor@0: (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ victor@0: 0, /*tp_as_number*/ victor@0: 0, /*tp_as_sequence*/ victor@0: 0, /*tp_as_mapping*/ victor@0: 0, /*tp_hash*/ victor@0: __Pyx_CyFunction_Call, /*tp_call*/ victor@0: 0, /*tp_str*/ victor@0: 0, /*tp_getattro*/ victor@0: 0, /*tp_setattro*/ victor@0: 0, /*tp_as_buffer*/ victor@0: Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ victor@0: 0, /*tp_doc*/ victor@0: (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ victor@0: (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ victor@0: 0, /*tp_richcompare*/ victor@0: offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ victor@0: 0, /*tp_iter*/ victor@0: 0, /*tp_iternext*/ victor@0: __pyx_CyFunction_methods, /*tp_methods*/ victor@0: __pyx_CyFunction_members, /*tp_members*/ victor@0: __pyx_CyFunction_getsets, /*tp_getset*/ victor@0: 0, /*tp_base*/ victor@0: 0, /*tp_dict*/ victor@0: __Pyx_CyFunction_descr_get, /*tp_descr_get*/ victor@0: 0, /*tp_descr_set*/ victor@0: offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ victor@0: 0, /*tp_init*/ victor@0: 0, /*tp_alloc*/ victor@0: 0, /*tp_new*/ victor@0: 0, /*tp_free*/ victor@0: 0, /*tp_is_gc*/ victor@0: 0, /*tp_bases*/ victor@0: 0, /*tp_mro*/ victor@0: 0, /*tp_cache*/ victor@0: 0, /*tp_subclasses*/ victor@0: 0, /*tp_weaklist*/ victor@0: 0, /*tp_del*/ victor@0: #if PY_VERSION_HEX >= 0x02060000 victor@0: 0, /*tp_version_tag*/ victor@0: #endif victor@0: #if PY_VERSION_HEX >= 0x030400a1 victor@0: 0, /*tp_finalize*/ victor@0: #endif victor@0: }; victor@0: static int __Pyx_CyFunction_init(void) { victor@0: #if !CYTHON_COMPILING_IN_PYPY victor@0: __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; victor@0: #endif victor@0: __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); victor@0: if (__pyx_CyFunctionType == NULL) { victor@0: return -1; victor@0: } victor@0: return 0; victor@0: } victor@0: static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { victor@0: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; victor@0: m->defaults = PyMem_Malloc(size); victor@0: if (!m->defaults) victor@0: return PyErr_NoMemory(); victor@0: memset(m->defaults, 0, size); victor@0: m->defaults_pyobjects = pyobjects; victor@0: return m->defaults; victor@0: } victor@0: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { victor@0: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; victor@0: m->defaults_tuple = tuple; victor@0: Py_INCREF(tuple); victor@0: } victor@0: static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { victor@0: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; victor@0: m->defaults_kwdict = dict; victor@0: Py_INCREF(dict); victor@0: } victor@0: static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { victor@0: __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; victor@0: m->func_annotations = dict; victor@0: Py_INCREF(dict); victor@0: } victor@0: victor@0: static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { victor@0: Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); victor@0: for (i=0; i < nbases; i++) { victor@0: PyTypeObject *tmptype; victor@0: PyObject *tmp = PyTuple_GET_ITEM(bases, i); victor@0: tmptype = Py_TYPE(tmp); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (tmptype == &PyClass_Type) victor@0: continue; victor@0: #endif victor@0: if (!metaclass) { victor@0: metaclass = tmptype; victor@0: continue; victor@0: } victor@0: if (PyType_IsSubtype(metaclass, tmptype)) victor@0: continue; victor@0: if (PyType_IsSubtype(tmptype, metaclass)) { victor@0: metaclass = tmptype; victor@0: continue; victor@0: } victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "metaclass conflict: " victor@0: "the metaclass of a derived class " victor@0: "must be a (non-strict) subclass " victor@0: "of the metaclasses of all its bases"); victor@0: return NULL; victor@0: } victor@0: if (!metaclass) { victor@0: #if PY_MAJOR_VERSION < 3 victor@0: metaclass = &PyClass_Type; victor@0: #else victor@0: metaclass = &PyType_Type; victor@0: #endif victor@0: } victor@0: Py_INCREF((PyObject*) metaclass); victor@0: return (PyObject*) metaclass; victor@0: } victor@0: victor@0: static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, victor@0: PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { victor@0: PyObject *ns; victor@0: if (metaclass) { victor@0: PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); victor@0: if (prep) { victor@0: PyObject *pargs = PyTuple_Pack(2, name, bases); victor@0: if (unlikely(!pargs)) { victor@0: Py_DECREF(prep); victor@0: return NULL; victor@0: } victor@0: ns = PyObject_Call(prep, pargs, mkw); victor@0: Py_DECREF(prep); victor@0: Py_DECREF(pargs); victor@0: } else { victor@0: if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) victor@0: return NULL; victor@0: PyErr_Clear(); victor@0: ns = PyDict_New(); victor@0: } victor@0: } else { victor@0: ns = PyDict_New(); victor@0: } victor@0: if (unlikely(!ns)) victor@0: return NULL; victor@0: if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; victor@0: if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; victor@0: if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; victor@0: return ns; victor@0: bad: victor@0: Py_DECREF(ns); victor@0: return NULL; victor@0: } victor@0: static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, victor@0: PyObject *dict, PyObject *mkw, victor@0: int calculate_metaclass, int allow_py2_metaclass) { victor@0: PyObject *result, *margs; victor@0: PyObject *owned_metaclass = NULL; victor@0: if (allow_py2_metaclass) { victor@0: owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); victor@0: if (owned_metaclass) { victor@0: metaclass = owned_metaclass; victor@0: } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { victor@0: PyErr_Clear(); victor@0: } else { victor@0: return NULL; victor@0: } victor@0: } victor@0: if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { victor@0: metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); victor@0: Py_XDECREF(owned_metaclass); victor@0: if (unlikely(!metaclass)) victor@0: return NULL; victor@0: owned_metaclass = metaclass; victor@0: } victor@0: margs = PyTuple_Pack(3, name, bases, dict); victor@0: if (unlikely(!margs)) { victor@0: result = NULL; victor@0: } else { victor@0: result = PyObject_Call(metaclass, margs, mkw); victor@0: Py_DECREF(margs); victor@0: } victor@0: Py_XDECREF(owned_metaclass); victor@0: return result; victor@0: } victor@0: victor@0: static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { victor@0: PyObject *empty_list = 0; victor@0: PyObject *module = 0; victor@0: PyObject *global_dict = 0; victor@0: PyObject *empty_dict = 0; victor@0: PyObject *list; victor@0: #if PY_VERSION_HEX < 0x03030000 victor@0: PyObject *py_import; victor@0: py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); victor@0: if (!py_import) victor@0: goto bad; victor@0: #endif victor@0: if (from_list) victor@0: list = from_list; victor@0: else { victor@0: empty_list = PyList_New(0); victor@0: if (!empty_list) victor@0: goto bad; victor@0: list = empty_list; victor@0: } victor@0: global_dict = PyModule_GetDict(__pyx_m); victor@0: if (!global_dict) victor@0: goto bad; victor@0: empty_dict = PyDict_New(); victor@0: if (!empty_dict) victor@0: goto bad; victor@0: #if PY_VERSION_HEX >= 0x02050000 victor@0: { victor@0: #if PY_MAJOR_VERSION >= 3 victor@0: if (level == -1) { victor@0: if (strchr(__Pyx_MODULE_NAME, '.')) { victor@0: #if PY_VERSION_HEX < 0x03030000 victor@0: PyObject *py_level = PyInt_FromLong(1); victor@0: if (!py_level) victor@0: goto bad; victor@0: module = PyObject_CallFunctionObjArgs(py_import, victor@0: name, global_dict, empty_dict, list, py_level, NULL); victor@0: Py_DECREF(py_level); victor@0: #else victor@0: module = PyImport_ImportModuleLevelObject( victor@0: name, global_dict, empty_dict, list, 1); victor@0: #endif victor@0: if (!module) { victor@0: if (!PyErr_ExceptionMatches(PyExc_ImportError)) victor@0: goto bad; victor@0: PyErr_Clear(); victor@0: } victor@0: } victor@0: level = 0; /* try absolute import on failure */ victor@0: } victor@0: #endif victor@0: if (!module) { victor@0: #if PY_VERSION_HEX < 0x03030000 victor@0: PyObject *py_level = PyInt_FromLong(level); victor@0: if (!py_level) victor@0: goto bad; victor@0: module = PyObject_CallFunctionObjArgs(py_import, victor@0: name, global_dict, empty_dict, list, py_level, NULL); victor@0: Py_DECREF(py_level); victor@0: #else victor@0: module = PyImport_ImportModuleLevelObject( victor@0: name, global_dict, empty_dict, list, level); victor@0: #endif victor@0: } victor@0: } victor@0: #else victor@0: if (level>0) { victor@0: PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); victor@0: goto bad; victor@0: } victor@0: module = PyObject_CallFunctionObjArgs(py_import, victor@0: name, global_dict, empty_dict, list, NULL); victor@0: #endif victor@0: bad: victor@0: #if PY_VERSION_HEX < 0x03030000 victor@0: Py_XDECREF(py_import); victor@0: #endif victor@0: Py_XDECREF(empty_list); victor@0: Py_XDECREF(empty_dict); victor@0: return module; victor@0: } victor@0: victor@0: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { victor@0: const long neg_one = (long) -1, const_zero = 0; victor@0: const int is_unsigned = neg_one > const_zero; victor@0: if (is_unsigned) { victor@0: if (sizeof(long) < sizeof(long)) { victor@0: return PyInt_FromLong((long) value); victor@0: } else if (sizeof(long) <= sizeof(unsigned long)) { victor@0: return PyLong_FromUnsignedLong((unsigned long) value); victor@0: } else if (sizeof(long) <= sizeof(unsigned long long)) { victor@0: return PyLong_FromUnsignedLongLong((unsigned long long) value); victor@0: } victor@0: } else { victor@0: if (sizeof(long) <= sizeof(long)) { victor@0: return PyInt_FromLong((long) value); victor@0: } else if (sizeof(long) <= sizeof(long long)) { victor@0: return PyLong_FromLongLong((long long) value); victor@0: } victor@0: } victor@0: { victor@0: int one = 1; int little = (int)*(unsigned char *)&one; victor@0: unsigned char *bytes = (unsigned char *)&value; victor@0: return _PyLong_FromByteArray(bytes, sizeof(long), victor@0: little, !is_unsigned); victor@0: } victor@0: } victor@0: victor@0: #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ victor@0: { \ victor@0: func_type value = func(x); \ victor@0: if (sizeof(target_type) < sizeof(func_type)) { \ victor@0: if (unlikely(value != (func_type) (target_type) value)) { \ victor@0: func_type zero = 0; \ victor@0: PyErr_SetString(PyExc_OverflowError, \ victor@0: (is_unsigned && unlikely(value < zero)) ? \ victor@0: "can't convert negative value to " #target_type : \ victor@0: "value too large to convert to " #target_type); \ victor@0: return (target_type) -1; \ victor@0: } \ victor@0: } \ victor@0: return (target_type) value; \ victor@0: } victor@0: victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: #include "longintrepr.h" victor@0: #endif victor@0: #endif victor@0: static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { victor@0: const int neg_one = (int) -1, const_zero = 0; victor@0: const int is_unsigned = neg_one > const_zero; victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (likely(PyInt_Check(x))) { victor@0: if (sizeof(int) < sizeof(long)) { victor@0: __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) victor@0: } else { victor@0: long val = PyInt_AS_LONG(x); victor@0: if (is_unsigned && unlikely(val < 0)) { victor@0: PyErr_SetString(PyExc_OverflowError, victor@0: "can't convert negative value to int"); victor@0: return (int) -1; victor@0: } victor@0: return (int) val; victor@0: } victor@0: } else victor@0: #endif victor@0: if (likely(PyLong_Check(x))) { victor@0: if (is_unsigned) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: if (sizeof(digit) <= sizeof(int)) { victor@0: switch (Py_SIZE(x)) { victor@0: case 0: return 0; victor@0: case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; victor@0: } victor@0: } victor@0: #endif victor@0: #endif victor@0: if (unlikely(Py_SIZE(x) < 0)) { victor@0: PyErr_SetString(PyExc_OverflowError, victor@0: "can't convert negative value to int"); victor@0: return (int) -1; victor@0: } victor@0: if (sizeof(int) <= sizeof(unsigned long)) { victor@0: __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) victor@0: } else if (sizeof(int) <= sizeof(unsigned long long)) { victor@0: __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) victor@0: } victor@0: } else { victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: if (sizeof(digit) <= sizeof(int)) { victor@0: switch (Py_SIZE(x)) { victor@0: case 0: return 0; victor@0: case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; victor@0: case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; victor@0: } victor@0: } victor@0: #endif victor@0: #endif victor@0: if (sizeof(int) <= sizeof(long)) { victor@0: __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) victor@0: } else if (sizeof(int) <= sizeof(long long)) { victor@0: __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) victor@0: } victor@0: } victor@0: { victor@0: #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) victor@0: PyErr_SetString(PyExc_RuntimeError, victor@0: "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); victor@0: #else victor@0: int val; victor@0: PyObject *v = __Pyx_PyNumber_Int(x); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (likely(v) && !PyLong_Check(v)) { victor@0: PyObject *tmp = v; victor@0: v = PyNumber_Long(tmp); victor@0: Py_DECREF(tmp); victor@0: } victor@0: #endif victor@0: if (likely(v)) { victor@0: int one = 1; int is_little = (int)*(unsigned char *)&one; victor@0: unsigned char *bytes = (unsigned char *)&val; victor@0: int ret = _PyLong_AsByteArray((PyLongObject *)v, victor@0: bytes, sizeof(val), victor@0: is_little, !is_unsigned); victor@0: Py_DECREF(v); victor@0: if (likely(!ret)) victor@0: return val; victor@0: } victor@0: #endif victor@0: return (int) -1; victor@0: } victor@0: } else { victor@0: int val; victor@0: PyObject *tmp = __Pyx_PyNumber_Int(x); victor@0: if (!tmp) return (int) -1; victor@0: val = __Pyx_PyInt_As_int(tmp); victor@0: Py_DECREF(tmp); victor@0: return val; victor@0: } victor@0: } victor@0: victor@0: static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { victor@0: const int neg_one = (int) -1, const_zero = 0; victor@0: const int is_unsigned = neg_one > const_zero; victor@0: if (is_unsigned) { victor@0: if (sizeof(int) < sizeof(long)) { victor@0: return PyInt_FromLong((long) value); victor@0: } else if (sizeof(int) <= sizeof(unsigned long)) { victor@0: return PyLong_FromUnsignedLong((unsigned long) value); victor@0: } else if (sizeof(int) <= sizeof(unsigned long long)) { victor@0: return PyLong_FromUnsignedLongLong((unsigned long long) value); victor@0: } victor@0: } else { victor@0: if (sizeof(int) <= sizeof(long)) { victor@0: return PyInt_FromLong((long) value); victor@0: } else if (sizeof(int) <= sizeof(long long)) { victor@0: return PyLong_FromLongLong((long long) value); victor@0: } victor@0: } victor@0: { victor@0: int one = 1; int little = (int)*(unsigned char *)&one; victor@0: unsigned char *bytes = (unsigned char *)&value; victor@0: return _PyLong_FromByteArray(bytes, sizeof(int), victor@0: little, !is_unsigned); victor@0: } victor@0: } victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #ifdef __cplusplus victor@0: static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { victor@0: return ::std::complex< float >(x, y); victor@0: } victor@0: #else victor@0: static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { victor@0: return x + y*(__pyx_t_float_complex)_Complex_I; victor@0: } victor@0: #endif victor@0: #else victor@0: static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { victor@0: __pyx_t_float_complex z; victor@0: z.real = x; victor@0: z.imag = y; victor@0: return z; victor@0: } victor@0: #endif victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #else victor@0: static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { victor@0: return (a.real == b.real) && (a.imag == b.imag); victor@0: } victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { victor@0: __pyx_t_float_complex z; victor@0: z.real = a.real + b.real; victor@0: z.imag = a.imag + b.imag; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { victor@0: __pyx_t_float_complex z; victor@0: z.real = a.real - b.real; victor@0: z.imag = a.imag - b.imag; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { victor@0: __pyx_t_float_complex z; victor@0: z.real = a.real * b.real - a.imag * b.imag; victor@0: z.imag = a.real * b.imag + a.imag * b.real; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { victor@0: __pyx_t_float_complex z; victor@0: float denom = b.real * b.real + b.imag * b.imag; victor@0: z.real = (a.real * b.real + a.imag * b.imag) / denom; victor@0: z.imag = (a.imag * b.real - a.real * b.imag) / denom; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { victor@0: __pyx_t_float_complex z; victor@0: z.real = -a.real; victor@0: z.imag = -a.imag; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { victor@0: return (a.real == 0) && (a.imag == 0); victor@0: } victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { victor@0: __pyx_t_float_complex z; victor@0: z.real = a.real; victor@0: z.imag = -a.imag; victor@0: return z; victor@0: } victor@0: #if 1 victor@0: static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { victor@0: #if !defined(HAVE_HYPOT) || defined(_MSC_VER) victor@0: return sqrtf(z.real*z.real + z.imag*z.imag); victor@0: #else victor@0: return hypotf(z.real, z.imag); victor@0: #endif victor@0: } victor@0: static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { victor@0: __pyx_t_float_complex z; victor@0: float r, lnr, theta, z_r, z_theta; victor@0: if (b.imag == 0 && b.real == (int)b.real) { victor@0: if (b.real < 0) { victor@0: float denom = a.real * a.real + a.imag * a.imag; victor@0: a.real = a.real / denom; victor@0: a.imag = -a.imag / denom; victor@0: b.real = -b.real; victor@0: } victor@0: switch ((int)b.real) { victor@0: case 0: victor@0: z.real = 1; victor@0: z.imag = 0; victor@0: return z; victor@0: case 1: victor@0: return a; victor@0: case 2: victor@0: z = __Pyx_c_prodf(a, a); victor@0: return __Pyx_c_prodf(a, a); victor@0: case 3: victor@0: z = __Pyx_c_prodf(a, a); victor@0: return __Pyx_c_prodf(z, a); victor@0: case 4: victor@0: z = __Pyx_c_prodf(a, a); victor@0: return __Pyx_c_prodf(z, z); victor@0: } victor@0: } victor@0: if (a.imag == 0) { victor@0: if (a.real == 0) { victor@0: return a; victor@0: } victor@0: r = a.real; victor@0: theta = 0; victor@0: } else { victor@0: r = __Pyx_c_absf(a); victor@0: theta = atan2f(a.imag, a.real); victor@0: } victor@0: lnr = logf(r); victor@0: z_r = expf(lnr * b.real - theta * b.imag); victor@0: z_theta = theta * b.real + lnr * b.imag; victor@0: z.real = z_r * cosf(z_theta); victor@0: z.imag = z_r * sinf(z_theta); victor@0: return z; victor@0: } victor@0: #endif victor@0: #endif victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #ifdef __cplusplus victor@0: static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { victor@0: return ::std::complex< double >(x, y); victor@0: } victor@0: #else victor@0: static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { victor@0: return x + y*(__pyx_t_double_complex)_Complex_I; victor@0: } victor@0: #endif victor@0: #else victor@0: static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { victor@0: __pyx_t_double_complex z; victor@0: z.real = x; victor@0: z.imag = y; victor@0: return z; victor@0: } victor@0: #endif victor@0: victor@0: #if CYTHON_CCOMPLEX victor@0: #else victor@0: static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { victor@0: return (a.real == b.real) && (a.imag == b.imag); victor@0: } victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { victor@0: __pyx_t_double_complex z; victor@0: z.real = a.real + b.real; victor@0: z.imag = a.imag + b.imag; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { victor@0: __pyx_t_double_complex z; victor@0: z.real = a.real - b.real; victor@0: z.imag = a.imag - b.imag; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { victor@0: __pyx_t_double_complex z; victor@0: z.real = a.real * b.real - a.imag * b.imag; victor@0: z.imag = a.real * b.imag + a.imag * b.real; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { victor@0: __pyx_t_double_complex z; victor@0: double denom = b.real * b.real + b.imag * b.imag; victor@0: z.real = (a.real * b.real + a.imag * b.imag) / denom; victor@0: z.imag = (a.imag * b.real - a.real * b.imag) / denom; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { victor@0: __pyx_t_double_complex z; victor@0: z.real = -a.real; victor@0: z.imag = -a.imag; victor@0: return z; victor@0: } victor@0: static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { victor@0: return (a.real == 0) && (a.imag == 0); victor@0: } victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { victor@0: __pyx_t_double_complex z; victor@0: z.real = a.real; victor@0: z.imag = -a.imag; victor@0: return z; victor@0: } victor@0: #if 1 victor@0: static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { victor@0: #if !defined(HAVE_HYPOT) || defined(_MSC_VER) victor@0: return sqrt(z.real*z.real + z.imag*z.imag); victor@0: #else victor@0: return hypot(z.real, z.imag); victor@0: #endif victor@0: } victor@0: static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { victor@0: __pyx_t_double_complex z; victor@0: double r, lnr, theta, z_r, z_theta; victor@0: if (b.imag == 0 && b.real == (int)b.real) { victor@0: if (b.real < 0) { victor@0: double denom = a.real * a.real + a.imag * a.imag; victor@0: a.real = a.real / denom; victor@0: a.imag = -a.imag / denom; victor@0: b.real = -b.real; victor@0: } victor@0: switch ((int)b.real) { victor@0: case 0: victor@0: z.real = 1; victor@0: z.imag = 0; victor@0: return z; victor@0: case 1: victor@0: return a; victor@0: case 2: victor@0: z = __Pyx_c_prod(a, a); victor@0: return __Pyx_c_prod(a, a); victor@0: case 3: victor@0: z = __Pyx_c_prod(a, a); victor@0: return __Pyx_c_prod(z, a); victor@0: case 4: victor@0: z = __Pyx_c_prod(a, a); victor@0: return __Pyx_c_prod(z, z); victor@0: } victor@0: } victor@0: if (a.imag == 0) { victor@0: if (a.real == 0) { victor@0: return a; victor@0: } victor@0: r = a.real; victor@0: theta = 0; victor@0: } else { victor@0: r = __Pyx_c_abs(a); victor@0: theta = atan2(a.imag, a.real); victor@0: } victor@0: lnr = log(r); victor@0: z_r = exp(lnr * b.real - theta * b.imag); victor@0: z_theta = theta * b.real + lnr * b.imag; victor@0: z.real = z_r * cos(z_theta); victor@0: z.imag = z_r * sin(z_theta); victor@0: return z; victor@0: } victor@0: #endif victor@0: #endif victor@0: victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: #include "longintrepr.h" victor@0: #endif victor@0: #endif victor@0: static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { victor@0: const long neg_one = (long) -1, const_zero = 0; victor@0: const int is_unsigned = neg_one > const_zero; victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (likely(PyInt_Check(x))) { victor@0: if (sizeof(long) < sizeof(long)) { victor@0: __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) victor@0: } else { victor@0: long val = PyInt_AS_LONG(x); victor@0: if (is_unsigned && unlikely(val < 0)) { victor@0: PyErr_SetString(PyExc_OverflowError, victor@0: "can't convert negative value to long"); victor@0: return (long) -1; victor@0: } victor@0: return (long) val; victor@0: } victor@0: } else victor@0: #endif victor@0: if (likely(PyLong_Check(x))) { victor@0: if (is_unsigned) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: if (sizeof(digit) <= sizeof(long)) { victor@0: switch (Py_SIZE(x)) { victor@0: case 0: return 0; victor@0: case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; victor@0: } victor@0: } victor@0: #endif victor@0: #endif victor@0: if (unlikely(Py_SIZE(x) < 0)) { victor@0: PyErr_SetString(PyExc_OverflowError, victor@0: "can't convert negative value to long"); victor@0: return (long) -1; victor@0: } victor@0: if (sizeof(long) <= sizeof(unsigned long)) { victor@0: __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) victor@0: } else if (sizeof(long) <= sizeof(unsigned long long)) { victor@0: __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) victor@0: } victor@0: } else { victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: if (sizeof(digit) <= sizeof(long)) { victor@0: switch (Py_SIZE(x)) { victor@0: case 0: return 0; victor@0: case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; victor@0: case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; victor@0: } victor@0: } victor@0: #endif victor@0: #endif victor@0: if (sizeof(long) <= sizeof(long)) { victor@0: __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) victor@0: } else if (sizeof(long) <= sizeof(long long)) { victor@0: __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) victor@0: } victor@0: } victor@0: { victor@0: #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) victor@0: PyErr_SetString(PyExc_RuntimeError, victor@0: "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); victor@0: #else victor@0: long val; victor@0: PyObject *v = __Pyx_PyNumber_Int(x); victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (likely(v) && !PyLong_Check(v)) { victor@0: PyObject *tmp = v; victor@0: v = PyNumber_Long(tmp); victor@0: Py_DECREF(tmp); victor@0: } victor@0: #endif victor@0: if (likely(v)) { victor@0: int one = 1; int is_little = (int)*(unsigned char *)&one; victor@0: unsigned char *bytes = (unsigned char *)&val; victor@0: int ret = _PyLong_AsByteArray((PyLongObject *)v, victor@0: bytes, sizeof(val), victor@0: is_little, !is_unsigned); victor@0: Py_DECREF(v); victor@0: if (likely(!ret)) victor@0: return val; victor@0: } victor@0: #endif victor@0: return (long) -1; victor@0: } victor@0: } else { victor@0: long val; victor@0: PyObject *tmp = __Pyx_PyNumber_Int(x); victor@0: if (!tmp) return (long) -1; victor@0: val = __Pyx_PyInt_As_long(tmp); victor@0: Py_DECREF(tmp); victor@0: return val; victor@0: } victor@0: } victor@0: victor@0: static int __Pyx_check_binary_version(void) { victor@0: char ctversion[4], rtversion[4]; victor@0: PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); victor@0: PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); victor@0: if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { victor@0: char message[200]; victor@0: PyOS_snprintf(message, sizeof(message), victor@0: "compiletime version %s of module '%.100s' " victor@0: "does not match runtime version %s", victor@0: ctversion, __Pyx_MODULE_NAME, rtversion); victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: return PyErr_Warn(NULL, message); victor@0: #else victor@0: return PyErr_WarnEx(NULL, message, 1); victor@0: #endif victor@0: } victor@0: return 0; victor@0: } victor@0: victor@0: #ifndef __PYX_HAVE_RT_ImportModule victor@0: #define __PYX_HAVE_RT_ImportModule victor@0: static PyObject *__Pyx_ImportModule(const char *name) { victor@0: PyObject *py_name = 0; victor@0: PyObject *py_module = 0; victor@0: py_name = __Pyx_PyIdentifier_FromString(name); victor@0: if (!py_name) victor@0: goto bad; victor@0: py_module = PyImport_Import(py_name); victor@0: Py_DECREF(py_name); victor@0: return py_module; victor@0: bad: victor@0: Py_XDECREF(py_name); victor@0: return 0; victor@0: } victor@0: #endif victor@0: victor@0: #ifndef __PYX_HAVE_RT_ImportType victor@0: #define __PYX_HAVE_RT_ImportType victor@0: static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, victor@0: size_t size, int strict) victor@0: { victor@0: PyObject *py_module = 0; victor@0: PyObject *result = 0; victor@0: PyObject *py_name = 0; victor@0: char warning[200]; victor@0: Py_ssize_t basicsize; victor@0: #ifdef Py_LIMITED_API victor@0: PyObject *py_basicsize; victor@0: #endif victor@0: py_module = __Pyx_ImportModule(module_name); victor@0: if (!py_module) victor@0: goto bad; victor@0: py_name = __Pyx_PyIdentifier_FromString(class_name); victor@0: if (!py_name) victor@0: goto bad; victor@0: result = PyObject_GetAttr(py_module, py_name); victor@0: Py_DECREF(py_name); victor@0: py_name = 0; victor@0: Py_DECREF(py_module); victor@0: py_module = 0; victor@0: if (!result) victor@0: goto bad; victor@0: if (!PyType_Check(result)) { victor@0: PyErr_Format(PyExc_TypeError, victor@0: "%.200s.%.200s is not a type object", victor@0: module_name, class_name); victor@0: goto bad; victor@0: } victor@0: #ifndef Py_LIMITED_API victor@0: basicsize = ((PyTypeObject *)result)->tp_basicsize; victor@0: #else victor@0: py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); victor@0: if (!py_basicsize) victor@0: goto bad; victor@0: basicsize = PyLong_AsSsize_t(py_basicsize); victor@0: Py_DECREF(py_basicsize); victor@0: py_basicsize = 0; victor@0: if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) victor@0: goto bad; victor@0: #endif victor@0: if (!strict && (size_t)basicsize > size) { victor@0: PyOS_snprintf(warning, sizeof(warning), victor@0: "%s.%s size changed, may indicate binary incompatibility", victor@0: module_name, class_name); victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: if (PyErr_Warn(NULL, warning) < 0) goto bad; victor@0: #else victor@0: if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; victor@0: #endif victor@0: } victor@0: else if ((size_t)basicsize != size) { victor@0: PyErr_Format(PyExc_ValueError, victor@0: "%.200s.%.200s has the wrong size, try recompiling", victor@0: module_name, class_name); victor@0: goto bad; victor@0: } victor@0: return (PyTypeObject *)result; victor@0: bad: victor@0: Py_XDECREF(py_module); victor@0: Py_XDECREF(result); victor@0: return NULL; victor@0: } victor@0: #endif victor@0: victor@0: static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { victor@0: int start = 0, mid = 0, end = count - 1; victor@0: if (end >= 0 && code_line > entries[end].code_line) { victor@0: return count; victor@0: } victor@0: while (start < end) { victor@0: mid = (start + end) / 2; victor@0: if (code_line < entries[mid].code_line) { victor@0: end = mid; victor@0: } else if (code_line > entries[mid].code_line) { victor@0: start = mid + 1; victor@0: } else { victor@0: return mid; victor@0: } victor@0: } victor@0: if (code_line <= entries[mid].code_line) { victor@0: return mid; victor@0: } else { victor@0: return mid + 1; victor@0: } victor@0: } victor@0: static PyCodeObject *__pyx_find_code_object(int code_line) { victor@0: PyCodeObject* code_object; victor@0: int pos; victor@0: if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { victor@0: return NULL; victor@0: } victor@0: pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); victor@0: if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { victor@0: return NULL; victor@0: } victor@0: code_object = __pyx_code_cache.entries[pos].code_object; victor@0: Py_INCREF(code_object); victor@0: return code_object; victor@0: } victor@0: static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { victor@0: int pos, i; victor@0: __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; victor@0: if (unlikely(!code_line)) { victor@0: return; victor@0: } victor@0: if (unlikely(!entries)) { victor@0: entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); victor@0: if (likely(entries)) { victor@0: __pyx_code_cache.entries = entries; victor@0: __pyx_code_cache.max_count = 64; victor@0: __pyx_code_cache.count = 1; victor@0: entries[0].code_line = code_line; victor@0: entries[0].code_object = code_object; victor@0: Py_INCREF(code_object); victor@0: } victor@0: return; victor@0: } victor@0: pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); victor@0: if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { victor@0: PyCodeObject* tmp = entries[pos].code_object; victor@0: entries[pos].code_object = code_object; victor@0: Py_DECREF(tmp); victor@0: return; victor@0: } victor@0: if (__pyx_code_cache.count == __pyx_code_cache.max_count) { victor@0: int new_max = __pyx_code_cache.max_count + 64; victor@0: entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( victor@0: __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); victor@0: if (unlikely(!entries)) { victor@0: return; victor@0: } victor@0: __pyx_code_cache.entries = entries; victor@0: __pyx_code_cache.max_count = new_max; victor@0: } victor@0: for (i=__pyx_code_cache.count; i>pos; i--) { victor@0: entries[i] = entries[i-1]; victor@0: } victor@0: entries[pos].code_line = code_line; victor@0: entries[pos].code_object = code_object; victor@0: __pyx_code_cache.count++; victor@0: Py_INCREF(code_object); victor@0: } victor@0: victor@0: #include "compile.h" victor@0: #include "frameobject.h" victor@0: #include "traceback.h" victor@0: static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( victor@0: const char *funcname, int c_line, victor@0: int py_line, const char *filename) { victor@0: PyCodeObject *py_code = 0; victor@0: PyObject *py_srcfile = 0; victor@0: PyObject *py_funcname = 0; victor@0: #if PY_MAJOR_VERSION < 3 victor@0: py_srcfile = PyString_FromString(filename); victor@0: #else victor@0: py_srcfile = PyUnicode_FromString(filename); victor@0: #endif victor@0: if (!py_srcfile) goto bad; victor@0: if (c_line) { victor@0: #if PY_MAJOR_VERSION < 3 victor@0: py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); victor@0: #else victor@0: py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); victor@0: #endif victor@0: } victor@0: else { victor@0: #if PY_MAJOR_VERSION < 3 victor@0: py_funcname = PyString_FromString(funcname); victor@0: #else victor@0: py_funcname = PyUnicode_FromString(funcname); victor@0: #endif victor@0: } victor@0: if (!py_funcname) goto bad; victor@0: py_code = __Pyx_PyCode_New( victor@0: 0, /*int argcount,*/ victor@0: 0, /*int kwonlyargcount,*/ victor@0: 0, /*int nlocals,*/ victor@0: 0, /*int stacksize,*/ victor@0: 0, /*int flags,*/ victor@0: __pyx_empty_bytes, /*PyObject *code,*/ victor@0: __pyx_empty_tuple, /*PyObject *consts,*/ victor@0: __pyx_empty_tuple, /*PyObject *names,*/ victor@0: __pyx_empty_tuple, /*PyObject *varnames,*/ victor@0: __pyx_empty_tuple, /*PyObject *freevars,*/ victor@0: __pyx_empty_tuple, /*PyObject *cellvars,*/ victor@0: py_srcfile, /*PyObject *filename,*/ victor@0: py_funcname, /*PyObject *name,*/ victor@0: py_line, /*int firstlineno,*/ victor@0: __pyx_empty_bytes /*PyObject *lnotab*/ victor@0: ); victor@0: Py_DECREF(py_srcfile); victor@0: Py_DECREF(py_funcname); victor@0: return py_code; victor@0: bad: victor@0: Py_XDECREF(py_srcfile); victor@0: Py_XDECREF(py_funcname); victor@0: return NULL; victor@0: } victor@0: static void __Pyx_AddTraceback(const char *funcname, int c_line, victor@0: int py_line, const char *filename) { victor@0: PyCodeObject *py_code = 0; victor@0: PyObject *py_globals = 0; victor@0: PyFrameObject *py_frame = 0; victor@0: py_code = __pyx_find_code_object(c_line ? c_line : py_line); victor@0: if (!py_code) { victor@0: py_code = __Pyx_CreateCodeObjectForTraceback( victor@0: funcname, c_line, py_line, filename); victor@0: if (!py_code) goto bad; victor@0: __pyx_insert_code_object(c_line ? c_line : py_line, py_code); victor@0: } victor@0: py_globals = PyModule_GetDict(__pyx_m); victor@0: if (!py_globals) goto bad; victor@0: py_frame = PyFrame_New( victor@0: PyThreadState_GET(), /*PyThreadState *tstate,*/ victor@0: py_code, /*PyCodeObject *code,*/ victor@0: py_globals, /*PyObject *globals,*/ victor@0: 0 /*PyObject *locals*/ victor@0: ); victor@0: if (!py_frame) goto bad; victor@0: py_frame->f_lineno = py_line; victor@0: PyTraceBack_Here(py_frame); victor@0: bad: victor@0: Py_XDECREF(py_code); victor@0: Py_XDECREF(py_frame); victor@0: } victor@0: victor@0: static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { victor@0: while (t->p) { victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (t->is_unicode) { victor@0: *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); victor@0: } else if (t->intern) { victor@0: *t->p = PyString_InternFromString(t->s); victor@0: } else { victor@0: *t->p = PyString_FromStringAndSize(t->s, t->n - 1); victor@0: } victor@0: #else /* Python 3+ has unicode identifiers */ victor@0: if (t->is_unicode | t->is_str) { victor@0: if (t->intern) { victor@0: *t->p = PyUnicode_InternFromString(t->s); victor@0: } else if (t->encoding) { victor@0: *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); victor@0: } else { victor@0: *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); victor@0: } victor@0: } else { victor@0: *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); victor@0: } victor@0: #endif victor@0: if (!*t->p) victor@0: return -1; victor@0: ++t; victor@0: } victor@0: return 0; victor@0: } victor@0: victor@0: static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { victor@0: return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); victor@0: } victor@0: static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { victor@0: Py_ssize_t ignore; victor@0: return __Pyx_PyObject_AsStringAndSize(o, &ignore); victor@0: } victor@0: static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { victor@0: #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT victor@0: if ( victor@0: #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII victor@0: __Pyx_sys_getdefaultencoding_not_ascii && victor@0: #endif victor@0: PyUnicode_Check(o)) { victor@0: #if PY_VERSION_HEX < 0x03030000 victor@0: char* defenc_c; victor@0: PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); victor@0: if (!defenc) return NULL; victor@0: defenc_c = PyBytes_AS_STRING(defenc); victor@0: #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII victor@0: { victor@0: char* end = defenc_c + PyBytes_GET_SIZE(defenc); victor@0: char* c; victor@0: for (c = defenc_c; c < end; c++) { victor@0: if ((unsigned char) (*c) >= 128) { victor@0: PyUnicode_AsASCIIString(o); victor@0: return NULL; victor@0: } victor@0: } victor@0: } victor@0: #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ victor@0: *length = PyBytes_GET_SIZE(defenc); victor@0: return defenc_c; victor@0: #else /* PY_VERSION_HEX < 0x03030000 */ victor@0: if (PyUnicode_READY(o) == -1) return NULL; victor@0: #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII victor@0: if (PyUnicode_IS_ASCII(o)) { victor@0: *length = PyUnicode_GET_LENGTH(o); victor@0: return PyUnicode_AsUTF8(o); victor@0: } else { victor@0: PyUnicode_AsASCIIString(o); victor@0: return NULL; victor@0: } victor@0: #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ victor@0: return PyUnicode_AsUTF8AndSize(o, length); victor@0: #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ victor@0: #endif /* PY_VERSION_HEX < 0x03030000 */ victor@0: } else victor@0: #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ victor@0: #if !CYTHON_COMPILING_IN_PYPY victor@0: #if PY_VERSION_HEX >= 0x02060000 victor@0: if (PyByteArray_Check(o)) { victor@0: *length = PyByteArray_GET_SIZE(o); victor@0: return PyByteArray_AS_STRING(o); victor@0: } else victor@0: #endif victor@0: #endif victor@0: { victor@0: char* result; victor@0: int r = PyBytes_AsStringAndSize(o, &result, length); victor@0: if (unlikely(r < 0)) { victor@0: return NULL; victor@0: } else { victor@0: return result; victor@0: } victor@0: } victor@0: } victor@0: static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { victor@0: int is_true = x == Py_True; victor@0: if (is_true | (x == Py_False) | (x == Py_None)) return is_true; victor@0: else return PyObject_IsTrue(x); victor@0: } victor@0: static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { victor@0: PyNumberMethods *m; victor@0: const char *name = NULL; victor@0: PyObject *res = NULL; victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (PyInt_Check(x) || PyLong_Check(x)) victor@0: #else victor@0: if (PyLong_Check(x)) victor@0: #endif victor@0: return Py_INCREF(x), x; victor@0: m = Py_TYPE(x)->tp_as_number; victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (m && m->nb_int) { victor@0: name = "int"; victor@0: res = PyNumber_Int(x); victor@0: } victor@0: else if (m && m->nb_long) { victor@0: name = "long"; victor@0: res = PyNumber_Long(x); victor@0: } victor@0: #else victor@0: if (m && m->nb_int) { victor@0: name = "int"; victor@0: res = PyNumber_Long(x); victor@0: } victor@0: #endif victor@0: if (res) { victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (!PyInt_Check(res) && !PyLong_Check(res)) { victor@0: #else victor@0: if (!PyLong_Check(res)) { victor@0: #endif victor@0: PyErr_Format(PyExc_TypeError, victor@0: "__%.4s__ returned non-%.4s (type %.200s)", victor@0: name, name, Py_TYPE(res)->tp_name); victor@0: Py_DECREF(res); victor@0: return NULL; victor@0: } victor@0: } victor@0: else if (!PyErr_Occurred()) { victor@0: PyErr_SetString(PyExc_TypeError, victor@0: "an integer is required"); victor@0: } victor@0: return res; victor@0: } victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: #include "longintrepr.h" victor@0: #endif victor@0: #endif victor@0: static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { victor@0: Py_ssize_t ival; victor@0: PyObject *x; victor@0: #if PY_MAJOR_VERSION < 3 victor@0: if (likely(PyInt_CheckExact(b))) victor@0: return PyInt_AS_LONG(b); victor@0: #endif victor@0: if (likely(PyLong_CheckExact(b))) { victor@0: #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 victor@0: #if CYTHON_USE_PYLONG_INTERNALS victor@0: switch (Py_SIZE(b)) { victor@0: case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; victor@0: case 0: return 0; victor@0: case 1: return ((PyLongObject*)b)->ob_digit[0]; victor@0: } victor@0: #endif victor@0: #endif victor@0: #if PY_VERSION_HEX < 0x02060000 victor@0: return PyInt_AsSsize_t(b); victor@0: #else victor@0: return PyLong_AsSsize_t(b); victor@0: #endif victor@0: } victor@0: x = PyNumber_Index(b); victor@0: if (!x) return -1; victor@0: ival = PyInt_AsSsize_t(x); victor@0: Py_DECREF(x); victor@0: return ival; victor@0: } victor@0: static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { victor@0: #if PY_VERSION_HEX < 0x02050000 victor@0: if (ival <= LONG_MAX) victor@0: return PyInt_FromLong((long)ival); victor@0: else { victor@0: unsigned char *bytes = (unsigned char *) &ival; victor@0: int one = 1; int little = (int)*(unsigned char*)&one; victor@0: return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); victor@0: } victor@0: #else victor@0: return PyInt_FromSize_t(ival); victor@0: #endif victor@0: } victor@0: victor@0: victor@0: #endif /* Py_PYTHON_H */