victor@0
|
1 /* Generated by Cython 0.20.2 on Fri Dec 12 12:34:51 2014 */
|
victor@0
|
2
|
victor@0
|
3 #define PY_SSIZE_T_CLEAN
|
victor@0
|
4 #ifndef CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
5 #ifdef PYLONG_BITS_IN_DIGIT
|
victor@0
|
6 #define CYTHON_USE_PYLONG_INTERNALS 0
|
victor@0
|
7 #else
|
victor@0
|
8 #include "pyconfig.h"
|
victor@0
|
9 #ifdef PYLONG_BITS_IN_DIGIT
|
victor@0
|
10 #define CYTHON_USE_PYLONG_INTERNALS 1
|
victor@0
|
11 #else
|
victor@0
|
12 #define CYTHON_USE_PYLONG_INTERNALS 0
|
victor@0
|
13 #endif
|
victor@0
|
14 #endif
|
victor@0
|
15 #endif
|
victor@0
|
16 #include "Python.h"
|
victor@0
|
17 #ifndef Py_PYTHON_H
|
victor@0
|
18 #error Python headers needed to compile C extensions, please install development version of Python.
|
victor@0
|
19 #elif PY_VERSION_HEX < 0x02040000
|
victor@0
|
20 #error Cython requires Python 2.4+.
|
victor@0
|
21 #else
|
victor@0
|
22 #define CYTHON_ABI "0_20_2"
|
victor@0
|
23 #include <stddef.h> /* For offsetof */
|
victor@0
|
24 #ifndef offsetof
|
victor@0
|
25 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
|
victor@0
|
26 #endif
|
victor@0
|
27 #if !defined(WIN32) && !defined(MS_WINDOWS)
|
victor@0
|
28 #ifndef __stdcall
|
victor@0
|
29 #define __stdcall
|
victor@0
|
30 #endif
|
victor@0
|
31 #ifndef __cdecl
|
victor@0
|
32 #define __cdecl
|
victor@0
|
33 #endif
|
victor@0
|
34 #ifndef __fastcall
|
victor@0
|
35 #define __fastcall
|
victor@0
|
36 #endif
|
victor@0
|
37 #endif
|
victor@0
|
38 #ifndef DL_IMPORT
|
victor@0
|
39 #define DL_IMPORT(t) t
|
victor@0
|
40 #endif
|
victor@0
|
41 #ifndef DL_EXPORT
|
victor@0
|
42 #define DL_EXPORT(t) t
|
victor@0
|
43 #endif
|
victor@0
|
44 #ifndef PY_LONG_LONG
|
victor@0
|
45 #define PY_LONG_LONG LONG_LONG
|
victor@0
|
46 #endif
|
victor@0
|
47 #ifndef Py_HUGE_VAL
|
victor@0
|
48 #define Py_HUGE_VAL HUGE_VAL
|
victor@0
|
49 #endif
|
victor@0
|
50 #ifdef PYPY_VERSION
|
victor@0
|
51 #define CYTHON_COMPILING_IN_PYPY 1
|
victor@0
|
52 #define CYTHON_COMPILING_IN_CPYTHON 0
|
victor@0
|
53 #else
|
victor@0
|
54 #define CYTHON_COMPILING_IN_PYPY 0
|
victor@0
|
55 #define CYTHON_COMPILING_IN_CPYTHON 1
|
victor@0
|
56 #endif
|
victor@0
|
57 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600
|
victor@0
|
58 #define Py_OptimizeFlag 0
|
victor@0
|
59 #endif
|
victor@0
|
60 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
61 typedef int Py_ssize_t;
|
victor@0
|
62 #define PY_SSIZE_T_MAX INT_MAX
|
victor@0
|
63 #define PY_SSIZE_T_MIN INT_MIN
|
victor@0
|
64 #define PY_FORMAT_SIZE_T ""
|
victor@0
|
65 #define CYTHON_FORMAT_SSIZE_T ""
|
victor@0
|
66 #define PyInt_FromSsize_t(z) PyInt_FromLong(z)
|
victor@0
|
67 #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o)
|
victor@0
|
68 #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \
|
victor@0
|
69 (PyErr_Format(PyExc_TypeError, \
|
victor@0
|
70 "expected index value, got %.200s", Py_TYPE(o)->tp_name), \
|
victor@0
|
71 (PyObject*)0))
|
victor@0
|
72 #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \
|
victor@0
|
73 !PyComplex_Check(o))
|
victor@0
|
74 #define PyIndex_Check __Pyx_PyIndex_Check
|
victor@0
|
75 #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message)
|
victor@0
|
76 #define __PYX_BUILD_PY_SSIZE_T "i"
|
victor@0
|
77 #else
|
victor@0
|
78 #define __PYX_BUILD_PY_SSIZE_T "n"
|
victor@0
|
79 #define CYTHON_FORMAT_SSIZE_T "z"
|
victor@0
|
80 #define __Pyx_PyIndex_Check PyIndex_Check
|
victor@0
|
81 #endif
|
victor@0
|
82 #if PY_VERSION_HEX < 0x02060000
|
victor@0
|
83 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt)
|
victor@0
|
84 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type)
|
victor@0
|
85 #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size)
|
victor@0
|
86 #define PyVarObject_HEAD_INIT(type, size) \
|
victor@0
|
87 PyObject_HEAD_INIT(type) size,
|
victor@0
|
88 #define PyType_Modified(t)
|
victor@0
|
89 typedef struct {
|
victor@0
|
90 void *buf;
|
victor@0
|
91 PyObject *obj;
|
victor@0
|
92 Py_ssize_t len;
|
victor@0
|
93 Py_ssize_t itemsize;
|
victor@0
|
94 int readonly;
|
victor@0
|
95 int ndim;
|
victor@0
|
96 char *format;
|
victor@0
|
97 Py_ssize_t *shape;
|
victor@0
|
98 Py_ssize_t *strides;
|
victor@0
|
99 Py_ssize_t *suboffsets;
|
victor@0
|
100 void *internal;
|
victor@0
|
101 } Py_buffer;
|
victor@0
|
102 #define PyBUF_SIMPLE 0
|
victor@0
|
103 #define PyBUF_WRITABLE 0x0001
|
victor@0
|
104 #define PyBUF_FORMAT 0x0004
|
victor@0
|
105 #define PyBUF_ND 0x0008
|
victor@0
|
106 #define PyBUF_STRIDES (0x0010 | PyBUF_ND)
|
victor@0
|
107 #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES)
|
victor@0
|
108 #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES)
|
victor@0
|
109 #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES)
|
victor@0
|
110 #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES)
|
victor@0
|
111 #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE)
|
victor@0
|
112 #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE)
|
victor@0
|
113 typedef int (*getbufferproc)(PyObject *, Py_buffer *, int);
|
victor@0
|
114 typedef void (*releasebufferproc)(PyObject *, Py_buffer *);
|
victor@0
|
115 #endif
|
victor@0
|
116 #if PY_MAJOR_VERSION < 3
|
victor@0
|
117 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
|
victor@0
|
118 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
|
victor@0
|
119 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
victor@0
|
120 #define __Pyx_DefaultClassType PyClass_Type
|
victor@0
|
121 #else
|
victor@0
|
122 #define __Pyx_BUILTIN_MODULE_NAME "builtins"
|
victor@0
|
123 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
|
victor@0
|
124 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
|
victor@0
|
125 #define __Pyx_DefaultClassType PyType_Type
|
victor@0
|
126 #endif
|
victor@0
|
127 #if PY_VERSION_HEX < 0x02060000
|
victor@0
|
128 #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict")
|
victor@0
|
129 #endif
|
victor@0
|
130 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
131 #define Py_TPFLAGS_CHECKTYPES 0
|
victor@0
|
132 #define Py_TPFLAGS_HAVE_INDEX 0
|
victor@0
|
133 #endif
|
victor@0
|
134 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3)
|
victor@0
|
135 #define Py_TPFLAGS_HAVE_NEWBUFFER 0
|
victor@0
|
136 #endif
|
victor@0
|
137 #if PY_VERSION_HEX < 0x02060000
|
victor@0
|
138 #define Py_TPFLAGS_HAVE_VERSION_TAG 0
|
victor@0
|
139 #endif
|
victor@0
|
140 #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT)
|
victor@0
|
141 #define Py_TPFLAGS_IS_ABSTRACT 0
|
victor@0
|
142 #endif
|
victor@0
|
143 #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE)
|
victor@0
|
144 #define Py_TPFLAGS_HAVE_FINALIZE 0
|
victor@0
|
145 #endif
|
victor@0
|
146 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
|
victor@0
|
147 #define CYTHON_PEP393_ENABLED 1
|
victor@0
|
148 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \
|
victor@0
|
149 0 : _PyUnicode_Ready((PyObject *)(op)))
|
victor@0
|
150 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
|
victor@0
|
151 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
|
victor@0
|
152 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
|
victor@0
|
153 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
|
victor@0
|
154 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
|
victor@0
|
155 #else
|
victor@0
|
156 #define CYTHON_PEP393_ENABLED 0
|
victor@0
|
157 #define __Pyx_PyUnicode_READY(op) (0)
|
victor@0
|
158 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
|
victor@0
|
159 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
|
victor@0
|
160 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
|
victor@0
|
161 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
|
victor@0
|
162 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
|
victor@0
|
163 #endif
|
victor@0
|
164 #if CYTHON_COMPILING_IN_PYPY
|
victor@0
|
165 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
|
victor@0
|
166 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
|
victor@0
|
167 #else
|
victor@0
|
168 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
|
victor@0
|
169 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \
|
victor@0
|
170 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
|
victor@0
|
171 #endif
|
victor@0
|
172 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
|
victor@0
|
173 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
|
victor@0
|
174 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
175 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
|
victor@0
|
176 #else
|
victor@0
|
177 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
|
victor@0
|
178 #endif
|
victor@0
|
179 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
180 #define PyBaseString_Type PyUnicode_Type
|
victor@0
|
181 #define PyStringObject PyUnicodeObject
|
victor@0
|
182 #define PyString_Type PyUnicode_Type
|
victor@0
|
183 #define PyString_Check PyUnicode_Check
|
victor@0
|
184 #define PyString_CheckExact PyUnicode_CheckExact
|
victor@0
|
185 #endif
|
victor@0
|
186 #if PY_VERSION_HEX < 0x02060000
|
victor@0
|
187 #define PyBytesObject PyStringObject
|
victor@0
|
188 #define PyBytes_Type PyString_Type
|
victor@0
|
189 #define PyBytes_Check PyString_Check
|
victor@0
|
190 #define PyBytes_CheckExact PyString_CheckExact
|
victor@0
|
191 #define PyBytes_FromString PyString_FromString
|
victor@0
|
192 #define PyBytes_FromStringAndSize PyString_FromStringAndSize
|
victor@0
|
193 #define PyBytes_FromFormat PyString_FromFormat
|
victor@0
|
194 #define PyBytes_DecodeEscape PyString_DecodeEscape
|
victor@0
|
195 #define PyBytes_AsString PyString_AsString
|
victor@0
|
196 #define PyBytes_AsStringAndSize PyString_AsStringAndSize
|
victor@0
|
197 #define PyBytes_Size PyString_Size
|
victor@0
|
198 #define PyBytes_AS_STRING PyString_AS_STRING
|
victor@0
|
199 #define PyBytes_GET_SIZE PyString_GET_SIZE
|
victor@0
|
200 #define PyBytes_Repr PyString_Repr
|
victor@0
|
201 #define PyBytes_Concat PyString_Concat
|
victor@0
|
202 #define PyBytes_ConcatAndDel PyString_ConcatAndDel
|
victor@0
|
203 #endif
|
victor@0
|
204 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
205 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
|
victor@0
|
206 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
|
victor@0
|
207 #else
|
victor@0
|
208 #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \
|
victor@0
|
209 PyString_Check(obj) || PyUnicode_Check(obj))
|
victor@0
|
210 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
|
victor@0
|
211 #endif
|
victor@0
|
212 #if PY_VERSION_HEX < 0x02060000
|
victor@0
|
213 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type)
|
victor@0
|
214 #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type)
|
victor@0
|
215 #endif
|
victor@0
|
216 #ifndef PySet_CheckExact
|
victor@0
|
217 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
|
victor@0
|
218 #endif
|
victor@0
|
219 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
|
victor@0
|
220 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
221 #define PyIntObject PyLongObject
|
victor@0
|
222 #define PyInt_Type PyLong_Type
|
victor@0
|
223 #define PyInt_Check(op) PyLong_Check(op)
|
victor@0
|
224 #define PyInt_CheckExact(op) PyLong_CheckExact(op)
|
victor@0
|
225 #define PyInt_FromString PyLong_FromString
|
victor@0
|
226 #define PyInt_FromUnicode PyLong_FromUnicode
|
victor@0
|
227 #define PyInt_FromLong PyLong_FromLong
|
victor@0
|
228 #define PyInt_FromSize_t PyLong_FromSize_t
|
victor@0
|
229 #define PyInt_FromSsize_t PyLong_FromSsize_t
|
victor@0
|
230 #define PyInt_AsLong PyLong_AsLong
|
victor@0
|
231 #define PyInt_AS_LONG PyLong_AS_LONG
|
victor@0
|
232 #define PyInt_AsSsize_t PyLong_AsSsize_t
|
victor@0
|
233 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
|
victor@0
|
234 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
|
victor@0
|
235 #define PyNumber_Int PyNumber_Long
|
victor@0
|
236 #endif
|
victor@0
|
237 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
238 #define PyBoolObject PyLongObject
|
victor@0
|
239 #endif
|
victor@0
|
240 #if PY_VERSION_HEX < 0x030200A4
|
victor@0
|
241 typedef long Py_hash_t;
|
victor@0
|
242 #define __Pyx_PyInt_FromHash_t PyInt_FromLong
|
victor@0
|
243 #define __Pyx_PyInt_AsHash_t PyInt_AsLong
|
victor@0
|
244 #else
|
victor@0
|
245 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
|
victor@0
|
246 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
|
victor@0
|
247 #endif
|
victor@0
|
248 #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300)
|
victor@0
|
249 #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b)
|
victor@0
|
250 #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value)
|
victor@0
|
251 #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b)
|
victor@0
|
252 #else
|
victor@0
|
253 #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \
|
victor@0
|
254 (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \
|
victor@0
|
255 (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \
|
victor@0
|
256 (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0)))
|
victor@0
|
257 #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \
|
victor@0
|
258 (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
|
victor@0
|
259 (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \
|
victor@0
|
260 (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1)))
|
victor@0
|
261 #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \
|
victor@0
|
262 (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \
|
victor@0
|
263 (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \
|
victor@0
|
264 (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1)))
|
victor@0
|
265 #endif
|
victor@0
|
266 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
267 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
|
victor@0
|
268 #endif
|
victor@0
|
269 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
270 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n)))
|
victor@0
|
271 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a))
|
victor@0
|
272 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n)))
|
victor@0
|
273 #else
|
victor@0
|
274 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n))
|
victor@0
|
275 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a))
|
victor@0
|
276 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n))
|
victor@0
|
277 #endif
|
victor@0
|
278 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
279 #define __Pyx_NAMESTR(n) ((char *)(n))
|
victor@0
|
280 #define __Pyx_DOCSTR(n) ((char *)(n))
|
victor@0
|
281 #else
|
victor@0
|
282 #define __Pyx_NAMESTR(n) (n)
|
victor@0
|
283 #define __Pyx_DOCSTR(n) (n)
|
victor@0
|
284 #endif
|
victor@0
|
285 #ifndef CYTHON_INLINE
|
victor@0
|
286 #if defined(__GNUC__)
|
victor@0
|
287 #define CYTHON_INLINE __inline__
|
victor@0
|
288 #elif defined(_MSC_VER)
|
victor@0
|
289 #define CYTHON_INLINE __inline
|
victor@0
|
290 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
victor@0
|
291 #define CYTHON_INLINE inline
|
victor@0
|
292 #else
|
victor@0
|
293 #define CYTHON_INLINE
|
victor@0
|
294 #endif
|
victor@0
|
295 #endif
|
victor@0
|
296 #ifndef CYTHON_RESTRICT
|
victor@0
|
297 #if defined(__GNUC__)
|
victor@0
|
298 #define CYTHON_RESTRICT __restrict__
|
victor@0
|
299 #elif defined(_MSC_VER) && _MSC_VER >= 1400
|
victor@0
|
300 #define CYTHON_RESTRICT __restrict
|
victor@0
|
301 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
|
victor@0
|
302 #define CYTHON_RESTRICT restrict
|
victor@0
|
303 #else
|
victor@0
|
304 #define CYTHON_RESTRICT
|
victor@0
|
305 #endif
|
victor@0
|
306 #endif
|
victor@0
|
307 #ifdef NAN
|
victor@0
|
308 #define __PYX_NAN() ((float) NAN)
|
victor@0
|
309 #else
|
victor@0
|
310 static CYTHON_INLINE float __PYX_NAN() {
|
victor@0
|
311 /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and
|
victor@0
|
312 a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is
|
victor@0
|
313 a quiet NaN. */
|
victor@0
|
314 float value;
|
victor@0
|
315 memset(&value, 0xFF, sizeof(value));
|
victor@0
|
316 return value;
|
victor@0
|
317 }
|
victor@0
|
318 #endif
|
victor@0
|
319 #ifdef __cplusplus
|
victor@0
|
320 template<typename T>
|
victor@0
|
321 void __Pyx_call_destructor(T* x) {
|
victor@0
|
322 x->~T();
|
victor@0
|
323 }
|
victor@0
|
324 #endif
|
victor@0
|
325
|
victor@0
|
326
|
victor@0
|
327 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
328 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
|
victor@0
|
329 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
|
victor@0
|
330 #else
|
victor@0
|
331 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
|
victor@0
|
332 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
|
victor@0
|
333 #endif
|
victor@0
|
334
|
victor@0
|
335 #ifndef __PYX_EXTERN_C
|
victor@0
|
336 #ifdef __cplusplus
|
victor@0
|
337 #define __PYX_EXTERN_C extern "C"
|
victor@0
|
338 #else
|
victor@0
|
339 #define __PYX_EXTERN_C extern
|
victor@0
|
340 #endif
|
victor@0
|
341 #endif
|
victor@0
|
342
|
victor@0
|
343 #if defined(WIN32) || defined(MS_WINDOWS)
|
victor@0
|
344 #define _USE_MATH_DEFINES
|
victor@0
|
345 #endif
|
victor@0
|
346 #include <math.h>
|
victor@0
|
347 #define __PYX_HAVE__MultipleOMR__Alignment__FastAlignmentArrays
|
victor@0
|
348 #define __PYX_HAVE_API__MultipleOMR__Alignment__FastAlignmentArrays
|
victor@0
|
349 #include "string.h"
|
victor@0
|
350 #include "stdio.h"
|
victor@0
|
351 #include "stdlib.h"
|
victor@0
|
352 #include "numpy/arrayobject.h"
|
victor@0
|
353 #include "numpy/ufuncobject.h"
|
victor@0
|
354 #include "pythread.h"
|
victor@0
|
355 #ifdef _OPENMP
|
victor@0
|
356 #include <omp.h>
|
victor@0
|
357 #endif /* _OPENMP */
|
victor@0
|
358
|
victor@0
|
359 #ifdef PYREX_WITHOUT_ASSERTIONS
|
victor@0
|
360 #define CYTHON_WITHOUT_ASSERTIONS
|
victor@0
|
361 #endif
|
victor@0
|
362
|
victor@0
|
363 #ifndef CYTHON_UNUSED
|
victor@0
|
364 # if defined(__GNUC__)
|
victor@0
|
365 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
|
victor@0
|
366 # define CYTHON_UNUSED __attribute__ ((__unused__))
|
victor@0
|
367 # else
|
victor@0
|
368 # define CYTHON_UNUSED
|
victor@0
|
369 # endif
|
victor@0
|
370 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
|
victor@0
|
371 # define CYTHON_UNUSED __attribute__ ((__unused__))
|
victor@0
|
372 # else
|
victor@0
|
373 # define CYTHON_UNUSED
|
victor@0
|
374 # endif
|
victor@0
|
375 #endif
|
victor@0
|
376 typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding;
|
victor@0
|
377 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/
|
victor@0
|
378
|
victor@0
|
379 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
|
victor@0
|
380 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
|
victor@0
|
381 #define __PYX_DEFAULT_STRING_ENCODING ""
|
victor@0
|
382 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
|
victor@0
|
383 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
victor@0
|
384 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \
|
victor@0
|
385 (sizeof(type) < sizeof(Py_ssize_t)) || \
|
victor@0
|
386 (sizeof(type) > sizeof(Py_ssize_t) && \
|
victor@0
|
387 likely(v < (type)PY_SSIZE_T_MAX || \
|
victor@0
|
388 v == (type)PY_SSIZE_T_MAX) && \
|
victor@0
|
389 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \
|
victor@0
|
390 v == (type)PY_SSIZE_T_MIN))) || \
|
victor@0
|
391 (sizeof(type) == sizeof(Py_ssize_t) && \
|
victor@0
|
392 (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \
|
victor@0
|
393 v == (type)PY_SSIZE_T_MAX))) )
|
victor@0
|
394 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
|
victor@0
|
395 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
|
victor@0
|
396 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
|
victor@0
|
397 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
|
victor@0
|
398 #define __Pyx_PyBytes_FromString PyBytes_FromString
|
victor@0
|
399 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
|
victor@0
|
400 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
|
victor@0
|
401 #if PY_MAJOR_VERSION < 3
|
victor@0
|
402 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
|
victor@0
|
403 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
|
victor@0
|
404 #else
|
victor@0
|
405 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
|
victor@0
|
406 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
|
victor@0
|
407 #endif
|
victor@0
|
408 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
|
victor@0
|
409 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
|
victor@0
|
410 #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s)
|
victor@0
|
411 #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s)
|
victor@0
|
412 #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s)
|
victor@0
|
413 #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s)
|
victor@0
|
414 #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s)
|
victor@0
|
415 #if PY_MAJOR_VERSION < 3
|
victor@0
|
416 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
|
victor@0
|
417 {
|
victor@0
|
418 const Py_UNICODE *u_end = u;
|
victor@0
|
419 while (*u_end++) ;
|
victor@0
|
420 return (size_t)(u_end - u - 1);
|
victor@0
|
421 }
|
victor@0
|
422 #else
|
victor@0
|
423 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
|
victor@0
|
424 #endif
|
victor@0
|
425 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
|
victor@0
|
426 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
|
victor@0
|
427 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
|
victor@0
|
428 #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None)
|
victor@0
|
429 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False))
|
victor@0
|
430 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
|
victor@0
|
431 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x);
|
victor@0
|
432 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
|
victor@0
|
433 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
|
victor@0
|
434 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
435 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
|
victor@0
|
436 #else
|
victor@0
|
437 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
|
victor@0
|
438 #endif
|
victor@0
|
439 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
|
victor@0
|
440 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
victor@0
|
441 static int __Pyx_sys_getdefaultencoding_not_ascii;
|
victor@0
|
442 static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
victor@0
|
443 PyObject* sys;
|
victor@0
|
444 PyObject* default_encoding = NULL;
|
victor@0
|
445 PyObject* ascii_chars_u = NULL;
|
victor@0
|
446 PyObject* ascii_chars_b = NULL;
|
victor@0
|
447 const char* default_encoding_c;
|
victor@0
|
448 sys = PyImport_ImportModule("sys");
|
victor@0
|
449 if (!sys) goto bad;
|
victor@0
|
450 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
|
victor@0
|
451 Py_DECREF(sys);
|
victor@0
|
452 if (!default_encoding) goto bad;
|
victor@0
|
453 default_encoding_c = PyBytes_AsString(default_encoding);
|
victor@0
|
454 if (!default_encoding_c) goto bad;
|
victor@0
|
455 if (strcmp(default_encoding_c, "ascii") == 0) {
|
victor@0
|
456 __Pyx_sys_getdefaultencoding_not_ascii = 0;
|
victor@0
|
457 } else {
|
victor@0
|
458 char ascii_chars[128];
|
victor@0
|
459 int c;
|
victor@0
|
460 for (c = 0; c < 128; c++) {
|
victor@0
|
461 ascii_chars[c] = c;
|
victor@0
|
462 }
|
victor@0
|
463 __Pyx_sys_getdefaultencoding_not_ascii = 1;
|
victor@0
|
464 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
|
victor@0
|
465 if (!ascii_chars_u) goto bad;
|
victor@0
|
466 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
|
victor@0
|
467 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
|
victor@0
|
468 PyErr_Format(
|
victor@0
|
469 PyExc_ValueError,
|
victor@0
|
470 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
|
victor@0
|
471 default_encoding_c);
|
victor@0
|
472 goto bad;
|
victor@0
|
473 }
|
victor@0
|
474 Py_DECREF(ascii_chars_u);
|
victor@0
|
475 Py_DECREF(ascii_chars_b);
|
victor@0
|
476 }
|
victor@0
|
477 Py_DECREF(default_encoding);
|
victor@0
|
478 return 0;
|
victor@0
|
479 bad:
|
victor@0
|
480 Py_XDECREF(default_encoding);
|
victor@0
|
481 Py_XDECREF(ascii_chars_u);
|
victor@0
|
482 Py_XDECREF(ascii_chars_b);
|
victor@0
|
483 return -1;
|
victor@0
|
484 }
|
victor@0
|
485 #endif
|
victor@0
|
486 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
|
victor@0
|
487 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
|
victor@0
|
488 #else
|
victor@0
|
489 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
|
victor@0
|
490 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
victor@0
|
491 static char* __PYX_DEFAULT_STRING_ENCODING;
|
victor@0
|
492 static int __Pyx_init_sys_getdefaultencoding_params(void) {
|
victor@0
|
493 PyObject* sys;
|
victor@0
|
494 PyObject* default_encoding = NULL;
|
victor@0
|
495 char* default_encoding_c;
|
victor@0
|
496 sys = PyImport_ImportModule("sys");
|
victor@0
|
497 if (!sys) goto bad;
|
victor@0
|
498 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
|
victor@0
|
499 Py_DECREF(sys);
|
victor@0
|
500 if (!default_encoding) goto bad;
|
victor@0
|
501 default_encoding_c = PyBytes_AsString(default_encoding);
|
victor@0
|
502 if (!default_encoding_c) goto bad;
|
victor@0
|
503 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
|
victor@0
|
504 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
|
victor@0
|
505 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
|
victor@0
|
506 Py_DECREF(default_encoding);
|
victor@0
|
507 return 0;
|
victor@0
|
508 bad:
|
victor@0
|
509 Py_XDECREF(default_encoding);
|
victor@0
|
510 return -1;
|
victor@0
|
511 }
|
victor@0
|
512 #endif
|
victor@0
|
513 #endif
|
victor@0
|
514
|
victor@0
|
515
|
victor@0
|
516 /* Test for GCC > 2.95 */
|
victor@0
|
517 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
|
victor@0
|
518 #define likely(x) __builtin_expect(!!(x), 1)
|
victor@0
|
519 #define unlikely(x) __builtin_expect(!!(x), 0)
|
victor@0
|
520 #else /* !__GNUC__ or GCC < 2.95 */
|
victor@0
|
521 #define likely(x) (x)
|
victor@0
|
522 #define unlikely(x) (x)
|
victor@0
|
523 #endif /* __GNUC__ */
|
victor@0
|
524
|
victor@0
|
525 static PyObject *__pyx_m;
|
victor@0
|
526 static PyObject *__pyx_d;
|
victor@0
|
527 static PyObject *__pyx_b;
|
victor@0
|
528 static PyObject *__pyx_empty_tuple;
|
victor@0
|
529 static PyObject *__pyx_empty_bytes;
|
victor@0
|
530 static int __pyx_lineno;
|
victor@0
|
531 static int __pyx_clineno = 0;
|
victor@0
|
532 static const char * __pyx_cfilenm= __FILE__;
|
victor@0
|
533 static const char *__pyx_filename;
|
victor@0
|
534
|
victor@0
|
535 #if !defined(CYTHON_CCOMPLEX)
|
victor@0
|
536 #if defined(__cplusplus)
|
victor@0
|
537 #define CYTHON_CCOMPLEX 1
|
victor@0
|
538 #elif defined(_Complex_I)
|
victor@0
|
539 #define CYTHON_CCOMPLEX 1
|
victor@0
|
540 #else
|
victor@0
|
541 #define CYTHON_CCOMPLEX 0
|
victor@0
|
542 #endif
|
victor@0
|
543 #endif
|
victor@0
|
544 #if CYTHON_CCOMPLEX
|
victor@0
|
545 #ifdef __cplusplus
|
victor@0
|
546 #include <complex>
|
victor@0
|
547 #else
|
victor@0
|
548 #include <complex.h>
|
victor@0
|
549 #endif
|
victor@0
|
550 #endif
|
victor@0
|
551 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
|
victor@0
|
552 #undef _Complex_I
|
victor@0
|
553 #define _Complex_I 1.0fj
|
victor@0
|
554 #endif
|
victor@0
|
555
|
victor@0
|
556
|
victor@0
|
557 static const char *__pyx_f[] = {
|
victor@0
|
558 "FastAlignmentArrays.pyx",
|
victor@0
|
559 "__init__.pxd",
|
victor@0
|
560 "type.pxd",
|
victor@0
|
561 "bool.pxd",
|
victor@0
|
562 "complex.pxd",
|
victor@0
|
563 };
|
victor@0
|
564
|
victor@0
|
565 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":723
|
victor@0
|
566 * # in Cython to enable them only on the right systems.
|
victor@0
|
567 *
|
victor@0
|
568 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
|
victor@0
|
569 * ctypedef npy_int16 int16_t
|
victor@0
|
570 * ctypedef npy_int32 int32_t
|
victor@0
|
571 */
|
victor@0
|
572 typedef npy_int8 __pyx_t_5numpy_int8_t;
|
victor@0
|
573
|
victor@0
|
574 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":724
|
victor@0
|
575 *
|
victor@0
|
576 * ctypedef npy_int8 int8_t
|
victor@0
|
577 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
|
victor@0
|
578 * ctypedef npy_int32 int32_t
|
victor@0
|
579 * ctypedef npy_int64 int64_t
|
victor@0
|
580 */
|
victor@0
|
581 typedef npy_int16 __pyx_t_5numpy_int16_t;
|
victor@0
|
582
|
victor@0
|
583 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":725
|
victor@0
|
584 * ctypedef npy_int8 int8_t
|
victor@0
|
585 * ctypedef npy_int16 int16_t
|
victor@0
|
586 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
|
victor@0
|
587 * ctypedef npy_int64 int64_t
|
victor@0
|
588 * #ctypedef npy_int96 int96_t
|
victor@0
|
589 */
|
victor@0
|
590 typedef npy_int32 __pyx_t_5numpy_int32_t;
|
victor@0
|
591
|
victor@0
|
592 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":726
|
victor@0
|
593 * ctypedef npy_int16 int16_t
|
victor@0
|
594 * ctypedef npy_int32 int32_t
|
victor@0
|
595 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
|
victor@0
|
596 * #ctypedef npy_int96 int96_t
|
victor@0
|
597 * #ctypedef npy_int128 int128_t
|
victor@0
|
598 */
|
victor@0
|
599 typedef npy_int64 __pyx_t_5numpy_int64_t;
|
victor@0
|
600
|
victor@0
|
601 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":730
|
victor@0
|
602 * #ctypedef npy_int128 int128_t
|
victor@0
|
603 *
|
victor@0
|
604 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
|
victor@0
|
605 * ctypedef npy_uint16 uint16_t
|
victor@0
|
606 * ctypedef npy_uint32 uint32_t
|
victor@0
|
607 */
|
victor@0
|
608 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
|
victor@0
|
609
|
victor@0
|
610 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":731
|
victor@0
|
611 *
|
victor@0
|
612 * ctypedef npy_uint8 uint8_t
|
victor@0
|
613 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
|
victor@0
|
614 * ctypedef npy_uint32 uint32_t
|
victor@0
|
615 * ctypedef npy_uint64 uint64_t
|
victor@0
|
616 */
|
victor@0
|
617 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
|
victor@0
|
618
|
victor@0
|
619 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":732
|
victor@0
|
620 * ctypedef npy_uint8 uint8_t
|
victor@0
|
621 * ctypedef npy_uint16 uint16_t
|
victor@0
|
622 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
|
victor@0
|
623 * ctypedef npy_uint64 uint64_t
|
victor@0
|
624 * #ctypedef npy_uint96 uint96_t
|
victor@0
|
625 */
|
victor@0
|
626 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
|
victor@0
|
627
|
victor@0
|
628 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":733
|
victor@0
|
629 * ctypedef npy_uint16 uint16_t
|
victor@0
|
630 * ctypedef npy_uint32 uint32_t
|
victor@0
|
631 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
|
victor@0
|
632 * #ctypedef npy_uint96 uint96_t
|
victor@0
|
633 * #ctypedef npy_uint128 uint128_t
|
victor@0
|
634 */
|
victor@0
|
635 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
|
victor@0
|
636
|
victor@0
|
637 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":737
|
victor@0
|
638 * #ctypedef npy_uint128 uint128_t
|
victor@0
|
639 *
|
victor@0
|
640 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
|
victor@0
|
641 * ctypedef npy_float64 float64_t
|
victor@0
|
642 * #ctypedef npy_float80 float80_t
|
victor@0
|
643 */
|
victor@0
|
644 typedef npy_float32 __pyx_t_5numpy_float32_t;
|
victor@0
|
645
|
victor@0
|
646 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":738
|
victor@0
|
647 *
|
victor@0
|
648 * ctypedef npy_float32 float32_t
|
victor@0
|
649 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
|
victor@0
|
650 * #ctypedef npy_float80 float80_t
|
victor@0
|
651 * #ctypedef npy_float128 float128_t
|
victor@0
|
652 */
|
victor@0
|
653 typedef npy_float64 __pyx_t_5numpy_float64_t;
|
victor@0
|
654
|
victor@0
|
655 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":747
|
victor@0
|
656 * # The int types are mapped a bit surprising --
|
victor@0
|
657 * # numpy.int corresponds to 'l' and numpy.long to 'q'
|
victor@0
|
658 * ctypedef npy_long int_t # <<<<<<<<<<<<<<
|
victor@0
|
659 * ctypedef npy_longlong long_t
|
victor@0
|
660 * ctypedef npy_longlong longlong_t
|
victor@0
|
661 */
|
victor@0
|
662 typedef npy_long __pyx_t_5numpy_int_t;
|
victor@0
|
663
|
victor@0
|
664 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":748
|
victor@0
|
665 * # numpy.int corresponds to 'l' and numpy.long to 'q'
|
victor@0
|
666 * ctypedef npy_long int_t
|
victor@0
|
667 * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
|
victor@0
|
668 * ctypedef npy_longlong longlong_t
|
victor@0
|
669 *
|
victor@0
|
670 */
|
victor@0
|
671 typedef npy_longlong __pyx_t_5numpy_long_t;
|
victor@0
|
672
|
victor@0
|
673 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":749
|
victor@0
|
674 * ctypedef npy_long int_t
|
victor@0
|
675 * ctypedef npy_longlong long_t
|
victor@0
|
676 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
|
victor@0
|
677 *
|
victor@0
|
678 * ctypedef npy_ulong uint_t
|
victor@0
|
679 */
|
victor@0
|
680 typedef npy_longlong __pyx_t_5numpy_longlong_t;
|
victor@0
|
681
|
victor@0
|
682 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":751
|
victor@0
|
683 * ctypedef npy_longlong longlong_t
|
victor@0
|
684 *
|
victor@0
|
685 * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
|
victor@0
|
686 * ctypedef npy_ulonglong ulong_t
|
victor@0
|
687 * ctypedef npy_ulonglong ulonglong_t
|
victor@0
|
688 */
|
victor@0
|
689 typedef npy_ulong __pyx_t_5numpy_uint_t;
|
victor@0
|
690
|
victor@0
|
691 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":752
|
victor@0
|
692 *
|
victor@0
|
693 * ctypedef npy_ulong uint_t
|
victor@0
|
694 * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
|
victor@0
|
695 * ctypedef npy_ulonglong ulonglong_t
|
victor@0
|
696 *
|
victor@0
|
697 */
|
victor@0
|
698 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
|
victor@0
|
699
|
victor@0
|
700 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":753
|
victor@0
|
701 * ctypedef npy_ulong uint_t
|
victor@0
|
702 * ctypedef npy_ulonglong ulong_t
|
victor@0
|
703 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
|
victor@0
|
704 *
|
victor@0
|
705 * ctypedef npy_intp intp_t
|
victor@0
|
706 */
|
victor@0
|
707 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
|
victor@0
|
708
|
victor@0
|
709 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":755
|
victor@0
|
710 * ctypedef npy_ulonglong ulonglong_t
|
victor@0
|
711 *
|
victor@0
|
712 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
|
victor@0
|
713 * ctypedef npy_uintp uintp_t
|
victor@0
|
714 *
|
victor@0
|
715 */
|
victor@0
|
716 typedef npy_intp __pyx_t_5numpy_intp_t;
|
victor@0
|
717
|
victor@0
|
718 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":756
|
victor@0
|
719 *
|
victor@0
|
720 * ctypedef npy_intp intp_t
|
victor@0
|
721 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
|
victor@0
|
722 *
|
victor@0
|
723 * ctypedef npy_double float_t
|
victor@0
|
724 */
|
victor@0
|
725 typedef npy_uintp __pyx_t_5numpy_uintp_t;
|
victor@0
|
726
|
victor@0
|
727 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":758
|
victor@0
|
728 * ctypedef npy_uintp uintp_t
|
victor@0
|
729 *
|
victor@0
|
730 * ctypedef npy_double float_t # <<<<<<<<<<<<<<
|
victor@0
|
731 * ctypedef npy_double double_t
|
victor@0
|
732 * ctypedef npy_longdouble longdouble_t
|
victor@0
|
733 */
|
victor@0
|
734 typedef npy_double __pyx_t_5numpy_float_t;
|
victor@0
|
735
|
victor@0
|
736 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":759
|
victor@0
|
737 *
|
victor@0
|
738 * ctypedef npy_double float_t
|
victor@0
|
739 * ctypedef npy_double double_t # <<<<<<<<<<<<<<
|
victor@0
|
740 * ctypedef npy_longdouble longdouble_t
|
victor@0
|
741 *
|
victor@0
|
742 */
|
victor@0
|
743 typedef npy_double __pyx_t_5numpy_double_t;
|
victor@0
|
744
|
victor@0
|
745 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":760
|
victor@0
|
746 * ctypedef npy_double float_t
|
victor@0
|
747 * ctypedef npy_double double_t
|
victor@0
|
748 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
|
victor@0
|
749 *
|
victor@0
|
750 * ctypedef npy_cfloat cfloat_t
|
victor@0
|
751 */
|
victor@0
|
752 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
|
victor@0
|
753 #if CYTHON_CCOMPLEX
|
victor@0
|
754 #ifdef __cplusplus
|
victor@0
|
755 typedef ::std::complex< float > __pyx_t_float_complex;
|
victor@0
|
756 #else
|
victor@0
|
757 typedef float _Complex __pyx_t_float_complex;
|
victor@0
|
758 #endif
|
victor@0
|
759 #else
|
victor@0
|
760 typedef struct { float real, imag; } __pyx_t_float_complex;
|
victor@0
|
761 #endif
|
victor@0
|
762
|
victor@0
|
763 #if CYTHON_CCOMPLEX
|
victor@0
|
764 #ifdef __cplusplus
|
victor@0
|
765 typedef ::std::complex< double > __pyx_t_double_complex;
|
victor@0
|
766 #else
|
victor@0
|
767 typedef double _Complex __pyx_t_double_complex;
|
victor@0
|
768 #endif
|
victor@0
|
769 #else
|
victor@0
|
770 typedef struct { double real, imag; } __pyx_t_double_complex;
|
victor@0
|
771 #endif
|
victor@0
|
772
|
victor@0
|
773
|
victor@0
|
774 /*--- Type declarations ---*/
|
victor@0
|
775
|
victor@0
|
776 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":762
|
victor@0
|
777 * ctypedef npy_longdouble longdouble_t
|
victor@0
|
778 *
|
victor@0
|
779 * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
|
victor@0
|
780 * ctypedef npy_cdouble cdouble_t
|
victor@0
|
781 * ctypedef npy_clongdouble clongdouble_t
|
victor@0
|
782 */
|
victor@0
|
783 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
|
victor@0
|
784
|
victor@0
|
785 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":763
|
victor@0
|
786 *
|
victor@0
|
787 * ctypedef npy_cfloat cfloat_t
|
victor@0
|
788 * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
|
victor@0
|
789 * ctypedef npy_clongdouble clongdouble_t
|
victor@0
|
790 *
|
victor@0
|
791 */
|
victor@0
|
792 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
|
victor@0
|
793
|
victor@0
|
794 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":764
|
victor@0
|
795 * ctypedef npy_cfloat cfloat_t
|
victor@0
|
796 * ctypedef npy_cdouble cdouble_t
|
victor@0
|
797 * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
|
victor@0
|
798 *
|
victor@0
|
799 * ctypedef npy_cdouble complex_t
|
victor@0
|
800 */
|
victor@0
|
801 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
|
victor@0
|
802
|
victor@0
|
803 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":766
|
victor@0
|
804 * ctypedef npy_clongdouble clongdouble_t
|
victor@0
|
805 *
|
victor@0
|
806 * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
|
victor@0
|
807 *
|
victor@0
|
808 * cdef inline object PyArray_MultiIterNew1(a):
|
victor@0
|
809 */
|
victor@0
|
810 typedef npy_cdouble __pyx_t_5numpy_complex_t;
|
victor@0
|
811 #ifndef CYTHON_REFNANNY
|
victor@0
|
812 #define CYTHON_REFNANNY 0
|
victor@0
|
813 #endif
|
victor@0
|
814 #if CYTHON_REFNANNY
|
victor@0
|
815 typedef struct {
|
victor@0
|
816 void (*INCREF)(void*, PyObject*, int);
|
victor@0
|
817 void (*DECREF)(void*, PyObject*, int);
|
victor@0
|
818 void (*GOTREF)(void*, PyObject*, int);
|
victor@0
|
819 void (*GIVEREF)(void*, PyObject*, int);
|
victor@0
|
820 void* (*SetupContext)(const char*, int, const char*);
|
victor@0
|
821 void (*FinishContext)(void**);
|
victor@0
|
822 } __Pyx_RefNannyAPIStruct;
|
victor@0
|
823 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
|
victor@0
|
824 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/
|
victor@0
|
825 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
|
victor@0
|
826 #ifdef WITH_THREAD
|
victor@0
|
827 #define __Pyx_RefNannySetupContext(name, acquire_gil) \
|
victor@0
|
828 if (acquire_gil) { \
|
victor@0
|
829 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \
|
victor@0
|
830 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
|
victor@0
|
831 PyGILState_Release(__pyx_gilstate_save); \
|
victor@0
|
832 } else { \
|
victor@0
|
833 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \
|
victor@0
|
834 }
|
victor@0
|
835 #else
|
victor@0
|
836 #define __Pyx_RefNannySetupContext(name, acquire_gil) \
|
victor@0
|
837 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
|
victor@0
|
838 #endif
|
victor@0
|
839 #define __Pyx_RefNannyFinishContext() \
|
victor@0
|
840 __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
|
victor@0
|
841 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
victor@0
|
842 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
victor@0
|
843 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
victor@0
|
844 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
|
victor@0
|
845 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
|
victor@0
|
846 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
|
victor@0
|
847 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
|
victor@0
|
848 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
|
victor@0
|
849 #else
|
victor@0
|
850 #define __Pyx_RefNannyDeclarations
|
victor@0
|
851 #define __Pyx_RefNannySetupContext(name, acquire_gil)
|
victor@0
|
852 #define __Pyx_RefNannyFinishContext()
|
victor@0
|
853 #define __Pyx_INCREF(r) Py_INCREF(r)
|
victor@0
|
854 #define __Pyx_DECREF(r) Py_DECREF(r)
|
victor@0
|
855 #define __Pyx_GOTREF(r)
|
victor@0
|
856 #define __Pyx_GIVEREF(r)
|
victor@0
|
857 #define __Pyx_XINCREF(r) Py_XINCREF(r)
|
victor@0
|
858 #define __Pyx_XDECREF(r) Py_XDECREF(r)
|
victor@0
|
859 #define __Pyx_XGOTREF(r)
|
victor@0
|
860 #define __Pyx_XGIVEREF(r)
|
victor@0
|
861 #endif /* CYTHON_REFNANNY */
|
victor@0
|
862 #define __Pyx_XDECREF_SET(r, v) do { \
|
victor@0
|
863 PyObject *tmp = (PyObject *) r; \
|
victor@0
|
864 r = v; __Pyx_XDECREF(tmp); \
|
victor@0
|
865 } while (0)
|
victor@0
|
866 #define __Pyx_DECREF_SET(r, v) do { \
|
victor@0
|
867 PyObject *tmp = (PyObject *) r; \
|
victor@0
|
868 r = v; __Pyx_DECREF(tmp); \
|
victor@0
|
869 } while (0)
|
victor@0
|
870 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
|
victor@0
|
871 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
|
victor@0
|
872
|
victor@0
|
873 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
874 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
|
victor@0
|
875 PyTypeObject* tp = Py_TYPE(obj);
|
victor@0
|
876 if (likely(tp->tp_getattro))
|
victor@0
|
877 return tp->tp_getattro(obj, attr_name);
|
victor@0
|
878 #if PY_MAJOR_VERSION < 3
|
victor@0
|
879 if (likely(tp->tp_getattr))
|
victor@0
|
880 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
|
victor@0
|
881 #endif
|
victor@0
|
882 return PyObject_GetAttr(obj, attr_name);
|
victor@0
|
883 }
|
victor@0
|
884 #else
|
victor@0
|
885 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
|
victor@0
|
886 #endif
|
victor@0
|
887
|
victor@0
|
888 static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/
|
victor@0
|
889
|
victor@0
|
890 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
|
victor@0
|
891 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/
|
victor@0
|
892
|
victor@0
|
893 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/
|
victor@0
|
894
|
victor@0
|
895 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \
|
victor@0
|
896 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \
|
victor@0
|
897 const char* function_name); /*proto*/
|
victor@0
|
898
|
victor@0
|
899 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/
|
victor@0
|
900
|
victor@0
|
901 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
902 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/
|
victor@0
|
903 #else
|
victor@0
|
904 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
|
victor@0
|
905 #endif
|
victor@0
|
906
|
victor@0
|
907 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/
|
victor@0
|
908
|
victor@0
|
909 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
|
victor@0
|
910 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
|
victor@0
|
911 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \
|
victor@0
|
912 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \
|
victor@0
|
913 __Pyx_GetItemInt_Generic(o, to_py_func(i))))
|
victor@0
|
914 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
|
victor@0
|
915 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
|
victor@0
|
916 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
|
victor@0
|
917 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
|
victor@0
|
918 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
|
victor@0
|
919 int wraparound, int boundscheck);
|
victor@0
|
920 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \
|
victor@0
|
921 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \
|
victor@0
|
922 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \
|
victor@0
|
923 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
|
victor@0
|
924 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
|
victor@0
|
925 int wraparound, int boundscheck);
|
victor@0
|
926 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
|
victor@0
|
927 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
|
victor@0
|
928 int is_list, int wraparound, int boundscheck);
|
victor@0
|
929
|
victor@0
|
930 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
|
victor@0
|
931 const char *name, int exact); /*proto*/
|
victor@0
|
932
|
victor@0
|
933 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
934 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
|
victor@0
|
935 PyListObject* L = (PyListObject*) list;
|
victor@0
|
936 Py_ssize_t len = Py_SIZE(list);
|
victor@0
|
937 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
|
victor@0
|
938 Py_INCREF(x);
|
victor@0
|
939 PyList_SET_ITEM(list, len, x);
|
victor@0
|
940 Py_SIZE(list) = len+1;
|
victor@0
|
941 return 0;
|
victor@0
|
942 }
|
victor@0
|
943 return PyList_Append(list, x);
|
victor@0
|
944 }
|
victor@0
|
945 #else
|
victor@0
|
946 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
|
victor@0
|
947 #endif
|
victor@0
|
948
|
victor@0
|
949 #include <string.h>
|
victor@0
|
950
|
victor@0
|
951 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
|
victor@0
|
952
|
victor@0
|
953 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/
|
victor@0
|
954
|
victor@0
|
955 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
956 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
|
victor@0
|
957 #else
|
victor@0
|
958 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
|
victor@0
|
959 #endif
|
victor@0
|
960
|
victor@0
|
961 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
|
victor@0
|
962
|
victor@0
|
963 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
|
victor@0
|
964
|
victor@0
|
965 static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/
|
victor@0
|
966
|
victor@0
|
967 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/
|
victor@0
|
968
|
victor@0
|
969 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/
|
victor@0
|
970 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/
|
victor@0
|
971
|
victor@0
|
972 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/
|
victor@0
|
973
|
victor@0
|
974 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
|
victor@0
|
975
|
victor@0
|
976 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
|
victor@0
|
977
|
victor@0
|
978 #define __Pyx_CyFunction_USED 1
|
victor@0
|
979 #include <structmember.h>
|
victor@0
|
980 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
|
victor@0
|
981 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
|
victor@0
|
982 #define __Pyx_CYFUNCTION_CCLASS 0x04
|
victor@0
|
983 #define __Pyx_CyFunction_GetClosure(f) \
|
victor@0
|
984 (((__pyx_CyFunctionObject *) (f))->func_closure)
|
victor@0
|
985 #define __Pyx_CyFunction_GetClassObj(f) \
|
victor@0
|
986 (((__pyx_CyFunctionObject *) (f))->func_classobj)
|
victor@0
|
987 #define __Pyx_CyFunction_Defaults(type, f) \
|
victor@0
|
988 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
|
victor@0
|
989 #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \
|
victor@0
|
990 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
|
victor@0
|
991 typedef struct {
|
victor@0
|
992 PyCFunctionObject func;
|
victor@0
|
993 PyObject *func_dict;
|
victor@0
|
994 PyObject *func_weakreflist;
|
victor@0
|
995 PyObject *func_name;
|
victor@0
|
996 PyObject *func_qualname;
|
victor@0
|
997 PyObject *func_doc;
|
victor@0
|
998 PyObject *func_globals;
|
victor@0
|
999 PyObject *func_code;
|
victor@0
|
1000 PyObject *func_closure;
|
victor@0
|
1001 PyObject *func_classobj; /* No-args super() class cell */
|
victor@0
|
1002 void *defaults;
|
victor@0
|
1003 int defaults_pyobjects;
|
victor@0
|
1004 int flags;
|
victor@0
|
1005 PyObject *defaults_tuple; /* Const defaults tuple */
|
victor@0
|
1006 PyObject *defaults_kwdict; /* Const kwonly defaults dict */
|
victor@0
|
1007 PyObject *(*defaults_getter)(PyObject *);
|
victor@0
|
1008 PyObject *func_annotations; /* function annotations dict */
|
victor@0
|
1009 } __pyx_CyFunctionObject;
|
victor@0
|
1010 static PyTypeObject *__pyx_CyFunctionType = 0;
|
victor@0
|
1011 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \
|
victor@0
|
1012 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
|
victor@0
|
1013 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
|
victor@0
|
1014 int flags, PyObject* qualname,
|
victor@0
|
1015 PyObject *self,
|
victor@0
|
1016 PyObject *module, PyObject *globals,
|
victor@0
|
1017 PyObject* code);
|
victor@0
|
1018 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
|
victor@0
|
1019 size_t size,
|
victor@0
|
1020 int pyobjects);
|
victor@0
|
1021 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
|
victor@0
|
1022 PyObject *tuple);
|
victor@0
|
1023 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
|
victor@0
|
1024 PyObject *dict);
|
victor@0
|
1025 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
|
victor@0
|
1026 PyObject *dict);
|
victor@0
|
1027 static int __Pyx_CyFunction_init(void);
|
victor@0
|
1028
|
victor@0
|
1029 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);
|
victor@0
|
1030
|
victor@0
|
1031 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
|
victor@0
|
1032 PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/
|
victor@0
|
1033 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
|
victor@0
|
1034 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/
|
victor@0
|
1035
|
victor@0
|
1036 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/
|
victor@0
|
1037
|
victor@0
|
1038 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
|
victor@0
|
1039
|
victor@0
|
1040 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
|
victor@0
|
1041
|
victor@0
|
1042 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
|
victor@0
|
1043
|
victor@0
|
1044 #if CYTHON_CCOMPLEX
|
victor@0
|
1045 #ifdef __cplusplus
|
victor@0
|
1046 #define __Pyx_CREAL(z) ((z).real())
|
victor@0
|
1047 #define __Pyx_CIMAG(z) ((z).imag())
|
victor@0
|
1048 #else
|
victor@0
|
1049 #define __Pyx_CREAL(z) (__real__(z))
|
victor@0
|
1050 #define __Pyx_CIMAG(z) (__imag__(z))
|
victor@0
|
1051 #endif
|
victor@0
|
1052 #else
|
victor@0
|
1053 #define __Pyx_CREAL(z) ((z).real)
|
victor@0
|
1054 #define __Pyx_CIMAG(z) ((z).imag)
|
victor@0
|
1055 #endif
|
victor@0
|
1056 #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX
|
victor@0
|
1057 #define __Pyx_SET_CREAL(z,x) ((z).real(x))
|
victor@0
|
1058 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
|
victor@0
|
1059 #else
|
victor@0
|
1060 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
|
victor@0
|
1061 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
|
victor@0
|
1062 #endif
|
victor@0
|
1063
|
victor@0
|
1064 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
|
victor@0
|
1065
|
victor@0
|
1066 #if CYTHON_CCOMPLEX
|
victor@0
|
1067 #define __Pyx_c_eqf(a, b) ((a)==(b))
|
victor@0
|
1068 #define __Pyx_c_sumf(a, b) ((a)+(b))
|
victor@0
|
1069 #define __Pyx_c_difff(a, b) ((a)-(b))
|
victor@0
|
1070 #define __Pyx_c_prodf(a, b) ((a)*(b))
|
victor@0
|
1071 #define __Pyx_c_quotf(a, b) ((a)/(b))
|
victor@0
|
1072 #define __Pyx_c_negf(a) (-(a))
|
victor@0
|
1073 #ifdef __cplusplus
|
victor@0
|
1074 #define __Pyx_c_is_zerof(z) ((z)==(float)0)
|
victor@0
|
1075 #define __Pyx_c_conjf(z) (::std::conj(z))
|
victor@0
|
1076 #if 1
|
victor@0
|
1077 #define __Pyx_c_absf(z) (::std::abs(z))
|
victor@0
|
1078 #define __Pyx_c_powf(a, b) (::std::pow(a, b))
|
victor@0
|
1079 #endif
|
victor@0
|
1080 #else
|
victor@0
|
1081 #define __Pyx_c_is_zerof(z) ((z)==0)
|
victor@0
|
1082 #define __Pyx_c_conjf(z) (conjf(z))
|
victor@0
|
1083 #if 1
|
victor@0
|
1084 #define __Pyx_c_absf(z) (cabsf(z))
|
victor@0
|
1085 #define __Pyx_c_powf(a, b) (cpowf(a, b))
|
victor@0
|
1086 #endif
|
victor@0
|
1087 #endif
|
victor@0
|
1088 #else
|
victor@0
|
1089 static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex);
|
victor@0
|
1090 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex);
|
victor@0
|
1091 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex);
|
victor@0
|
1092 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex);
|
victor@0
|
1093 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex);
|
victor@0
|
1094 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex);
|
victor@0
|
1095 static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex);
|
victor@0
|
1096 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex);
|
victor@0
|
1097 #if 1
|
victor@0
|
1098 static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex);
|
victor@0
|
1099 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex);
|
victor@0
|
1100 #endif
|
victor@0
|
1101 #endif
|
victor@0
|
1102
|
victor@0
|
1103 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
|
victor@0
|
1104
|
victor@0
|
1105 #if CYTHON_CCOMPLEX
|
victor@0
|
1106 #define __Pyx_c_eq(a, b) ((a)==(b))
|
victor@0
|
1107 #define __Pyx_c_sum(a, b) ((a)+(b))
|
victor@0
|
1108 #define __Pyx_c_diff(a, b) ((a)-(b))
|
victor@0
|
1109 #define __Pyx_c_prod(a, b) ((a)*(b))
|
victor@0
|
1110 #define __Pyx_c_quot(a, b) ((a)/(b))
|
victor@0
|
1111 #define __Pyx_c_neg(a) (-(a))
|
victor@0
|
1112 #ifdef __cplusplus
|
victor@0
|
1113 #define __Pyx_c_is_zero(z) ((z)==(double)0)
|
victor@0
|
1114 #define __Pyx_c_conj(z) (::std::conj(z))
|
victor@0
|
1115 #if 1
|
victor@0
|
1116 #define __Pyx_c_abs(z) (::std::abs(z))
|
victor@0
|
1117 #define __Pyx_c_pow(a, b) (::std::pow(a, b))
|
victor@0
|
1118 #endif
|
victor@0
|
1119 #else
|
victor@0
|
1120 #define __Pyx_c_is_zero(z) ((z)==0)
|
victor@0
|
1121 #define __Pyx_c_conj(z) (conj(z))
|
victor@0
|
1122 #if 1
|
victor@0
|
1123 #define __Pyx_c_abs(z) (cabs(z))
|
victor@0
|
1124 #define __Pyx_c_pow(a, b) (cpow(a, b))
|
victor@0
|
1125 #endif
|
victor@0
|
1126 #endif
|
victor@0
|
1127 #else
|
victor@0
|
1128 static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex);
|
victor@0
|
1129 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex);
|
victor@0
|
1130 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex);
|
victor@0
|
1131 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex);
|
victor@0
|
1132 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex);
|
victor@0
|
1133 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex);
|
victor@0
|
1134 static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex);
|
victor@0
|
1135 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex);
|
victor@0
|
1136 #if 1
|
victor@0
|
1137 static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex);
|
victor@0
|
1138 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex);
|
victor@0
|
1139 #endif
|
victor@0
|
1140 #endif
|
victor@0
|
1141
|
victor@0
|
1142 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
|
victor@0
|
1143
|
victor@0
|
1144 static int __Pyx_check_binary_version(void);
|
victor@0
|
1145
|
victor@0
|
1146 #if !defined(__Pyx_PyIdentifier_FromString)
|
victor@0
|
1147 #if PY_MAJOR_VERSION < 3
|
victor@0
|
1148 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
|
victor@0
|
1149 #else
|
victor@0
|
1150 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
|
victor@0
|
1151 #endif
|
victor@0
|
1152 #endif
|
victor@0
|
1153
|
victor@0
|
1154 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/
|
victor@0
|
1155
|
victor@0
|
1156 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/
|
victor@0
|
1157
|
victor@0
|
1158 typedef struct {
|
victor@0
|
1159 int code_line;
|
victor@0
|
1160 PyCodeObject* code_object;
|
victor@0
|
1161 } __Pyx_CodeObjectCacheEntry;
|
victor@0
|
1162 struct __Pyx_CodeObjectCache {
|
victor@0
|
1163 int count;
|
victor@0
|
1164 int max_count;
|
victor@0
|
1165 __Pyx_CodeObjectCacheEntry* entries;
|
victor@0
|
1166 };
|
victor@0
|
1167 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
|
victor@0
|
1168 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
|
victor@0
|
1169 static PyCodeObject *__pyx_find_code_object(int code_line);
|
victor@0
|
1170 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
|
victor@0
|
1171
|
victor@0
|
1172 static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
victor@0
|
1173 int py_line, const char *filename); /*proto*/
|
victor@0
|
1174
|
victor@0
|
1175 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/
|
victor@0
|
1176
|
victor@0
|
1177
|
victor@0
|
1178 /* Module declarations from 'cpython.buffer' */
|
victor@0
|
1179
|
victor@0
|
1180 /* Module declarations from 'cpython.ref' */
|
victor@0
|
1181
|
victor@0
|
1182 /* Module declarations from 'libc.string' */
|
victor@0
|
1183
|
victor@0
|
1184 /* Module declarations from 'libc.stdio' */
|
victor@0
|
1185
|
victor@0
|
1186 /* Module declarations from 'cpython.object' */
|
victor@0
|
1187
|
victor@0
|
1188 /* Module declarations from '__builtin__' */
|
victor@0
|
1189
|
victor@0
|
1190 /* Module declarations from 'cpython.type' */
|
victor@0
|
1191 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
|
victor@0
|
1192
|
victor@0
|
1193 /* Module declarations from 'libc.stdlib' */
|
victor@0
|
1194
|
victor@0
|
1195 /* Module declarations from 'numpy' */
|
victor@0
|
1196
|
victor@0
|
1197 /* Module declarations from 'numpy' */
|
victor@0
|
1198 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
|
victor@0
|
1199 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
|
victor@0
|
1200 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
|
victor@0
|
1201 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
|
victor@0
|
1202 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
|
victor@0
|
1203 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
|
victor@0
|
1204
|
victor@0
|
1205 /* Module declarations from 'cpython.version' */
|
victor@0
|
1206
|
victor@0
|
1207 /* Module declarations from 'cpython.exc' */
|
victor@0
|
1208
|
victor@0
|
1209 /* Module declarations from 'cpython.module' */
|
victor@0
|
1210
|
victor@0
|
1211 /* Module declarations from 'cpython.mem' */
|
victor@0
|
1212
|
victor@0
|
1213 /* Module declarations from 'cpython.tuple' */
|
victor@0
|
1214
|
victor@0
|
1215 /* Module declarations from 'cpython.list' */
|
victor@0
|
1216
|
victor@0
|
1217 /* Module declarations from 'cpython.sequence' */
|
victor@0
|
1218
|
victor@0
|
1219 /* Module declarations from 'cpython.mapping' */
|
victor@0
|
1220
|
victor@0
|
1221 /* Module declarations from 'cpython.iterator' */
|
victor@0
|
1222
|
victor@0
|
1223 /* Module declarations from 'cpython.number' */
|
victor@0
|
1224
|
victor@0
|
1225 /* Module declarations from 'cpython.int' */
|
victor@0
|
1226
|
victor@0
|
1227 /* Module declarations from '__builtin__' */
|
victor@0
|
1228
|
victor@0
|
1229 /* Module declarations from 'cpython.bool' */
|
victor@0
|
1230 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
|
victor@0
|
1231
|
victor@0
|
1232 /* Module declarations from 'cpython.long' */
|
victor@0
|
1233
|
victor@0
|
1234 /* Module declarations from 'cpython.float' */
|
victor@0
|
1235
|
victor@0
|
1236 /* Module declarations from '__builtin__' */
|
victor@0
|
1237
|
victor@0
|
1238 /* Module declarations from 'cpython.complex' */
|
victor@0
|
1239 static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
|
victor@0
|
1240
|
victor@0
|
1241 /* Module declarations from 'cpython.string' */
|
victor@0
|
1242
|
victor@0
|
1243 /* Module declarations from 'cpython.unicode' */
|
victor@0
|
1244
|
victor@0
|
1245 /* Module declarations from 'cpython.dict' */
|
victor@0
|
1246
|
victor@0
|
1247 /* Module declarations from 'cpython.instance' */
|
victor@0
|
1248
|
victor@0
|
1249 /* Module declarations from 'cpython.function' */
|
victor@0
|
1250
|
victor@0
|
1251 /* Module declarations from 'cpython.method' */
|
victor@0
|
1252
|
victor@0
|
1253 /* Module declarations from 'cpython.weakref' */
|
victor@0
|
1254
|
victor@0
|
1255 /* Module declarations from 'cpython.getargs' */
|
victor@0
|
1256
|
victor@0
|
1257 /* Module declarations from 'cpython.pythread' */
|
victor@0
|
1258
|
victor@0
|
1259 /* Module declarations from 'cpython.pystate' */
|
victor@0
|
1260
|
victor@0
|
1261 /* Module declarations from 'cpython.cobject' */
|
victor@0
|
1262
|
victor@0
|
1263 /* Module declarations from 'cpython.oldbuffer' */
|
victor@0
|
1264
|
victor@0
|
1265 /* Module declarations from 'cpython.set' */
|
victor@0
|
1266
|
victor@0
|
1267 /* Module declarations from 'cpython.bytes' */
|
victor@0
|
1268
|
victor@0
|
1269 /* Module declarations from 'cpython.pycapsule' */
|
victor@0
|
1270
|
victor@0
|
1271 /* Module declarations from 'cpython' */
|
victor@0
|
1272
|
victor@0
|
1273 /* Module declarations from 'MultipleOMR.Alignment.FastAlignmentArrays' */
|
victor@0
|
1274 static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG;
|
victor@0
|
1275 static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP;
|
victor@0
|
1276 static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT;
|
victor@0
|
1277 static float __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_score;
|
victor@0
|
1278 #define __Pyx_MODULE_NAME "MultipleOMR.Alignment.FastAlignmentArrays"
|
victor@0
|
1279 int __pyx_module_is_main_MultipleOMR__Alignment__FastAlignmentArrays = 0;
|
victor@0
|
1280
|
victor@0
|
1281 /* Implementation of 'MultipleOMR.Alignment.FastAlignmentArrays' */
|
victor@0
|
1282 static PyObject *__pyx_builtin_range;
|
victor@0
|
1283 static PyObject *__pyx_builtin_ValueError;
|
victor@0
|
1284 static PyObject *__pyx_builtin_RuntimeError;
|
victor@0
|
1285 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
|
1286 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
|
1287 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
|
1288 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
|
victor@0
|
1289 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
|
victor@0
|
1290 static char __pyx_k_B[] = "B";
|
victor@0
|
1291 static char __pyx_k_H[] = "H";
|
victor@0
|
1292 static char __pyx_k_I[] = "I";
|
victor@0
|
1293 static char __pyx_k_L[] = "L";
|
victor@0
|
1294 static char __pyx_k_O[] = "O";
|
victor@0
|
1295 static char __pyx_k_Q[] = "Q";
|
victor@0
|
1296 static char __pyx_k_b[] = "b";
|
victor@0
|
1297 static char __pyx_k_d[] = "d";
|
victor@0
|
1298 static char __pyx_k_f[] = "f";
|
victor@0
|
1299 static char __pyx_k_g[] = "g";
|
victor@0
|
1300 static char __pyx_k_h[] = "h";
|
victor@0
|
1301 static char __pyx_k_i[] = "i";
|
victor@0
|
1302 static char __pyx_k_j[] = "j";
|
victor@0
|
1303 static char __pyx_k_l[] = "l";
|
victor@0
|
1304 static char __pyx_k_m[] = "m";
|
victor@0
|
1305 static char __pyx_k_n[] = "n";
|
victor@0
|
1306 static char __pyx_k_p[] = "p";
|
victor@0
|
1307 static char __pyx_k_q[] = "q";
|
victor@0
|
1308 static char __pyx_k_s[] = "s";
|
victor@0
|
1309 static char __pyx_k_Zd[] = "Zd";
|
victor@0
|
1310 static char __pyx_k_Zf[] = "Zf";
|
victor@0
|
1311 static char __pyx_k_Zg[] = "Zg";
|
victor@0
|
1312 static char __pyx_k__5[] = "*";
|
victor@0
|
1313 static char __pyx_k_np[] = "np";
|
victor@0
|
1314 static char __pyx_k_GAP[] = "[GAP]";
|
victor@0
|
1315 static char __pyx_k_doc[] = "__doc__";
|
victor@0
|
1316 static char __pyx_k_ptr[] = "ptr";
|
victor@0
|
1317 static char __pyx_k_curr[] = "curr";
|
victor@0
|
1318 static char __pyx_k_gap1[] = "gap1";
|
victor@0
|
1319 static char __pyx_k_gap2[] = "gap2";
|
victor@0
|
1320 static char __pyx_k_main[] = "__main__";
|
victor@0
|
1321 static char __pyx_k_self[] = "self";
|
victor@0
|
1322 static char __pyx_k_seq1[] = "seq1";
|
victor@0
|
1323 static char __pyx_k_seq2[] = "seq2";
|
victor@0
|
1324 static char __pyx_k_test[] = "__test__";
|
victor@0
|
1325 static char __pyx_k_dtype[] = "dtype";
|
victor@0
|
1326 static char __pyx_k_indel[] = "indel";
|
victor@0
|
1327 static char __pyx_k_index[] = "index";
|
victor@0
|
1328 static char __pyx_k_numpy[] = "numpy";
|
victor@0
|
1329 static char __pyx_k_range[] = "range";
|
victor@0
|
1330 static char __pyx_k_score[] = "score";
|
victor@0
|
1331 static char __pyx_k_zeros[] = "zeros";
|
victor@0
|
1332 static char __pyx_k_align1[] = "align1";
|
victor@0
|
1333 static char __pyx_k_align2[] = "align2";
|
victor@0
|
1334 static char __pyx_k_import[] = "__import__";
|
victor@0
|
1335 static char __pyx_k_isFast[] = "isFast";
|
victor@0
|
1336 static char __pyx_k_maxlen[] = "maxlen";
|
victor@0
|
1337 static char __pyx_k_module[] = "__module__";
|
victor@0
|
1338 static char __pyx_k_myseq1[] = "myseq1";
|
victor@0
|
1339 static char __pyx_k_myseq2[] = "myseq2";
|
victor@0
|
1340 static char __pyx_k_NWunsch[] = "NWunsch";
|
victor@0
|
1341 static char __pyx_k_prepare[] = "__prepare__";
|
victor@0
|
1342 static char __pyx_k_qualname[] = "__qualname__";
|
victor@0
|
1343 static char __pyx_k_alignment[] = "alignment";
|
victor@0
|
1344 static char __pyx_k_metaclass[] = "__metaclass__";
|
victor@0
|
1345 static char __pyx_k_ValueError[] = "ValueError";
|
victor@0
|
1346 static char __pyx_k_align1_gap[] = "align1_gap";
|
victor@0
|
1347 static char __pyx_k_align2_gap[] = "align2_gap";
|
victor@0
|
1348 static char __pyx_k_finalscore[] = "finalscore";
|
victor@0
|
1349 static char __pyx_k_RuntimeError[] = "RuntimeError";
|
victor@0
|
1350 static char __pyx_k_diagonalRange[] = "diagonalRange";
|
victor@0
|
1351 static char __pyx_k_needleman_wunsch[] = "needleman_wunsch";
|
victor@0
|
1352 static char __pyx_k_FastAlignmentArrays[] = "FastAlignmentArrays";
|
victor@0
|
1353 static char __pyx_k_NWunsch_getSimilarity[] = "NWunsch_getSimilarity";
|
victor@0
|
1354 static char __pyx_k_needleman_wunsch_trace[] = "__needleman_wunsch_trace";
|
victor@0
|
1355 static char __pyx_k_needleman_wunsch_matrix[] = "__needleman_wunsch_matrix";
|
victor@0
|
1356 static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
|
victor@0
|
1357 static char __pyx_k_FastAlignmentArrays__needleman[] = "_FastAlignmentArrays__needleman_wunsch_matrix";
|
victor@0
|
1358 static char __pyx_k_C_LICA_OMR_PythonV4_MultipleOMR[] = "C:\\LICA\\OMR_PythonV4\\MultipleOMR\\Alignment\\FastAlignmentArrays.pyx";
|
victor@0
|
1359 static char __pyx_k_FastAlignmentArrays___needleman[] = "FastAlignmentArrays.__needleman_wunsch_matrix";
|
victor@0
|
1360 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
|
1361 static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
|
victor@0
|
1362 static char __pyx_k_FastAlignmentArrays__needleman_2[] = "_FastAlignmentArrays__needleman_wunsch_trace";
|
victor@0
|
1363 static char __pyx_k_FastAlignmentArrays_needleman_wu[] = "FastAlignmentArrays.needleman_wunsch";
|
victor@0
|
1364 static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
|
victor@0
|
1365 static char __pyx_k_MultipleOMR_Alignment_FastAlignm[] = "MultipleOMR.Alignment.FastAlignmentArrays";
|
victor@0
|
1366 static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
|
victor@0
|
1367 static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
|
victor@0
|
1368 static char __pyx_k_FastAlignmentArrays___needleman_2[] = "FastAlignmentArrays.__needleman_wunsch_trace";
|
victor@0
|
1369 static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
|
victor@0
|
1370 static PyObject *__pyx_kp_s_C_LICA_OMR_PythonV4_MultipleOMR;
|
victor@0
|
1371 static PyObject *__pyx_n_s_FastAlignmentArrays;
|
victor@0
|
1372 static PyObject *__pyx_n_s_FastAlignmentArrays___needleman;
|
victor@0
|
1373 static PyObject *__pyx_n_s_FastAlignmentArrays___needleman_2;
|
victor@0
|
1374 static PyObject *__pyx_n_s_FastAlignmentArrays__needleman;
|
victor@0
|
1375 static PyObject *__pyx_n_s_FastAlignmentArrays__needleman_2;
|
victor@0
|
1376 static PyObject *__pyx_n_s_FastAlignmentArrays_needleman_wu;
|
victor@0
|
1377 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
|
victor@0
|
1378 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
|
victor@0
|
1379 static PyObject *__pyx_kp_s_GAP;
|
victor@0
|
1380 static PyObject *__pyx_n_s_MultipleOMR_Alignment_FastAlignm;
|
victor@0
|
1381 static PyObject *__pyx_n_s_NWunsch;
|
victor@0
|
1382 static PyObject *__pyx_n_s_NWunsch_getSimilarity;
|
victor@0
|
1383 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
|
victor@0
|
1384 static PyObject *__pyx_n_s_RuntimeError;
|
victor@0
|
1385 static PyObject *__pyx_n_s_ValueError;
|
victor@0
|
1386 static PyObject *__pyx_kp_s__5;
|
victor@0
|
1387 static PyObject *__pyx_n_s_align1;
|
victor@0
|
1388 static PyObject *__pyx_n_s_align1_gap;
|
victor@0
|
1389 static PyObject *__pyx_n_s_align2;
|
victor@0
|
1390 static PyObject *__pyx_n_s_align2_gap;
|
victor@0
|
1391 static PyObject *__pyx_n_s_alignment;
|
victor@0
|
1392 static PyObject *__pyx_n_s_curr;
|
victor@0
|
1393 static PyObject *__pyx_n_s_diagonalRange;
|
victor@0
|
1394 static PyObject *__pyx_n_s_doc;
|
victor@0
|
1395 static PyObject *__pyx_n_s_dtype;
|
victor@0
|
1396 static PyObject *__pyx_n_s_finalscore;
|
victor@0
|
1397 static PyObject *__pyx_n_s_gap1;
|
victor@0
|
1398 static PyObject *__pyx_n_s_gap2;
|
victor@0
|
1399 static PyObject *__pyx_n_s_i;
|
victor@0
|
1400 static PyObject *__pyx_n_s_import;
|
victor@0
|
1401 static PyObject *__pyx_n_s_indel;
|
victor@0
|
1402 static PyObject *__pyx_n_s_index;
|
victor@0
|
1403 static PyObject *__pyx_n_s_isFast;
|
victor@0
|
1404 static PyObject *__pyx_n_s_j;
|
victor@0
|
1405 static PyObject *__pyx_n_s_m;
|
victor@0
|
1406 static PyObject *__pyx_n_s_main;
|
victor@0
|
1407 static PyObject *__pyx_n_s_maxlen;
|
victor@0
|
1408 static PyObject *__pyx_n_s_metaclass;
|
victor@0
|
1409 static PyObject *__pyx_n_s_module;
|
victor@0
|
1410 static PyObject *__pyx_n_s_myseq1;
|
victor@0
|
1411 static PyObject *__pyx_n_s_myseq2;
|
victor@0
|
1412 static PyObject *__pyx_n_s_n;
|
victor@0
|
1413 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
|
victor@0
|
1414 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
|
victor@0
|
1415 static PyObject *__pyx_n_s_needleman_wunsch;
|
victor@0
|
1416 static PyObject *__pyx_n_s_needleman_wunsch_matrix;
|
victor@0
|
1417 static PyObject *__pyx_n_s_needleman_wunsch_trace;
|
victor@0
|
1418 static PyObject *__pyx_n_s_np;
|
victor@0
|
1419 static PyObject *__pyx_n_s_numpy;
|
victor@0
|
1420 static PyObject *__pyx_n_s_p;
|
victor@0
|
1421 static PyObject *__pyx_n_s_prepare;
|
victor@0
|
1422 static PyObject *__pyx_n_s_ptr;
|
victor@0
|
1423 static PyObject *__pyx_n_s_q;
|
victor@0
|
1424 static PyObject *__pyx_n_s_qualname;
|
victor@0
|
1425 static PyObject *__pyx_n_s_range;
|
victor@0
|
1426 static PyObject *__pyx_n_s_s;
|
victor@0
|
1427 static PyObject *__pyx_n_s_score;
|
victor@0
|
1428 static PyObject *__pyx_n_s_self;
|
victor@0
|
1429 static PyObject *__pyx_n_s_seq1;
|
victor@0
|
1430 static PyObject *__pyx_n_s_seq2;
|
victor@0
|
1431 static PyObject *__pyx_n_s_test;
|
victor@0
|
1432 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
|
victor@0
|
1433 static PyObject *__pyx_n_s_zeros;
|
victor@0
|
1434 static PyObject *__pyx_int_0;
|
victor@0
|
1435 static PyObject *__pyx_int_1;
|
victor@0
|
1436 static PyObject *__pyx_int_3;
|
victor@0
|
1437 static PyObject *__pyx_int_350;
|
victor@0
|
1438 static PyObject *__pyx_int_neg_1;
|
victor@0
|
1439 static PyObject *__pyx_slice_;
|
victor@0
|
1440 static PyObject *__pyx_slice__3;
|
victor@0
|
1441 static PyObject *__pyx_tuple__2;
|
victor@0
|
1442 static PyObject *__pyx_tuple__4;
|
victor@0
|
1443 static PyObject *__pyx_tuple__6;
|
victor@0
|
1444 static PyObject *__pyx_tuple__7;
|
victor@0
|
1445 static PyObject *__pyx_tuple__8;
|
victor@0
|
1446 static PyObject *__pyx_tuple__9;
|
victor@0
|
1447 static PyObject *__pyx_tuple__10;
|
victor@0
|
1448 static PyObject *__pyx_tuple__11;
|
victor@0
|
1449 static PyObject *__pyx_tuple__12;
|
victor@0
|
1450 static PyObject *__pyx_tuple__14;
|
victor@0
|
1451 static PyObject *__pyx_tuple__16;
|
victor@0
|
1452 static PyObject *__pyx_tuple__18;
|
victor@0
|
1453 static PyObject *__pyx_codeobj__13;
|
victor@0
|
1454 static PyObject *__pyx_codeobj__15;
|
victor@0
|
1455 static PyObject *__pyx_codeobj__17;
|
victor@0
|
1456
|
victor@0
|
1457 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57
|
victor@0
|
1458 * class FastAlignmentArrays:
|
victor@0
|
1459 *
|
victor@0
|
1460 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<<
|
victor@0
|
1461 * """
|
victor@0
|
1462 * fill in the DP matrix according to the Needleman-Wunsch algorithm.
|
victor@0
|
1463 */
|
victor@0
|
1464
|
victor@0
|
1465 /* Python wrapper */
|
victor@0
|
1466 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
victor@0
|
1467 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
|
1468 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
|
1469 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
victor@0
|
1470 CYTHON_UNUSED PyObject *__pyx_v_self = 0;
|
victor@0
|
1471 PyObject *__pyx_v_seq1 = 0;
|
victor@0
|
1472 PyObject *__pyx_v_seq2 = 0;
|
victor@0
|
1473 PyObject *__pyx_v_isFast = 0;
|
victor@0
|
1474 int __pyx_lineno = 0;
|
victor@0
|
1475 const char *__pyx_filename = NULL;
|
victor@0
|
1476 int __pyx_clineno = 0;
|
victor@0
|
1477 PyObject *__pyx_r = 0;
|
victor@0
|
1478 __Pyx_RefNannyDeclarations
|
victor@0
|
1479 __Pyx_RefNannySetupContext("__needleman_wunsch_matrix (wrapper)", 0);
|
victor@0
|
1480 {
|
victor@0
|
1481 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_isFast,0};
|
victor@0
|
1482 PyObject* values[4] = {0,0,0,0};
|
victor@0
|
1483 if (unlikely(__pyx_kwds)) {
|
victor@0
|
1484 Py_ssize_t kw_args;
|
victor@0
|
1485 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
victor@0
|
1486 switch (pos_args) {
|
victor@0
|
1487 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
victor@0
|
1488 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
victor@0
|
1489 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
victor@0
|
1490 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
victor@0
|
1491 case 0: break;
|
victor@0
|
1492 default: goto __pyx_L5_argtuple_error;
|
victor@0
|
1493 }
|
victor@0
|
1494 kw_args = PyDict_Size(__pyx_kwds);
|
victor@0
|
1495 switch (pos_args) {
|
victor@0
|
1496 case 0:
|
victor@0
|
1497 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
|
victor@0
|
1498 else goto __pyx_L5_argtuple_error;
|
victor@0
|
1499 case 1:
|
victor@0
|
1500 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--;
|
victor@0
|
1501 else {
|
victor@0
|
1502 __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
|
1503 }
|
victor@0
|
1504 case 2:
|
victor@0
|
1505 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--;
|
victor@0
|
1506 else {
|
victor@0
|
1507 __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
|
1508 }
|
victor@0
|
1509 case 3:
|
victor@0
|
1510 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isFast)) != 0)) kw_args--;
|
victor@0
|
1511 else {
|
victor@0
|
1512 __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
|
1513 }
|
victor@0
|
1514 }
|
victor@0
|
1515 if (unlikely(kw_args > 0)) {
|
victor@0
|
1516 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
|
1517 }
|
victor@0
|
1518 } else if (PyTuple_GET_SIZE(__pyx_args) != 4) {
|
victor@0
|
1519 goto __pyx_L5_argtuple_error;
|
victor@0
|
1520 } else {
|
victor@0
|
1521 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
victor@0
|
1522 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
victor@0
|
1523 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
victor@0
|
1524 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
victor@0
|
1525 }
|
victor@0
|
1526 __pyx_v_self = values[0];
|
victor@0
|
1527 __pyx_v_seq1 = values[1];
|
victor@0
|
1528 __pyx_v_seq2 = values[2];
|
victor@0
|
1529 __pyx_v_isFast = values[3];
|
victor@0
|
1530 }
|
victor@0
|
1531 goto __pyx_L4_argument_unpacking_done;
|
victor@0
|
1532 __pyx_L5_argtuple_error:;
|
victor@0
|
1533 __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
|
1534 __pyx_L3_error:;
|
victor@0
|
1535 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
1536 __Pyx_RefNannyFinishContext();
|
victor@0
|
1537 return NULL;
|
victor@0
|
1538 __pyx_L4_argument_unpacking_done:;
|
victor@0
|
1539 __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
|
1540
|
victor@0
|
1541 /* function exit code */
|
victor@0
|
1542 __Pyx_RefNannyFinishContext();
|
victor@0
|
1543 return __pyx_r;
|
victor@0
|
1544 }
|
victor@0
|
1545
|
victor@0
|
1546 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
|
1547 PyObject *__pyx_v_indel = NULL;
|
victor@0
|
1548 int __pyx_v_n;
|
victor@0
|
1549 int __pyx_v_m;
|
victor@0
|
1550 PyArrayObject *__pyx_v_s = 0;
|
victor@0
|
1551 PyArrayObject *__pyx_v_ptr = 0;
|
victor@0
|
1552 int __pyx_v_i;
|
victor@0
|
1553 int __pyx_v_j;
|
victor@0
|
1554 int __pyx_v_p;
|
victor@0
|
1555 int __pyx_v_q;
|
victor@0
|
1556 PyObject *__pyx_v_diagonalRange = NULL;
|
victor@0
|
1557 PyObject *__pyx_v_myseq1 = NULL;
|
victor@0
|
1558 PyObject *__pyx_v_myseq2 = NULL;
|
victor@0
|
1559 PyObject *__pyx_v_score = NULL;
|
victor@0
|
1560 PyObject *__pyx_r = NULL;
|
victor@0
|
1561 __Pyx_RefNannyDeclarations
|
victor@0
|
1562 Py_ssize_t __pyx_t_1;
|
victor@0
|
1563 PyObject *__pyx_t_2 = NULL;
|
victor@0
|
1564 PyObject *__pyx_t_3 = NULL;
|
victor@0
|
1565 PyObject *__pyx_t_4 = NULL;
|
victor@0
|
1566 PyObject *__pyx_t_5 = NULL;
|
victor@0
|
1567 long __pyx_t_6;
|
victor@0
|
1568 int __pyx_t_7;
|
victor@0
|
1569 int __pyx_t_8;
|
victor@0
|
1570 int __pyx_t_9;
|
victor@0
|
1571 int __pyx_t_10;
|
victor@0
|
1572 long __pyx_t_11;
|
victor@0
|
1573 int __pyx_t_12;
|
victor@0
|
1574 int __pyx_t_13;
|
victor@0
|
1575 int __pyx_lineno = 0;
|
victor@0
|
1576 const char *__pyx_filename = NULL;
|
victor@0
|
1577 int __pyx_clineno = 0;
|
victor@0
|
1578 __Pyx_RefNannySetupContext("__needleman_wunsch_matrix", 0);
|
victor@0
|
1579
|
victor@0
|
1580 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":67
|
victor@0
|
1581 * """
|
victor@0
|
1582 *
|
victor@0
|
1583 * indel = -1 # indel penalty # <<<<<<<<<<<<<<
|
victor@0
|
1584 *
|
victor@0
|
1585 * cdef int n = len(seq1)
|
victor@0
|
1586 */
|
victor@0
|
1587 __Pyx_INCREF(__pyx_int_neg_1);
|
victor@0
|
1588 __pyx_v_indel = __pyx_int_neg_1;
|
victor@0
|
1589
|
victor@0
|
1590 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":69
|
victor@0
|
1591 * indel = -1 # indel penalty
|
victor@0
|
1592 *
|
victor@0
|
1593 * cdef int n = len(seq1) # <<<<<<<<<<<<<<
|
victor@0
|
1594 * cdef int m = len(seq2)
|
victor@0
|
1595 *
|
victor@0
|
1596 */
|
victor@0
|
1597 __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
|
1598 __pyx_v_n = __pyx_t_1;
|
victor@0
|
1599
|
victor@0
|
1600 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":70
|
victor@0
|
1601 *
|
victor@0
|
1602 * cdef int n = len(seq1)
|
victor@0
|
1603 * cdef int m = len(seq2) # <<<<<<<<<<<<<<
|
victor@0
|
1604 *
|
victor@0
|
1605 * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix
|
victor@0
|
1606 */
|
victor@0
|
1607 __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
|
1608 __pyx_v_m = __pyx_t_1;
|
victor@0
|
1609
|
victor@0
|
1610 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":72
|
victor@0
|
1611 * cdef int m = len(seq2)
|
victor@0
|
1612 *
|
victor@0
|
1613 * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix # <<<<<<<<<<<<<<
|
victor@0
|
1614 * cdef np.ndarray ptr = np.zeros( (n+1, m+1), dtype=int ) # matrix of pointers
|
victor@0
|
1615 *
|
victor@0
|
1616 */
|
victor@0
|
1617 __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
|
1618 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
1619 __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
|
1620 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1621 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
1622 __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
|
1623 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
1624 __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
|
1625 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
1626 __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
|
1627 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1628 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
|
victor@0
|
1629 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
1630 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
|
victor@0
|
1631 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
1632 __pyx_t_2 = 0;
|
victor@0
|
1633 __pyx_t_4 = 0;
|
victor@0
|
1634 __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
|
1635 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
1636 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
|
victor@0
|
1637 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
1638 __pyx_t_5 = 0;
|
victor@0
|
1639 __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
|
1640 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1641 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1642 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
1643 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
|
1644 __pyx_v_s = ((PyArrayObject *)__pyx_t_5);
|
victor@0
|
1645 __pyx_t_5 = 0;
|
victor@0
|
1646
|
victor@0
|
1647 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":73
|
victor@0
|
1648 *
|
victor@0
|
1649 * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix
|
victor@0
|
1650 * cdef np.ndarray ptr = np.zeros( (n+1, m+1), dtype=int ) # matrix of pointers # <<<<<<<<<<<<<<
|
victor@0
|
1651 *
|
victor@0
|
1652 * ##### INITIALIZE SCORING MATRIX (base case) #####
|
victor@0
|
1653 */
|
victor@0
|
1654 __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
|
1655 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1656 __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
|
1657 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
1658 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
1659 __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
|
1660 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1661 __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
|
1662 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1663 __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
|
1664 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
1665 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
|
victor@0
|
1666 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
1667 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
|
victor@0
|
1668 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
1669 __pyx_t_5 = 0;
|
victor@0
|
1670 __pyx_t_3 = 0;
|
victor@0
|
1671 __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
|
1672 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1673 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
|
victor@0
|
1674 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
1675 __pyx_t_2 = 0;
|
victor@0
|
1676 __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
|
1677 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
1678 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
|
1679 __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
|
1680 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1681 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
1682 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
1684 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
|
1685 __pyx_v_ptr = ((PyArrayObject *)__pyx_t_5);
|
victor@0
|
1686 __pyx_t_5 = 0;
|
victor@0
|
1687
|
victor@0
|
1688 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":79
|
victor@0
|
1689 * cdef int i
|
victor@0
|
1690 * cdef int j
|
victor@0
|
1691 * for i in range(1, n+1) : # <<<<<<<<<<<<<<
|
victor@0
|
1692 * s[i,0] = indel * i
|
victor@0
|
1693 * for j in range(1, m+1):
|
victor@0
|
1694 */
|
victor@0
|
1695 __pyx_t_6 = (__pyx_v_n + 1);
|
victor@0
|
1696 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
|
victor@0
|
1697 __pyx_v_i = __pyx_t_7;
|
victor@0
|
1698
|
victor@0
|
1699 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":80
|
victor@0
|
1700 * cdef int j
|
victor@0
|
1701 * for i in range(1, n+1) :
|
victor@0
|
1702 * s[i,0] = indel * i # <<<<<<<<<<<<<<
|
victor@0
|
1703 * for j in range(1, m+1):
|
victor@0
|
1704 * s[0,j] = indel * j
|
victor@0
|
1705 */
|
victor@0
|
1706 __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
|
1707 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1708 __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
|
1709 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
1710 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
1711 __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
|
1712 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1713 __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
|
1714 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1715 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5);
|
victor@0
|
1716 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
1717 __Pyx_INCREF(__pyx_int_0);
|
victor@0
|
1718 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
|
victor@0
|
1719 __Pyx_GIVEREF(__pyx_int_0);
|
victor@0
|
1720 __pyx_t_5 = 0;
|
victor@0
|
1721 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
|
1722 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1723 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
1724 }
|
victor@0
|
1725
|
victor@0
|
1726 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":81
|
victor@0
|
1727 * for i in range(1, n+1) :
|
victor@0
|
1728 * s[i,0] = indel * i
|
victor@0
|
1729 * for j in range(1, m+1): # <<<<<<<<<<<<<<
|
victor@0
|
1730 * s[0,j] = indel * j
|
victor@0
|
1731 *
|
victor@0
|
1732 */
|
victor@0
|
1733 __pyx_t_6 = (__pyx_v_m + 1);
|
victor@0
|
1734 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
|
victor@0
|
1735 __pyx_v_j = __pyx_t_7;
|
victor@0
|
1736
|
victor@0
|
1737 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":82
|
victor@0
|
1738 * s[i,0] = indel * i
|
victor@0
|
1739 * for j in range(1, m+1):
|
victor@0
|
1740 * s[0,j] = indel * j # <<<<<<<<<<<<<<
|
victor@0
|
1741 *
|
victor@0
|
1742 * ########## INITIALIZE TRACEBACK MATRIX ##########
|
victor@0
|
1743 */
|
victor@0
|
1744 __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
|
1745 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
1746 __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
|
1747 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1748 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
1749 __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
|
1750 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
1751 __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
|
1752 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1753 __Pyx_INCREF(__pyx_int_0);
|
victor@0
|
1754 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0);
|
victor@0
|
1755 __Pyx_GIVEREF(__pyx_int_0);
|
victor@0
|
1756 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
|
victor@0
|
1757 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
1758 __pyx_t_2 = 0;
|
victor@0
|
1759 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
|
1760 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
1761 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1762 }
|
victor@0
|
1763
|
victor@0
|
1764 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":87
|
victor@0
|
1765 *
|
victor@0
|
1766 * # Tag first row by LEFT, indicating initial "-"s
|
victor@0
|
1767 * ptr[0,1:] = LEFT # <<<<<<<<<<<<<<
|
victor@0
|
1768 *
|
victor@0
|
1769 * # Tag first column by UP, indicating initial "-"s
|
victor@0
|
1770 */
|
victor@0
|
1771 __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
|
1772 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1773 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
|
1774 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1775
|
victor@0
|
1776 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":90
|
victor@0
|
1777 *
|
victor@0
|
1778 * # Tag first column by UP, indicating initial "-"s
|
victor@0
|
1779 * ptr[1:,0] = UP # <<<<<<<<<<<<<<
|
victor@0
|
1780 *
|
victor@0
|
1781 * #####################################################
|
victor@0
|
1782 */
|
victor@0
|
1783 __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
|
1784 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1785 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
|
1786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1787
|
victor@0
|
1788 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":97
|
victor@0
|
1789 * cdef int p
|
victor@0
|
1790 * cdef int q
|
victor@0
|
1791 * diagonalRange=350 # <<<<<<<<<<<<<<
|
victor@0
|
1792 * for i in range(1,n+1):
|
victor@0
|
1793 * p=i-diagonalRange
|
victor@0
|
1794 */
|
victor@0
|
1795 __Pyx_INCREF(__pyx_int_350);
|
victor@0
|
1796 __pyx_v_diagonalRange = __pyx_int_350;
|
victor@0
|
1797
|
victor@0
|
1798 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":98
|
victor@0
|
1799 * cdef int q
|
victor@0
|
1800 * diagonalRange=350
|
victor@0
|
1801 * for i in range(1,n+1): # <<<<<<<<<<<<<<
|
victor@0
|
1802 * p=i-diagonalRange
|
victor@0
|
1803 * q=i+diagonalRange
|
victor@0
|
1804 */
|
victor@0
|
1805 __pyx_t_6 = (__pyx_v_n + 1);
|
victor@0
|
1806 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) {
|
victor@0
|
1807 __pyx_v_i = __pyx_t_7;
|
victor@0
|
1808
|
victor@0
|
1809 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":99
|
victor@0
|
1810 * diagonalRange=350
|
victor@0
|
1811 * for i in range(1,n+1):
|
victor@0
|
1812 * p=i-diagonalRange # <<<<<<<<<<<<<<
|
victor@0
|
1813 * q=i+diagonalRange
|
victor@0
|
1814 * if(p<1):
|
victor@0
|
1815 */
|
victor@0
|
1816 __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
|
1817 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1818 __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
|
1819 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1821 __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
|
1822 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
1823 __pyx_v_p = __pyx_t_8;
|
victor@0
|
1824
|
victor@0
|
1825 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":100
|
victor@0
|
1826 * for i in range(1,n+1):
|
victor@0
|
1827 * p=i-diagonalRange
|
victor@0
|
1828 * q=i+diagonalRange # <<<<<<<<<<<<<<
|
victor@0
|
1829 * if(p<1):
|
victor@0
|
1830 * p=1
|
victor@0
|
1831 */
|
victor@0
|
1832 __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
|
1833 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
1834 __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
|
1835 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1836 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
1837 __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
|
1838 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1839 __pyx_v_q = __pyx_t_8;
|
victor@0
|
1840
|
victor@0
|
1841 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":101
|
victor@0
|
1842 * p=i-diagonalRange
|
victor@0
|
1843 * q=i+diagonalRange
|
victor@0
|
1844 * if(p<1): # <<<<<<<<<<<<<<
|
victor@0
|
1845 * p=1
|
victor@0
|
1846 * if(q>m+1):
|
victor@0
|
1847 */
|
victor@0
|
1848 __pyx_t_9 = ((__pyx_v_p < 1) != 0);
|
victor@0
|
1849 if (__pyx_t_9) {
|
victor@0
|
1850
|
victor@0
|
1851 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":102
|
victor@0
|
1852 * q=i+diagonalRange
|
victor@0
|
1853 * if(p<1):
|
victor@0
|
1854 * p=1 # <<<<<<<<<<<<<<
|
victor@0
|
1855 * if(q>m+1):
|
victor@0
|
1856 * q=m+1
|
victor@0
|
1857 */
|
victor@0
|
1858 __pyx_v_p = 1;
|
victor@0
|
1859 goto __pyx_L9;
|
victor@0
|
1860 }
|
victor@0
|
1861 __pyx_L9:;
|
victor@0
|
1862
|
victor@0
|
1863 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":103
|
victor@0
|
1864 * if(p<1):
|
victor@0
|
1865 * p=1
|
victor@0
|
1866 * if(q>m+1): # <<<<<<<<<<<<<<
|
victor@0
|
1867 * q=m+1
|
victor@0
|
1868 * for j in range(p,q):
|
victor@0
|
1869 */
|
victor@0
|
1870 __pyx_t_9 = ((__pyx_v_q > (__pyx_v_m + 1)) != 0);
|
victor@0
|
1871 if (__pyx_t_9) {
|
victor@0
|
1872
|
victor@0
|
1873 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":104
|
victor@0
|
1874 * p=1
|
victor@0
|
1875 * if(q>m+1):
|
victor@0
|
1876 * q=m+1 # <<<<<<<<<<<<<<
|
victor@0
|
1877 * for j in range(p,q):
|
victor@0
|
1878 * # match
|
victor@0
|
1879 */
|
victor@0
|
1880 __pyx_v_q = (__pyx_v_m + 1);
|
victor@0
|
1881 goto __pyx_L10;
|
victor@0
|
1882 }
|
victor@0
|
1883 __pyx_L10:;
|
victor@0
|
1884
|
victor@0
|
1885 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":105
|
victor@0
|
1886 * if(q>m+1):
|
victor@0
|
1887 * q=m+1
|
victor@0
|
1888 * for j in range(p,q): # <<<<<<<<<<<<<<
|
victor@0
|
1889 * # match
|
victor@0
|
1890 * myseq1=seq1[i-1]
|
victor@0
|
1891 */
|
victor@0
|
1892 __pyx_t_8 = __pyx_v_q;
|
victor@0
|
1893 for (__pyx_t_10 = __pyx_v_p; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) {
|
victor@0
|
1894 __pyx_v_j = __pyx_t_10;
|
victor@0
|
1895
|
victor@0
|
1896 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":107
|
victor@0
|
1897 * for j in range(p,q):
|
victor@0
|
1898 * # match
|
victor@0
|
1899 * myseq1=seq1[i-1] # <<<<<<<<<<<<<<
|
victor@0
|
1900 * myseq2=seq2[j-1]
|
victor@0
|
1901 * if isinstance(myseq1,list):
|
victor@0
|
1902 */
|
victor@0
|
1903 __pyx_t_11 = (__pyx_v_i - 1);
|
victor@0
|
1904 __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
|
1905 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1906 __Pyx_XDECREF_SET(__pyx_v_myseq1, __pyx_t_3);
|
victor@0
|
1907 __pyx_t_3 = 0;
|
victor@0
|
1908
|
victor@0
|
1909 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":108
|
victor@0
|
1910 * # match
|
victor@0
|
1911 * myseq1=seq1[i-1]
|
victor@0
|
1912 * myseq2=seq2[j-1] # <<<<<<<<<<<<<<
|
victor@0
|
1913 * if isinstance(myseq1,list):
|
victor@0
|
1914 * myseq1=myseq1[0]
|
victor@0
|
1915 */
|
victor@0
|
1916 __pyx_t_11 = (__pyx_v_j - 1);
|
victor@0
|
1917 __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
|
1918 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1919 __Pyx_XDECREF_SET(__pyx_v_myseq2, __pyx_t_3);
|
victor@0
|
1920 __pyx_t_3 = 0;
|
victor@0
|
1921
|
victor@0
|
1922 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":109
|
victor@0
|
1923 * myseq1=seq1[i-1]
|
victor@0
|
1924 * myseq2=seq2[j-1]
|
victor@0
|
1925 * if isinstance(myseq1,list): # <<<<<<<<<<<<<<
|
victor@0
|
1926 * myseq1=myseq1[0]
|
victor@0
|
1927 * if isinstance(myseq2,list):
|
victor@0
|
1928 */
|
victor@0
|
1929 __pyx_t_9 = PyList_Check(__pyx_v_myseq1);
|
victor@0
|
1930 __pyx_t_12 = (__pyx_t_9 != 0);
|
victor@0
|
1931 if (__pyx_t_12) {
|
victor@0
|
1932
|
victor@0
|
1933 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":110
|
victor@0
|
1934 * myseq2=seq2[j-1]
|
victor@0
|
1935 * if isinstance(myseq1,list):
|
victor@0
|
1936 * myseq1=myseq1[0] # <<<<<<<<<<<<<<
|
victor@0
|
1937 * if isinstance(myseq2,list):
|
victor@0
|
1938 * myseq2=myseq2[0]
|
victor@0
|
1939 */
|
victor@0
|
1940 __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
|
1941 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1942 __Pyx_DECREF_SET(__pyx_v_myseq1, __pyx_t_3);
|
victor@0
|
1943 __pyx_t_3 = 0;
|
victor@0
|
1944 goto __pyx_L13;
|
victor@0
|
1945 }
|
victor@0
|
1946 __pyx_L13:;
|
victor@0
|
1947
|
victor@0
|
1948 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":111
|
victor@0
|
1949 * if isinstance(myseq1,list):
|
victor@0
|
1950 * myseq1=myseq1[0]
|
victor@0
|
1951 * if isinstance(myseq2,list): # <<<<<<<<<<<<<<
|
victor@0
|
1952 * myseq2=myseq2[0]
|
victor@0
|
1953 *
|
victor@0
|
1954 */
|
victor@0
|
1955 __pyx_t_12 = PyList_Check(__pyx_v_myseq2);
|
victor@0
|
1956 __pyx_t_9 = (__pyx_t_12 != 0);
|
victor@0
|
1957 if (__pyx_t_9) {
|
victor@0
|
1958
|
victor@0
|
1959 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":112
|
victor@0
|
1960 * myseq1=myseq1[0]
|
victor@0
|
1961 * if isinstance(myseq2,list):
|
victor@0
|
1962 * myseq2=myseq2[0] # <<<<<<<<<<<<<<
|
victor@0
|
1963 *
|
victor@0
|
1964 *
|
victor@0
|
1965 */
|
victor@0
|
1966 __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
|
1967 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
1968 __Pyx_DECREF_SET(__pyx_v_myseq2, __pyx_t_3);
|
victor@0
|
1969 __pyx_t_3 = 0;
|
victor@0
|
1970 goto __pyx_L14;
|
victor@0
|
1971 }
|
victor@0
|
1972 __pyx_L14:;
|
victor@0
|
1973
|
victor@0
|
1974 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":115
|
victor@0
|
1975 *
|
victor@0
|
1976 *
|
victor@0
|
1977 * if(myseq1== myseq2): # <<<<<<<<<<<<<<
|
victor@0
|
1978 * score=1
|
victor@0
|
1979 * else:
|
victor@0
|
1980 */
|
victor@0
|
1981 __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
|
1982 __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
|
1983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
1984 if (__pyx_t_9) {
|
victor@0
|
1985
|
victor@0
|
1986 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":116
|
victor@0
|
1987 *
|
victor@0
|
1988 * if(myseq1== myseq2):
|
victor@0
|
1989 * score=1 # <<<<<<<<<<<<<<
|
victor@0
|
1990 * else:
|
victor@0
|
1991 * score=-1
|
victor@0
|
1992 */
|
victor@0
|
1993 __Pyx_INCREF(__pyx_int_1);
|
victor@0
|
1994 __Pyx_XDECREF_SET(__pyx_v_score, __pyx_int_1);
|
victor@0
|
1995 goto __pyx_L15;
|
victor@0
|
1996 }
|
victor@0
|
1997 /*else*/ {
|
victor@0
|
1998
|
victor@0
|
1999 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":118
|
victor@0
|
2000 * score=1
|
victor@0
|
2001 * else:
|
victor@0
|
2002 * score=-1 # <<<<<<<<<<<<<<
|
victor@0
|
2003 *
|
victor@0
|
2004 * if len(myseq1)==0 or len(myseq2)==0:
|
victor@0
|
2005 */
|
victor@0
|
2006 __Pyx_INCREF(__pyx_int_neg_1);
|
victor@0
|
2007 __Pyx_XDECREF_SET(__pyx_v_score, __pyx_int_neg_1);
|
victor@0
|
2008 }
|
victor@0
|
2009 __pyx_L15:;
|
victor@0
|
2010
|
victor@0
|
2011 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":120
|
victor@0
|
2012 * score=-1
|
victor@0
|
2013 *
|
victor@0
|
2014 * if len(myseq1)==0 or len(myseq2)==0: # <<<<<<<<<<<<<<
|
victor@0
|
2015 * score=0
|
victor@0
|
2016 *
|
victor@0
|
2017 */
|
victor@0
|
2018 __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
|
2019 __pyx_t_9 = ((__pyx_t_1 == 0) != 0);
|
victor@0
|
2020 if (!__pyx_t_9) {
|
victor@0
|
2021 __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
|
2022 __pyx_t_12 = ((__pyx_t_1 == 0) != 0);
|
victor@0
|
2023 __pyx_t_13 = __pyx_t_12;
|
victor@0
|
2024 } else {
|
victor@0
|
2025 __pyx_t_13 = __pyx_t_9;
|
victor@0
|
2026 }
|
victor@0
|
2027 if (__pyx_t_13) {
|
victor@0
|
2028
|
victor@0
|
2029 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":121
|
victor@0
|
2030 *
|
victor@0
|
2031 * if len(myseq1)==0 or len(myseq2)==0:
|
victor@0
|
2032 * score=0 # <<<<<<<<<<<<<<
|
victor@0
|
2033 *
|
victor@0
|
2034 * #####For double alignment###
|
victor@0
|
2035 */
|
victor@0
|
2036 __Pyx_INCREF(__pyx_int_0);
|
victor@0
|
2037 __Pyx_DECREF_SET(__pyx_v_score, __pyx_int_0);
|
victor@0
|
2038 goto __pyx_L16;
|
victor@0
|
2039 }
|
victor@0
|
2040 __pyx_L16:;
|
victor@0
|
2041
|
victor@0
|
2042 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":124
|
victor@0
|
2043 *
|
victor@0
|
2044 * #####For double alignment###
|
victor@0
|
2045 * if isFast==False: # <<<<<<<<<<<<<<
|
victor@0
|
2046 * if len(myseq1)==0 or len(myseq2)==0:
|
victor@0
|
2047 * score=0
|
victor@0
|
2048 */
|
victor@0
|
2049 __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
|
2050 __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
|
2051 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2052 if (__pyx_t_13) {
|
victor@0
|
2053
|
victor@0
|
2054 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":125
|
victor@0
|
2055 * #####For double alignment###
|
victor@0
|
2056 * if isFast==False:
|
victor@0
|
2057 * if len(myseq1)==0 or len(myseq2)==0: # <<<<<<<<<<<<<<
|
victor@0
|
2058 * score=0
|
victor@0
|
2059 * else:
|
victor@0
|
2060 */
|
victor@0
|
2061 __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
|
2062 __pyx_t_13 = ((__pyx_t_1 == 0) != 0);
|
victor@0
|
2063 if (!__pyx_t_13) {
|
victor@0
|
2064 __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
|
2065 __pyx_t_9 = ((__pyx_t_1 == 0) != 0);
|
victor@0
|
2066 __pyx_t_12 = __pyx_t_9;
|
victor@0
|
2067 } else {
|
victor@0
|
2068 __pyx_t_12 = __pyx_t_13;
|
victor@0
|
2069 }
|
victor@0
|
2070 if (__pyx_t_12) {
|
victor@0
|
2071
|
victor@0
|
2072 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":126
|
victor@0
|
2073 * if isFast==False:
|
victor@0
|
2074 * if len(myseq1)==0 or len(myseq2)==0:
|
victor@0
|
2075 * score=0 # <<<<<<<<<<<<<<
|
victor@0
|
2076 * else:
|
victor@0
|
2077 * score=NWunsch.NWunsch_getSimilarity(myseq1,myseq2)
|
victor@0
|
2078 */
|
victor@0
|
2079 __Pyx_INCREF(__pyx_int_0);
|
victor@0
|
2080 __Pyx_DECREF_SET(__pyx_v_score, __pyx_int_0);
|
victor@0
|
2081 goto __pyx_L18;
|
victor@0
|
2082 }
|
victor@0
|
2083 /*else*/ {
|
victor@0
|
2084
|
victor@0
|
2085 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":128
|
victor@0
|
2086 * score=0
|
victor@0
|
2087 * else:
|
victor@0
|
2088 * score=NWunsch.NWunsch_getSimilarity(myseq1,myseq2) # <<<<<<<<<<<<<<
|
victor@0
|
2089 * ############################
|
victor@0
|
2090 *
|
victor@0
|
2091 */
|
victor@0
|
2092 __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
|
2093 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2094 __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
|
2095 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2096 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2097 __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
|
2098 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2099 __Pyx_INCREF(__pyx_v_myseq1);
|
victor@0
|
2100 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_myseq1);
|
victor@0
|
2101 __Pyx_GIVEREF(__pyx_v_myseq1);
|
victor@0
|
2102 __Pyx_INCREF(__pyx_v_myseq2);
|
victor@0
|
2103 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_myseq2);
|
victor@0
|
2104 __Pyx_GIVEREF(__pyx_v_myseq2);
|
victor@0
|
2105 __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
|
2106 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2107 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2108 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2109 __Pyx_DECREF_SET(__pyx_v_score, __pyx_t_2);
|
victor@0
|
2110 __pyx_t_2 = 0;
|
victor@0
|
2111 }
|
victor@0
|
2112 __pyx_L18:;
|
victor@0
|
2113 goto __pyx_L17;
|
victor@0
|
2114 }
|
victor@0
|
2115 __pyx_L17:;
|
victor@0
|
2116
|
victor@0
|
2117 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":131
|
victor@0
|
2118 * ############################
|
victor@0
|
2119 *
|
victor@0
|
2120 * s[i,j] = s[i-1,j-1]+ score # <<<<<<<<<<<<<<
|
victor@0
|
2121 *
|
victor@0
|
2122 *
|
victor@0
|
2123 */
|
victor@0
|
2124 __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
|
2125 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2126 __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
|
2127 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2128 __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
|
2129 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2130 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
|
victor@0
|
2131 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
2132 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
|
victor@0
|
2133 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
2134 __pyx_t_2 = 0;
|
victor@0
|
2135 __pyx_t_3 = 0;
|
victor@0
|
2136 __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
|
2137 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2138 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2139 __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
|
2140 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2142 __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
|
2143 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2144 __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
|
2145 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2146 __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
|
2147 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2148 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
|
victor@0
|
2149 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
2150 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
|
victor@0
|
2151 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
2152 __pyx_t_3 = 0;
|
victor@0
|
2153 __pyx_t_2 = 0;
|
victor@0
|
2154 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
|
2155 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2156 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2157
|
victor@0
|
2158 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":135
|
victor@0
|
2159 *
|
victor@0
|
2160 * # indel penalty
|
victor@0
|
2161 * if s[i-1,j] + indel > s[i,j] : # <<<<<<<<<<<<<<
|
victor@0
|
2162 * s[i,j] = s[i-1,j] + indel
|
victor@0
|
2163 * ptr[i,j] = UP
|
victor@0
|
2164 */
|
victor@0
|
2165 __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
|
2166 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2167 __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
|
2168 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2169 __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
|
2170 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2171 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
|
victor@0
|
2172 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2173 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
|
victor@0
|
2174 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2175 __pyx_t_5 = 0;
|
victor@0
|
2176 __pyx_t_4 = 0;
|
victor@0
|
2177 __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
|
2178 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2179 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2180 __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
|
2181 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2182 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2183 __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
|
2184 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2185 __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
|
2186 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2187 __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
|
2188 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2189 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
|
victor@0
|
2190 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2191 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
|
victor@0
|
2192 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2193 __pyx_t_4 = 0;
|
victor@0
|
2194 __pyx_t_5 = 0;
|
victor@0
|
2195 __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
|
2196 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2198 __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
|
2199 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2200 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2201 __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
|
2202 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2203 if (__pyx_t_12) {
|
victor@0
|
2204
|
victor@0
|
2205 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":136
|
victor@0
|
2206 * # indel penalty
|
victor@0
|
2207 * if s[i-1,j] + indel > s[i,j] :
|
victor@0
|
2208 * s[i,j] = s[i-1,j] + indel # <<<<<<<<<<<<<<
|
victor@0
|
2209 * ptr[i,j] = UP
|
victor@0
|
2210 * # indel penalty
|
victor@0
|
2211 */
|
victor@0
|
2212 __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
|
2213 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2214 __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
|
2215 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2216 __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
|
2217 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2218 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
|
victor@0
|
2219 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
2220 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5);
|
victor@0
|
2221 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2222 __pyx_t_3 = 0;
|
victor@0
|
2223 __pyx_t_5 = 0;
|
victor@0
|
2224 __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
|
2225 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2227 __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
|
2228 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2229 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2230 __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
|
2231 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2232 __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
|
2233 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2234 __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
|
2235 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2236 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
|
victor@0
|
2237 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2238 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
|
victor@0
|
2239 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
2240 __pyx_t_5 = 0;
|
victor@0
|
2241 __pyx_t_3 = 0;
|
victor@0
|
2242 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
|
2243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2245
|
victor@0
|
2246 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":137
|
victor@0
|
2247 * if s[i-1,j] + indel > s[i,j] :
|
victor@0
|
2248 * s[i,j] = s[i-1,j] + indel
|
victor@0
|
2249 * ptr[i,j] = UP # <<<<<<<<<<<<<<
|
victor@0
|
2250 * # indel penalty
|
victor@0
|
2251 * if s[i, j-1] + indel > s[i,j]:
|
victor@0
|
2252 */
|
victor@0
|
2253 __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
|
2254 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2255 __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
|
2256 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2257 __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
|
2258 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2259 __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
|
2260 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2261 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
|
victor@0
|
2262 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2263 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3);
|
victor@0
|
2264 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
2265 __pyx_t_4 = 0;
|
victor@0
|
2266 __pyx_t_3 = 0;
|
victor@0
|
2267 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
|
2268 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2270 goto __pyx_L19;
|
victor@0
|
2271 }
|
victor@0
|
2272 __pyx_L19:;
|
victor@0
|
2273
|
victor@0
|
2274 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":139
|
victor@0
|
2275 * ptr[i,j] = UP
|
victor@0
|
2276 * # indel penalty
|
victor@0
|
2277 * if s[i, j-1] + indel > s[i,j]: # <<<<<<<<<<<<<<
|
victor@0
|
2278 * s[i,j] = s[i, j-1] + indel
|
victor@0
|
2279 * ptr[i,j] = LEFT
|
victor@0
|
2280 */
|
victor@0
|
2281 __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
|
2282 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2283 __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
|
2284 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2285 __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
|
2286 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2287 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
|
victor@0
|
2288 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
2289 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5);
|
victor@0
|
2290 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2291 __pyx_t_2 = 0;
|
victor@0
|
2292 __pyx_t_5 = 0;
|
victor@0
|
2293 __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
|
2294 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2296 __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
|
2297 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2298 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2299 __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
|
2300 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2301 __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
|
2302 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2303 __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
|
2304 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2305 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
|
victor@0
|
2306 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2307 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
|
victor@0
|
2308 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
2309 __pyx_t_5 = 0;
|
victor@0
|
2310 __pyx_t_2 = 0;
|
victor@0
|
2311 __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
|
2312 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2313 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2314 __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
|
2315 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2316 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2317 __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
|
2318 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2319 if (__pyx_t_12) {
|
victor@0
|
2320
|
victor@0
|
2321 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":140
|
victor@0
|
2322 * # indel penalty
|
victor@0
|
2323 * if s[i, j-1] + indel > s[i,j]:
|
victor@0
|
2324 * s[i,j] = s[i, j-1] + indel # <<<<<<<<<<<<<<
|
victor@0
|
2325 * ptr[i,j] = LEFT
|
victor@0
|
2326 *
|
victor@0
|
2327 */
|
victor@0
|
2328 __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
|
2329 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2330 __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
|
2331 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2332 __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
|
2333 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2334 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
|
victor@0
|
2335 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2336 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
|
victor@0
|
2337 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
2338 __pyx_t_4 = 0;
|
victor@0
|
2339 __pyx_t_2 = 0;
|
victor@0
|
2340 __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
|
2341 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2342 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2343 __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
|
2344 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2346 __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
|
2347 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2348 __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
|
2349 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2350 __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
|
2351 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2352 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2);
|
victor@0
|
2353 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
2354 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
|
victor@0
|
2355 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2356 __pyx_t_2 = 0;
|
victor@0
|
2357 __pyx_t_4 = 0;
|
victor@0
|
2358 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
|
2359 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2361
|
victor@0
|
2362 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":141
|
victor@0
|
2363 * if s[i, j-1] + indel > s[i,j]:
|
victor@0
|
2364 * s[i,j] = s[i, j-1] + indel
|
victor@0
|
2365 * ptr[i,j] = LEFT # <<<<<<<<<<<<<<
|
victor@0
|
2366 *
|
victor@0
|
2367 * return s, ptr
|
victor@0
|
2368 */
|
victor@0
|
2369 __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
|
2370 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2371 __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
|
2372 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2373 __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
|
2374 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2375 __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
|
2376 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
2377 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5);
|
victor@0
|
2378 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2379 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
|
victor@0
|
2380 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2381 __pyx_t_5 = 0;
|
victor@0
|
2382 __pyx_t_4 = 0;
|
victor@0
|
2383 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
|
2384 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
2385 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
2386 goto __pyx_L20;
|
victor@0
|
2387 }
|
victor@0
|
2388 __pyx_L20:;
|
victor@0
|
2389 }
|
victor@0
|
2390 }
|
victor@0
|
2391
|
victor@0
|
2392 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":143
|
victor@0
|
2393 * ptr[i,j] = LEFT
|
victor@0
|
2394 *
|
victor@0
|
2395 * return s, ptr # <<<<<<<<<<<<<<
|
victor@0
|
2396 *
|
victor@0
|
2397 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) :
|
victor@0
|
2398 */
|
victor@0
|
2399 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
2400 __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
|
2401 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
2402 __Pyx_INCREF(((PyObject *)__pyx_v_s));
|
victor@0
|
2403 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_s));
|
victor@0
|
2404 __Pyx_GIVEREF(((PyObject *)__pyx_v_s));
|
victor@0
|
2405 __Pyx_INCREF(((PyObject *)__pyx_v_ptr));
|
victor@0
|
2406 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_ptr));
|
victor@0
|
2407 __Pyx_GIVEREF(((PyObject *)__pyx_v_ptr));
|
victor@0
|
2408 __pyx_r = __pyx_t_3;
|
victor@0
|
2409 __pyx_t_3 = 0;
|
victor@0
|
2410 goto __pyx_L0;
|
victor@0
|
2411
|
victor@0
|
2412 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57
|
victor@0
|
2413 * class FastAlignmentArrays:
|
victor@0
|
2414 *
|
victor@0
|
2415 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<<
|
victor@0
|
2416 * """
|
victor@0
|
2417 * fill in the DP matrix according to the Needleman-Wunsch algorithm.
|
victor@0
|
2418 */
|
victor@0
|
2419
|
victor@0
|
2420 /* function exit code */
|
victor@0
|
2421 __pyx_L1_error:;
|
victor@0
|
2422 __Pyx_XDECREF(__pyx_t_2);
|
victor@0
|
2423 __Pyx_XDECREF(__pyx_t_3);
|
victor@0
|
2424 __Pyx_XDECREF(__pyx_t_4);
|
victor@0
|
2425 __Pyx_XDECREF(__pyx_t_5);
|
victor@0
|
2426 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
2427 __pyx_r = NULL;
|
victor@0
|
2428 __pyx_L0:;
|
victor@0
|
2429 __Pyx_XDECREF(__pyx_v_indel);
|
victor@0
|
2430 __Pyx_XDECREF((PyObject *)__pyx_v_s);
|
victor@0
|
2431 __Pyx_XDECREF((PyObject *)__pyx_v_ptr);
|
victor@0
|
2432 __Pyx_XDECREF(__pyx_v_diagonalRange);
|
victor@0
|
2433 __Pyx_XDECREF(__pyx_v_myseq1);
|
victor@0
|
2434 __Pyx_XDECREF(__pyx_v_myseq2);
|
victor@0
|
2435 __Pyx_XDECREF(__pyx_v_score);
|
victor@0
|
2436 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
2437 __Pyx_RefNannyFinishContext();
|
victor@0
|
2438 return __pyx_r;
|
victor@0
|
2439 }
|
victor@0
|
2440
|
victor@0
|
2441 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145
|
victor@0
|
2442 * return s, ptr
|
victor@0
|
2443 *
|
victor@0
|
2444 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<<
|
victor@0
|
2445 *
|
victor@0
|
2446 * #### TRACE BEST PATH TO GET ALIGNMENT ####
|
victor@0
|
2447 */
|
victor@0
|
2448
|
victor@0
|
2449 /* Python wrapper */
|
victor@0
|
2450 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
victor@0
|
2451 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
|
2452 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
victor@0
|
2453 CYTHON_UNUSED PyObject *__pyx_v_self = 0;
|
victor@0
|
2454 PyObject *__pyx_v_seq1 = 0;
|
victor@0
|
2455 PyObject *__pyx_v_seq2 = 0;
|
victor@0
|
2456 CYTHON_UNUSED PyArrayObject *__pyx_v_s = 0;
|
victor@0
|
2457 PyArrayObject *__pyx_v_ptr = 0;
|
victor@0
|
2458 int __pyx_lineno = 0;
|
victor@0
|
2459 const char *__pyx_filename = NULL;
|
victor@0
|
2460 int __pyx_clineno = 0;
|
victor@0
|
2461 PyObject *__pyx_r = 0;
|
victor@0
|
2462 __Pyx_RefNannyDeclarations
|
victor@0
|
2463 __Pyx_RefNannySetupContext("__needleman_wunsch_trace (wrapper)", 0);
|
victor@0
|
2464 {
|
victor@0
|
2465 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
|
2466 PyObject* values[5] = {0,0,0,0,0};
|
victor@0
|
2467 if (unlikely(__pyx_kwds)) {
|
victor@0
|
2468 Py_ssize_t kw_args;
|
victor@0
|
2469 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
victor@0
|
2470 switch (pos_args) {
|
victor@0
|
2471 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
|
victor@0
|
2472 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
victor@0
|
2473 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
victor@0
|
2474 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
victor@0
|
2475 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
victor@0
|
2476 case 0: break;
|
victor@0
|
2477 default: goto __pyx_L5_argtuple_error;
|
victor@0
|
2478 }
|
victor@0
|
2479 kw_args = PyDict_Size(__pyx_kwds);
|
victor@0
|
2480 switch (pos_args) {
|
victor@0
|
2481 case 0:
|
victor@0
|
2482 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
|
victor@0
|
2483 else goto __pyx_L5_argtuple_error;
|
victor@0
|
2484 case 1:
|
victor@0
|
2485 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--;
|
victor@0
|
2486 else {
|
victor@0
|
2487 __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
|
2488 }
|
victor@0
|
2489 case 2:
|
victor@0
|
2490 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--;
|
victor@0
|
2491 else {
|
victor@0
|
2492 __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
|
2493 }
|
victor@0
|
2494 case 3:
|
victor@0
|
2495 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--;
|
victor@0
|
2496 else {
|
victor@0
|
2497 __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
|
2498 }
|
victor@0
|
2499 case 4:
|
victor@0
|
2500 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ptr)) != 0)) kw_args--;
|
victor@0
|
2501 else {
|
victor@0
|
2502 __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
|
2503 }
|
victor@0
|
2504 }
|
victor@0
|
2505 if (unlikely(kw_args > 0)) {
|
victor@0
|
2506 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
|
2507 }
|
victor@0
|
2508 } else if (PyTuple_GET_SIZE(__pyx_args) != 5) {
|
victor@0
|
2509 goto __pyx_L5_argtuple_error;
|
victor@0
|
2510 } else {
|
victor@0
|
2511 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
victor@0
|
2512 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
victor@0
|
2513 values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
victor@0
|
2514 values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
victor@0
|
2515 values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
|
victor@0
|
2516 }
|
victor@0
|
2517 __pyx_v_self = values[0];
|
victor@0
|
2518 __pyx_v_seq1 = values[1];
|
victor@0
|
2519 __pyx_v_seq2 = values[2];
|
victor@0
|
2520 __pyx_v_s = ((PyArrayObject *)values[3]);
|
victor@0
|
2521 __pyx_v_ptr = ((PyArrayObject *)values[4]);
|
victor@0
|
2522 }
|
victor@0
|
2523 goto __pyx_L4_argument_unpacking_done;
|
victor@0
|
2524 __pyx_L5_argtuple_error:;
|
victor@0
|
2525 __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
|
2526 __pyx_L3_error:;
|
victor@0
|
2527 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
2528 __Pyx_RefNannyFinishContext();
|
victor@0
|
2529 return NULL;
|
victor@0
|
2530 __pyx_L4_argument_unpacking_done:;
|
victor@0
|
2531 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
|
2532 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
|
2533 __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
|
2534
|
victor@0
|
2535 /* function exit code */
|
victor@0
|
2536 goto __pyx_L0;
|
victor@0
|
2537 __pyx_L1_error:;
|
victor@0
|
2538 __pyx_r = NULL;
|
victor@0
|
2539 __pyx_L0:;
|
victor@0
|
2540 __Pyx_RefNannyFinishContext();
|
victor@0
|
2541 return __pyx_r;
|
victor@0
|
2542 }
|
victor@0
|
2543
|
victor@0
|
2544 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
|
2545 PyObject *__pyx_v_align1 = NULL;
|
victor@0
|
2546 PyObject *__pyx_v_align2 = NULL;
|
victor@0
|
2547 PyObject *__pyx_v_align1_gap = NULL;
|
victor@0
|
2548 PyObject *__pyx_v_align2_gap = NULL;
|
victor@0
|
2549 PyObject *__pyx_v_gap1 = NULL;
|
victor@0
|
2550 PyObject *__pyx_v_gap2 = NULL;
|
victor@0
|
2551 int __pyx_v_n;
|
victor@0
|
2552 int __pyx_v_m;
|
victor@0
|
2553 int __pyx_v_i;
|
victor@0
|
2554 int __pyx_v_j;
|
victor@0
|
2555 int __pyx_v_curr;
|
victor@0
|
2556 Py_ssize_t __pyx_v_index;
|
victor@0
|
2557 PyObject *__pyx_r = NULL;
|
victor@0
|
2558 __Pyx_RefNannyDeclarations
|
victor@0
|
2559 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
2560 Py_ssize_t __pyx_t_2;
|
victor@0
|
2561 Py_ssize_t __pyx_t_3;
|
victor@0
|
2562 PyObject *__pyx_t_4 = NULL;
|
victor@0
|
2563 PyObject *__pyx_t_5 = NULL;
|
victor@0
|
2564 int __pyx_t_6;
|
victor@0
|
2565 int __pyx_t_7;
|
victor@0
|
2566 int __pyx_t_8;
|
victor@0
|
2567 int __pyx_t_9;
|
victor@0
|
2568 long __pyx_t_10;
|
victor@0
|
2569 int __pyx_t_11;
|
victor@0
|
2570 int __pyx_lineno = 0;
|
victor@0
|
2571 const char *__pyx_filename = NULL;
|
victor@0
|
2572 int __pyx_clineno = 0;
|
victor@0
|
2573 __Pyx_RefNannySetupContext("__needleman_wunsch_trace", 0);
|
victor@0
|
2574
|
victor@0
|
2575 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":148
|
victor@0
|
2576 *
|
victor@0
|
2577 * #### TRACE BEST PATH TO GET ALIGNMENT ####
|
victor@0
|
2578 * align1 = [] # <<<<<<<<<<<<<<
|
victor@0
|
2579 * align2 = []
|
victor@0
|
2580 * align1_gap = []
|
victor@0
|
2581 */
|
victor@0
|
2582 __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
|
2583 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2584 __pyx_v_align1 = ((PyObject*)__pyx_t_1);
|
victor@0
|
2585 __pyx_t_1 = 0;
|
victor@0
|
2586
|
victor@0
|
2587 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":149
|
victor@0
|
2588 * #### TRACE BEST PATH TO GET ALIGNMENT ####
|
victor@0
|
2589 * align1 = []
|
victor@0
|
2590 * align2 = [] # <<<<<<<<<<<<<<
|
victor@0
|
2591 * align1_gap = []
|
victor@0
|
2592 * align2_gap = []
|
victor@0
|
2593 */
|
victor@0
|
2594 __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
|
2595 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2596 __pyx_v_align2 = ((PyObject*)__pyx_t_1);
|
victor@0
|
2597 __pyx_t_1 = 0;
|
victor@0
|
2598
|
victor@0
|
2599 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":150
|
victor@0
|
2600 * align1 = []
|
victor@0
|
2601 * align2 = []
|
victor@0
|
2602 * align1_gap = [] # <<<<<<<<<<<<<<
|
victor@0
|
2603 * align2_gap = []
|
victor@0
|
2604 * gap1=[]
|
victor@0
|
2605 */
|
victor@0
|
2606 __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
|
2607 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2608 __pyx_v_align1_gap = ((PyObject*)__pyx_t_1);
|
victor@0
|
2609 __pyx_t_1 = 0;
|
victor@0
|
2610
|
victor@0
|
2611 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":151
|
victor@0
|
2612 * align2 = []
|
victor@0
|
2613 * align1_gap = []
|
victor@0
|
2614 * align2_gap = [] # <<<<<<<<<<<<<<
|
victor@0
|
2615 * gap1=[]
|
victor@0
|
2616 * gap2=[]
|
victor@0
|
2617 */
|
victor@0
|
2618 __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
|
2619 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2620 __pyx_v_align2_gap = ((PyObject*)__pyx_t_1);
|
victor@0
|
2621 __pyx_t_1 = 0;
|
victor@0
|
2622
|
victor@0
|
2623 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":152
|
victor@0
|
2624 * align1_gap = []
|
victor@0
|
2625 * align2_gap = []
|
victor@0
|
2626 * gap1=[] # <<<<<<<<<<<<<<
|
victor@0
|
2627 * gap2=[]
|
victor@0
|
2628 *
|
victor@0
|
2629 */
|
victor@0
|
2630 __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
|
2631 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2632 __pyx_v_gap1 = ((PyObject*)__pyx_t_1);
|
victor@0
|
2633 __pyx_t_1 = 0;
|
victor@0
|
2634
|
victor@0
|
2635 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":153
|
victor@0
|
2636 * align2_gap = []
|
victor@0
|
2637 * gap1=[]
|
victor@0
|
2638 * gap2=[] # <<<<<<<<<<<<<<
|
victor@0
|
2639 *
|
victor@0
|
2640 * cdef int n,m
|
victor@0
|
2641 */
|
victor@0
|
2642 __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
|
2643 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2644 __pyx_v_gap2 = ((PyObject*)__pyx_t_1);
|
victor@0
|
2645 __pyx_t_1 = 0;
|
victor@0
|
2646
|
victor@0
|
2647 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":156
|
victor@0
|
2648 *
|
victor@0
|
2649 * cdef int n,m
|
victor@0
|
2650 * n, m = (len(seq1), len(seq2)) # <<<<<<<<<<<<<<
|
victor@0
|
2651 * cdef int i,j,curr
|
victor@0
|
2652 * i = n
|
victor@0
|
2653 */
|
victor@0
|
2654 __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
|
2655 __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
|
2656 __pyx_v_n = __pyx_t_2;
|
victor@0
|
2657 __pyx_v_m = __pyx_t_3;
|
victor@0
|
2658
|
victor@0
|
2659 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":158
|
victor@0
|
2660 * n, m = (len(seq1), len(seq2))
|
victor@0
|
2661 * cdef int i,j,curr
|
victor@0
|
2662 * i = n # <<<<<<<<<<<<<<
|
victor@0
|
2663 * j = m
|
victor@0
|
2664 * curr = ptr[i, j]
|
victor@0
|
2665 */
|
victor@0
|
2666 __pyx_v_i = __pyx_v_n;
|
victor@0
|
2667
|
victor@0
|
2668 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":159
|
victor@0
|
2669 * cdef int i,j,curr
|
victor@0
|
2670 * i = n
|
victor@0
|
2671 * j = m # <<<<<<<<<<<<<<
|
victor@0
|
2672 * curr = ptr[i, j]
|
victor@0
|
2673 * while (i > 0 or j > 0):
|
victor@0
|
2674 */
|
victor@0
|
2675 __pyx_v_j = __pyx_v_m;
|
victor@0
|
2676
|
victor@0
|
2677 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":160
|
victor@0
|
2678 * i = n
|
victor@0
|
2679 * j = m
|
victor@0
|
2680 * curr = ptr[i, j] # <<<<<<<<<<<<<<
|
victor@0
|
2681 * while (i > 0 or j > 0):
|
victor@0
|
2682 * ptr[i,j] += 3
|
victor@0
|
2683 */
|
victor@0
|
2684 __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
|
2685 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2686 __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
|
2687 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2688 __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
|
2689 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2690 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
|
victor@0
|
2691 __Pyx_GIVEREF(__pyx_t_1);
|
victor@0
|
2692 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
|
victor@0
|
2693 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2694 __pyx_t_1 = 0;
|
victor@0
|
2695 __pyx_t_4 = 0;
|
victor@0
|
2696 __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
|
2697 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2698 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2699 __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
|
2700 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2701 __pyx_v_curr = __pyx_t_6;
|
victor@0
|
2702
|
victor@0
|
2703 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":161
|
victor@0
|
2704 * j = m
|
victor@0
|
2705 * curr = ptr[i, j]
|
victor@0
|
2706 * while (i > 0 or j > 0): # <<<<<<<<<<<<<<
|
victor@0
|
2707 * ptr[i,j] += 3
|
victor@0
|
2708 * if curr == DIAG :
|
victor@0
|
2709 */
|
victor@0
|
2710 while (1) {
|
victor@0
|
2711 __pyx_t_7 = ((__pyx_v_i > 0) != 0);
|
victor@0
|
2712 if (!__pyx_t_7) {
|
victor@0
|
2713 __pyx_t_8 = ((__pyx_v_j > 0) != 0);
|
victor@0
|
2714 __pyx_t_9 = __pyx_t_8;
|
victor@0
|
2715 } else {
|
victor@0
|
2716 __pyx_t_9 = __pyx_t_7;
|
victor@0
|
2717 }
|
victor@0
|
2718 if (!__pyx_t_9) break;
|
victor@0
|
2719
|
victor@0
|
2720 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":162
|
victor@0
|
2721 * curr = ptr[i, j]
|
victor@0
|
2722 * while (i > 0 or j > 0):
|
victor@0
|
2723 * ptr[i,j] += 3 # <<<<<<<<<<<<<<
|
victor@0
|
2724 * if curr == DIAG :
|
victor@0
|
2725 * align1.append(seq1[i-1])
|
victor@0
|
2726 */
|
victor@0
|
2727 __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
|
2728 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2729 __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
|
2730 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2731 __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
|
2732 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2733 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4);
|
victor@0
|
2734 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2735 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5);
|
victor@0
|
2736 __Pyx_GIVEREF(__pyx_t_5);
|
victor@0
|
2737 __pyx_t_4 = 0;
|
victor@0
|
2738 __pyx_t_5 = 0;
|
victor@0
|
2739 __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
|
2740 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2741 __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
|
2742 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2743 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2744 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
|
2745 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2747
|
victor@0
|
2748 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":163
|
victor@0
|
2749 * while (i > 0 or j > 0):
|
victor@0
|
2750 * ptr[i,j] += 3
|
victor@0
|
2751 * if curr == DIAG : # <<<<<<<<<<<<<<
|
victor@0
|
2752 * align1.append(seq1[i-1])
|
victor@0
|
2753 * align2.append(seq2[j-1])
|
victor@0
|
2754 */
|
victor@0
|
2755 __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG) != 0);
|
victor@0
|
2756 if (__pyx_t_9) {
|
victor@0
|
2757
|
victor@0
|
2758 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":164
|
victor@0
|
2759 * ptr[i,j] += 3
|
victor@0
|
2760 * if curr == DIAG :
|
victor@0
|
2761 * align1.append(seq1[i-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2762 * align2.append(seq2[j-1])
|
victor@0
|
2763 * align1_gap.append(seq1[i-1])
|
victor@0
|
2764 */
|
victor@0
|
2765 __pyx_t_10 = (__pyx_v_i - 1);
|
victor@0
|
2766 __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
|
2767 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2768 __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
|
2769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2770
|
victor@0
|
2771 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":165
|
victor@0
|
2772 * if curr == DIAG :
|
victor@0
|
2773 * align1.append(seq1[i-1])
|
victor@0
|
2774 * align2.append(seq2[j-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2775 * align1_gap.append(seq1[i-1])
|
victor@0
|
2776 * align2_gap.append(seq2[j-1])
|
victor@0
|
2777 */
|
victor@0
|
2778 __pyx_t_10 = (__pyx_v_j - 1);
|
victor@0
|
2779 __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
|
2780 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2781 __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
|
2782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2783
|
victor@0
|
2784 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":166
|
victor@0
|
2785 * align1.append(seq1[i-1])
|
victor@0
|
2786 * align2.append(seq2[j-1])
|
victor@0
|
2787 * align1_gap.append(seq1[i-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2788 * align2_gap.append(seq2[j-1])
|
victor@0
|
2789 * i -= 1
|
victor@0
|
2790 */
|
victor@0
|
2791 __pyx_t_10 = (__pyx_v_i - 1);
|
victor@0
|
2792 __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
|
2793 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2794 __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
|
2795 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2796
|
victor@0
|
2797 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":167
|
victor@0
|
2798 * align2.append(seq2[j-1])
|
victor@0
|
2799 * align1_gap.append(seq1[i-1])
|
victor@0
|
2800 * align2_gap.append(seq2[j-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2801 * i -= 1
|
victor@0
|
2802 * j -= 1
|
victor@0
|
2803 */
|
victor@0
|
2804 __pyx_t_10 = (__pyx_v_j - 1);
|
victor@0
|
2805 __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
|
2806 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2807 __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
|
2808 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2809
|
victor@0
|
2810 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":168
|
victor@0
|
2811 * align1_gap.append(seq1[i-1])
|
victor@0
|
2812 * align2_gap.append(seq2[j-1])
|
victor@0
|
2813 * i -= 1 # <<<<<<<<<<<<<<
|
victor@0
|
2814 * j -= 1
|
victor@0
|
2815 * elif curr == LEFT:
|
victor@0
|
2816 */
|
victor@0
|
2817 __pyx_v_i = (__pyx_v_i - 1);
|
victor@0
|
2818
|
victor@0
|
2819 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":169
|
victor@0
|
2820 * align2_gap.append(seq2[j-1])
|
victor@0
|
2821 * i -= 1
|
victor@0
|
2822 * j -= 1 # <<<<<<<<<<<<<<
|
victor@0
|
2823 * elif curr == LEFT:
|
victor@0
|
2824 * align1.append("*")
|
victor@0
|
2825 */
|
victor@0
|
2826 __pyx_v_j = (__pyx_v_j - 1);
|
victor@0
|
2827 goto __pyx_L5;
|
victor@0
|
2828 }
|
victor@0
|
2829
|
victor@0
|
2830 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":170
|
victor@0
|
2831 * i -= 1
|
victor@0
|
2832 * j -= 1
|
victor@0
|
2833 * elif curr == LEFT: # <<<<<<<<<<<<<<
|
victor@0
|
2834 * align1.append("*")
|
victor@0
|
2835 * align2.append(seq2[j-1])
|
victor@0
|
2836 */
|
victor@0
|
2837 __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT) != 0);
|
victor@0
|
2838 if (__pyx_t_9) {
|
victor@0
|
2839
|
victor@0
|
2840 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":171
|
victor@0
|
2841 * j -= 1
|
victor@0
|
2842 * elif curr == LEFT:
|
victor@0
|
2843 * align1.append("*") # <<<<<<<<<<<<<<
|
victor@0
|
2844 * align2.append(seq2[j-1])
|
victor@0
|
2845 * align1_gap.append("[GAP]")
|
victor@0
|
2846 */
|
victor@0
|
2847 __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
|
2848
|
victor@0
|
2849 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":172
|
victor@0
|
2850 * elif curr == LEFT:
|
victor@0
|
2851 * align1.append("*")
|
victor@0
|
2852 * align2.append(seq2[j-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2853 * align1_gap.append("[GAP]")
|
victor@0
|
2854 * align2_gap.append(seq2[j-1])
|
victor@0
|
2855 */
|
victor@0
|
2856 __pyx_t_10 = (__pyx_v_j - 1);
|
victor@0
|
2857 __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
|
2858 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2859 __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
|
2860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2861
|
victor@0
|
2862 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":173
|
victor@0
|
2863 * align1.append("*")
|
victor@0
|
2864 * align2.append(seq2[j-1])
|
victor@0
|
2865 * align1_gap.append("[GAP]") # <<<<<<<<<<<<<<
|
victor@0
|
2866 * align2_gap.append(seq2[j-1])
|
victor@0
|
2867 * j -= 1
|
victor@0
|
2868 */
|
victor@0
|
2869 __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
|
2870
|
victor@0
|
2871 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":174
|
victor@0
|
2872 * align2.append(seq2[j-1])
|
victor@0
|
2873 * align1_gap.append("[GAP]")
|
victor@0
|
2874 * align2_gap.append(seq2[j-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2875 * j -= 1
|
victor@0
|
2876 * elif curr == UP:
|
victor@0
|
2877 */
|
victor@0
|
2878 __pyx_t_10 = (__pyx_v_j - 1);
|
victor@0
|
2879 __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
|
2880 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2881 __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
|
2882 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2883
|
victor@0
|
2884 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":175
|
victor@0
|
2885 * align1_gap.append("[GAP]")
|
victor@0
|
2886 * align2_gap.append(seq2[j-1])
|
victor@0
|
2887 * j -= 1 # <<<<<<<<<<<<<<
|
victor@0
|
2888 * elif curr == UP:
|
victor@0
|
2889 * align1.append(seq1[i-1])
|
victor@0
|
2890 */
|
victor@0
|
2891 __pyx_v_j = (__pyx_v_j - 1);
|
victor@0
|
2892 goto __pyx_L5;
|
victor@0
|
2893 }
|
victor@0
|
2894
|
victor@0
|
2895 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":176
|
victor@0
|
2896 * align2_gap.append(seq2[j-1])
|
victor@0
|
2897 * j -= 1
|
victor@0
|
2898 * elif curr == UP: # <<<<<<<<<<<<<<
|
victor@0
|
2899 * align1.append(seq1[i-1])
|
victor@0
|
2900 * align2.append("*")
|
victor@0
|
2901 */
|
victor@0
|
2902 __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP) != 0);
|
victor@0
|
2903 if (__pyx_t_9) {
|
victor@0
|
2904
|
victor@0
|
2905 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":177
|
victor@0
|
2906 * j -= 1
|
victor@0
|
2907 * elif curr == UP:
|
victor@0
|
2908 * align1.append(seq1[i-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2909 * align2.append("*")
|
victor@0
|
2910 * align1_gap.append(seq1[i-1])
|
victor@0
|
2911 */
|
victor@0
|
2912 __pyx_t_10 = (__pyx_v_i - 1);
|
victor@0
|
2913 __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
|
2914 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2915 __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
|
2916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2917
|
victor@0
|
2918 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":178
|
victor@0
|
2919 * elif curr == UP:
|
victor@0
|
2920 * align1.append(seq1[i-1])
|
victor@0
|
2921 * align2.append("*") # <<<<<<<<<<<<<<
|
victor@0
|
2922 * align1_gap.append(seq1[i-1])
|
victor@0
|
2923 * align2_gap.append("[GAP]")
|
victor@0
|
2924 */
|
victor@0
|
2925 __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
|
2926
|
victor@0
|
2927 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":179
|
victor@0
|
2928 * align1.append(seq1[i-1])
|
victor@0
|
2929 * align2.append("*")
|
victor@0
|
2930 * align1_gap.append(seq1[i-1]) # <<<<<<<<<<<<<<
|
victor@0
|
2931 * align2_gap.append("[GAP]")
|
victor@0
|
2932 * i -= 1
|
victor@0
|
2933 */
|
victor@0
|
2934 __pyx_t_10 = (__pyx_v_i - 1);
|
victor@0
|
2935 __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
|
2936 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2937 __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
|
2938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
2939
|
victor@0
|
2940 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":180
|
victor@0
|
2941 * align2.append("*")
|
victor@0
|
2942 * align1_gap.append(seq1[i-1])
|
victor@0
|
2943 * align2_gap.append("[GAP]") # <<<<<<<<<<<<<<
|
victor@0
|
2944 * i -= 1
|
victor@0
|
2945 *
|
victor@0
|
2946 */
|
victor@0
|
2947 __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
|
2948
|
victor@0
|
2949 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":181
|
victor@0
|
2950 * align1_gap.append(seq1[i-1])
|
victor@0
|
2951 * align2_gap.append("[GAP]")
|
victor@0
|
2952 * i -= 1 # <<<<<<<<<<<<<<
|
victor@0
|
2953 *
|
victor@0
|
2954 * curr = ptr[i,j]
|
victor@0
|
2955 */
|
victor@0
|
2956 __pyx_v_i = (__pyx_v_i - 1);
|
victor@0
|
2957 goto __pyx_L5;
|
victor@0
|
2958 }
|
victor@0
|
2959 __pyx_L5:;
|
victor@0
|
2960
|
victor@0
|
2961 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":183
|
victor@0
|
2962 * i -= 1
|
victor@0
|
2963 *
|
victor@0
|
2964 * curr = ptr[i,j] # <<<<<<<<<<<<<<
|
victor@0
|
2965 *
|
victor@0
|
2966 * align1.reverse()
|
victor@0
|
2967 */
|
victor@0
|
2968 __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
|
2969 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
2970 __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
|
2971 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2972 __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
|
2973 __Pyx_GOTREF(__pyx_t_5);
|
victor@0
|
2974 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
|
victor@0
|
2975 __Pyx_GIVEREF(__pyx_t_1);
|
victor@0
|
2976 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
|
victor@0
|
2977 __Pyx_GIVEREF(__pyx_t_4);
|
victor@0
|
2978 __pyx_t_1 = 0;
|
victor@0
|
2979 __pyx_t_4 = 0;
|
victor@0
|
2980 __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
|
2981 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
2982 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
|
victor@0
|
2983 __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
|
2984 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
2985 __pyx_v_curr = __pyx_t_6;
|
victor@0
|
2986 }
|
victor@0
|
2987
|
victor@0
|
2988 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":185
|
victor@0
|
2989 * curr = ptr[i,j]
|
victor@0
|
2990 *
|
victor@0
|
2991 * align1.reverse() # <<<<<<<<<<<<<<
|
victor@0
|
2992 * align2.reverse()
|
victor@0
|
2993 * align1_gap.reverse()
|
victor@0
|
2994 */
|
victor@0
|
2995 __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
|
2996
|
victor@0
|
2997 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":186
|
victor@0
|
2998 *
|
victor@0
|
2999 * align1.reverse()
|
victor@0
|
3000 * align2.reverse() # <<<<<<<<<<<<<<
|
victor@0
|
3001 * align1_gap.reverse()
|
victor@0
|
3002 * align2_gap.reverse()
|
victor@0
|
3003 */
|
victor@0
|
3004 __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
|
3005
|
victor@0
|
3006 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":187
|
victor@0
|
3007 * align1.reverse()
|
victor@0
|
3008 * align2.reverse()
|
victor@0
|
3009 * align1_gap.reverse() # <<<<<<<<<<<<<<
|
victor@0
|
3010 * align2_gap.reverse()
|
victor@0
|
3011 * #gaps
|
victor@0
|
3012 */
|
victor@0
|
3013 __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
|
3014
|
victor@0
|
3015 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":188
|
victor@0
|
3016 * align2.reverse()
|
victor@0
|
3017 * align1_gap.reverse()
|
victor@0
|
3018 * align2_gap.reverse() # <<<<<<<<<<<<<<
|
victor@0
|
3019 * #gaps
|
victor@0
|
3020 * for index in range(len(align1_gap)):
|
victor@0
|
3021 */
|
victor@0
|
3022 __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
|
3023
|
victor@0
|
3024 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":190
|
victor@0
|
3025 * align2_gap.reverse()
|
victor@0
|
3026 * #gaps
|
victor@0
|
3027 * for index in range(len(align1_gap)): # <<<<<<<<<<<<<<
|
victor@0
|
3028 * if(align1_gap[index])=="[GAP]":
|
victor@0
|
3029 * gap1.append(index)
|
victor@0
|
3030 */
|
victor@0
|
3031 __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
|
3032 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) {
|
victor@0
|
3033 __pyx_v_index = __pyx_t_2;
|
victor@0
|
3034
|
victor@0
|
3035 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":191
|
victor@0
|
3036 * #gaps
|
victor@0
|
3037 * for index in range(len(align1_gap)):
|
victor@0
|
3038 * if(align1_gap[index])=="[GAP]": # <<<<<<<<<<<<<<
|
victor@0
|
3039 * gap1.append(index)
|
victor@0
|
3040 *
|
victor@0
|
3041 */
|
victor@0
|
3042 __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
|
3043 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3044 __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
|
3045 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3046 if (__pyx_t_9) {
|
victor@0
|
3047
|
victor@0
|
3048 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":192
|
victor@0
|
3049 * for index in range(len(align1_gap)):
|
victor@0
|
3050 * if(align1_gap[index])=="[GAP]":
|
victor@0
|
3051 * gap1.append(index) # <<<<<<<<<<<<<<
|
victor@0
|
3052 *
|
victor@0
|
3053 * for index in range(len(align2_gap)):
|
victor@0
|
3054 */
|
victor@0
|
3055 __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
|
3056 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3057 __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
|
3058 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3059 goto __pyx_L8;
|
victor@0
|
3060 }
|
victor@0
|
3061 __pyx_L8:;
|
victor@0
|
3062 }
|
victor@0
|
3063
|
victor@0
|
3064 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":194
|
victor@0
|
3065 * gap1.append(index)
|
victor@0
|
3066 *
|
victor@0
|
3067 * for index in range(len(align2_gap)): # <<<<<<<<<<<<<<
|
victor@0
|
3068 * if(align2_gap[index])=="[GAP]":
|
victor@0
|
3069 * gap2.append(index)
|
victor@0
|
3070 */
|
victor@0
|
3071 __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
|
3072 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) {
|
victor@0
|
3073 __pyx_v_index = __pyx_t_2;
|
victor@0
|
3074
|
victor@0
|
3075 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":195
|
victor@0
|
3076 *
|
victor@0
|
3077 * for index in range(len(align2_gap)):
|
victor@0
|
3078 * if(align2_gap[index])=="[GAP]": # <<<<<<<<<<<<<<
|
victor@0
|
3079 * gap2.append(index)
|
victor@0
|
3080 *
|
victor@0
|
3081 */
|
victor@0
|
3082 __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
|
3083 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3084 __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
|
3085 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3086 if (__pyx_t_9) {
|
victor@0
|
3087
|
victor@0
|
3088 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":196
|
victor@0
|
3089 * for index in range(len(align2_gap)):
|
victor@0
|
3090 * if(align2_gap[index])=="[GAP]":
|
victor@0
|
3091 * gap2.append(index) # <<<<<<<<<<<<<<
|
victor@0
|
3092 *
|
victor@0
|
3093 *
|
victor@0
|
3094 */
|
victor@0
|
3095 __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
|
3096 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3097 __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
|
3098 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3099 goto __pyx_L11;
|
victor@0
|
3100 }
|
victor@0
|
3101 __pyx_L11:;
|
victor@0
|
3102 }
|
victor@0
|
3103
|
victor@0
|
3104 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":199
|
victor@0
|
3105 *
|
victor@0
|
3106 *
|
victor@0
|
3107 * return align1, align2,gap1,gap2 # <<<<<<<<<<<<<<
|
victor@0
|
3108 *
|
victor@0
|
3109 *
|
victor@0
|
3110 */
|
victor@0
|
3111 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
3112 __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
|
3113 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3114 __Pyx_INCREF(__pyx_v_align1);
|
victor@0
|
3115 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_align1);
|
victor@0
|
3116 __Pyx_GIVEREF(__pyx_v_align1);
|
victor@0
|
3117 __Pyx_INCREF(__pyx_v_align2);
|
victor@0
|
3118 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_align2);
|
victor@0
|
3119 __Pyx_GIVEREF(__pyx_v_align2);
|
victor@0
|
3120 __Pyx_INCREF(__pyx_v_gap1);
|
victor@0
|
3121 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_gap1);
|
victor@0
|
3122 __Pyx_GIVEREF(__pyx_v_gap1);
|
victor@0
|
3123 __Pyx_INCREF(__pyx_v_gap2);
|
victor@0
|
3124 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_gap2);
|
victor@0
|
3125 __Pyx_GIVEREF(__pyx_v_gap2);
|
victor@0
|
3126 __pyx_r = __pyx_t_4;
|
victor@0
|
3127 __pyx_t_4 = 0;
|
victor@0
|
3128 goto __pyx_L0;
|
victor@0
|
3129
|
victor@0
|
3130 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145
|
victor@0
|
3131 * return s, ptr
|
victor@0
|
3132 *
|
victor@0
|
3133 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<<
|
victor@0
|
3134 *
|
victor@0
|
3135 * #### TRACE BEST PATH TO GET ALIGNMENT ####
|
victor@0
|
3136 */
|
victor@0
|
3137
|
victor@0
|
3138 /* function exit code */
|
victor@0
|
3139 __pyx_L1_error:;
|
victor@0
|
3140 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
3141 __Pyx_XDECREF(__pyx_t_4);
|
victor@0
|
3142 __Pyx_XDECREF(__pyx_t_5);
|
victor@0
|
3143 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_trace", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
3144 __pyx_r = NULL;
|
victor@0
|
3145 __pyx_L0:;
|
victor@0
|
3146 __Pyx_XDECREF(__pyx_v_align1);
|
victor@0
|
3147 __Pyx_XDECREF(__pyx_v_align2);
|
victor@0
|
3148 __Pyx_XDECREF(__pyx_v_align1_gap);
|
victor@0
|
3149 __Pyx_XDECREF(__pyx_v_align2_gap);
|
victor@0
|
3150 __Pyx_XDECREF(__pyx_v_gap1);
|
victor@0
|
3151 __Pyx_XDECREF(__pyx_v_gap2);
|
victor@0
|
3152 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
3153 __Pyx_RefNannyFinishContext();
|
victor@0
|
3154 return __pyx_r;
|
victor@0
|
3155 }
|
victor@0
|
3156
|
victor@0
|
3157 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202
|
victor@0
|
3158 *
|
victor@0
|
3159 *
|
victor@0
|
3160 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<<
|
victor@0
|
3161 * """
|
victor@0
|
3162 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch
|
victor@0
|
3163 */
|
victor@0
|
3164
|
victor@0
|
3165 /* Python wrapper */
|
victor@0
|
3166 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
|
victor@0
|
3167 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
|
3168 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
|
3169 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
|
victor@0
|
3170 PyObject *__pyx_v_self = 0;
|
victor@0
|
3171 PyObject *__pyx_v_seq1 = 0;
|
victor@0
|
3172 PyObject *__pyx_v_seq2 = 0;
|
victor@0
|
3173 PyObject *__pyx_v_isFast = 0;
|
victor@0
|
3174 int __pyx_lineno = 0;
|
victor@0
|
3175 const char *__pyx_filename = NULL;
|
victor@0
|
3176 int __pyx_clineno = 0;
|
victor@0
|
3177 PyObject *__pyx_r = 0;
|
victor@0
|
3178 __Pyx_RefNannyDeclarations
|
victor@0
|
3179 __Pyx_RefNannySetupContext("needleman_wunsch (wrapper)", 0);
|
victor@0
|
3180 {
|
victor@0
|
3181 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_isFast,0};
|
victor@0
|
3182 PyObject* values[4] = {0,0,0,0};
|
victor@0
|
3183 values[3] = ((PyObject *)((PyObject *)Py_True));
|
victor@0
|
3184 if (unlikely(__pyx_kwds)) {
|
victor@0
|
3185 Py_ssize_t kw_args;
|
victor@0
|
3186 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
|
victor@0
|
3187 switch (pos_args) {
|
victor@0
|
3188 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
victor@0
|
3189 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
victor@0
|
3190 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
victor@0
|
3191 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
victor@0
|
3192 case 0: break;
|
victor@0
|
3193 default: goto __pyx_L5_argtuple_error;
|
victor@0
|
3194 }
|
victor@0
|
3195 kw_args = PyDict_Size(__pyx_kwds);
|
victor@0
|
3196 switch (pos_args) {
|
victor@0
|
3197 case 0:
|
victor@0
|
3198 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--;
|
victor@0
|
3199 else goto __pyx_L5_argtuple_error;
|
victor@0
|
3200 case 1:
|
victor@0
|
3201 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--;
|
victor@0
|
3202 else {
|
victor@0
|
3203 __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
|
3204 }
|
victor@0
|
3205 case 2:
|
victor@0
|
3206 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--;
|
victor@0
|
3207 else {
|
victor@0
|
3208 __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
|
3209 }
|
victor@0
|
3210 case 3:
|
victor@0
|
3211 if (kw_args > 0) {
|
victor@0
|
3212 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isFast);
|
victor@0
|
3213 if (value) { values[3] = value; kw_args--; }
|
victor@0
|
3214 }
|
victor@0
|
3215 }
|
victor@0
|
3216 if (unlikely(kw_args > 0)) {
|
victor@0
|
3217 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
|
3218 }
|
victor@0
|
3219 } else {
|
victor@0
|
3220 switch (PyTuple_GET_SIZE(__pyx_args)) {
|
victor@0
|
3221 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
|
victor@0
|
3222 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
|
victor@0
|
3223 values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
|
victor@0
|
3224 values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
|
victor@0
|
3225 break;
|
victor@0
|
3226 default: goto __pyx_L5_argtuple_error;
|
victor@0
|
3227 }
|
victor@0
|
3228 }
|
victor@0
|
3229 __pyx_v_self = values[0];
|
victor@0
|
3230 __pyx_v_seq1 = values[1];
|
victor@0
|
3231 __pyx_v_seq2 = values[2];
|
victor@0
|
3232 __pyx_v_isFast = values[3];
|
victor@0
|
3233 }
|
victor@0
|
3234 goto __pyx_L4_argument_unpacking_done;
|
victor@0
|
3235 __pyx_L5_argtuple_error:;
|
victor@0
|
3236 __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
|
3237 __pyx_L3_error:;
|
victor@0
|
3238 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.needleman_wunsch", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
3239 __Pyx_RefNannyFinishContext();
|
victor@0
|
3240 return NULL;
|
victor@0
|
3241 __pyx_L4_argument_unpacking_done:;
|
victor@0
|
3242 __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
|
3243
|
victor@0
|
3244 /* function exit code */
|
victor@0
|
3245 __Pyx_RefNannyFinishContext();
|
victor@0
|
3246 return __pyx_r;
|
victor@0
|
3247 }
|
victor@0
|
3248
|
victor@0
|
3249 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
|
3250 PyObject *__pyx_v_s = NULL;
|
victor@0
|
3251 PyObject *__pyx_v_ptr = NULL;
|
victor@0
|
3252 PyObject *__pyx_v_alignment = NULL;
|
victor@0
|
3253 int __pyx_v_maxlen;
|
victor@0
|
3254 float __pyx_v_finalscore;
|
victor@0
|
3255 PyObject *__pyx_r = NULL;
|
victor@0
|
3256 __Pyx_RefNannyDeclarations
|
victor@0
|
3257 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
3258 PyObject *__pyx_t_2 = NULL;
|
victor@0
|
3259 PyObject *__pyx_t_3 = NULL;
|
victor@0
|
3260 PyObject *__pyx_t_4 = NULL;
|
victor@0
|
3261 PyObject *(*__pyx_t_5)(PyObject *);
|
victor@0
|
3262 Py_ssize_t __pyx_t_6;
|
victor@0
|
3263 Py_ssize_t __pyx_t_7;
|
victor@0
|
3264 int __pyx_t_8;
|
victor@0
|
3265 float __pyx_t_9;
|
victor@0
|
3266 int __pyx_lineno = 0;
|
victor@0
|
3267 const char *__pyx_filename = NULL;
|
victor@0
|
3268 int __pyx_clineno = 0;
|
victor@0
|
3269 __Pyx_RefNannySetupContext("needleman_wunsch", 0);
|
victor@0
|
3270
|
victor@0
|
3271 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":229
|
victor@0
|
3272 *
|
victor@0
|
3273 * """
|
victor@0
|
3274 * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast) # <<<<<<<<<<<<<<
|
victor@0
|
3275 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr)
|
victor@0
|
3276 * cdef int maxlen=len(seq1)
|
victor@0
|
3277 */
|
victor@0
|
3278 __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
|
3279 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3280 __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
|
3281 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3282 __Pyx_INCREF(__pyx_v_seq1);
|
victor@0
|
3283 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq1);
|
victor@0
|
3284 __Pyx_GIVEREF(__pyx_v_seq1);
|
victor@0
|
3285 __Pyx_INCREF(__pyx_v_seq2);
|
victor@0
|
3286 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_seq2);
|
victor@0
|
3287 __Pyx_GIVEREF(__pyx_v_seq2);
|
victor@0
|
3288 __Pyx_INCREF(__pyx_v_isFast);
|
victor@0
|
3289 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_isFast);
|
victor@0
|
3290 __Pyx_GIVEREF(__pyx_v_isFast);
|
victor@0
|
3291 __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
|
3292 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
3293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
3294 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
3295 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) {
|
victor@0
|
3296 PyObject* sequence = __pyx_t_3;
|
victor@0
|
3297 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
3298 Py_ssize_t size = Py_SIZE(sequence);
|
victor@0
|
3299 #else
|
victor@0
|
3300 Py_ssize_t size = PySequence_Size(sequence);
|
victor@0
|
3301 #endif
|
victor@0
|
3302 if (unlikely(size != 2)) {
|
victor@0
|
3303 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
victor@0
|
3304 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
victor@0
|
3305 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
3306 }
|
victor@0
|
3307 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
3308 if (likely(PyTuple_CheckExact(sequence))) {
|
victor@0
|
3309 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0);
|
victor@0
|
3310 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1);
|
victor@0
|
3311 } else {
|
victor@0
|
3312 __pyx_t_2 = PyList_GET_ITEM(sequence, 0);
|
victor@0
|
3313 __pyx_t_1 = PyList_GET_ITEM(sequence, 1);
|
victor@0
|
3314 }
|
victor@0
|
3315 __Pyx_INCREF(__pyx_t_2);
|
victor@0
|
3316 __Pyx_INCREF(__pyx_t_1);
|
victor@0
|
3317 #else
|
victor@0
|
3318 __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
|
3319 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3320 __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
|
3321 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3322 #endif
|
victor@0
|
3323 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
3324 } else {
|
victor@0
|
3325 Py_ssize_t index = -1;
|
victor@0
|
3326 __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
|
3327 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3328 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
3329 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext;
|
victor@0
|
3330 index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed;
|
victor@0
|
3331 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3332 index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed;
|
victor@0
|
3333 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3334 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
|
3335 __pyx_t_5 = NULL;
|
victor@0
|
3336 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3337 goto __pyx_L4_unpacking_done;
|
victor@0
|
3338 __pyx_L3_unpacking_failed:;
|
victor@0
|
3339 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3340 __pyx_t_5 = NULL;
|
victor@0
|
3341 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
|
victor@0
|
3342 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
3343 __pyx_L4_unpacking_done:;
|
victor@0
|
3344 }
|
victor@0
|
3345 __pyx_v_s = __pyx_t_2;
|
victor@0
|
3346 __pyx_t_2 = 0;
|
victor@0
|
3347 __pyx_v_ptr = __pyx_t_1;
|
victor@0
|
3348 __pyx_t_1 = 0;
|
victor@0
|
3349
|
victor@0
|
3350 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":230
|
victor@0
|
3351 * """
|
victor@0
|
3352 * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast)
|
victor@0
|
3353 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) # <<<<<<<<<<<<<<
|
victor@0
|
3354 * cdef int maxlen=len(seq1)
|
victor@0
|
3355 * if len(seq2)>len(seq1):
|
victor@0
|
3356 */
|
victor@0
|
3357 __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
|
3358 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
3359 __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
|
3360 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3361 __Pyx_INCREF(__pyx_v_seq1);
|
victor@0
|
3362 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq1);
|
victor@0
|
3363 __Pyx_GIVEREF(__pyx_v_seq1);
|
victor@0
|
3364 __Pyx_INCREF(__pyx_v_seq2);
|
victor@0
|
3365 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_seq2);
|
victor@0
|
3366 __Pyx_GIVEREF(__pyx_v_seq2);
|
victor@0
|
3367 __Pyx_INCREF(__pyx_v_s);
|
victor@0
|
3368 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_s);
|
victor@0
|
3369 __Pyx_GIVEREF(__pyx_v_s);
|
victor@0
|
3370 __Pyx_INCREF(__pyx_v_ptr);
|
victor@0
|
3371 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_ptr);
|
victor@0
|
3372 __Pyx_GIVEREF(__pyx_v_ptr);
|
victor@0
|
3373 __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
|
3374 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
3376 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
3377 __pyx_v_alignment = __pyx_t_2;
|
victor@0
|
3378 __pyx_t_2 = 0;
|
victor@0
|
3379
|
victor@0
|
3380 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":231
|
victor@0
|
3381 * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast)
|
victor@0
|
3382 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr)
|
victor@0
|
3383 * cdef int maxlen=len(seq1) # <<<<<<<<<<<<<<
|
victor@0
|
3384 * if len(seq2)>len(seq1):
|
victor@0
|
3385 * maxlen=len(seq2)
|
victor@0
|
3386 */
|
victor@0
|
3387 __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
|
3388 __pyx_v_maxlen = __pyx_t_6;
|
victor@0
|
3389
|
victor@0
|
3390 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":232
|
victor@0
|
3391 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr)
|
victor@0
|
3392 * cdef int maxlen=len(seq1)
|
victor@0
|
3393 * if len(seq2)>len(seq1): # <<<<<<<<<<<<<<
|
victor@0
|
3394 * maxlen=len(seq2)
|
victor@0
|
3395 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen
|
victor@0
|
3396 */
|
victor@0
|
3397 __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
|
3398 __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
|
3399 __pyx_t_8 = ((__pyx_t_6 > __pyx_t_7) != 0);
|
victor@0
|
3400 if (__pyx_t_8) {
|
victor@0
|
3401
|
victor@0
|
3402 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":233
|
victor@0
|
3403 * cdef int maxlen=len(seq1)
|
victor@0
|
3404 * if len(seq2)>len(seq1):
|
victor@0
|
3405 * maxlen=len(seq2) # <<<<<<<<<<<<<<
|
victor@0
|
3406 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen
|
victor@0
|
3407 * return alignment, s[len(seq1), len(seq2)],finalscore
|
victor@0
|
3408 */
|
victor@0
|
3409 __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
|
3410 __pyx_v_maxlen = __pyx_t_7;
|
victor@0
|
3411 goto __pyx_L5;
|
victor@0
|
3412 }
|
victor@0
|
3413 __pyx_L5:;
|
victor@0
|
3414
|
victor@0
|
3415 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":234
|
victor@0
|
3416 * if len(seq2)>len(seq1):
|
victor@0
|
3417 * maxlen=len(seq2)
|
victor@0
|
3418 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen # <<<<<<<<<<<<<<
|
victor@0
|
3419 * return alignment, s[len(seq1), len(seq2)],finalscore
|
victor@0
|
3420 *
|
victor@0
|
3421 */
|
victor@0
|
3422 __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
|
3423 __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
|
3424 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3425 __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
|
3426 __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
|
3427 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3428 __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
|
3429 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
3430 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
|
victor@0
|
3431 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
3432 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
|
victor@0
|
3433 __Pyx_GIVEREF(__pyx_t_1);
|
victor@0
|
3434 __pyx_t_2 = 0;
|
victor@0
|
3435 __pyx_t_1 = 0;
|
victor@0
|
3436 __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
|
3437 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3438 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
3439 __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
|
3440 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
3441 __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
|
3442 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
3444 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
3445 __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
|
3446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
3447 __pyx_v_finalscore = __pyx_t_9;
|
victor@0
|
3448
|
victor@0
|
3449 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":235
|
victor@0
|
3450 * maxlen=len(seq2)
|
victor@0
|
3451 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen
|
victor@0
|
3452 * return alignment, s[len(seq1), len(seq2)],finalscore # <<<<<<<<<<<<<<
|
victor@0
|
3453 *
|
victor@0
|
3454 *
|
victor@0
|
3455 */
|
victor@0
|
3456 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
3457 __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
|
3458 __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
|
3459 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3460 __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
|
3461 __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
|
3462 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
3463 __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
|
3464 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3465 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
|
victor@0
|
3466 __Pyx_GIVEREF(__pyx_t_2);
|
victor@0
|
3467 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
|
victor@0
|
3468 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
3469 __pyx_t_2 = 0;
|
victor@0
|
3470 __pyx_t_3 = 0;
|
victor@0
|
3471 __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
|
3472 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
3473 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
3474 __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
|
3475 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
3476 __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
|
3477 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
3478 __Pyx_INCREF(__pyx_v_alignment);
|
victor@0
|
3479 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_alignment);
|
victor@0
|
3480 __Pyx_GIVEREF(__pyx_v_alignment);
|
victor@0
|
3481 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
|
victor@0
|
3482 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
3483 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1);
|
victor@0
|
3484 __Pyx_GIVEREF(__pyx_t_1);
|
victor@0
|
3485 __pyx_t_3 = 0;
|
victor@0
|
3486 __pyx_t_1 = 0;
|
victor@0
|
3487 __pyx_r = __pyx_t_2;
|
victor@0
|
3488 __pyx_t_2 = 0;
|
victor@0
|
3489 goto __pyx_L0;
|
victor@0
|
3490
|
victor@0
|
3491 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202
|
victor@0
|
3492 *
|
victor@0
|
3493 *
|
victor@0
|
3494 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<<
|
victor@0
|
3495 * """
|
victor@0
|
3496 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch
|
victor@0
|
3497 */
|
victor@0
|
3498
|
victor@0
|
3499 /* function exit code */
|
victor@0
|
3500 __pyx_L1_error:;
|
victor@0
|
3501 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
3502 __Pyx_XDECREF(__pyx_t_2);
|
victor@0
|
3503 __Pyx_XDECREF(__pyx_t_3);
|
victor@0
|
3504 __Pyx_XDECREF(__pyx_t_4);
|
victor@0
|
3505 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.needleman_wunsch", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
3506 __pyx_r = NULL;
|
victor@0
|
3507 __pyx_L0:;
|
victor@0
|
3508 __Pyx_XDECREF(__pyx_v_s);
|
victor@0
|
3509 __Pyx_XDECREF(__pyx_v_ptr);
|
victor@0
|
3510 __Pyx_XDECREF(__pyx_v_alignment);
|
victor@0
|
3511 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
3512 __Pyx_RefNannyFinishContext();
|
victor@0
|
3513 return __pyx_r;
|
victor@0
|
3514 }
|
victor@0
|
3515
|
victor@0
|
3516 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194
|
victor@0
|
3517 * # experimental exception made for __getbuffer__ and __releasebuffer__
|
victor@0
|
3518 * # -- the details of this may change.
|
victor@0
|
3519 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
|
victor@0
|
3520 * # This implementation of getbuffer is geared towards Cython
|
victor@0
|
3521 * # requirements, and does not yet fullfill the PEP.
|
victor@0
|
3522 */
|
victor@0
|
3523
|
victor@0
|
3524 /* Python wrapper */
|
victor@0
|
3525 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
|
3526 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
|
3527 int __pyx_r;
|
victor@0
|
3528 __Pyx_RefNannyDeclarations
|
victor@0
|
3529 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
|
victor@0
|
3530 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
|
victor@0
|
3531
|
victor@0
|
3532 /* function exit code */
|
victor@0
|
3533 __Pyx_RefNannyFinishContext();
|
victor@0
|
3534 return __pyx_r;
|
victor@0
|
3535 }
|
victor@0
|
3536
|
victor@0
|
3537 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
|
victor@0
|
3538 int __pyx_v_copy_shape;
|
victor@0
|
3539 int __pyx_v_i;
|
victor@0
|
3540 int __pyx_v_ndim;
|
victor@0
|
3541 int __pyx_v_endian_detector;
|
victor@0
|
3542 int __pyx_v_little_endian;
|
victor@0
|
3543 int __pyx_v_t;
|
victor@0
|
3544 char *__pyx_v_f;
|
victor@0
|
3545 PyArray_Descr *__pyx_v_descr = 0;
|
victor@0
|
3546 int __pyx_v_offset;
|
victor@0
|
3547 int __pyx_v_hasfields;
|
victor@0
|
3548 int __pyx_r;
|
victor@0
|
3549 __Pyx_RefNannyDeclarations
|
victor@0
|
3550 int __pyx_t_1;
|
victor@0
|
3551 int __pyx_t_2;
|
victor@0
|
3552 int __pyx_t_3;
|
victor@0
|
3553 PyObject *__pyx_t_4 = NULL;
|
victor@0
|
3554 int __pyx_t_5;
|
victor@0
|
3555 int __pyx_t_6;
|
victor@0
|
3556 int __pyx_t_7;
|
victor@0
|
3557 PyObject *__pyx_t_8 = NULL;
|
victor@0
|
3558 char *__pyx_t_9;
|
victor@0
|
3559 int __pyx_lineno = 0;
|
victor@0
|
3560 const char *__pyx_filename = NULL;
|
victor@0
|
3561 int __pyx_clineno = 0;
|
victor@0
|
3562 __Pyx_RefNannySetupContext("__getbuffer__", 0);
|
victor@0
|
3563 if (__pyx_v_info != NULL) {
|
victor@0
|
3564 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
|
victor@0
|
3565 __Pyx_GIVEREF(__pyx_v_info->obj);
|
victor@0
|
3566 }
|
victor@0
|
3567
|
victor@0
|
3568 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":200
|
victor@0
|
3569 * # of flags
|
victor@0
|
3570 *
|
victor@0
|
3571 * if info == NULL: return # <<<<<<<<<<<<<<
|
victor@0
|
3572 *
|
victor@0
|
3573 * cdef int copy_shape, i, ndim
|
victor@0
|
3574 */
|
victor@0
|
3575 __pyx_t_1 = ((__pyx_v_info == NULL) != 0);
|
victor@0
|
3576 if (__pyx_t_1) {
|
victor@0
|
3577 __pyx_r = 0;
|
victor@0
|
3578 goto __pyx_L0;
|
victor@0
|
3579 }
|
victor@0
|
3580
|
victor@0
|
3581 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":203
|
victor@0
|
3582 *
|
victor@0
|
3583 * cdef int copy_shape, i, ndim
|
victor@0
|
3584 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
|
victor@0
|
3585 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
|
victor@0
|
3586 *
|
victor@0
|
3587 */
|
victor@0
|
3588 __pyx_v_endian_detector = 1;
|
victor@0
|
3589
|
victor@0
|
3590 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":204
|
victor@0
|
3591 * cdef int copy_shape, i, ndim
|
victor@0
|
3592 * cdef int endian_detector = 1
|
victor@0
|
3593 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
|
victor@0
|
3594 *
|
victor@0
|
3595 * ndim = PyArray_NDIM(self)
|
victor@0
|
3596 */
|
victor@0
|
3597 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
|
victor@0
|
3598
|
victor@0
|
3599 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":206
|
victor@0
|
3600 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
|
victor@0
|
3601 *
|
victor@0
|
3602 * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
|
victor@0
|
3603 *
|
victor@0
|
3604 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
victor@0
|
3605 */
|
victor@0
|
3606 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
|
victor@0
|
3607
|
victor@0
|
3608 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":208
|
victor@0
|
3609 * ndim = PyArray_NDIM(self)
|
victor@0
|
3610 *
|
victor@0
|
3611 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
|
victor@0
|
3612 * copy_shape = 1
|
victor@0
|
3613 * else:
|
victor@0
|
3614 */
|
victor@0
|
3615 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
|
victor@0
|
3616 if (__pyx_t_1) {
|
victor@0
|
3617
|
victor@0
|
3618 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":209
|
victor@0
|
3619 *
|
victor@0
|
3620 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
victor@0
|
3621 * copy_shape = 1 # <<<<<<<<<<<<<<
|
victor@0
|
3622 * else:
|
victor@0
|
3623 * copy_shape = 0
|
victor@0
|
3624 */
|
victor@0
|
3625 __pyx_v_copy_shape = 1;
|
victor@0
|
3626 goto __pyx_L4;
|
victor@0
|
3627 }
|
victor@0
|
3628 /*else*/ {
|
victor@0
|
3629
|
victor@0
|
3630 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":211
|
victor@0
|
3631 * copy_shape = 1
|
victor@0
|
3632 * else:
|
victor@0
|
3633 * copy_shape = 0 # <<<<<<<<<<<<<<
|
victor@0
|
3634 *
|
victor@0
|
3635 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
victor@0
|
3636 */
|
victor@0
|
3637 __pyx_v_copy_shape = 0;
|
victor@0
|
3638 }
|
victor@0
|
3639 __pyx_L4:;
|
victor@0
|
3640
|
victor@0
|
3641 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":213
|
victor@0
|
3642 * copy_shape = 0
|
victor@0
|
3643 *
|
victor@0
|
3644 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
|
victor@0
|
3645 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
|
victor@0
|
3646 * raise ValueError(u"ndarray is not C contiguous")
|
victor@0
|
3647 */
|
victor@0
|
3648 __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
|
victor@0
|
3649 if (__pyx_t_1) {
|
victor@0
|
3650
|
victor@0
|
3651 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":214
|
victor@0
|
3652 *
|
victor@0
|
3653 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
victor@0
|
3654 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
|
victor@0
|
3655 * raise ValueError(u"ndarray is not C contiguous")
|
victor@0
|
3656 *
|
victor@0
|
3657 */
|
victor@0
|
3658 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
|
victor@0
|
3659 __pyx_t_3 = __pyx_t_2;
|
victor@0
|
3660 } else {
|
victor@0
|
3661 __pyx_t_3 = __pyx_t_1;
|
victor@0
|
3662 }
|
victor@0
|
3663 if (__pyx_t_3) {
|
victor@0
|
3664
|
victor@0
|
3665 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215
|
victor@0
|
3666 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
victor@0
|
3667 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
|
victor@0
|
3668 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
|
victor@0
|
3669 *
|
victor@0
|
3670 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
victor@0
|
3671 */
|
victor@0
|
3672 __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
|
3673 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3674 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
victor@0
|
3675 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3676 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
3677 }
|
victor@0
|
3678
|
victor@0
|
3679 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":217
|
victor@0
|
3680 * raise ValueError(u"ndarray is not C contiguous")
|
victor@0
|
3681 *
|
victor@0
|
3682 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
|
victor@0
|
3683 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
|
victor@0
|
3684 * raise ValueError(u"ndarray is not Fortran contiguous")
|
victor@0
|
3685 */
|
victor@0
|
3686 __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
|
victor@0
|
3687 if (__pyx_t_3) {
|
victor@0
|
3688
|
victor@0
|
3689 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":218
|
victor@0
|
3690 *
|
victor@0
|
3691 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
victor@0
|
3692 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
|
victor@0
|
3693 * raise ValueError(u"ndarray is not Fortran contiguous")
|
victor@0
|
3694 *
|
victor@0
|
3695 */
|
victor@0
|
3696 __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
|
victor@0
|
3697 __pyx_t_2 = __pyx_t_1;
|
victor@0
|
3698 } else {
|
victor@0
|
3699 __pyx_t_2 = __pyx_t_3;
|
victor@0
|
3700 }
|
victor@0
|
3701 if (__pyx_t_2) {
|
victor@0
|
3702
|
victor@0
|
3703 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219
|
victor@0
|
3704 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
victor@0
|
3705 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
|
victor@0
|
3706 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
|
victor@0
|
3707 *
|
victor@0
|
3708 * info.buf = PyArray_DATA(self)
|
victor@0
|
3709 */
|
victor@0
|
3710 __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
|
3711 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3712 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
victor@0
|
3713 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3714 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
3715 }
|
victor@0
|
3716
|
victor@0
|
3717 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":221
|
victor@0
|
3718 * raise ValueError(u"ndarray is not Fortran contiguous")
|
victor@0
|
3719 *
|
victor@0
|
3720 * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
|
victor@0
|
3721 * info.ndim = ndim
|
victor@0
|
3722 * if copy_shape:
|
victor@0
|
3723 */
|
victor@0
|
3724 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
|
victor@0
|
3725
|
victor@0
|
3726 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":222
|
victor@0
|
3727 *
|
victor@0
|
3728 * info.buf = PyArray_DATA(self)
|
victor@0
|
3729 * info.ndim = ndim # <<<<<<<<<<<<<<
|
victor@0
|
3730 * if copy_shape:
|
victor@0
|
3731 * # Allocate new buffer for strides and shape info.
|
victor@0
|
3732 */
|
victor@0
|
3733 __pyx_v_info->ndim = __pyx_v_ndim;
|
victor@0
|
3734
|
victor@0
|
3735 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":223
|
victor@0
|
3736 * info.buf = PyArray_DATA(self)
|
victor@0
|
3737 * info.ndim = ndim
|
victor@0
|
3738 * if copy_shape: # <<<<<<<<<<<<<<
|
victor@0
|
3739 * # Allocate new buffer for strides and shape info.
|
victor@0
|
3740 * # This is allocated as one block, strides first.
|
victor@0
|
3741 */
|
victor@0
|
3742 __pyx_t_2 = (__pyx_v_copy_shape != 0);
|
victor@0
|
3743 if (__pyx_t_2) {
|
victor@0
|
3744
|
victor@0
|
3745 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":226
|
victor@0
|
3746 * # Allocate new buffer for strides and shape info.
|
victor@0
|
3747 * # This is allocated as one block, strides first.
|
victor@0
|
3748 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<<
|
victor@0
|
3749 * info.shape = info.strides + ndim
|
victor@0
|
3750 * for i in range(ndim):
|
victor@0
|
3751 */
|
victor@0
|
3752 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2)));
|
victor@0
|
3753
|
victor@0
|
3754 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":227
|
victor@0
|
3755 * # This is allocated as one block, strides first.
|
victor@0
|
3756 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
|
victor@0
|
3757 * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
|
victor@0
|
3758 * for i in range(ndim):
|
victor@0
|
3759 * info.strides[i] = PyArray_STRIDES(self)[i]
|
victor@0
|
3760 */
|
victor@0
|
3761 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
|
victor@0
|
3762
|
victor@0
|
3763 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":228
|
victor@0
|
3764 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2)
|
victor@0
|
3765 * info.shape = info.strides + ndim
|
victor@0
|
3766 * for i in range(ndim): # <<<<<<<<<<<<<<
|
victor@0
|
3767 * info.strides[i] = PyArray_STRIDES(self)[i]
|
victor@0
|
3768 * info.shape[i] = PyArray_DIMS(self)[i]
|
victor@0
|
3769 */
|
victor@0
|
3770 __pyx_t_5 = __pyx_v_ndim;
|
victor@0
|
3771 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
|
victor@0
|
3772 __pyx_v_i = __pyx_t_6;
|
victor@0
|
3773
|
victor@0
|
3774 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":229
|
victor@0
|
3775 * info.shape = info.strides + ndim
|
victor@0
|
3776 * for i in range(ndim):
|
victor@0
|
3777 * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
|
victor@0
|
3778 * info.shape[i] = PyArray_DIMS(self)[i]
|
victor@0
|
3779 * else:
|
victor@0
|
3780 */
|
victor@0
|
3781 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
|
victor@0
|
3782
|
victor@0
|
3783 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":230
|
victor@0
|
3784 * for i in range(ndim):
|
victor@0
|
3785 * info.strides[i] = PyArray_STRIDES(self)[i]
|
victor@0
|
3786 * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
|
victor@0
|
3787 * else:
|
victor@0
|
3788 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
|
victor@0
|
3789 */
|
victor@0
|
3790 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
|
victor@0
|
3791 }
|
victor@0
|
3792 goto __pyx_L7;
|
victor@0
|
3793 }
|
victor@0
|
3794 /*else*/ {
|
victor@0
|
3795
|
victor@0
|
3796 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":232
|
victor@0
|
3797 * info.shape[i] = PyArray_DIMS(self)[i]
|
victor@0
|
3798 * else:
|
victor@0
|
3799 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
|
victor@0
|
3800 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
|
victor@0
|
3801 * info.suboffsets = NULL
|
victor@0
|
3802 */
|
victor@0
|
3803 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
|
victor@0
|
3804
|
victor@0
|
3805 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":233
|
victor@0
|
3806 * else:
|
victor@0
|
3807 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
|
victor@0
|
3808 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
|
victor@0
|
3809 * info.suboffsets = NULL
|
victor@0
|
3810 * info.itemsize = PyArray_ITEMSIZE(self)
|
victor@0
|
3811 */
|
victor@0
|
3812 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
|
victor@0
|
3813 }
|
victor@0
|
3814 __pyx_L7:;
|
victor@0
|
3815
|
victor@0
|
3816 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":234
|
victor@0
|
3817 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
|
victor@0
|
3818 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
|
victor@0
|
3819 * info.suboffsets = NULL # <<<<<<<<<<<<<<
|
victor@0
|
3820 * info.itemsize = PyArray_ITEMSIZE(self)
|
victor@0
|
3821 * info.readonly = not PyArray_ISWRITEABLE(self)
|
victor@0
|
3822 */
|
victor@0
|
3823 __pyx_v_info->suboffsets = NULL;
|
victor@0
|
3824
|
victor@0
|
3825 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":235
|
victor@0
|
3826 * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
|
victor@0
|
3827 * info.suboffsets = NULL
|
victor@0
|
3828 * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
|
victor@0
|
3829 * info.readonly = not PyArray_ISWRITEABLE(self)
|
victor@0
|
3830 *
|
victor@0
|
3831 */
|
victor@0
|
3832 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
|
victor@0
|
3833
|
victor@0
|
3834 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":236
|
victor@0
|
3835 * info.suboffsets = NULL
|
victor@0
|
3836 * info.itemsize = PyArray_ITEMSIZE(self)
|
victor@0
|
3837 * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
|
victor@0
|
3838 *
|
victor@0
|
3839 * cdef int t
|
victor@0
|
3840 */
|
victor@0
|
3841 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
|
victor@0
|
3842
|
victor@0
|
3843 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":239
|
victor@0
|
3844 *
|
victor@0
|
3845 * cdef int t
|
victor@0
|
3846 * cdef char* f = NULL # <<<<<<<<<<<<<<
|
victor@0
|
3847 * cdef dtype descr = self.descr
|
victor@0
|
3848 * cdef list stack
|
victor@0
|
3849 */
|
victor@0
|
3850 __pyx_v_f = NULL;
|
victor@0
|
3851
|
victor@0
|
3852 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":240
|
victor@0
|
3853 * cdef int t
|
victor@0
|
3854 * cdef char* f = NULL
|
victor@0
|
3855 * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
|
victor@0
|
3856 * cdef list stack
|
victor@0
|
3857 * cdef int offset
|
victor@0
|
3858 */
|
victor@0
|
3859 __pyx_t_4 = ((PyObject *)__pyx_v_self->descr);
|
victor@0
|
3860 __Pyx_INCREF(__pyx_t_4);
|
victor@0
|
3861 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4);
|
victor@0
|
3862 __pyx_t_4 = 0;
|
victor@0
|
3863
|
victor@0
|
3864 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":244
|
victor@0
|
3865 * cdef int offset
|
victor@0
|
3866 *
|
victor@0
|
3867 * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<<
|
victor@0
|
3868 *
|
victor@0
|
3869 * if not hasfields and not copy_shape:
|
victor@0
|
3870 */
|
victor@0
|
3871 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr);
|
victor@0
|
3872
|
victor@0
|
3873 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":246
|
victor@0
|
3874 * cdef bint hasfields = PyDataType_HASFIELDS(descr)
|
victor@0
|
3875 *
|
victor@0
|
3876 * if not hasfields and not copy_shape: # <<<<<<<<<<<<<<
|
victor@0
|
3877 * # do not call releasebuffer
|
victor@0
|
3878 * info.obj = None
|
victor@0
|
3879 */
|
victor@0
|
3880 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0);
|
victor@0
|
3881 if (__pyx_t_2) {
|
victor@0
|
3882 __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0);
|
victor@0
|
3883 __pyx_t_1 = __pyx_t_3;
|
victor@0
|
3884 } else {
|
victor@0
|
3885 __pyx_t_1 = __pyx_t_2;
|
victor@0
|
3886 }
|
victor@0
|
3887 if (__pyx_t_1) {
|
victor@0
|
3888
|
victor@0
|
3889 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":248
|
victor@0
|
3890 * if not hasfields and not copy_shape:
|
victor@0
|
3891 * # do not call releasebuffer
|
victor@0
|
3892 * info.obj = None # <<<<<<<<<<<<<<
|
victor@0
|
3893 * else:
|
victor@0
|
3894 * # need to call releasebuffer
|
victor@0
|
3895 */
|
victor@0
|
3896 __Pyx_INCREF(Py_None);
|
victor@0
|
3897 __Pyx_GIVEREF(Py_None);
|
victor@0
|
3898 __Pyx_GOTREF(__pyx_v_info->obj);
|
victor@0
|
3899 __Pyx_DECREF(__pyx_v_info->obj);
|
victor@0
|
3900 __pyx_v_info->obj = Py_None;
|
victor@0
|
3901 goto __pyx_L10;
|
victor@0
|
3902 }
|
victor@0
|
3903 /*else*/ {
|
victor@0
|
3904
|
victor@0
|
3905 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":251
|
victor@0
|
3906 * else:
|
victor@0
|
3907 * # need to call releasebuffer
|
victor@0
|
3908 * info.obj = self # <<<<<<<<<<<<<<
|
victor@0
|
3909 *
|
victor@0
|
3910 * if not hasfields:
|
victor@0
|
3911 */
|
victor@0
|
3912 __Pyx_INCREF(((PyObject *)__pyx_v_self));
|
victor@0
|
3913 __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
|
victor@0
|
3914 __Pyx_GOTREF(__pyx_v_info->obj);
|
victor@0
|
3915 __Pyx_DECREF(__pyx_v_info->obj);
|
victor@0
|
3916 __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
|
victor@0
|
3917 }
|
victor@0
|
3918 __pyx_L10:;
|
victor@0
|
3919
|
victor@0
|
3920 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":253
|
victor@0
|
3921 * info.obj = self
|
victor@0
|
3922 *
|
victor@0
|
3923 * if not hasfields: # <<<<<<<<<<<<<<
|
victor@0
|
3924 * t = descr.type_num
|
victor@0
|
3925 * if ((descr.byteorder == c'>' and little_endian) or
|
victor@0
|
3926 */
|
victor@0
|
3927 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0);
|
victor@0
|
3928 if (__pyx_t_1) {
|
victor@0
|
3929
|
victor@0
|
3930 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":254
|
victor@0
|
3931 *
|
victor@0
|
3932 * if not hasfields:
|
victor@0
|
3933 * t = descr.type_num # <<<<<<<<<<<<<<
|
victor@0
|
3934 * if ((descr.byteorder == c'>' and little_endian) or
|
victor@0
|
3935 * (descr.byteorder == c'<' and not little_endian)):
|
victor@0
|
3936 */
|
victor@0
|
3937 __pyx_t_5 = __pyx_v_descr->type_num;
|
victor@0
|
3938 __pyx_v_t = __pyx_t_5;
|
victor@0
|
3939
|
victor@0
|
3940 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":255
|
victor@0
|
3941 * if not hasfields:
|
victor@0
|
3942 * t = descr.type_num
|
victor@0
|
3943 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
victor@0
|
3944 * (descr.byteorder == c'<' and not little_endian)):
|
victor@0
|
3945 * raise ValueError(u"Non-native byte order not supported")
|
victor@0
|
3946 */
|
victor@0
|
3947 __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0);
|
victor@0
|
3948 if (__pyx_t_1) {
|
victor@0
|
3949 __pyx_t_2 = (__pyx_v_little_endian != 0);
|
victor@0
|
3950 } else {
|
victor@0
|
3951 __pyx_t_2 = __pyx_t_1;
|
victor@0
|
3952 }
|
victor@0
|
3953 if (!__pyx_t_2) {
|
victor@0
|
3954
|
victor@0
|
3955 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":256
|
victor@0
|
3956 * t = descr.type_num
|
victor@0
|
3957 * if ((descr.byteorder == c'>' and little_endian) or
|
victor@0
|
3958 * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
|
victor@0
|
3959 * raise ValueError(u"Non-native byte order not supported")
|
victor@0
|
3960 * if t == NPY_BYTE: f = "b"
|
victor@0
|
3961 */
|
victor@0
|
3962 __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0);
|
victor@0
|
3963 if (__pyx_t_1) {
|
victor@0
|
3964 __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0);
|
victor@0
|
3965 __pyx_t_7 = __pyx_t_3;
|
victor@0
|
3966 } else {
|
victor@0
|
3967 __pyx_t_7 = __pyx_t_1;
|
victor@0
|
3968 }
|
victor@0
|
3969 __pyx_t_1 = __pyx_t_7;
|
victor@0
|
3970 } else {
|
victor@0
|
3971 __pyx_t_1 = __pyx_t_2;
|
victor@0
|
3972 }
|
victor@0
|
3973 if (__pyx_t_1) {
|
victor@0
|
3974
|
victor@0
|
3975 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257
|
victor@0
|
3976 * if ((descr.byteorder == c'>' and little_endian) or
|
victor@0
|
3977 * (descr.byteorder == c'<' and not little_endian)):
|
victor@0
|
3978 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
|
victor@0
|
3979 * if t == NPY_BYTE: f = "b"
|
victor@0
|
3980 * elif t == NPY_UBYTE: f = "B"
|
victor@0
|
3981 */
|
victor@0
|
3982 __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
|
3983 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
3984 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
victor@0
|
3985 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
3986 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
3987 }
|
victor@0
|
3988
|
victor@0
|
3989 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274
|
victor@0
|
3990 * elif t == NPY_CDOUBLE: f = "Zd"
|
victor@0
|
3991 * elif t == NPY_CLONGDOUBLE: f = "Zg"
|
victor@0
|
3992 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
|
victor@0
|
3993 * else:
|
victor@0
|
3994 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
victor@0
|
3995 */
|
victor@0
|
3996 switch (__pyx_v_t) {
|
victor@0
|
3997
|
victor@0
|
3998 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":258
|
victor@0
|
3999 * (descr.byteorder == c'<' and not little_endian)):
|
victor@0
|
4000 * raise ValueError(u"Non-native byte order not supported")
|
victor@0
|
4001 * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
|
victor@0
|
4002 * elif t == NPY_UBYTE: f = "B"
|
victor@0
|
4003 * elif t == NPY_SHORT: f = "h"
|
victor@0
|
4004 */
|
victor@0
|
4005 case NPY_BYTE:
|
victor@0
|
4006 __pyx_v_f = __pyx_k_b;
|
victor@0
|
4007 break;
|
victor@0
|
4008
|
victor@0
|
4009 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":259
|
victor@0
|
4010 * raise ValueError(u"Non-native byte order not supported")
|
victor@0
|
4011 * if t == NPY_BYTE: f = "b"
|
victor@0
|
4012 * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
|
victor@0
|
4013 * elif t == NPY_SHORT: f = "h"
|
victor@0
|
4014 * elif t == NPY_USHORT: f = "H"
|
victor@0
|
4015 */
|
victor@0
|
4016 case NPY_UBYTE:
|
victor@0
|
4017 __pyx_v_f = __pyx_k_B;
|
victor@0
|
4018 break;
|
victor@0
|
4019
|
victor@0
|
4020 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":260
|
victor@0
|
4021 * if t == NPY_BYTE: f = "b"
|
victor@0
|
4022 * elif t == NPY_UBYTE: f = "B"
|
victor@0
|
4023 * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
|
victor@0
|
4024 * elif t == NPY_USHORT: f = "H"
|
victor@0
|
4025 * elif t == NPY_INT: f = "i"
|
victor@0
|
4026 */
|
victor@0
|
4027 case NPY_SHORT:
|
victor@0
|
4028 __pyx_v_f = __pyx_k_h;
|
victor@0
|
4029 break;
|
victor@0
|
4030
|
victor@0
|
4031 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":261
|
victor@0
|
4032 * elif t == NPY_UBYTE: f = "B"
|
victor@0
|
4033 * elif t == NPY_SHORT: f = "h"
|
victor@0
|
4034 * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
|
victor@0
|
4035 * elif t == NPY_INT: f = "i"
|
victor@0
|
4036 * elif t == NPY_UINT: f = "I"
|
victor@0
|
4037 */
|
victor@0
|
4038 case NPY_USHORT:
|
victor@0
|
4039 __pyx_v_f = __pyx_k_H;
|
victor@0
|
4040 break;
|
victor@0
|
4041
|
victor@0
|
4042 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":262
|
victor@0
|
4043 * elif t == NPY_SHORT: f = "h"
|
victor@0
|
4044 * elif t == NPY_USHORT: f = "H"
|
victor@0
|
4045 * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
|
victor@0
|
4046 * elif t == NPY_UINT: f = "I"
|
victor@0
|
4047 * elif t == NPY_LONG: f = "l"
|
victor@0
|
4048 */
|
victor@0
|
4049 case NPY_INT:
|
victor@0
|
4050 __pyx_v_f = __pyx_k_i;
|
victor@0
|
4051 break;
|
victor@0
|
4052
|
victor@0
|
4053 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":263
|
victor@0
|
4054 * elif t == NPY_USHORT: f = "H"
|
victor@0
|
4055 * elif t == NPY_INT: f = "i"
|
victor@0
|
4056 * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
|
victor@0
|
4057 * elif t == NPY_LONG: f = "l"
|
victor@0
|
4058 * elif t == NPY_ULONG: f = "L"
|
victor@0
|
4059 */
|
victor@0
|
4060 case NPY_UINT:
|
victor@0
|
4061 __pyx_v_f = __pyx_k_I;
|
victor@0
|
4062 break;
|
victor@0
|
4063
|
victor@0
|
4064 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":264
|
victor@0
|
4065 * elif t == NPY_INT: f = "i"
|
victor@0
|
4066 * elif t == NPY_UINT: f = "I"
|
victor@0
|
4067 * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
|
victor@0
|
4068 * elif t == NPY_ULONG: f = "L"
|
victor@0
|
4069 * elif t == NPY_LONGLONG: f = "q"
|
victor@0
|
4070 */
|
victor@0
|
4071 case NPY_LONG:
|
victor@0
|
4072 __pyx_v_f = __pyx_k_l;
|
victor@0
|
4073 break;
|
victor@0
|
4074
|
victor@0
|
4075 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":265
|
victor@0
|
4076 * elif t == NPY_UINT: f = "I"
|
victor@0
|
4077 * elif t == NPY_LONG: f = "l"
|
victor@0
|
4078 * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
|
victor@0
|
4079 * elif t == NPY_LONGLONG: f = "q"
|
victor@0
|
4080 * elif t == NPY_ULONGLONG: f = "Q"
|
victor@0
|
4081 */
|
victor@0
|
4082 case NPY_ULONG:
|
victor@0
|
4083 __pyx_v_f = __pyx_k_L;
|
victor@0
|
4084 break;
|
victor@0
|
4085
|
victor@0
|
4086 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":266
|
victor@0
|
4087 * elif t == NPY_LONG: f = "l"
|
victor@0
|
4088 * elif t == NPY_ULONG: f = "L"
|
victor@0
|
4089 * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
|
victor@0
|
4090 * elif t == NPY_ULONGLONG: f = "Q"
|
victor@0
|
4091 * elif t == NPY_FLOAT: f = "f"
|
victor@0
|
4092 */
|
victor@0
|
4093 case NPY_LONGLONG:
|
victor@0
|
4094 __pyx_v_f = __pyx_k_q;
|
victor@0
|
4095 break;
|
victor@0
|
4096
|
victor@0
|
4097 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":267
|
victor@0
|
4098 * elif t == NPY_ULONG: f = "L"
|
victor@0
|
4099 * elif t == NPY_LONGLONG: f = "q"
|
victor@0
|
4100 * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
|
victor@0
|
4101 * elif t == NPY_FLOAT: f = "f"
|
victor@0
|
4102 * elif t == NPY_DOUBLE: f = "d"
|
victor@0
|
4103 */
|
victor@0
|
4104 case NPY_ULONGLONG:
|
victor@0
|
4105 __pyx_v_f = __pyx_k_Q;
|
victor@0
|
4106 break;
|
victor@0
|
4107
|
victor@0
|
4108 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":268
|
victor@0
|
4109 * elif t == NPY_LONGLONG: f = "q"
|
victor@0
|
4110 * elif t == NPY_ULONGLONG: f = "Q"
|
victor@0
|
4111 * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
|
victor@0
|
4112 * elif t == NPY_DOUBLE: f = "d"
|
victor@0
|
4113 * elif t == NPY_LONGDOUBLE: f = "g"
|
victor@0
|
4114 */
|
victor@0
|
4115 case NPY_FLOAT:
|
victor@0
|
4116 __pyx_v_f = __pyx_k_f;
|
victor@0
|
4117 break;
|
victor@0
|
4118
|
victor@0
|
4119 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":269
|
victor@0
|
4120 * elif t == NPY_ULONGLONG: f = "Q"
|
victor@0
|
4121 * elif t == NPY_FLOAT: f = "f"
|
victor@0
|
4122 * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
|
victor@0
|
4123 * elif t == NPY_LONGDOUBLE: f = "g"
|
victor@0
|
4124 * elif t == NPY_CFLOAT: f = "Zf"
|
victor@0
|
4125 */
|
victor@0
|
4126 case NPY_DOUBLE:
|
victor@0
|
4127 __pyx_v_f = __pyx_k_d;
|
victor@0
|
4128 break;
|
victor@0
|
4129
|
victor@0
|
4130 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":270
|
victor@0
|
4131 * elif t == NPY_FLOAT: f = "f"
|
victor@0
|
4132 * elif t == NPY_DOUBLE: f = "d"
|
victor@0
|
4133 * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
|
victor@0
|
4134 * elif t == NPY_CFLOAT: f = "Zf"
|
victor@0
|
4135 * elif t == NPY_CDOUBLE: f = "Zd"
|
victor@0
|
4136 */
|
victor@0
|
4137 case NPY_LONGDOUBLE:
|
victor@0
|
4138 __pyx_v_f = __pyx_k_g;
|
victor@0
|
4139 break;
|
victor@0
|
4140
|
victor@0
|
4141 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":271
|
victor@0
|
4142 * elif t == NPY_DOUBLE: f = "d"
|
victor@0
|
4143 * elif t == NPY_LONGDOUBLE: f = "g"
|
victor@0
|
4144 * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
|
victor@0
|
4145 * elif t == NPY_CDOUBLE: f = "Zd"
|
victor@0
|
4146 * elif t == NPY_CLONGDOUBLE: f = "Zg"
|
victor@0
|
4147 */
|
victor@0
|
4148 case NPY_CFLOAT:
|
victor@0
|
4149 __pyx_v_f = __pyx_k_Zf;
|
victor@0
|
4150 break;
|
victor@0
|
4151
|
victor@0
|
4152 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":272
|
victor@0
|
4153 * elif t == NPY_LONGDOUBLE: f = "g"
|
victor@0
|
4154 * elif t == NPY_CFLOAT: f = "Zf"
|
victor@0
|
4155 * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
|
victor@0
|
4156 * elif t == NPY_CLONGDOUBLE: f = "Zg"
|
victor@0
|
4157 * elif t == NPY_OBJECT: f = "O"
|
victor@0
|
4158 */
|
victor@0
|
4159 case NPY_CDOUBLE:
|
victor@0
|
4160 __pyx_v_f = __pyx_k_Zd;
|
victor@0
|
4161 break;
|
victor@0
|
4162
|
victor@0
|
4163 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":273
|
victor@0
|
4164 * elif t == NPY_CFLOAT: f = "Zf"
|
victor@0
|
4165 * elif t == NPY_CDOUBLE: f = "Zd"
|
victor@0
|
4166 * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
|
victor@0
|
4167 * elif t == NPY_OBJECT: f = "O"
|
victor@0
|
4168 * else:
|
victor@0
|
4169 */
|
victor@0
|
4170 case NPY_CLONGDOUBLE:
|
victor@0
|
4171 __pyx_v_f = __pyx_k_Zg;
|
victor@0
|
4172 break;
|
victor@0
|
4173
|
victor@0
|
4174 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274
|
victor@0
|
4175 * elif t == NPY_CDOUBLE: f = "Zd"
|
victor@0
|
4176 * elif t == NPY_CLONGDOUBLE: f = "Zg"
|
victor@0
|
4177 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
|
victor@0
|
4178 * else:
|
victor@0
|
4179 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
victor@0
|
4180 */
|
victor@0
|
4181 case NPY_OBJECT:
|
victor@0
|
4182 __pyx_v_f = __pyx_k_O;
|
victor@0
|
4183 break;
|
victor@0
|
4184 default:
|
victor@0
|
4185
|
victor@0
|
4186 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":276
|
victor@0
|
4187 * elif t == NPY_OBJECT: f = "O"
|
victor@0
|
4188 * else:
|
victor@0
|
4189 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
|
victor@0
|
4190 * info.format = f
|
victor@0
|
4191 * return
|
victor@0
|
4192 */
|
victor@0
|
4193 __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
|
4194 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4195 __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
|
4196 __Pyx_GOTREF(__pyx_t_8);
|
victor@0
|
4197 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4198 __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
|
4199 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4200 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8);
|
victor@0
|
4201 __Pyx_GIVEREF(__pyx_t_8);
|
victor@0
|
4202 __pyx_t_8 = 0;
|
victor@0
|
4203 __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
|
4204 __Pyx_GOTREF(__pyx_t_8);
|
victor@0
|
4205 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4206 __Pyx_Raise(__pyx_t_8, 0, 0, 0);
|
victor@0
|
4207 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
|
victor@0
|
4208 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
4209 break;
|
victor@0
|
4210 }
|
victor@0
|
4211
|
victor@0
|
4212 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":277
|
victor@0
|
4213 * else:
|
victor@0
|
4214 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
victor@0
|
4215 * info.format = f # <<<<<<<<<<<<<<
|
victor@0
|
4216 * return
|
victor@0
|
4217 * else:
|
victor@0
|
4218 */
|
victor@0
|
4219 __pyx_v_info->format = __pyx_v_f;
|
victor@0
|
4220
|
victor@0
|
4221 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":278
|
victor@0
|
4222 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
victor@0
|
4223 * info.format = f
|
victor@0
|
4224 * return # <<<<<<<<<<<<<<
|
victor@0
|
4225 * else:
|
victor@0
|
4226 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
|
victor@0
|
4227 */
|
victor@0
|
4228 __pyx_r = 0;
|
victor@0
|
4229 goto __pyx_L0;
|
victor@0
|
4230 }
|
victor@0
|
4231 /*else*/ {
|
victor@0
|
4232
|
victor@0
|
4233 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":280
|
victor@0
|
4234 * return
|
victor@0
|
4235 * else:
|
victor@0
|
4236 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
|
victor@0
|
4237 * info.format[0] = c'^' # Native data types, manual alignment
|
victor@0
|
4238 * offset = 0
|
victor@0
|
4239 */
|
victor@0
|
4240 __pyx_v_info->format = ((char *)malloc(255));
|
victor@0
|
4241
|
victor@0
|
4242 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":281
|
victor@0
|
4243 * else:
|
victor@0
|
4244 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
|
victor@0
|
4245 * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
|
victor@0
|
4246 * offset = 0
|
victor@0
|
4247 * f = _util_dtypestring(descr, info.format + 1,
|
victor@0
|
4248 */
|
victor@0
|
4249 (__pyx_v_info->format[0]) = '^';
|
victor@0
|
4250
|
victor@0
|
4251 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":282
|
victor@0
|
4252 * info.format = <char*>stdlib.malloc(_buffer_format_string_len)
|
victor@0
|
4253 * info.format[0] = c'^' # Native data types, manual alignment
|
victor@0
|
4254 * offset = 0 # <<<<<<<<<<<<<<
|
victor@0
|
4255 * f = _util_dtypestring(descr, info.format + 1,
|
victor@0
|
4256 * info.format + _buffer_format_string_len,
|
victor@0
|
4257 */
|
victor@0
|
4258 __pyx_v_offset = 0;
|
victor@0
|
4259
|
victor@0
|
4260 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":283
|
victor@0
|
4261 * info.format[0] = c'^' # Native data types, manual alignment
|
victor@0
|
4262 * offset = 0
|
victor@0
|
4263 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
|
victor@0
|
4264 * info.format + _buffer_format_string_len,
|
victor@0
|
4265 * &offset)
|
victor@0
|
4266 */
|
victor@0
|
4267 __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
|
4268 __pyx_v_f = __pyx_t_9;
|
victor@0
|
4269
|
victor@0
|
4270 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":286
|
victor@0
|
4271 * info.format + _buffer_format_string_len,
|
victor@0
|
4272 * &offset)
|
victor@0
|
4273 * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
|
victor@0
|
4274 *
|
victor@0
|
4275 * def __releasebuffer__(ndarray self, Py_buffer* info):
|
victor@0
|
4276 */
|
victor@0
|
4277 (__pyx_v_f[0]) = '\x00';
|
victor@0
|
4278 }
|
victor@0
|
4279
|
victor@0
|
4280 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194
|
victor@0
|
4281 * # experimental exception made for __getbuffer__ and __releasebuffer__
|
victor@0
|
4282 * # -- the details of this may change.
|
victor@0
|
4283 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
|
victor@0
|
4284 * # This implementation of getbuffer is geared towards Cython
|
victor@0
|
4285 * # requirements, and does not yet fullfill the PEP.
|
victor@0
|
4286 */
|
victor@0
|
4287
|
victor@0
|
4288 /* function exit code */
|
victor@0
|
4289 __pyx_r = 0;
|
victor@0
|
4290 goto __pyx_L0;
|
victor@0
|
4291 __pyx_L1_error:;
|
victor@0
|
4292 __Pyx_XDECREF(__pyx_t_4);
|
victor@0
|
4293 __Pyx_XDECREF(__pyx_t_8);
|
victor@0
|
4294 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
4295 __pyx_r = -1;
|
victor@0
|
4296 if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) {
|
victor@0
|
4297 __Pyx_GOTREF(__pyx_v_info->obj);
|
victor@0
|
4298 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL;
|
victor@0
|
4299 }
|
victor@0
|
4300 goto __pyx_L2;
|
victor@0
|
4301 __pyx_L0:;
|
victor@0
|
4302 if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) {
|
victor@0
|
4303 __Pyx_GOTREF(Py_None);
|
victor@0
|
4304 __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL;
|
victor@0
|
4305 }
|
victor@0
|
4306 __pyx_L2:;
|
victor@0
|
4307 __Pyx_XDECREF((PyObject *)__pyx_v_descr);
|
victor@0
|
4308 __Pyx_RefNannyFinishContext();
|
victor@0
|
4309 return __pyx_r;
|
victor@0
|
4310 }
|
victor@0
|
4311
|
victor@0
|
4312 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288
|
victor@0
|
4313 * f[0] = c'\0' # Terminate format string
|
victor@0
|
4314 *
|
victor@0
|
4315 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
|
victor@0
|
4316 * if PyArray_HASFIELDS(self):
|
victor@0
|
4317 * stdlib.free(info.format)
|
victor@0
|
4318 */
|
victor@0
|
4319
|
victor@0
|
4320 /* Python wrapper */
|
victor@0
|
4321 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
|
victor@0
|
4322 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
|
victor@0
|
4323 __Pyx_RefNannyDeclarations
|
victor@0
|
4324 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
|
victor@0
|
4325 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
|
victor@0
|
4326
|
victor@0
|
4327 /* function exit code */
|
victor@0
|
4328 __Pyx_RefNannyFinishContext();
|
victor@0
|
4329 }
|
victor@0
|
4330
|
victor@0
|
4331 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
|
victor@0
|
4332 __Pyx_RefNannyDeclarations
|
victor@0
|
4333 int __pyx_t_1;
|
victor@0
|
4334 __Pyx_RefNannySetupContext("__releasebuffer__", 0);
|
victor@0
|
4335
|
victor@0
|
4336 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":289
|
victor@0
|
4337 *
|
victor@0
|
4338 * def __releasebuffer__(ndarray self, Py_buffer* info):
|
victor@0
|
4339 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
|
victor@0
|
4340 * stdlib.free(info.format)
|
victor@0
|
4341 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
victor@0
|
4342 */
|
victor@0
|
4343 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
|
victor@0
|
4344 if (__pyx_t_1) {
|
victor@0
|
4345
|
victor@0
|
4346 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":290
|
victor@0
|
4347 * def __releasebuffer__(ndarray self, Py_buffer* info):
|
victor@0
|
4348 * if PyArray_HASFIELDS(self):
|
victor@0
|
4349 * stdlib.free(info.format) # <<<<<<<<<<<<<<
|
victor@0
|
4350 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
victor@0
|
4351 * stdlib.free(info.strides)
|
victor@0
|
4352 */
|
victor@0
|
4353 free(__pyx_v_info->format);
|
victor@0
|
4354 goto __pyx_L3;
|
victor@0
|
4355 }
|
victor@0
|
4356 __pyx_L3:;
|
victor@0
|
4357
|
victor@0
|
4358 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":291
|
victor@0
|
4359 * if PyArray_HASFIELDS(self):
|
victor@0
|
4360 * stdlib.free(info.format)
|
victor@0
|
4361 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
|
victor@0
|
4362 * stdlib.free(info.strides)
|
victor@0
|
4363 * # info.shape was stored after info.strides in the same block
|
victor@0
|
4364 */
|
victor@0
|
4365 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
|
victor@0
|
4366 if (__pyx_t_1) {
|
victor@0
|
4367
|
victor@0
|
4368 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":292
|
victor@0
|
4369 * stdlib.free(info.format)
|
victor@0
|
4370 * if sizeof(npy_intp) != sizeof(Py_ssize_t):
|
victor@0
|
4371 * stdlib.free(info.strides) # <<<<<<<<<<<<<<
|
victor@0
|
4372 * # info.shape was stored after info.strides in the same block
|
victor@0
|
4373 *
|
victor@0
|
4374 */
|
victor@0
|
4375 free(__pyx_v_info->strides);
|
victor@0
|
4376 goto __pyx_L4;
|
victor@0
|
4377 }
|
victor@0
|
4378 __pyx_L4:;
|
victor@0
|
4379
|
victor@0
|
4380 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288
|
victor@0
|
4381 * f[0] = c'\0' # Terminate format string
|
victor@0
|
4382 *
|
victor@0
|
4383 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
|
victor@0
|
4384 * if PyArray_HASFIELDS(self):
|
victor@0
|
4385 * stdlib.free(info.format)
|
victor@0
|
4386 */
|
victor@0
|
4387
|
victor@0
|
4388 /* function exit code */
|
victor@0
|
4389 __Pyx_RefNannyFinishContext();
|
victor@0
|
4390 }
|
victor@0
|
4391
|
victor@0
|
4392 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768
|
victor@0
|
4393 * ctypedef npy_cdouble complex_t
|
victor@0
|
4394 *
|
victor@0
|
4395 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
victor@0
|
4396 * return PyArray_MultiIterNew(1, <void*>a)
|
victor@0
|
4397 *
|
victor@0
|
4398 */
|
victor@0
|
4399
|
victor@0
|
4400 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
|
victor@0
|
4401 PyObject *__pyx_r = NULL;
|
victor@0
|
4402 __Pyx_RefNannyDeclarations
|
victor@0
|
4403 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
4404 int __pyx_lineno = 0;
|
victor@0
|
4405 const char *__pyx_filename = NULL;
|
victor@0
|
4406 int __pyx_clineno = 0;
|
victor@0
|
4407 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
|
victor@0
|
4408
|
victor@0
|
4409 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":769
|
victor@0
|
4410 *
|
victor@0
|
4411 * cdef inline object PyArray_MultiIterNew1(a):
|
victor@0
|
4412 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
|
victor@0
|
4413 *
|
victor@0
|
4414 * cdef inline object PyArray_MultiIterNew2(a, b):
|
victor@0
|
4415 */
|
victor@0
|
4416 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
4417 __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
|
4418 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
4419 __pyx_r = __pyx_t_1;
|
victor@0
|
4420 __pyx_t_1 = 0;
|
victor@0
|
4421 goto __pyx_L0;
|
victor@0
|
4422
|
victor@0
|
4423 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768
|
victor@0
|
4424 * ctypedef npy_cdouble complex_t
|
victor@0
|
4425 *
|
victor@0
|
4426 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
|
victor@0
|
4427 * return PyArray_MultiIterNew(1, <void*>a)
|
victor@0
|
4428 *
|
victor@0
|
4429 */
|
victor@0
|
4430
|
victor@0
|
4431 /* function exit code */
|
victor@0
|
4432 __pyx_L1_error:;
|
victor@0
|
4433 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
4434 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
4435 __pyx_r = 0;
|
victor@0
|
4436 __pyx_L0:;
|
victor@0
|
4437 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
4438 __Pyx_RefNannyFinishContext();
|
victor@0
|
4439 return __pyx_r;
|
victor@0
|
4440 }
|
victor@0
|
4441
|
victor@0
|
4442 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771
|
victor@0
|
4443 * return PyArray_MultiIterNew(1, <void*>a)
|
victor@0
|
4444 *
|
victor@0
|
4445 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
victor@0
|
4446 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
victor@0
|
4447 *
|
victor@0
|
4448 */
|
victor@0
|
4449
|
victor@0
|
4450 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
|
victor@0
|
4451 PyObject *__pyx_r = NULL;
|
victor@0
|
4452 __Pyx_RefNannyDeclarations
|
victor@0
|
4453 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
4454 int __pyx_lineno = 0;
|
victor@0
|
4455 const char *__pyx_filename = NULL;
|
victor@0
|
4456 int __pyx_clineno = 0;
|
victor@0
|
4457 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
|
victor@0
|
4458
|
victor@0
|
4459 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":772
|
victor@0
|
4460 *
|
victor@0
|
4461 * cdef inline object PyArray_MultiIterNew2(a, b):
|
victor@0
|
4462 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
|
victor@0
|
4463 *
|
victor@0
|
4464 * cdef inline object PyArray_MultiIterNew3(a, b, c):
|
victor@0
|
4465 */
|
victor@0
|
4466 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
4467 __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
|
4468 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
4469 __pyx_r = __pyx_t_1;
|
victor@0
|
4470 __pyx_t_1 = 0;
|
victor@0
|
4471 goto __pyx_L0;
|
victor@0
|
4472
|
victor@0
|
4473 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771
|
victor@0
|
4474 * return PyArray_MultiIterNew(1, <void*>a)
|
victor@0
|
4475 *
|
victor@0
|
4476 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
|
victor@0
|
4477 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
victor@0
|
4478 *
|
victor@0
|
4479 */
|
victor@0
|
4480
|
victor@0
|
4481 /* function exit code */
|
victor@0
|
4482 __pyx_L1_error:;
|
victor@0
|
4483 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
4484 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
4485 __pyx_r = 0;
|
victor@0
|
4486 __pyx_L0:;
|
victor@0
|
4487 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
4488 __Pyx_RefNannyFinishContext();
|
victor@0
|
4489 return __pyx_r;
|
victor@0
|
4490 }
|
victor@0
|
4491
|
victor@0
|
4492 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774
|
victor@0
|
4493 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
victor@0
|
4494 *
|
victor@0
|
4495 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
victor@0
|
4496 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
victor@0
|
4497 *
|
victor@0
|
4498 */
|
victor@0
|
4499
|
victor@0
|
4500 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
|
victor@0
|
4501 PyObject *__pyx_r = NULL;
|
victor@0
|
4502 __Pyx_RefNannyDeclarations
|
victor@0
|
4503 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
4504 int __pyx_lineno = 0;
|
victor@0
|
4505 const char *__pyx_filename = NULL;
|
victor@0
|
4506 int __pyx_clineno = 0;
|
victor@0
|
4507 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
|
victor@0
|
4508
|
victor@0
|
4509 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":775
|
victor@0
|
4510 *
|
victor@0
|
4511 * cdef inline object PyArray_MultiIterNew3(a, b, c):
|
victor@0
|
4512 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
|
victor@0
|
4513 *
|
victor@0
|
4514 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
|
victor@0
|
4515 */
|
victor@0
|
4516 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
4517 __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
|
4518 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
4519 __pyx_r = __pyx_t_1;
|
victor@0
|
4520 __pyx_t_1 = 0;
|
victor@0
|
4521 goto __pyx_L0;
|
victor@0
|
4522
|
victor@0
|
4523 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774
|
victor@0
|
4524 * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
|
victor@0
|
4525 *
|
victor@0
|
4526 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
|
victor@0
|
4527 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
victor@0
|
4528 *
|
victor@0
|
4529 */
|
victor@0
|
4530
|
victor@0
|
4531 /* function exit code */
|
victor@0
|
4532 __pyx_L1_error:;
|
victor@0
|
4533 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
4534 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
4535 __pyx_r = 0;
|
victor@0
|
4536 __pyx_L0:;
|
victor@0
|
4537 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
4538 __Pyx_RefNannyFinishContext();
|
victor@0
|
4539 return __pyx_r;
|
victor@0
|
4540 }
|
victor@0
|
4541
|
victor@0
|
4542 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777
|
victor@0
|
4543 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
victor@0
|
4544 *
|
victor@0
|
4545 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
victor@0
|
4546 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
victor@0
|
4547 *
|
victor@0
|
4548 */
|
victor@0
|
4549
|
victor@0
|
4550 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
|
4551 PyObject *__pyx_r = NULL;
|
victor@0
|
4552 __Pyx_RefNannyDeclarations
|
victor@0
|
4553 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
4554 int __pyx_lineno = 0;
|
victor@0
|
4555 const char *__pyx_filename = NULL;
|
victor@0
|
4556 int __pyx_clineno = 0;
|
victor@0
|
4557 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
|
victor@0
|
4558
|
victor@0
|
4559 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":778
|
victor@0
|
4560 *
|
victor@0
|
4561 * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
|
victor@0
|
4562 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
|
victor@0
|
4563 *
|
victor@0
|
4564 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
|
victor@0
|
4565 */
|
victor@0
|
4566 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
4567 __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
|
4568 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
4569 __pyx_r = __pyx_t_1;
|
victor@0
|
4570 __pyx_t_1 = 0;
|
victor@0
|
4571 goto __pyx_L0;
|
victor@0
|
4572
|
victor@0
|
4573 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777
|
victor@0
|
4574 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
|
victor@0
|
4575 *
|
victor@0
|
4576 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
|
victor@0
|
4577 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
victor@0
|
4578 *
|
victor@0
|
4579 */
|
victor@0
|
4580
|
victor@0
|
4581 /* function exit code */
|
victor@0
|
4582 __pyx_L1_error:;
|
victor@0
|
4583 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
4584 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
4585 __pyx_r = 0;
|
victor@0
|
4586 __pyx_L0:;
|
victor@0
|
4587 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
4588 __Pyx_RefNannyFinishContext();
|
victor@0
|
4589 return __pyx_r;
|
victor@0
|
4590 }
|
victor@0
|
4591
|
victor@0
|
4592 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780
|
victor@0
|
4593 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
victor@0
|
4594 *
|
victor@0
|
4595 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
victor@0
|
4596 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
victor@0
|
4597 *
|
victor@0
|
4598 */
|
victor@0
|
4599
|
victor@0
|
4600 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
|
4601 PyObject *__pyx_r = NULL;
|
victor@0
|
4602 __Pyx_RefNannyDeclarations
|
victor@0
|
4603 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
4604 int __pyx_lineno = 0;
|
victor@0
|
4605 const char *__pyx_filename = NULL;
|
victor@0
|
4606 int __pyx_clineno = 0;
|
victor@0
|
4607 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
|
victor@0
|
4608
|
victor@0
|
4609 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":781
|
victor@0
|
4610 *
|
victor@0
|
4611 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
|
victor@0
|
4612 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
|
victor@0
|
4613 *
|
victor@0
|
4614 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
|
victor@0
|
4615 */
|
victor@0
|
4616 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
4617 __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
|
4618 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
4619 __pyx_r = __pyx_t_1;
|
victor@0
|
4620 __pyx_t_1 = 0;
|
victor@0
|
4621 goto __pyx_L0;
|
victor@0
|
4622
|
victor@0
|
4623 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780
|
victor@0
|
4624 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
|
victor@0
|
4625 *
|
victor@0
|
4626 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
|
victor@0
|
4627 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
victor@0
|
4628 *
|
victor@0
|
4629 */
|
victor@0
|
4630
|
victor@0
|
4631 /* function exit code */
|
victor@0
|
4632 __pyx_L1_error:;
|
victor@0
|
4633 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
4634 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
4635 __pyx_r = 0;
|
victor@0
|
4636 __pyx_L0:;
|
victor@0
|
4637 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
4638 __Pyx_RefNannyFinishContext();
|
victor@0
|
4639 return __pyx_r;
|
victor@0
|
4640 }
|
victor@0
|
4641
|
victor@0
|
4642 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783
|
victor@0
|
4643 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
victor@0
|
4644 *
|
victor@0
|
4645 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
|
victor@0
|
4646 * # Recursive utility function used in __getbuffer__ to get format
|
victor@0
|
4647 * # string. The new location in the format string is returned.
|
victor@0
|
4648 */
|
victor@0
|
4649
|
victor@0
|
4650 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
|
4651 PyArray_Descr *__pyx_v_child = 0;
|
victor@0
|
4652 int __pyx_v_endian_detector;
|
victor@0
|
4653 int __pyx_v_little_endian;
|
victor@0
|
4654 PyObject *__pyx_v_fields = 0;
|
victor@0
|
4655 PyObject *__pyx_v_childname = NULL;
|
victor@0
|
4656 PyObject *__pyx_v_new_offset = NULL;
|
victor@0
|
4657 PyObject *__pyx_v_t = NULL;
|
victor@0
|
4658 char *__pyx_r;
|
victor@0
|
4659 __Pyx_RefNannyDeclarations
|
victor@0
|
4660 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
4661 Py_ssize_t __pyx_t_2;
|
victor@0
|
4662 PyObject *__pyx_t_3 = NULL;
|
victor@0
|
4663 PyObject *__pyx_t_4 = NULL;
|
victor@0
|
4664 int __pyx_t_5;
|
victor@0
|
4665 int __pyx_t_6;
|
victor@0
|
4666 int __pyx_t_7;
|
victor@0
|
4667 int __pyx_t_8;
|
victor@0
|
4668 int __pyx_t_9;
|
victor@0
|
4669 long __pyx_t_10;
|
victor@0
|
4670 char *__pyx_t_11;
|
victor@0
|
4671 int __pyx_lineno = 0;
|
victor@0
|
4672 const char *__pyx_filename = NULL;
|
victor@0
|
4673 int __pyx_clineno = 0;
|
victor@0
|
4674 __Pyx_RefNannySetupContext("_util_dtypestring", 0);
|
victor@0
|
4675
|
victor@0
|
4676 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":790
|
victor@0
|
4677 * cdef int delta_offset
|
victor@0
|
4678 * cdef tuple i
|
victor@0
|
4679 * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
|
victor@0
|
4680 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
|
victor@0
|
4681 * cdef tuple fields
|
victor@0
|
4682 */
|
victor@0
|
4683 __pyx_v_endian_detector = 1;
|
victor@0
|
4684
|
victor@0
|
4685 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":791
|
victor@0
|
4686 * cdef tuple i
|
victor@0
|
4687 * cdef int endian_detector = 1
|
victor@0
|
4688 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
|
victor@0
|
4689 * cdef tuple fields
|
victor@0
|
4690 *
|
victor@0
|
4691 */
|
victor@0
|
4692 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
|
victor@0
|
4693
|
victor@0
|
4694 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":794
|
victor@0
|
4695 * cdef tuple fields
|
victor@0
|
4696 *
|
victor@0
|
4697 * for childname in descr.names: # <<<<<<<<<<<<<<
|
victor@0
|
4698 * fields = descr.fields[childname]
|
victor@0
|
4699 * child, new_offset = fields
|
victor@0
|
4700 */
|
victor@0
|
4701 if (unlikely(__pyx_v_descr->names == Py_None)) {
|
victor@0
|
4702 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
|
victor@0
|
4703 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
4704 }
|
victor@0
|
4705 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
|
victor@0
|
4706 for (;;) {
|
victor@0
|
4707 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
|
victor@0
|
4708 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
4709 __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
|
4710 #else
|
victor@0
|
4711 __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
|
4712 #endif
|
victor@0
|
4713 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
|
victor@0
|
4714 __pyx_t_3 = 0;
|
victor@0
|
4715
|
victor@0
|
4716 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":795
|
victor@0
|
4717 *
|
victor@0
|
4718 * for childname in descr.names:
|
victor@0
|
4719 * fields = descr.fields[childname] # <<<<<<<<<<<<<<
|
victor@0
|
4720 * child, new_offset = fields
|
victor@0
|
4721 *
|
victor@0
|
4722 */
|
victor@0
|
4723 __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
|
4724 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
4725 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
|
4726 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
|
victor@0
|
4727 __pyx_t_3 = 0;
|
victor@0
|
4728
|
victor@0
|
4729 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":796
|
victor@0
|
4730 * for childname in descr.names:
|
victor@0
|
4731 * fields = descr.fields[childname]
|
victor@0
|
4732 * child, new_offset = fields # <<<<<<<<<<<<<<
|
victor@0
|
4733 *
|
victor@0
|
4734 * if (end - f) - <int>(new_offset - offset[0]) < 15:
|
victor@0
|
4735 */
|
victor@0
|
4736 if (likely(__pyx_v_fields != Py_None)) {
|
victor@0
|
4737 PyObject* sequence = __pyx_v_fields;
|
victor@0
|
4738 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
4739 Py_ssize_t size = Py_SIZE(sequence);
|
victor@0
|
4740 #else
|
victor@0
|
4741 Py_ssize_t size = PySequence_Size(sequence);
|
victor@0
|
4742 #endif
|
victor@0
|
4743 if (unlikely(size != 2)) {
|
victor@0
|
4744 if (size > 2) __Pyx_RaiseTooManyValuesError(2);
|
victor@0
|
4745 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
|
victor@0
|
4746 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
4747 }
|
victor@0
|
4748 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
4749 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
|
victor@0
|
4750 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
|
victor@0
|
4751 __Pyx_INCREF(__pyx_t_3);
|
victor@0
|
4752 __Pyx_INCREF(__pyx_t_4);
|
victor@0
|
4753 #else
|
victor@0
|
4754 __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
|
4755 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
4756 __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
|
4757 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4758 #endif
|
victor@0
|
4759 } else {
|
victor@0
|
4760 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
4761 }
|
victor@0
|
4762 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
|
4763 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
|
victor@0
|
4764 __pyx_t_3 = 0;
|
victor@0
|
4765 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
|
victor@0
|
4766 __pyx_t_4 = 0;
|
victor@0
|
4767
|
victor@0
|
4768 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":798
|
victor@0
|
4769 * child, new_offset = fields
|
victor@0
|
4770 *
|
victor@0
|
4771 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
|
victor@0
|
4772 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
|
victor@0
|
4773 *
|
victor@0
|
4774 */
|
victor@0
|
4775 __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
|
4776 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4777 __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
|
4778 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
4779 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4780 __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
|
4781 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
4782 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
|
victor@0
|
4783 if (__pyx_t_6) {
|
victor@0
|
4784
|
victor@0
|
4785 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799
|
victor@0
|
4786 *
|
victor@0
|
4787 * if (end - f) - <int>(new_offset - offset[0]) < 15:
|
victor@0
|
4788 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
|
victor@0
|
4789 *
|
victor@0
|
4790 * if ((child.byteorder == c'>' and little_endian) or
|
victor@0
|
4791 */
|
victor@0
|
4792 __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
|
4793 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
4794 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
victor@0
|
4795 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
4796 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
4797 }
|
victor@0
|
4798
|
victor@0
|
4799 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":801
|
victor@0
|
4800 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
|
victor@0
|
4801 *
|
victor@0
|
4802 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
|
victor@0
|
4803 * (child.byteorder == c'<' and not little_endian)):
|
victor@0
|
4804 * raise ValueError(u"Non-native byte order not supported")
|
victor@0
|
4805 */
|
victor@0
|
4806 __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0);
|
victor@0
|
4807 if (__pyx_t_6) {
|
victor@0
|
4808 __pyx_t_7 = (__pyx_v_little_endian != 0);
|
victor@0
|
4809 } else {
|
victor@0
|
4810 __pyx_t_7 = __pyx_t_6;
|
victor@0
|
4811 }
|
victor@0
|
4812 if (!__pyx_t_7) {
|
victor@0
|
4813
|
victor@0
|
4814 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":802
|
victor@0
|
4815 *
|
victor@0
|
4816 * if ((child.byteorder == c'>' and little_endian) or
|
victor@0
|
4817 * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
|
victor@0
|
4818 * raise ValueError(u"Non-native byte order not supported")
|
victor@0
|
4819 * # One could encode it in the format string and have Cython
|
victor@0
|
4820 */
|
victor@0
|
4821 __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0);
|
victor@0
|
4822 if (__pyx_t_6) {
|
victor@0
|
4823 __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0);
|
victor@0
|
4824 __pyx_t_9 = __pyx_t_8;
|
victor@0
|
4825 } else {
|
victor@0
|
4826 __pyx_t_9 = __pyx_t_6;
|
victor@0
|
4827 }
|
victor@0
|
4828 __pyx_t_6 = __pyx_t_9;
|
victor@0
|
4829 } else {
|
victor@0
|
4830 __pyx_t_6 = __pyx_t_7;
|
victor@0
|
4831 }
|
victor@0
|
4832 if (__pyx_t_6) {
|
victor@0
|
4833
|
victor@0
|
4834 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803
|
victor@0
|
4835 * if ((child.byteorder == c'>' and little_endian) or
|
victor@0
|
4836 * (child.byteorder == c'<' and not little_endian)):
|
victor@0
|
4837 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
|
victor@0
|
4838 * # One could encode it in the format string and have Cython
|
victor@0
|
4839 * # complain instead, BUT: < and > in format strings also imply
|
victor@0
|
4840 */
|
victor@0
|
4841 __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
|
4842 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
4843 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
victor@0
|
4844 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
4845 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
4846 }
|
victor@0
|
4847
|
victor@0
|
4848 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":813
|
victor@0
|
4849 *
|
victor@0
|
4850 * # Output padding bytes
|
victor@0
|
4851 * while offset[0] < new_offset: # <<<<<<<<<<<<<<
|
victor@0
|
4852 * f[0] = 120 # "x"; pad byte
|
victor@0
|
4853 * f += 1
|
victor@0
|
4854 */
|
victor@0
|
4855 while (1) {
|
victor@0
|
4856 __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
|
4857 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
4858 __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
|
4859 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
4860 __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
|
4861 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4862 if (!__pyx_t_6) break;
|
victor@0
|
4863
|
victor@0
|
4864 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":814
|
victor@0
|
4865 * # Output padding bytes
|
victor@0
|
4866 * while offset[0] < new_offset:
|
victor@0
|
4867 * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
|
victor@0
|
4868 * f += 1
|
victor@0
|
4869 * offset[0] += 1
|
victor@0
|
4870 */
|
victor@0
|
4871 (__pyx_v_f[0]) = 120;
|
victor@0
|
4872
|
victor@0
|
4873 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":815
|
victor@0
|
4874 * while offset[0] < new_offset:
|
victor@0
|
4875 * f[0] = 120 # "x"; pad byte
|
victor@0
|
4876 * f += 1 # <<<<<<<<<<<<<<
|
victor@0
|
4877 * offset[0] += 1
|
victor@0
|
4878 *
|
victor@0
|
4879 */
|
victor@0
|
4880 __pyx_v_f = (__pyx_v_f + 1);
|
victor@0
|
4881
|
victor@0
|
4882 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":816
|
victor@0
|
4883 * f[0] = 120 # "x"; pad byte
|
victor@0
|
4884 * f += 1
|
victor@0
|
4885 * offset[0] += 1 # <<<<<<<<<<<<<<
|
victor@0
|
4886 *
|
victor@0
|
4887 * offset[0] += child.itemsize
|
victor@0
|
4888 */
|
victor@0
|
4889 __pyx_t_10 = 0;
|
victor@0
|
4890 (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1);
|
victor@0
|
4891 }
|
victor@0
|
4892
|
victor@0
|
4893 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":818
|
victor@0
|
4894 * offset[0] += 1
|
victor@0
|
4895 *
|
victor@0
|
4896 * offset[0] += child.itemsize # <<<<<<<<<<<<<<
|
victor@0
|
4897 *
|
victor@0
|
4898 * if not PyDataType_HASFIELDS(child):
|
victor@0
|
4899 */
|
victor@0
|
4900 __pyx_t_10 = 0;
|
victor@0
|
4901 (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize);
|
victor@0
|
4902
|
victor@0
|
4903 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":820
|
victor@0
|
4904 * offset[0] += child.itemsize
|
victor@0
|
4905 *
|
victor@0
|
4906 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
|
victor@0
|
4907 * t = child.type_num
|
victor@0
|
4908 * if end - f < 5:
|
victor@0
|
4909 */
|
victor@0
|
4910 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
|
victor@0
|
4911 if (__pyx_t_6) {
|
victor@0
|
4912
|
victor@0
|
4913 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":821
|
victor@0
|
4914 *
|
victor@0
|
4915 * if not PyDataType_HASFIELDS(child):
|
victor@0
|
4916 * t = child.type_num # <<<<<<<<<<<<<<
|
victor@0
|
4917 * if end - f < 5:
|
victor@0
|
4918 * raise RuntimeError(u"Format string allocated too short.")
|
victor@0
|
4919 */
|
victor@0
|
4920 __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
|
4921 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4922 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
|
victor@0
|
4923 __pyx_t_4 = 0;
|
victor@0
|
4924
|
victor@0
|
4925 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":822
|
victor@0
|
4926 * if not PyDataType_HASFIELDS(child):
|
victor@0
|
4927 * t = child.type_num
|
victor@0
|
4928 * if end - f < 5: # <<<<<<<<<<<<<<
|
victor@0
|
4929 * raise RuntimeError(u"Format string allocated too short.")
|
victor@0
|
4930 *
|
victor@0
|
4931 */
|
victor@0
|
4932 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
|
victor@0
|
4933 if (__pyx_t_6) {
|
victor@0
|
4934
|
victor@0
|
4935 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823
|
victor@0
|
4936 * t = child.type_num
|
victor@0
|
4937 * if end - f < 5:
|
victor@0
|
4938 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
|
victor@0
|
4939 *
|
victor@0
|
4940 * # Until ticket #99 is fixed, use integers to avoid warnings
|
victor@0
|
4941 */
|
victor@0
|
4942 __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
|
4943 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4944 __Pyx_Raise(__pyx_t_4, 0, 0, 0);
|
victor@0
|
4945 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4946 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
4947 }
|
victor@0
|
4948
|
victor@0
|
4949 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":826
|
victor@0
|
4950 *
|
victor@0
|
4951 * # Until ticket #99 is fixed, use integers to avoid warnings
|
victor@0
|
4952 * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
|
victor@0
|
4953 * elif t == NPY_UBYTE: f[0] = 66 #"B"
|
victor@0
|
4954 * elif t == NPY_SHORT: f[0] = 104 #"h"
|
victor@0
|
4955 */
|
victor@0
|
4956 __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
|
4957 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4958 __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
|
4959 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4960 __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
|
4961 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
4962 if (__pyx_t_6) {
|
victor@0
|
4963 (__pyx_v_f[0]) = 98;
|
victor@0
|
4964 goto __pyx_L11;
|
victor@0
|
4965 }
|
victor@0
|
4966
|
victor@0
|
4967 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":827
|
victor@0
|
4968 * # Until ticket #99 is fixed, use integers to avoid warnings
|
victor@0
|
4969 * if t == NPY_BYTE: f[0] = 98 #"b"
|
victor@0
|
4970 * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
|
victor@0
|
4971 * elif t == NPY_SHORT: f[0] = 104 #"h"
|
victor@0
|
4972 * elif t == NPY_USHORT: f[0] = 72 #"H"
|
victor@0
|
4973 */
|
victor@0
|
4974 __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
|
4975 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
4976 __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
|
4977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
4978 __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
|
4979 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4980 if (__pyx_t_6) {
|
victor@0
|
4981 (__pyx_v_f[0]) = 66;
|
victor@0
|
4982 goto __pyx_L11;
|
victor@0
|
4983 }
|
victor@0
|
4984
|
victor@0
|
4985 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":828
|
victor@0
|
4986 * if t == NPY_BYTE: f[0] = 98 #"b"
|
victor@0
|
4987 * elif t == NPY_UBYTE: f[0] = 66 #"B"
|
victor@0
|
4988 * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
|
victor@0
|
4989 * elif t == NPY_USHORT: f[0] = 72 #"H"
|
victor@0
|
4990 * elif t == NPY_INT: f[0] = 105 #"i"
|
victor@0
|
4991 */
|
victor@0
|
4992 __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
|
4993 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
4994 __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
|
4995 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
4996 __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
|
4997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
4998 if (__pyx_t_6) {
|
victor@0
|
4999 (__pyx_v_f[0]) = 104;
|
victor@0
|
5000 goto __pyx_L11;
|
victor@0
|
5001 }
|
victor@0
|
5002
|
victor@0
|
5003 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":829
|
victor@0
|
5004 * elif t == NPY_UBYTE: f[0] = 66 #"B"
|
victor@0
|
5005 * elif t == NPY_SHORT: f[0] = 104 #"h"
|
victor@0
|
5006 * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
|
victor@0
|
5007 * elif t == NPY_INT: f[0] = 105 #"i"
|
victor@0
|
5008 * elif t == NPY_UINT: f[0] = 73 #"I"
|
victor@0
|
5009 */
|
victor@0
|
5010 __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
|
5011 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5012 __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
|
5013 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5014 __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
|
5015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5016 if (__pyx_t_6) {
|
victor@0
|
5017 (__pyx_v_f[0]) = 72;
|
victor@0
|
5018 goto __pyx_L11;
|
victor@0
|
5019 }
|
victor@0
|
5020
|
victor@0
|
5021 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":830
|
victor@0
|
5022 * elif t == NPY_SHORT: f[0] = 104 #"h"
|
victor@0
|
5023 * elif t == NPY_USHORT: f[0] = 72 #"H"
|
victor@0
|
5024 * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
|
victor@0
|
5025 * elif t == NPY_UINT: f[0] = 73 #"I"
|
victor@0
|
5026 * elif t == NPY_LONG: f[0] = 108 #"l"
|
victor@0
|
5027 */
|
victor@0
|
5028 __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
|
5029 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5030 __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
|
5031 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5032 __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
|
5033 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5034 if (__pyx_t_6) {
|
victor@0
|
5035 (__pyx_v_f[0]) = 105;
|
victor@0
|
5036 goto __pyx_L11;
|
victor@0
|
5037 }
|
victor@0
|
5038
|
victor@0
|
5039 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":831
|
victor@0
|
5040 * elif t == NPY_USHORT: f[0] = 72 #"H"
|
victor@0
|
5041 * elif t == NPY_INT: f[0] = 105 #"i"
|
victor@0
|
5042 * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
|
victor@0
|
5043 * elif t == NPY_LONG: f[0] = 108 #"l"
|
victor@0
|
5044 * elif t == NPY_ULONG: f[0] = 76 #"L"
|
victor@0
|
5045 */
|
victor@0
|
5046 __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
|
5047 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5048 __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
|
5049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5050 __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
|
5051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5052 if (__pyx_t_6) {
|
victor@0
|
5053 (__pyx_v_f[0]) = 73;
|
victor@0
|
5054 goto __pyx_L11;
|
victor@0
|
5055 }
|
victor@0
|
5056
|
victor@0
|
5057 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":832
|
victor@0
|
5058 * elif t == NPY_INT: f[0] = 105 #"i"
|
victor@0
|
5059 * elif t == NPY_UINT: f[0] = 73 #"I"
|
victor@0
|
5060 * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
|
victor@0
|
5061 * elif t == NPY_ULONG: f[0] = 76 #"L"
|
victor@0
|
5062 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
victor@0
|
5063 */
|
victor@0
|
5064 __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
|
5065 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5066 __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
|
5067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5068 __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
|
5069 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5070 if (__pyx_t_6) {
|
victor@0
|
5071 (__pyx_v_f[0]) = 108;
|
victor@0
|
5072 goto __pyx_L11;
|
victor@0
|
5073 }
|
victor@0
|
5074
|
victor@0
|
5075 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":833
|
victor@0
|
5076 * elif t == NPY_UINT: f[0] = 73 #"I"
|
victor@0
|
5077 * elif t == NPY_LONG: f[0] = 108 #"l"
|
victor@0
|
5078 * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
|
victor@0
|
5079 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
victor@0
|
5080 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
victor@0
|
5081 */
|
victor@0
|
5082 __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
|
5083 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5084 __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
|
5085 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5086 __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
|
5087 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5088 if (__pyx_t_6) {
|
victor@0
|
5089 (__pyx_v_f[0]) = 76;
|
victor@0
|
5090 goto __pyx_L11;
|
victor@0
|
5091 }
|
victor@0
|
5092
|
victor@0
|
5093 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":834
|
victor@0
|
5094 * elif t == NPY_LONG: f[0] = 108 #"l"
|
victor@0
|
5095 * elif t == NPY_ULONG: f[0] = 76 #"L"
|
victor@0
|
5096 * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
|
victor@0
|
5097 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
victor@0
|
5098 * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
victor@0
|
5099 */
|
victor@0
|
5100 __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
|
5101 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5102 __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
|
5103 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5104 __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
|
5105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5106 if (__pyx_t_6) {
|
victor@0
|
5107 (__pyx_v_f[0]) = 113;
|
victor@0
|
5108 goto __pyx_L11;
|
victor@0
|
5109 }
|
victor@0
|
5110
|
victor@0
|
5111 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":835
|
victor@0
|
5112 * elif t == NPY_ULONG: f[0] = 76 #"L"
|
victor@0
|
5113 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
victor@0
|
5114 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
|
victor@0
|
5115 * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
victor@0
|
5116 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
victor@0
|
5117 */
|
victor@0
|
5118 __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
|
5119 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5120 __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
|
5121 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5122 __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
|
5123 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5124 if (__pyx_t_6) {
|
victor@0
|
5125 (__pyx_v_f[0]) = 81;
|
victor@0
|
5126 goto __pyx_L11;
|
victor@0
|
5127 }
|
victor@0
|
5128
|
victor@0
|
5129 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":836
|
victor@0
|
5130 * elif t == NPY_LONGLONG: f[0] = 113 #"q"
|
victor@0
|
5131 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
victor@0
|
5132 * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
|
victor@0
|
5133 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
victor@0
|
5134 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
victor@0
|
5135 */
|
victor@0
|
5136 __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
|
5137 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5138 __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
|
5139 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5140 __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
|
5141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5142 if (__pyx_t_6) {
|
victor@0
|
5143 (__pyx_v_f[0]) = 102;
|
victor@0
|
5144 goto __pyx_L11;
|
victor@0
|
5145 }
|
victor@0
|
5146
|
victor@0
|
5147 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":837
|
victor@0
|
5148 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
|
victor@0
|
5149 * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
victor@0
|
5150 * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
|
victor@0
|
5151 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
victor@0
|
5152 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
victor@0
|
5153 */
|
victor@0
|
5154 __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
|
5155 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5156 __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
|
5157 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5158 __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
|
5159 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5160 if (__pyx_t_6) {
|
victor@0
|
5161 (__pyx_v_f[0]) = 100;
|
victor@0
|
5162 goto __pyx_L11;
|
victor@0
|
5163 }
|
victor@0
|
5164
|
victor@0
|
5165 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":838
|
victor@0
|
5166 * elif t == NPY_FLOAT: f[0] = 102 #"f"
|
victor@0
|
5167 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
victor@0
|
5168 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
|
victor@0
|
5169 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
victor@0
|
5170 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
victor@0
|
5171 */
|
victor@0
|
5172 __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
|
5173 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5174 __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
|
5175 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5176 __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
|
5177 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5178 if (__pyx_t_6) {
|
victor@0
|
5179 (__pyx_v_f[0]) = 103;
|
victor@0
|
5180 goto __pyx_L11;
|
victor@0
|
5181 }
|
victor@0
|
5182
|
victor@0
|
5183 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":839
|
victor@0
|
5184 * elif t == NPY_DOUBLE: f[0] = 100 #"d"
|
victor@0
|
5185 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
victor@0
|
5186 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
|
victor@0
|
5187 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
victor@0
|
5188 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
|
victor@0
|
5189 */
|
victor@0
|
5190 __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
|
5191 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5192 __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
|
5193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5194 __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
|
5195 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5196 if (__pyx_t_6) {
|
victor@0
|
5197 (__pyx_v_f[0]) = 90;
|
victor@0
|
5198 (__pyx_v_f[1]) = 102;
|
victor@0
|
5199 __pyx_v_f = (__pyx_v_f + 1);
|
victor@0
|
5200 goto __pyx_L11;
|
victor@0
|
5201 }
|
victor@0
|
5202
|
victor@0
|
5203 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":840
|
victor@0
|
5204 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
|
victor@0
|
5205 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
victor@0
|
5206 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
|
victor@0
|
5207 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
|
victor@0
|
5208 * elif t == NPY_OBJECT: f[0] = 79 #"O"
|
victor@0
|
5209 */
|
victor@0
|
5210 __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
|
5211 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5212 __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
|
5213 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5214 __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
|
5215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5216 if (__pyx_t_6) {
|
victor@0
|
5217 (__pyx_v_f[0]) = 90;
|
victor@0
|
5218 (__pyx_v_f[1]) = 100;
|
victor@0
|
5219 __pyx_v_f = (__pyx_v_f + 1);
|
victor@0
|
5220 goto __pyx_L11;
|
victor@0
|
5221 }
|
victor@0
|
5222
|
victor@0
|
5223 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":841
|
victor@0
|
5224 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
|
victor@0
|
5225 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
victor@0
|
5226 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
|
victor@0
|
5227 * elif t == NPY_OBJECT: f[0] = 79 #"O"
|
victor@0
|
5228 * else:
|
victor@0
|
5229 */
|
victor@0
|
5230 __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
|
5231 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5232 __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
|
5233 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5234 __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
|
5235 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5236 if (__pyx_t_6) {
|
victor@0
|
5237 (__pyx_v_f[0]) = 90;
|
victor@0
|
5238 (__pyx_v_f[1]) = 103;
|
victor@0
|
5239 __pyx_v_f = (__pyx_v_f + 1);
|
victor@0
|
5240 goto __pyx_L11;
|
victor@0
|
5241 }
|
victor@0
|
5242
|
victor@0
|
5243 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":842
|
victor@0
|
5244 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
|
victor@0
|
5245 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
|
victor@0
|
5246 * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
|
victor@0
|
5247 * else:
|
victor@0
|
5248 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
victor@0
|
5249 */
|
victor@0
|
5250 __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
|
5251 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5252 __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
|
5253 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5254 __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
|
5255 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5256 if (__pyx_t_6) {
|
victor@0
|
5257 (__pyx_v_f[0]) = 79;
|
victor@0
|
5258 goto __pyx_L11;
|
victor@0
|
5259 }
|
victor@0
|
5260 /*else*/ {
|
victor@0
|
5261
|
victor@0
|
5262 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":844
|
victor@0
|
5263 * elif t == NPY_OBJECT: f[0] = 79 #"O"
|
victor@0
|
5264 * else:
|
victor@0
|
5265 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
|
victor@0
|
5266 * f += 1
|
victor@0
|
5267 * else:
|
victor@0
|
5268 */
|
victor@0
|
5269 __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
|
5270 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5271 __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
|
5272 __Pyx_GOTREF(__pyx_t_4);
|
victor@0
|
5273 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
|
victor@0
|
5274 __Pyx_GIVEREF(__pyx_t_3);
|
victor@0
|
5275 __pyx_t_3 = 0;
|
victor@0
|
5276 __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
|
5277 __Pyx_GOTREF(__pyx_t_3);
|
victor@0
|
5278 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
|
victor@0
|
5279 __Pyx_Raise(__pyx_t_3, 0, 0, 0);
|
victor@0
|
5280 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
|
victor@0
|
5281 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5282 }
|
victor@0
|
5283 __pyx_L11:;
|
victor@0
|
5284
|
victor@0
|
5285 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":845
|
victor@0
|
5286 * else:
|
victor@0
|
5287 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
|
victor@0
|
5288 * f += 1 # <<<<<<<<<<<<<<
|
victor@0
|
5289 * else:
|
victor@0
|
5290 * # Cython ignores struct boundary information ("T{...}"),
|
victor@0
|
5291 */
|
victor@0
|
5292 __pyx_v_f = (__pyx_v_f + 1);
|
victor@0
|
5293 goto __pyx_L9;
|
victor@0
|
5294 }
|
victor@0
|
5295 /*else*/ {
|
victor@0
|
5296
|
victor@0
|
5297 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":849
|
victor@0
|
5298 * # Cython ignores struct boundary information ("T{...}"),
|
victor@0
|
5299 * # so don't output it
|
victor@0
|
5300 * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
|
victor@0
|
5301 * return f
|
victor@0
|
5302 *
|
victor@0
|
5303 */
|
victor@0
|
5304 __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
|
5305 __pyx_v_f = __pyx_t_11;
|
victor@0
|
5306 }
|
victor@0
|
5307 __pyx_L9:;
|
victor@0
|
5308 }
|
victor@0
|
5309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
5310
|
victor@0
|
5311 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":850
|
victor@0
|
5312 * # so don't output it
|
victor@0
|
5313 * f = _util_dtypestring(child, f, end, offset)
|
victor@0
|
5314 * return f # <<<<<<<<<<<<<<
|
victor@0
|
5315 *
|
victor@0
|
5316 *
|
victor@0
|
5317 */
|
victor@0
|
5318 __pyx_r = __pyx_v_f;
|
victor@0
|
5319 goto __pyx_L0;
|
victor@0
|
5320
|
victor@0
|
5321 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783
|
victor@0
|
5322 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
|
victor@0
|
5323 *
|
victor@0
|
5324 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
|
victor@0
|
5325 * # Recursive utility function used in __getbuffer__ to get format
|
victor@0
|
5326 * # string. The new location in the format string is returned.
|
victor@0
|
5327 */
|
victor@0
|
5328
|
victor@0
|
5329 /* function exit code */
|
victor@0
|
5330 __pyx_L1_error:;
|
victor@0
|
5331 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
5332 __Pyx_XDECREF(__pyx_t_3);
|
victor@0
|
5333 __Pyx_XDECREF(__pyx_t_4);
|
victor@0
|
5334 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
5335 __pyx_r = NULL;
|
victor@0
|
5336 __pyx_L0:;
|
victor@0
|
5337 __Pyx_XDECREF((PyObject *)__pyx_v_child);
|
victor@0
|
5338 __Pyx_XDECREF(__pyx_v_fields);
|
victor@0
|
5339 __Pyx_XDECREF(__pyx_v_childname);
|
victor@0
|
5340 __Pyx_XDECREF(__pyx_v_new_offset);
|
victor@0
|
5341 __Pyx_XDECREF(__pyx_v_t);
|
victor@0
|
5342 __Pyx_RefNannyFinishContext();
|
victor@0
|
5343 return __pyx_r;
|
victor@0
|
5344 }
|
victor@0
|
5345
|
victor@0
|
5346 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966
|
victor@0
|
5347 *
|
victor@0
|
5348 *
|
victor@0
|
5349 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
victor@0
|
5350 * cdef PyObject* baseptr
|
victor@0
|
5351 * if base is None:
|
victor@0
|
5352 */
|
victor@0
|
5353
|
victor@0
|
5354 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
|
victor@0
|
5355 PyObject *__pyx_v_baseptr;
|
victor@0
|
5356 __Pyx_RefNannyDeclarations
|
victor@0
|
5357 int __pyx_t_1;
|
victor@0
|
5358 int __pyx_t_2;
|
victor@0
|
5359 __Pyx_RefNannySetupContext("set_array_base", 0);
|
victor@0
|
5360
|
victor@0
|
5361 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":968
|
victor@0
|
5362 * cdef inline void set_array_base(ndarray arr, object base):
|
victor@0
|
5363 * cdef PyObject* baseptr
|
victor@0
|
5364 * if base is None: # <<<<<<<<<<<<<<
|
victor@0
|
5365 * baseptr = NULL
|
victor@0
|
5366 * else:
|
victor@0
|
5367 */
|
victor@0
|
5368 __pyx_t_1 = (__pyx_v_base == Py_None);
|
victor@0
|
5369 __pyx_t_2 = (__pyx_t_1 != 0);
|
victor@0
|
5370 if (__pyx_t_2) {
|
victor@0
|
5371
|
victor@0
|
5372 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":969
|
victor@0
|
5373 * cdef PyObject* baseptr
|
victor@0
|
5374 * if base is None:
|
victor@0
|
5375 * baseptr = NULL # <<<<<<<<<<<<<<
|
victor@0
|
5376 * else:
|
victor@0
|
5377 * Py_INCREF(base) # important to do this before decref below!
|
victor@0
|
5378 */
|
victor@0
|
5379 __pyx_v_baseptr = NULL;
|
victor@0
|
5380 goto __pyx_L3;
|
victor@0
|
5381 }
|
victor@0
|
5382 /*else*/ {
|
victor@0
|
5383
|
victor@0
|
5384 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":971
|
victor@0
|
5385 * baseptr = NULL
|
victor@0
|
5386 * else:
|
victor@0
|
5387 * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
|
victor@0
|
5388 * baseptr = <PyObject*>base
|
victor@0
|
5389 * Py_XDECREF(arr.base)
|
victor@0
|
5390 */
|
victor@0
|
5391 Py_INCREF(__pyx_v_base);
|
victor@0
|
5392
|
victor@0
|
5393 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":972
|
victor@0
|
5394 * else:
|
victor@0
|
5395 * Py_INCREF(base) # important to do this before decref below!
|
victor@0
|
5396 * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
|
victor@0
|
5397 * Py_XDECREF(arr.base)
|
victor@0
|
5398 * arr.base = baseptr
|
victor@0
|
5399 */
|
victor@0
|
5400 __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
|
victor@0
|
5401 }
|
victor@0
|
5402 __pyx_L3:;
|
victor@0
|
5403
|
victor@0
|
5404 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":973
|
victor@0
|
5405 * Py_INCREF(base) # important to do this before decref below!
|
victor@0
|
5406 * baseptr = <PyObject*>base
|
victor@0
|
5407 * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
|
victor@0
|
5408 * arr.base = baseptr
|
victor@0
|
5409 *
|
victor@0
|
5410 */
|
victor@0
|
5411 Py_XDECREF(__pyx_v_arr->base);
|
victor@0
|
5412
|
victor@0
|
5413 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":974
|
victor@0
|
5414 * baseptr = <PyObject*>base
|
victor@0
|
5415 * Py_XDECREF(arr.base)
|
victor@0
|
5416 * arr.base = baseptr # <<<<<<<<<<<<<<
|
victor@0
|
5417 *
|
victor@0
|
5418 * cdef inline object get_array_base(ndarray arr):
|
victor@0
|
5419 */
|
victor@0
|
5420 __pyx_v_arr->base = __pyx_v_baseptr;
|
victor@0
|
5421
|
victor@0
|
5422 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966
|
victor@0
|
5423 *
|
victor@0
|
5424 *
|
victor@0
|
5425 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
|
victor@0
|
5426 * cdef PyObject* baseptr
|
victor@0
|
5427 * if base is None:
|
victor@0
|
5428 */
|
victor@0
|
5429
|
victor@0
|
5430 /* function exit code */
|
victor@0
|
5431 __Pyx_RefNannyFinishContext();
|
victor@0
|
5432 }
|
victor@0
|
5433
|
victor@0
|
5434 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976
|
victor@0
|
5435 * arr.base = baseptr
|
victor@0
|
5436 *
|
victor@0
|
5437 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
victor@0
|
5438 * if arr.base is NULL:
|
victor@0
|
5439 * return None
|
victor@0
|
5440 */
|
victor@0
|
5441
|
victor@0
|
5442 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
|
victor@0
|
5443 PyObject *__pyx_r = NULL;
|
victor@0
|
5444 __Pyx_RefNannyDeclarations
|
victor@0
|
5445 int __pyx_t_1;
|
victor@0
|
5446 __Pyx_RefNannySetupContext("get_array_base", 0);
|
victor@0
|
5447
|
victor@0
|
5448 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":977
|
victor@0
|
5449 *
|
victor@0
|
5450 * cdef inline object get_array_base(ndarray arr):
|
victor@0
|
5451 * if arr.base is NULL: # <<<<<<<<<<<<<<
|
victor@0
|
5452 * return None
|
victor@0
|
5453 * else:
|
victor@0
|
5454 */
|
victor@0
|
5455 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
|
victor@0
|
5456 if (__pyx_t_1) {
|
victor@0
|
5457
|
victor@0
|
5458 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":978
|
victor@0
|
5459 * cdef inline object get_array_base(ndarray arr):
|
victor@0
|
5460 * if arr.base is NULL:
|
victor@0
|
5461 * return None # <<<<<<<<<<<<<<
|
victor@0
|
5462 * else:
|
victor@0
|
5463 * return <object>arr.base
|
victor@0
|
5464 */
|
victor@0
|
5465 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
5466 __Pyx_INCREF(Py_None);
|
victor@0
|
5467 __pyx_r = Py_None;
|
victor@0
|
5468 goto __pyx_L0;
|
victor@0
|
5469 }
|
victor@0
|
5470 /*else*/ {
|
victor@0
|
5471
|
victor@0
|
5472 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":980
|
victor@0
|
5473 * return None
|
victor@0
|
5474 * else:
|
victor@0
|
5475 * return <object>arr.base # <<<<<<<<<<<<<<
|
victor@0
|
5476 */
|
victor@0
|
5477 __Pyx_XDECREF(__pyx_r);
|
victor@0
|
5478 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
|
victor@0
|
5479 __pyx_r = ((PyObject *)__pyx_v_arr->base);
|
victor@0
|
5480 goto __pyx_L0;
|
victor@0
|
5481 }
|
victor@0
|
5482
|
victor@0
|
5483 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976
|
victor@0
|
5484 * arr.base = baseptr
|
victor@0
|
5485 *
|
victor@0
|
5486 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
victor@0
|
5487 * if arr.base is NULL:
|
victor@0
|
5488 * return None
|
victor@0
|
5489 */
|
victor@0
|
5490
|
victor@0
|
5491 /* function exit code */
|
victor@0
|
5492 __pyx_L0:;
|
victor@0
|
5493 __Pyx_XGIVEREF(__pyx_r);
|
victor@0
|
5494 __Pyx_RefNannyFinishContext();
|
victor@0
|
5495 return __pyx_r;
|
victor@0
|
5496 }
|
victor@0
|
5497
|
victor@0
|
5498 static PyMethodDef __pyx_methods[] = {
|
victor@0
|
5499 {0, 0, 0, 0}
|
victor@0
|
5500 };
|
victor@0
|
5501
|
victor@0
|
5502 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
5503 static struct PyModuleDef __pyx_moduledef = {
|
victor@0
|
5504 #if PY_VERSION_HEX < 0x03020000
|
victor@0
|
5505 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
|
victor@0
|
5506 #else
|
victor@0
|
5507 PyModuleDef_HEAD_INIT,
|
victor@0
|
5508 #endif
|
victor@0
|
5509 __Pyx_NAMESTR("FastAlignmentArrays"),
|
victor@0
|
5510 __Pyx_DOCSTR(__pyx_k_organization_Lancaster_Universi), /* m_doc */
|
victor@0
|
5511 -1, /* m_size */
|
victor@0
|
5512 __pyx_methods /* m_methods */,
|
victor@0
|
5513 NULL, /* m_reload */
|
victor@0
|
5514 NULL, /* m_traverse */
|
victor@0
|
5515 NULL, /* m_clear */
|
victor@0
|
5516 NULL /* m_free */
|
victor@0
|
5517 };
|
victor@0
|
5518 #endif
|
victor@0
|
5519
|
victor@0
|
5520 static __Pyx_StringTabEntry __pyx_string_tab[] = {
|
victor@0
|
5521 {&__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
|
5522 {&__pyx_n_s_FastAlignmentArrays, __pyx_k_FastAlignmentArrays, sizeof(__pyx_k_FastAlignmentArrays), 0, 0, 1, 1},
|
victor@0
|
5523 {&__pyx_n_s_FastAlignmentArrays___needleman, __pyx_k_FastAlignmentArrays___needleman, sizeof(__pyx_k_FastAlignmentArrays___needleman), 0, 0, 1, 1},
|
victor@0
|
5524 {&__pyx_n_s_FastAlignmentArrays___needleman_2, __pyx_k_FastAlignmentArrays___needleman_2, sizeof(__pyx_k_FastAlignmentArrays___needleman_2), 0, 0, 1, 1},
|
victor@0
|
5525 {&__pyx_n_s_FastAlignmentArrays__needleman, __pyx_k_FastAlignmentArrays__needleman, sizeof(__pyx_k_FastAlignmentArrays__needleman), 0, 0, 1, 1},
|
victor@0
|
5526 {&__pyx_n_s_FastAlignmentArrays__needleman_2, __pyx_k_FastAlignmentArrays__needleman_2, sizeof(__pyx_k_FastAlignmentArrays__needleman_2), 0, 0, 1, 1},
|
victor@0
|
5527 {&__pyx_n_s_FastAlignmentArrays_needleman_wu, __pyx_k_FastAlignmentArrays_needleman_wu, sizeof(__pyx_k_FastAlignmentArrays_needleman_wu), 0, 0, 1, 1},
|
victor@0
|
5528 {&__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
|
5529 {&__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
|
5530 {&__pyx_kp_s_GAP, __pyx_k_GAP, sizeof(__pyx_k_GAP), 0, 0, 1, 0},
|
victor@0
|
5531 {&__pyx_n_s_MultipleOMR_Alignment_FastAlignm, __pyx_k_MultipleOMR_Alignment_FastAlignm, sizeof(__pyx_k_MultipleOMR_Alignment_FastAlignm), 0, 0, 1, 1},
|
victor@0
|
5532 {&__pyx_n_s_NWunsch, __pyx_k_NWunsch, sizeof(__pyx_k_NWunsch), 0, 0, 1, 1},
|
victor@0
|
5533 {&__pyx_n_s_NWunsch_getSimilarity, __pyx_k_NWunsch_getSimilarity, sizeof(__pyx_k_NWunsch_getSimilarity), 0, 0, 1, 1},
|
victor@0
|
5534 {&__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
|
5535 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
|
victor@0
|
5536 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
|
victor@0
|
5537 {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0},
|
victor@0
|
5538 {&__pyx_n_s_align1, __pyx_k_align1, sizeof(__pyx_k_align1), 0, 0, 1, 1},
|
victor@0
|
5539 {&__pyx_n_s_align1_gap, __pyx_k_align1_gap, sizeof(__pyx_k_align1_gap), 0, 0, 1, 1},
|
victor@0
|
5540 {&__pyx_n_s_align2, __pyx_k_align2, sizeof(__pyx_k_align2), 0, 0, 1, 1},
|
victor@0
|
5541 {&__pyx_n_s_align2_gap, __pyx_k_align2_gap, sizeof(__pyx_k_align2_gap), 0, 0, 1, 1},
|
victor@0
|
5542 {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1},
|
victor@0
|
5543 {&__pyx_n_s_curr, __pyx_k_curr, sizeof(__pyx_k_curr), 0, 0, 1, 1},
|
victor@0
|
5544 {&__pyx_n_s_diagonalRange, __pyx_k_diagonalRange, sizeof(__pyx_k_diagonalRange), 0, 0, 1, 1},
|
victor@0
|
5545 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
|
victor@0
|
5546 {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1},
|
victor@0
|
5547 {&__pyx_n_s_finalscore, __pyx_k_finalscore, sizeof(__pyx_k_finalscore), 0, 0, 1, 1},
|
victor@0
|
5548 {&__pyx_n_s_gap1, __pyx_k_gap1, sizeof(__pyx_k_gap1), 0, 0, 1, 1},
|
victor@0
|
5549 {&__pyx_n_s_gap2, __pyx_k_gap2, sizeof(__pyx_k_gap2), 0, 0, 1, 1},
|
victor@0
|
5550 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
|
victor@0
|
5551 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
|
victor@0
|
5552 {&__pyx_n_s_indel, __pyx_k_indel, sizeof(__pyx_k_indel), 0, 0, 1, 1},
|
victor@0
|
5553 {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1},
|
victor@0
|
5554 {&__pyx_n_s_isFast, __pyx_k_isFast, sizeof(__pyx_k_isFast), 0, 0, 1, 1},
|
victor@0
|
5555 {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
|
victor@0
|
5556 {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
|
victor@0
|
5557 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
|
victor@0
|
5558 {&__pyx_n_s_maxlen, __pyx_k_maxlen, sizeof(__pyx_k_maxlen), 0, 0, 1, 1},
|
victor@0
|
5559 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
|
victor@0
|
5560 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
|
victor@0
|
5561 {&__pyx_n_s_myseq1, __pyx_k_myseq1, sizeof(__pyx_k_myseq1), 0, 0, 1, 1},
|
victor@0
|
5562 {&__pyx_n_s_myseq2, __pyx_k_myseq2, sizeof(__pyx_k_myseq2), 0, 0, 1, 1},
|
victor@0
|
5563 {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
|
victor@0
|
5564 {&__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
|
5565 {&__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
|
5566 {&__pyx_n_s_needleman_wunsch, __pyx_k_needleman_wunsch, sizeof(__pyx_k_needleman_wunsch), 0, 0, 1, 1},
|
victor@0
|
5567 {&__pyx_n_s_needleman_wunsch_matrix, __pyx_k_needleman_wunsch_matrix, sizeof(__pyx_k_needleman_wunsch_matrix), 0, 0, 1, 1},
|
victor@0
|
5568 {&__pyx_n_s_needleman_wunsch_trace, __pyx_k_needleman_wunsch_trace, sizeof(__pyx_k_needleman_wunsch_trace), 0, 0, 1, 1},
|
victor@0
|
5569 {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1},
|
victor@0
|
5570 {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1},
|
victor@0
|
5571 {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
|
victor@0
|
5572 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
|
victor@0
|
5573 {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1},
|
victor@0
|
5574 {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1},
|
victor@0
|
5575 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
|
victor@0
|
5576 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
|
victor@0
|
5577 {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1},
|
victor@0
|
5578 {&__pyx_n_s_score, __pyx_k_score, sizeof(__pyx_k_score), 0, 0, 1, 1},
|
victor@0
|
5579 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
|
victor@0
|
5580 {&__pyx_n_s_seq1, __pyx_k_seq1, sizeof(__pyx_k_seq1), 0, 0, 1, 1},
|
victor@0
|
5581 {&__pyx_n_s_seq2, __pyx_k_seq2, sizeof(__pyx_k_seq2), 0, 0, 1, 1},
|
victor@0
|
5582 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
|
victor@0
|
5583 {&__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
|
5584 {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1},
|
victor@0
|
5585 {0, 0, 0, 0, 0, 0, 0}
|
victor@0
|
5586 };
|
victor@0
|
5587 static int __Pyx_InitCachedBuiltins(void) {
|
victor@0
|
5588 __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
|
5589 __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
|
5590 __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
|
5591 return 0;
|
victor@0
|
5592 __pyx_L1_error:;
|
victor@0
|
5593 return -1;
|
victor@0
|
5594 }
|
victor@0
|
5595
|
victor@0
|
5596 static int __Pyx_InitCachedConstants(void) {
|
victor@0
|
5597 __Pyx_RefNannyDeclarations
|
victor@0
|
5598 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
|
victor@0
|
5599
|
victor@0
|
5600 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":87
|
victor@0
|
5601 *
|
victor@0
|
5602 * # Tag first row by LEFT, indicating initial "-"s
|
victor@0
|
5603 * ptr[0,1:] = LEFT # <<<<<<<<<<<<<<
|
victor@0
|
5604 *
|
victor@0
|
5605 * # Tag first column by UP, indicating initial "-"s
|
victor@0
|
5606 */
|
victor@0
|
5607 __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
|
5608 __Pyx_GOTREF(__pyx_slice_);
|
victor@0
|
5609 __Pyx_GIVEREF(__pyx_slice_);
|
victor@0
|
5610 __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
|
5611 __Pyx_GOTREF(__pyx_tuple__2);
|
victor@0
|
5612 __Pyx_GIVEREF(__pyx_tuple__2);
|
victor@0
|
5613
|
victor@0
|
5614 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":90
|
victor@0
|
5615 *
|
victor@0
|
5616 * # Tag first column by UP, indicating initial "-"s
|
victor@0
|
5617 * ptr[1:,0] = UP # <<<<<<<<<<<<<<
|
victor@0
|
5618 *
|
victor@0
|
5619 * #####################################################
|
victor@0
|
5620 */
|
victor@0
|
5621 __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
|
5622 __Pyx_GOTREF(__pyx_slice__3);
|
victor@0
|
5623 __Pyx_GIVEREF(__pyx_slice__3);
|
victor@0
|
5624 __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
|
5625 __Pyx_GOTREF(__pyx_tuple__4);
|
victor@0
|
5626 __Pyx_GIVEREF(__pyx_tuple__4);
|
victor@0
|
5627
|
victor@0
|
5628 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215
|
victor@0
|
5629 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
|
victor@0
|
5630 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
|
victor@0
|
5631 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
|
victor@0
|
5632 *
|
victor@0
|
5633 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
victor@0
|
5634 */
|
victor@0
|
5635 __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
|
5636 __Pyx_GOTREF(__pyx_tuple__6);
|
victor@0
|
5637 __Pyx_GIVEREF(__pyx_tuple__6);
|
victor@0
|
5638
|
victor@0
|
5639 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219
|
victor@0
|
5640 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
|
victor@0
|
5641 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
|
victor@0
|
5642 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
|
victor@0
|
5643 *
|
victor@0
|
5644 * info.buf = PyArray_DATA(self)
|
victor@0
|
5645 */
|
victor@0
|
5646 __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
|
5647 __Pyx_GOTREF(__pyx_tuple__7);
|
victor@0
|
5648 __Pyx_GIVEREF(__pyx_tuple__7);
|
victor@0
|
5649
|
victor@0
|
5650 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257
|
victor@0
|
5651 * if ((descr.byteorder == c'>' and little_endian) or
|
victor@0
|
5652 * (descr.byteorder == c'<' and not little_endian)):
|
victor@0
|
5653 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
|
victor@0
|
5654 * if t == NPY_BYTE: f = "b"
|
victor@0
|
5655 * elif t == NPY_UBYTE: f = "B"
|
victor@0
|
5656 */
|
victor@0
|
5657 __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
|
5658 __Pyx_GOTREF(__pyx_tuple__8);
|
victor@0
|
5659 __Pyx_GIVEREF(__pyx_tuple__8);
|
victor@0
|
5660
|
victor@0
|
5661 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799
|
victor@0
|
5662 *
|
victor@0
|
5663 * if (end - f) - <int>(new_offset - offset[0]) < 15:
|
victor@0
|
5664 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
|
victor@0
|
5665 *
|
victor@0
|
5666 * if ((child.byteorder == c'>' and little_endian) or
|
victor@0
|
5667 */
|
victor@0
|
5668 __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
|
5669 __Pyx_GOTREF(__pyx_tuple__9);
|
victor@0
|
5670 __Pyx_GIVEREF(__pyx_tuple__9);
|
victor@0
|
5671
|
victor@0
|
5672 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803
|
victor@0
|
5673 * if ((child.byteorder == c'>' and little_endian) or
|
victor@0
|
5674 * (child.byteorder == c'<' and not little_endian)):
|
victor@0
|
5675 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
|
victor@0
|
5676 * # One could encode it in the format string and have Cython
|
victor@0
|
5677 * # complain instead, BUT: < and > in format strings also imply
|
victor@0
|
5678 */
|
victor@0
|
5679 __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
|
5680 __Pyx_GOTREF(__pyx_tuple__10);
|
victor@0
|
5681 __Pyx_GIVEREF(__pyx_tuple__10);
|
victor@0
|
5682
|
victor@0
|
5683 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823
|
victor@0
|
5684 * t = child.type_num
|
victor@0
|
5685 * if end - f < 5:
|
victor@0
|
5686 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
|
victor@0
|
5687 *
|
victor@0
|
5688 * # Until ticket #99 is fixed, use integers to avoid warnings
|
victor@0
|
5689 */
|
victor@0
|
5690 __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
|
5691 __Pyx_GOTREF(__pyx_tuple__11);
|
victor@0
|
5692 __Pyx_GIVEREF(__pyx_tuple__11);
|
victor@0
|
5693
|
victor@0
|
5694 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57
|
victor@0
|
5695 * class FastAlignmentArrays:
|
victor@0
|
5696 *
|
victor@0
|
5697 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<<
|
victor@0
|
5698 * """
|
victor@0
|
5699 * fill in the DP matrix according to the Needleman-Wunsch algorithm.
|
victor@0
|
5700 */
|
victor@0
|
5701 __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
|
5702 __Pyx_GOTREF(__pyx_tuple__12);
|
victor@0
|
5703 __Pyx_GIVEREF(__pyx_tuple__12);
|
victor@0
|
5704 __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
|
5705
|
victor@0
|
5706 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145
|
victor@0
|
5707 * return s, ptr
|
victor@0
|
5708 *
|
victor@0
|
5709 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<<
|
victor@0
|
5710 *
|
victor@0
|
5711 * #### TRACE BEST PATH TO GET ALIGNMENT ####
|
victor@0
|
5712 */
|
victor@0
|
5713 __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
|
5714 __Pyx_GOTREF(__pyx_tuple__14);
|
victor@0
|
5715 __Pyx_GIVEREF(__pyx_tuple__14);
|
victor@0
|
5716 __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
|
5717
|
victor@0
|
5718 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202
|
victor@0
|
5719 *
|
victor@0
|
5720 *
|
victor@0
|
5721 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<<
|
victor@0
|
5722 * """
|
victor@0
|
5723 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch
|
victor@0
|
5724 */
|
victor@0
|
5725 __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
|
5726 __Pyx_GOTREF(__pyx_tuple__16);
|
victor@0
|
5727 __Pyx_GIVEREF(__pyx_tuple__16);
|
victor@0
|
5728 __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
|
5729 __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
|
5730 __Pyx_GOTREF(__pyx_tuple__18);
|
victor@0
|
5731 __Pyx_GIVEREF(__pyx_tuple__18);
|
victor@0
|
5732 __Pyx_RefNannyFinishContext();
|
victor@0
|
5733 return 0;
|
victor@0
|
5734 __pyx_L1_error:;
|
victor@0
|
5735 __Pyx_RefNannyFinishContext();
|
victor@0
|
5736 return -1;
|
victor@0
|
5737 }
|
victor@0
|
5738
|
victor@0
|
5739 static int __Pyx_InitGlobals(void) {
|
victor@0
|
5740 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;};
|
victor@0
|
5741 __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
|
5742 __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
|
5743 __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
|
5744 __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
|
5745 __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
|
5746 return 0;
|
victor@0
|
5747 __pyx_L1_error:;
|
victor@0
|
5748 return -1;
|
victor@0
|
5749 }
|
victor@0
|
5750
|
victor@0
|
5751 #if PY_MAJOR_VERSION < 3
|
victor@0
|
5752 PyMODINIT_FUNC initFastAlignmentArrays(void); /*proto*/
|
victor@0
|
5753 PyMODINIT_FUNC initFastAlignmentArrays(void)
|
victor@0
|
5754 #else
|
victor@0
|
5755 PyMODINIT_FUNC PyInit_FastAlignmentArrays(void); /*proto*/
|
victor@0
|
5756 PyMODINIT_FUNC PyInit_FastAlignmentArrays(void)
|
victor@0
|
5757 #endif
|
victor@0
|
5758 {
|
victor@0
|
5759 PyObject *__pyx_t_1 = NULL;
|
victor@0
|
5760 PyObject *__pyx_t_2 = NULL;
|
victor@0
|
5761 int __pyx_lineno = 0;
|
victor@0
|
5762 const char *__pyx_filename = NULL;
|
victor@0
|
5763 int __pyx_clineno = 0;
|
victor@0
|
5764 __Pyx_RefNannyDeclarations
|
victor@0
|
5765 #if CYTHON_REFNANNY
|
victor@0
|
5766 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
|
victor@0
|
5767 if (!__Pyx_RefNanny) {
|
victor@0
|
5768 PyErr_Clear();
|
victor@0
|
5769 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
|
victor@0
|
5770 if (!__Pyx_RefNanny)
|
victor@0
|
5771 Py_FatalError("failed to import 'refnanny' module");
|
victor@0
|
5772 }
|
victor@0
|
5773 #endif
|
victor@0
|
5774 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_FastAlignmentArrays(void)", 0);
|
victor@0
|
5775 if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5776 __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
|
5777 __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
|
5778 #ifdef __Pyx_CyFunction_USED
|
victor@0
|
5779 if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5780 #endif
|
victor@0
|
5781 #ifdef __Pyx_FusedFunction_USED
|
victor@0
|
5782 if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5783 #endif
|
victor@0
|
5784 #ifdef __Pyx_Generator_USED
|
victor@0
|
5785 if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5786 #endif
|
victor@0
|
5787 /*--- Library function declarations ---*/
|
victor@0
|
5788 /*--- Threads initialization code ---*/
|
victor@0
|
5789 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
|
victor@0
|
5790 #ifdef WITH_THREAD /* Python build with threading support? */
|
victor@0
|
5791 PyEval_InitThreads();
|
victor@0
|
5792 #endif
|
victor@0
|
5793 #endif
|
victor@0
|
5794 /*--- Module creation code ---*/
|
victor@0
|
5795 #if PY_MAJOR_VERSION < 3
|
victor@0
|
5796 __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
|
5797 #else
|
victor@0
|
5798 __pyx_m = PyModule_Create(&__pyx_moduledef);
|
victor@0
|
5799 #endif
|
victor@0
|
5800 if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5801 __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
|
5802 Py_INCREF(__pyx_d);
|
victor@0
|
5803 __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
|
5804 #if CYTHON_COMPILING_IN_PYPY
|
victor@0
|
5805 Py_INCREF(__pyx_b);
|
victor@0
|
5806 #endif
|
victor@0
|
5807 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
|
5808 /*--- Initialize various global constants etc. ---*/
|
victor@0
|
5809 if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5810 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
|
victor@0
|
5811 if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5812 #endif
|
victor@0
|
5813 if (__pyx_module_is_main_MultipleOMR__Alignment__FastAlignmentArrays) {
|
victor@0
|
5814 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
|
5815 }
|
victor@0
|
5816 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
5817 {
|
victor@0
|
5818 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5819 if (!PyDict_GetItemString(modules, "MultipleOMR.Alignment.FastAlignmentArrays")) {
|
victor@0
|
5820 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
|
5821 }
|
victor@0
|
5822 }
|
victor@0
|
5823 #endif
|
victor@0
|
5824 /*--- Builtin init code ---*/
|
victor@0
|
5825 if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5826 /*--- Constants init code ---*/
|
victor@0
|
5827 if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}
|
victor@0
|
5828 /*--- Global init code ---*/
|
victor@0
|
5829 /*--- Variable export code ---*/
|
victor@0
|
5830 /*--- Function export code ---*/
|
victor@0
|
5831 /*--- Type init code ---*/
|
victor@0
|
5832 /*--- Type import code ---*/
|
victor@0
|
5833 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
|
victor@0
|
5834 #if CYTHON_COMPILING_IN_PYPY
|
victor@0
|
5835 sizeof(PyTypeObject),
|
victor@0
|
5836 #else
|
victor@0
|
5837 sizeof(PyHeapTypeObject),
|
victor@0
|
5838 #endif
|
victor@0
|
5839 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
|
5840 __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
|
5841 __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
|
5842 __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
|
5843 __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
|
5844 __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
|
5845 __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
|
5846 __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
|
5847 /*--- Variable import code ---*/
|
victor@0
|
5848 /*--- Function import code ---*/
|
victor@0
|
5849 /*--- Execution code ---*/
|
victor@0
|
5850
|
victor@0
|
5851 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":40
|
victor@0
|
5852 * '''
|
victor@0
|
5853 *
|
victor@0
|
5854 * import numpy as np # <<<<<<<<<<<<<<
|
victor@0
|
5855 * cimport numpy as np
|
victor@0
|
5856 *
|
victor@0
|
5857 */
|
victor@0
|
5858 __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
|
5859 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
5860 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
|
5861 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
5862
|
victor@0
|
5863 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":43
|
victor@0
|
5864 * cimport numpy as np
|
victor@0
|
5865 *
|
victor@0
|
5866 * import NWunsch # <<<<<<<<<<<<<<
|
victor@0
|
5867 *
|
victor@0
|
5868 * # -*- coding: utf-8 -*-
|
victor@0
|
5869 */
|
victor@0
|
5870 __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
|
5871 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
5872 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
|
5873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
5874
|
victor@0
|
5875 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":50
|
victor@0
|
5876 *
|
victor@0
|
5877 * # the three directions you can go in the traceback:
|
victor@0
|
5878 * cdef int DIAG = 0 # <<<<<<<<<<<<<<
|
victor@0
|
5879 * cdef int UP = 1
|
victor@0
|
5880 * cdef int LEFT = 2
|
victor@0
|
5881 */
|
victor@0
|
5882 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG = 0;
|
victor@0
|
5883
|
victor@0
|
5884 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":51
|
victor@0
|
5885 * # the three directions you can go in the traceback:
|
victor@0
|
5886 * cdef int DIAG = 0
|
victor@0
|
5887 * cdef int UP = 1 # <<<<<<<<<<<<<<
|
victor@0
|
5888 * cdef int LEFT = 2
|
victor@0
|
5889 * cdef float score=0
|
victor@0
|
5890 */
|
victor@0
|
5891 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP = 1;
|
victor@0
|
5892
|
victor@0
|
5893 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":52
|
victor@0
|
5894 * cdef int DIAG = 0
|
victor@0
|
5895 * cdef int UP = 1
|
victor@0
|
5896 * cdef int LEFT = 2 # <<<<<<<<<<<<<<
|
victor@0
|
5897 * cdef float score=0
|
victor@0
|
5898 *
|
victor@0
|
5899 */
|
victor@0
|
5900 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT = 2;
|
victor@0
|
5901
|
victor@0
|
5902 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":53
|
victor@0
|
5903 * cdef int UP = 1
|
victor@0
|
5904 * cdef int LEFT = 2
|
victor@0
|
5905 * cdef float score=0 # <<<<<<<<<<<<<<
|
victor@0
|
5906 *
|
victor@0
|
5907 * class FastAlignmentArrays:
|
victor@0
|
5908 */
|
victor@0
|
5909 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_score = 0.0;
|
victor@0
|
5910
|
victor@0
|
5911 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":55
|
victor@0
|
5912 * cdef float score=0
|
victor@0
|
5913 *
|
victor@0
|
5914 * class FastAlignmentArrays: # <<<<<<<<<<<<<<
|
victor@0
|
5915 *
|
victor@0
|
5916 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast):
|
victor@0
|
5917 */
|
victor@0
|
5918 __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
|
5919 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
5920
|
victor@0
|
5921 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57
|
victor@0
|
5922 * class FastAlignmentArrays:
|
victor@0
|
5923 *
|
victor@0
|
5924 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<<
|
victor@0
|
5925 * """
|
victor@0
|
5926 * fill in the DP matrix according to the Needleman-Wunsch algorithm.
|
victor@0
|
5927 */
|
victor@0
|
5928 __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
|
5929 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
5930 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
|
5931 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
5932
|
victor@0
|
5933 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145
|
victor@0
|
5934 * return s, ptr
|
victor@0
|
5935 *
|
victor@0
|
5936 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<<
|
victor@0
|
5937 *
|
victor@0
|
5938 * #### TRACE BEST PATH TO GET ALIGNMENT ####
|
victor@0
|
5939 */
|
victor@0
|
5940 __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
|
5941 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
5942 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
|
5943 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
5944
|
victor@0
|
5945 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202
|
victor@0
|
5946 *
|
victor@0
|
5947 *
|
victor@0
|
5948 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<<
|
victor@0
|
5949 * """
|
victor@0
|
5950 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch
|
victor@0
|
5951 */
|
victor@0
|
5952 __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
|
5953 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
5954 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__18);
|
victor@0
|
5955 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
|
5956 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
5957
|
victor@0
|
5958 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":55
|
victor@0
|
5959 * cdef float score=0
|
victor@0
|
5960 *
|
victor@0
|
5961 * class FastAlignmentArrays: # <<<<<<<<<<<<<<
|
victor@0
|
5962 *
|
victor@0
|
5963 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast):
|
victor@0
|
5964 */
|
victor@0
|
5965 __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
|
5966 __Pyx_GOTREF(__pyx_t_2);
|
victor@0
|
5967 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
|
5968 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
|
victor@0
|
5969 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
5970
|
victor@0
|
5971 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":1
|
victor@0
|
5972 * ''' # <<<<<<<<<<<<<<
|
victor@0
|
5973 * @organization: Lancaster University & University of Leeds
|
victor@0
|
5974 * @version: 1.0
|
victor@0
|
5975 */
|
victor@0
|
5976 __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
|
5977 __Pyx_GOTREF(__pyx_t_1);
|
victor@0
|
5978 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
|
5979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
|
victor@0
|
5980
|
victor@0
|
5981 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976
|
victor@0
|
5982 * arr.base = baseptr
|
victor@0
|
5983 *
|
victor@0
|
5984 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
|
victor@0
|
5985 * if arr.base is NULL:
|
victor@0
|
5986 * return None
|
victor@0
|
5987 */
|
victor@0
|
5988 goto __pyx_L0;
|
victor@0
|
5989 __pyx_L1_error:;
|
victor@0
|
5990 __Pyx_XDECREF(__pyx_t_1);
|
victor@0
|
5991 __Pyx_XDECREF(__pyx_t_2);
|
victor@0
|
5992 if (__pyx_m) {
|
victor@0
|
5993 __Pyx_AddTraceback("init MultipleOMR.Alignment.FastAlignmentArrays", __pyx_clineno, __pyx_lineno, __pyx_filename);
|
victor@0
|
5994 Py_DECREF(__pyx_m); __pyx_m = 0;
|
victor@0
|
5995 } else if (!PyErr_Occurred()) {
|
victor@0
|
5996 PyErr_SetString(PyExc_ImportError, "init MultipleOMR.Alignment.FastAlignmentArrays");
|
victor@0
|
5997 }
|
victor@0
|
5998 __pyx_L0:;
|
victor@0
|
5999 __Pyx_RefNannyFinishContext();
|
victor@0
|
6000 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6001 return;
|
victor@0
|
6002 #else
|
victor@0
|
6003 return __pyx_m;
|
victor@0
|
6004 #endif
|
victor@0
|
6005 }
|
victor@0
|
6006
|
victor@0
|
6007 /* Runtime support code */
|
victor@0
|
6008 #if CYTHON_REFNANNY
|
victor@0
|
6009 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
|
victor@0
|
6010 PyObject *m = NULL, *p = NULL;
|
victor@0
|
6011 void *r = NULL;
|
victor@0
|
6012 m = PyImport_ImportModule((char *)modname);
|
victor@0
|
6013 if (!m) goto end;
|
victor@0
|
6014 p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
|
victor@0
|
6015 if (!p) goto end;
|
victor@0
|
6016 r = PyLong_AsVoidPtr(p);
|
victor@0
|
6017 end:
|
victor@0
|
6018 Py_XDECREF(p);
|
victor@0
|
6019 Py_XDECREF(m);
|
victor@0
|
6020 return (__Pyx_RefNannyAPIStruct *)r;
|
victor@0
|
6021 }
|
victor@0
|
6022 #endif /* CYTHON_REFNANNY */
|
victor@0
|
6023
|
victor@0
|
6024 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
|
victor@0
|
6025 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
|
victor@0
|
6026 if (unlikely(!result)) {
|
victor@0
|
6027 PyErr_Format(PyExc_NameError,
|
victor@0
|
6028 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
6029 "name '%U' is not defined", name);
|
victor@0
|
6030 #else
|
victor@0
|
6031 "name '%.200s' is not defined", PyString_AS_STRING(name));
|
victor@0
|
6032 #endif
|
victor@0
|
6033 }
|
victor@0
|
6034 return result;
|
victor@0
|
6035 }
|
victor@0
|
6036
|
victor@0
|
6037 static void __Pyx_RaiseArgtupleInvalid(
|
victor@0
|
6038 const char* func_name,
|
victor@0
|
6039 int exact,
|
victor@0
|
6040 Py_ssize_t num_min,
|
victor@0
|
6041 Py_ssize_t num_max,
|
victor@0
|
6042 Py_ssize_t num_found)
|
victor@0
|
6043 {
|
victor@0
|
6044 Py_ssize_t num_expected;
|
victor@0
|
6045 const char *more_or_less;
|
victor@0
|
6046 if (num_found < num_min) {
|
victor@0
|
6047 num_expected = num_min;
|
victor@0
|
6048 more_or_less = "at least";
|
victor@0
|
6049 } else {
|
victor@0
|
6050 num_expected = num_max;
|
victor@0
|
6051 more_or_less = "at most";
|
victor@0
|
6052 }
|
victor@0
|
6053 if (exact) {
|
victor@0
|
6054 more_or_less = "exactly";
|
victor@0
|
6055 }
|
victor@0
|
6056 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6057 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
|
victor@0
|
6058 func_name, more_or_less, num_expected,
|
victor@0
|
6059 (num_expected == 1) ? "" : "s", num_found);
|
victor@0
|
6060 }
|
victor@0
|
6061
|
victor@0
|
6062 static void __Pyx_RaiseDoubleKeywordsError(
|
victor@0
|
6063 const char* func_name,
|
victor@0
|
6064 PyObject* kw_name)
|
victor@0
|
6065 {
|
victor@0
|
6066 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6067 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
6068 "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
|
victor@0
|
6069 #else
|
victor@0
|
6070 "%s() got multiple values for keyword argument '%s'", func_name,
|
victor@0
|
6071 PyString_AsString(kw_name));
|
victor@0
|
6072 #endif
|
victor@0
|
6073 }
|
victor@0
|
6074
|
victor@0
|
6075 static int __Pyx_ParseOptionalKeywords(
|
victor@0
|
6076 PyObject *kwds,
|
victor@0
|
6077 PyObject **argnames[],
|
victor@0
|
6078 PyObject *kwds2,
|
victor@0
|
6079 PyObject *values[],
|
victor@0
|
6080 Py_ssize_t num_pos_args,
|
victor@0
|
6081 const char* function_name)
|
victor@0
|
6082 {
|
victor@0
|
6083 PyObject *key = 0, *value = 0;
|
victor@0
|
6084 Py_ssize_t pos = 0;
|
victor@0
|
6085 PyObject*** name;
|
victor@0
|
6086 PyObject*** first_kw_arg = argnames + num_pos_args;
|
victor@0
|
6087 while (PyDict_Next(kwds, &pos, &key, &value)) {
|
victor@0
|
6088 name = first_kw_arg;
|
victor@0
|
6089 while (*name && (**name != key)) name++;
|
victor@0
|
6090 if (*name) {
|
victor@0
|
6091 values[name-argnames] = value;
|
victor@0
|
6092 continue;
|
victor@0
|
6093 }
|
victor@0
|
6094 name = first_kw_arg;
|
victor@0
|
6095 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6096 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
|
victor@0
|
6097 while (*name) {
|
victor@0
|
6098 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
|
victor@0
|
6099 && _PyString_Eq(**name, key)) {
|
victor@0
|
6100 values[name-argnames] = value;
|
victor@0
|
6101 break;
|
victor@0
|
6102 }
|
victor@0
|
6103 name++;
|
victor@0
|
6104 }
|
victor@0
|
6105 if (*name) continue;
|
victor@0
|
6106 else {
|
victor@0
|
6107 PyObject*** argname = argnames;
|
victor@0
|
6108 while (argname != first_kw_arg) {
|
victor@0
|
6109 if ((**argname == key) || (
|
victor@0
|
6110 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
|
victor@0
|
6111 && _PyString_Eq(**argname, key))) {
|
victor@0
|
6112 goto arg_passed_twice;
|
victor@0
|
6113 }
|
victor@0
|
6114 argname++;
|
victor@0
|
6115 }
|
victor@0
|
6116 }
|
victor@0
|
6117 } else
|
victor@0
|
6118 #endif
|
victor@0
|
6119 if (likely(PyUnicode_Check(key))) {
|
victor@0
|
6120 while (*name) {
|
victor@0
|
6121 int cmp = (**name == key) ? 0 :
|
victor@0
|
6122 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
|
victor@0
|
6123 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
|
victor@0
|
6124 #endif
|
victor@0
|
6125 PyUnicode_Compare(**name, key);
|
victor@0
|
6126 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
|
victor@0
|
6127 if (cmp == 0) {
|
victor@0
|
6128 values[name-argnames] = value;
|
victor@0
|
6129 break;
|
victor@0
|
6130 }
|
victor@0
|
6131 name++;
|
victor@0
|
6132 }
|
victor@0
|
6133 if (*name) continue;
|
victor@0
|
6134 else {
|
victor@0
|
6135 PyObject*** argname = argnames;
|
victor@0
|
6136 while (argname != first_kw_arg) {
|
victor@0
|
6137 int cmp = (**argname == key) ? 0 :
|
victor@0
|
6138 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
|
victor@0
|
6139 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
|
victor@0
|
6140 #endif
|
victor@0
|
6141 PyUnicode_Compare(**argname, key);
|
victor@0
|
6142 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
|
victor@0
|
6143 if (cmp == 0) goto arg_passed_twice;
|
victor@0
|
6144 argname++;
|
victor@0
|
6145 }
|
victor@0
|
6146 }
|
victor@0
|
6147 } else
|
victor@0
|
6148 goto invalid_keyword_type;
|
victor@0
|
6149 if (kwds2) {
|
victor@0
|
6150 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
|
victor@0
|
6151 } else {
|
victor@0
|
6152 goto invalid_keyword;
|
victor@0
|
6153 }
|
victor@0
|
6154 }
|
victor@0
|
6155 return 0;
|
victor@0
|
6156 arg_passed_twice:
|
victor@0
|
6157 __Pyx_RaiseDoubleKeywordsError(function_name, key);
|
victor@0
|
6158 goto bad;
|
victor@0
|
6159 invalid_keyword_type:
|
victor@0
|
6160 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6161 "%.200s() keywords must be strings", function_name);
|
victor@0
|
6162 goto bad;
|
victor@0
|
6163 invalid_keyword:
|
victor@0
|
6164 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6165 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6166 "%.200s() got an unexpected keyword argument '%.200s'",
|
victor@0
|
6167 function_name, PyString_AsString(key));
|
victor@0
|
6168 #else
|
victor@0
|
6169 "%s() got an unexpected keyword argument '%U'",
|
victor@0
|
6170 function_name, key);
|
victor@0
|
6171 #endif
|
victor@0
|
6172 bad:
|
victor@0
|
6173 return -1;
|
victor@0
|
6174 }
|
victor@0
|
6175
|
victor@0
|
6176 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
|
victor@0
|
6177 PyObject *result;
|
victor@0
|
6178 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6179 result = PyDict_GetItem(__pyx_d, name);
|
victor@0
|
6180 if (result) {
|
victor@0
|
6181 Py_INCREF(result);
|
victor@0
|
6182 } else {
|
victor@0
|
6183 #else
|
victor@0
|
6184 result = PyObject_GetItem(__pyx_d, name);
|
victor@0
|
6185 if (!result) {
|
victor@0
|
6186 PyErr_Clear();
|
victor@0
|
6187 #endif
|
victor@0
|
6188 result = __Pyx_GetBuiltinName(name);
|
victor@0
|
6189 }
|
victor@0
|
6190 return result;
|
victor@0
|
6191 }
|
victor@0
|
6192
|
victor@0
|
6193 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6194 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
victor@0
|
6195 PyObject *result;
|
victor@0
|
6196 ternaryfunc call = func->ob_type->tp_call;
|
victor@0
|
6197 if (unlikely(!call))
|
victor@0
|
6198 return PyObject_Call(func, arg, kw);
|
victor@0
|
6199 #if PY_VERSION_HEX >= 0x02060000
|
victor@0
|
6200 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
|
victor@0
|
6201 return NULL;
|
victor@0
|
6202 #endif
|
victor@0
|
6203 result = (*call)(func, arg, kw);
|
victor@0
|
6204 #if PY_VERSION_HEX >= 0x02060000
|
victor@0
|
6205 Py_LeaveRecursiveCall();
|
victor@0
|
6206 #endif
|
victor@0
|
6207 if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
|
victor@0
|
6208 PyErr_SetString(
|
victor@0
|
6209 PyExc_SystemError,
|
victor@0
|
6210 "NULL result without error in PyObject_Call");
|
victor@0
|
6211 }
|
victor@0
|
6212 return result;
|
victor@0
|
6213 }
|
victor@0
|
6214 #endif
|
victor@0
|
6215
|
victor@0
|
6216 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
|
victor@0
|
6217 if (unlikely(!type)) {
|
victor@0
|
6218 PyErr_SetString(PyExc_SystemError, "Missing type object");
|
victor@0
|
6219 return 0;
|
victor@0
|
6220 }
|
victor@0
|
6221 if (likely(PyObject_TypeCheck(obj, type)))
|
victor@0
|
6222 return 1;
|
victor@0
|
6223 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
|
victor@0
|
6224 Py_TYPE(obj)->tp_name, type->tp_name);
|
victor@0
|
6225 return 0;
|
victor@0
|
6226 }
|
victor@0
|
6227
|
victor@0
|
6228 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
|
victor@0
|
6229 PyObject *r;
|
victor@0
|
6230 if (!j) return NULL;
|
victor@0
|
6231 r = PyObject_GetItem(o, j);
|
victor@0
|
6232 Py_DECREF(j);
|
victor@0
|
6233 return r;
|
victor@0
|
6234 }
|
victor@0
|
6235 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
|
victor@0
|
6236 int wraparound, int boundscheck) {
|
victor@0
|
6237 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6238 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
|
victor@0
|
6239 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
|
victor@0
|
6240 PyObject *r = PyList_GET_ITEM(o, i);
|
victor@0
|
6241 Py_INCREF(r);
|
victor@0
|
6242 return r;
|
victor@0
|
6243 }
|
victor@0
|
6244 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
|
victor@0
|
6245 #else
|
victor@0
|
6246 return PySequence_GetItem(o, i);
|
victor@0
|
6247 #endif
|
victor@0
|
6248 }
|
victor@0
|
6249 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
|
victor@0
|
6250 int wraparound, int boundscheck) {
|
victor@0
|
6251 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6252 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
|
victor@0
|
6253 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
|
victor@0
|
6254 PyObject *r = PyTuple_GET_ITEM(o, i);
|
victor@0
|
6255 Py_INCREF(r);
|
victor@0
|
6256 return r;
|
victor@0
|
6257 }
|
victor@0
|
6258 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
|
victor@0
|
6259 #else
|
victor@0
|
6260 return PySequence_GetItem(o, i);
|
victor@0
|
6261 #endif
|
victor@0
|
6262 }
|
victor@0
|
6263 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
|
victor@0
|
6264 int is_list, int wraparound, int boundscheck) {
|
victor@0
|
6265 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6266 if (is_list || PyList_CheckExact(o)) {
|
victor@0
|
6267 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
|
victor@0
|
6268 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
|
victor@0
|
6269 PyObject *r = PyList_GET_ITEM(o, n);
|
victor@0
|
6270 Py_INCREF(r);
|
victor@0
|
6271 return r;
|
victor@0
|
6272 }
|
victor@0
|
6273 }
|
victor@0
|
6274 else if (PyTuple_CheckExact(o)) {
|
victor@0
|
6275 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
|
victor@0
|
6276 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
|
victor@0
|
6277 PyObject *r = PyTuple_GET_ITEM(o, n);
|
victor@0
|
6278 Py_INCREF(r);
|
victor@0
|
6279 return r;
|
victor@0
|
6280 }
|
victor@0
|
6281 } else {
|
victor@0
|
6282 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
|
victor@0
|
6283 if (likely(m && m->sq_item)) {
|
victor@0
|
6284 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
|
victor@0
|
6285 Py_ssize_t l = m->sq_length(o);
|
victor@0
|
6286 if (likely(l >= 0)) {
|
victor@0
|
6287 i += l;
|
victor@0
|
6288 } else {
|
victor@0
|
6289 if (PyErr_ExceptionMatches(PyExc_OverflowError))
|
victor@0
|
6290 PyErr_Clear();
|
victor@0
|
6291 else
|
victor@0
|
6292 return NULL;
|
victor@0
|
6293 }
|
victor@0
|
6294 }
|
victor@0
|
6295 return m->sq_item(o, i);
|
victor@0
|
6296 }
|
victor@0
|
6297 }
|
victor@0
|
6298 #else
|
victor@0
|
6299 if (is_list || PySequence_Check(o)) {
|
victor@0
|
6300 return PySequence_GetItem(o, i);
|
victor@0
|
6301 }
|
victor@0
|
6302 #endif
|
victor@0
|
6303 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
|
victor@0
|
6304 }
|
victor@0
|
6305
|
victor@0
|
6306 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) {
|
victor@0
|
6307 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6308 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
|
victor@0
|
6309 name, type->tp_name, Py_TYPE(obj)->tp_name);
|
victor@0
|
6310 }
|
victor@0
|
6311 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed,
|
victor@0
|
6312 const char *name, int exact)
|
victor@0
|
6313 {
|
victor@0
|
6314 if (unlikely(!type)) {
|
victor@0
|
6315 PyErr_SetString(PyExc_SystemError, "Missing type object");
|
victor@0
|
6316 return 0;
|
victor@0
|
6317 }
|
victor@0
|
6318 if (none_allowed && obj == Py_None) return 1;
|
victor@0
|
6319 else if (exact) {
|
victor@0
|
6320 if (likely(Py_TYPE(obj) == type)) return 1;
|
victor@0
|
6321 #if PY_MAJOR_VERSION == 2
|
victor@0
|
6322 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
|
victor@0
|
6323 #endif
|
victor@0
|
6324 }
|
victor@0
|
6325 else {
|
victor@0
|
6326 if (likely(PyObject_TypeCheck(obj, type))) return 1;
|
victor@0
|
6327 }
|
victor@0
|
6328 __Pyx_RaiseArgumentTypeInvalid(name, obj, type);
|
victor@0
|
6329 return 0;
|
victor@0
|
6330 }
|
victor@0
|
6331
|
victor@0
|
6332 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
|
victor@0
|
6333 #if CYTHON_COMPILING_IN_PYPY
|
victor@0
|
6334 return PyObject_RichCompareBool(s1, s2, equals);
|
victor@0
|
6335 #else
|
victor@0
|
6336 if (s1 == s2) {
|
victor@0
|
6337 return (equals == Py_EQ);
|
victor@0
|
6338 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
|
victor@0
|
6339 const char *ps1, *ps2;
|
victor@0
|
6340 Py_ssize_t length = PyBytes_GET_SIZE(s1);
|
victor@0
|
6341 if (length != PyBytes_GET_SIZE(s2))
|
victor@0
|
6342 return (equals == Py_NE);
|
victor@0
|
6343 ps1 = PyBytes_AS_STRING(s1);
|
victor@0
|
6344 ps2 = PyBytes_AS_STRING(s2);
|
victor@0
|
6345 if (ps1[0] != ps2[0]) {
|
victor@0
|
6346 return (equals == Py_NE);
|
victor@0
|
6347 } else if (length == 1) {
|
victor@0
|
6348 return (equals == Py_EQ);
|
victor@0
|
6349 } else {
|
victor@0
|
6350 int result = memcmp(ps1, ps2, (size_t)length);
|
victor@0
|
6351 return (equals == Py_EQ) ? (result == 0) : (result != 0);
|
victor@0
|
6352 }
|
victor@0
|
6353 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
|
victor@0
|
6354 return (equals == Py_NE);
|
victor@0
|
6355 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
|
victor@0
|
6356 return (equals == Py_NE);
|
victor@0
|
6357 } else {
|
victor@0
|
6358 int result;
|
victor@0
|
6359 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
|
victor@0
|
6360 if (!py_result)
|
victor@0
|
6361 return -1;
|
victor@0
|
6362 result = __Pyx_PyObject_IsTrue(py_result);
|
victor@0
|
6363 Py_DECREF(py_result);
|
victor@0
|
6364 return result;
|
victor@0
|
6365 }
|
victor@0
|
6366 #endif
|
victor@0
|
6367 }
|
victor@0
|
6368
|
victor@0
|
6369 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
|
victor@0
|
6370 #if CYTHON_COMPILING_IN_PYPY
|
victor@0
|
6371 return PyObject_RichCompareBool(s1, s2, equals);
|
victor@0
|
6372 #else
|
victor@0
|
6373 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6374 PyObject* owned_ref = NULL;
|
victor@0
|
6375 #endif
|
victor@0
|
6376 int s1_is_unicode, s2_is_unicode;
|
victor@0
|
6377 if (s1 == s2) {
|
victor@0
|
6378 goto return_eq;
|
victor@0
|
6379 }
|
victor@0
|
6380 s1_is_unicode = PyUnicode_CheckExact(s1);
|
victor@0
|
6381 s2_is_unicode = PyUnicode_CheckExact(s2);
|
victor@0
|
6382 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6383 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
|
victor@0
|
6384 owned_ref = PyUnicode_FromObject(s2);
|
victor@0
|
6385 if (unlikely(!owned_ref))
|
victor@0
|
6386 return -1;
|
victor@0
|
6387 s2 = owned_ref;
|
victor@0
|
6388 s2_is_unicode = 1;
|
victor@0
|
6389 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
|
victor@0
|
6390 owned_ref = PyUnicode_FromObject(s1);
|
victor@0
|
6391 if (unlikely(!owned_ref))
|
victor@0
|
6392 return -1;
|
victor@0
|
6393 s1 = owned_ref;
|
victor@0
|
6394 s1_is_unicode = 1;
|
victor@0
|
6395 } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
|
victor@0
|
6396 return __Pyx_PyBytes_Equals(s1, s2, equals);
|
victor@0
|
6397 }
|
victor@0
|
6398 #endif
|
victor@0
|
6399 if (s1_is_unicode & s2_is_unicode) {
|
victor@0
|
6400 Py_ssize_t length;
|
victor@0
|
6401 int kind;
|
victor@0
|
6402 void *data1, *data2;
|
victor@0
|
6403 #if CYTHON_PEP393_ENABLED
|
victor@0
|
6404 if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0))
|
victor@0
|
6405 return -1;
|
victor@0
|
6406 #endif
|
victor@0
|
6407 length = __Pyx_PyUnicode_GET_LENGTH(s1);
|
victor@0
|
6408 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
|
victor@0
|
6409 goto return_ne;
|
victor@0
|
6410 }
|
victor@0
|
6411 kind = __Pyx_PyUnicode_KIND(s1);
|
victor@0
|
6412 if (kind != __Pyx_PyUnicode_KIND(s2)) {
|
victor@0
|
6413 goto return_ne;
|
victor@0
|
6414 }
|
victor@0
|
6415 data1 = __Pyx_PyUnicode_DATA(s1);
|
victor@0
|
6416 data2 = __Pyx_PyUnicode_DATA(s2);
|
victor@0
|
6417 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
|
victor@0
|
6418 goto return_ne;
|
victor@0
|
6419 } else if (length == 1) {
|
victor@0
|
6420 goto return_eq;
|
victor@0
|
6421 } else {
|
victor@0
|
6422 int result = memcmp(data1, data2, (size_t)(length * kind));
|
victor@0
|
6423 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6424 Py_XDECREF(owned_ref);
|
victor@0
|
6425 #endif
|
victor@0
|
6426 return (equals == Py_EQ) ? (result == 0) : (result != 0);
|
victor@0
|
6427 }
|
victor@0
|
6428 } else if ((s1 == Py_None) & s2_is_unicode) {
|
victor@0
|
6429 goto return_ne;
|
victor@0
|
6430 } else if ((s2 == Py_None) & s1_is_unicode) {
|
victor@0
|
6431 goto return_ne;
|
victor@0
|
6432 } else {
|
victor@0
|
6433 int result;
|
victor@0
|
6434 PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
|
victor@0
|
6435 if (!py_result)
|
victor@0
|
6436 return -1;
|
victor@0
|
6437 result = __Pyx_PyObject_IsTrue(py_result);
|
victor@0
|
6438 Py_DECREF(py_result);
|
victor@0
|
6439 return result;
|
victor@0
|
6440 }
|
victor@0
|
6441 return_eq:
|
victor@0
|
6442 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6443 Py_XDECREF(owned_ref);
|
victor@0
|
6444 #endif
|
victor@0
|
6445 return (equals == Py_EQ);
|
victor@0
|
6446 return_ne:
|
victor@0
|
6447 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6448 Py_XDECREF(owned_ref);
|
victor@0
|
6449 #endif
|
victor@0
|
6450 return (equals == Py_NE);
|
victor@0
|
6451 #endif
|
victor@0
|
6452 }
|
victor@0
|
6453
|
victor@0
|
6454 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
|
victor@0
|
6455 PyErr_Format(PyExc_ValueError,
|
victor@0
|
6456 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
|
victor@0
|
6457 }
|
victor@0
|
6458
|
victor@0
|
6459 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
|
victor@0
|
6460 PyErr_Format(PyExc_ValueError,
|
victor@0
|
6461 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
|
victor@0
|
6462 index, (index == 1) ? "" : "s");
|
victor@0
|
6463 }
|
victor@0
|
6464
|
victor@0
|
6465 static CYTHON_INLINE int __Pyx_IterFinish(void) {
|
victor@0
|
6466 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6467 PyThreadState *tstate = PyThreadState_GET();
|
victor@0
|
6468 PyObject* exc_type = tstate->curexc_type;
|
victor@0
|
6469 if (unlikely(exc_type)) {
|
victor@0
|
6470 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
|
victor@0
|
6471 PyObject *exc_value, *exc_tb;
|
victor@0
|
6472 exc_value = tstate->curexc_value;
|
victor@0
|
6473 exc_tb = tstate->curexc_traceback;
|
victor@0
|
6474 tstate->curexc_type = 0;
|
victor@0
|
6475 tstate->curexc_value = 0;
|
victor@0
|
6476 tstate->curexc_traceback = 0;
|
victor@0
|
6477 Py_DECREF(exc_type);
|
victor@0
|
6478 Py_XDECREF(exc_value);
|
victor@0
|
6479 Py_XDECREF(exc_tb);
|
victor@0
|
6480 return 0;
|
victor@0
|
6481 } else {
|
victor@0
|
6482 return -1;
|
victor@0
|
6483 }
|
victor@0
|
6484 }
|
victor@0
|
6485 return 0;
|
victor@0
|
6486 #else
|
victor@0
|
6487 if (unlikely(PyErr_Occurred())) {
|
victor@0
|
6488 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
|
victor@0
|
6489 PyErr_Clear();
|
victor@0
|
6490 return 0;
|
victor@0
|
6491 } else {
|
victor@0
|
6492 return -1;
|
victor@0
|
6493 }
|
victor@0
|
6494 }
|
victor@0
|
6495 return 0;
|
victor@0
|
6496 #endif
|
victor@0
|
6497 }
|
victor@0
|
6498
|
victor@0
|
6499 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
|
victor@0
|
6500 if (unlikely(retval)) {
|
victor@0
|
6501 Py_DECREF(retval);
|
victor@0
|
6502 __Pyx_RaiseTooManyValuesError(expected);
|
victor@0
|
6503 return -1;
|
victor@0
|
6504 } else {
|
victor@0
|
6505 return __Pyx_IterFinish();
|
victor@0
|
6506 }
|
victor@0
|
6507 return 0;
|
victor@0
|
6508 }
|
victor@0
|
6509
|
victor@0
|
6510 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) {
|
victor@0
|
6511 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6512 PyObject *tmp_type, *tmp_value, *tmp_tb;
|
victor@0
|
6513 PyThreadState *tstate = PyThreadState_GET();
|
victor@0
|
6514 tmp_type = tstate->curexc_type;
|
victor@0
|
6515 tmp_value = tstate->curexc_value;
|
victor@0
|
6516 tmp_tb = tstate->curexc_traceback;
|
victor@0
|
6517 tstate->curexc_type = type;
|
victor@0
|
6518 tstate->curexc_value = value;
|
victor@0
|
6519 tstate->curexc_traceback = tb;
|
victor@0
|
6520 Py_XDECREF(tmp_type);
|
victor@0
|
6521 Py_XDECREF(tmp_value);
|
victor@0
|
6522 Py_XDECREF(tmp_tb);
|
victor@0
|
6523 #else
|
victor@0
|
6524 PyErr_Restore(type, value, tb);
|
victor@0
|
6525 #endif
|
victor@0
|
6526 }
|
victor@0
|
6527 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) {
|
victor@0
|
6528 #if CYTHON_COMPILING_IN_CPYTHON
|
victor@0
|
6529 PyThreadState *tstate = PyThreadState_GET();
|
victor@0
|
6530 *type = tstate->curexc_type;
|
victor@0
|
6531 *value = tstate->curexc_value;
|
victor@0
|
6532 *tb = tstate->curexc_traceback;
|
victor@0
|
6533 tstate->curexc_type = 0;
|
victor@0
|
6534 tstate->curexc_value = 0;
|
victor@0
|
6535 tstate->curexc_traceback = 0;
|
victor@0
|
6536 #else
|
victor@0
|
6537 PyErr_Fetch(type, value, tb);
|
victor@0
|
6538 #endif
|
victor@0
|
6539 }
|
victor@0
|
6540
|
victor@0
|
6541 #if PY_MAJOR_VERSION < 3
|
victor@0
|
6542 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
|
victor@0
|
6543 CYTHON_UNUSED PyObject *cause) {
|
victor@0
|
6544 Py_XINCREF(type);
|
victor@0
|
6545 if (!value || value == Py_None)
|
victor@0
|
6546 value = NULL;
|
victor@0
|
6547 else
|
victor@0
|
6548 Py_INCREF(value);
|
victor@0
|
6549 if (!tb || tb == Py_None)
|
victor@0
|
6550 tb = NULL;
|
victor@0
|
6551 else {
|
victor@0
|
6552 Py_INCREF(tb);
|
victor@0
|
6553 if (!PyTraceBack_Check(tb)) {
|
victor@0
|
6554 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6555 "raise: arg 3 must be a traceback or None");
|
victor@0
|
6556 goto raise_error;
|
victor@0
|
6557 }
|
victor@0
|
6558 }
|
victor@0
|
6559 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
6560 if (PyClass_Check(type)) {
|
victor@0
|
6561 #else
|
victor@0
|
6562 if (PyType_Check(type)) {
|
victor@0
|
6563 #endif
|
victor@0
|
6564 #if CYTHON_COMPILING_IN_PYPY
|
victor@0
|
6565 if (!value) {
|
victor@0
|
6566 Py_INCREF(Py_None);
|
victor@0
|
6567 value = Py_None;
|
victor@0
|
6568 }
|
victor@0
|
6569 #endif
|
victor@0
|
6570 PyErr_NormalizeException(&type, &value, &tb);
|
victor@0
|
6571 } else {
|
victor@0
|
6572 if (value) {
|
victor@0
|
6573 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6574 "instance exception may not have a separate value");
|
victor@0
|
6575 goto raise_error;
|
victor@0
|
6576 }
|
victor@0
|
6577 value = type;
|
victor@0
|
6578 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
6579 if (PyInstance_Check(type)) {
|
victor@0
|
6580 type = (PyObject*) ((PyInstanceObject*)type)->in_class;
|
victor@0
|
6581 Py_INCREF(type);
|
victor@0
|
6582 } else {
|
victor@0
|
6583 type = 0;
|
victor@0
|
6584 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6585 "raise: exception must be an old-style class or instance");
|
victor@0
|
6586 goto raise_error;
|
victor@0
|
6587 }
|
victor@0
|
6588 #else
|
victor@0
|
6589 type = (PyObject*) Py_TYPE(type);
|
victor@0
|
6590 Py_INCREF(type);
|
victor@0
|
6591 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
|
victor@0
|
6592 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6593 "raise: exception class must be a subclass of BaseException");
|
victor@0
|
6594 goto raise_error;
|
victor@0
|
6595 }
|
victor@0
|
6596 #endif
|
victor@0
|
6597 }
|
victor@0
|
6598 __Pyx_ErrRestore(type, value, tb);
|
victor@0
|
6599 return;
|
victor@0
|
6600 raise_error:
|
victor@0
|
6601 Py_XDECREF(value);
|
victor@0
|
6602 Py_XDECREF(type);
|
victor@0
|
6603 Py_XDECREF(tb);
|
victor@0
|
6604 return;
|
victor@0
|
6605 }
|
victor@0
|
6606 #else /* Python 3+ */
|
victor@0
|
6607 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
|
victor@0
|
6608 PyObject* owned_instance = NULL;
|
victor@0
|
6609 if (tb == Py_None) {
|
victor@0
|
6610 tb = 0;
|
victor@0
|
6611 } else if (tb && !PyTraceBack_Check(tb)) {
|
victor@0
|
6612 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6613 "raise: arg 3 must be a traceback or None");
|
victor@0
|
6614 goto bad;
|
victor@0
|
6615 }
|
victor@0
|
6616 if (value == Py_None)
|
victor@0
|
6617 value = 0;
|
victor@0
|
6618 if (PyExceptionInstance_Check(type)) {
|
victor@0
|
6619 if (value) {
|
victor@0
|
6620 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6621 "instance exception may not have a separate value");
|
victor@0
|
6622 goto bad;
|
victor@0
|
6623 }
|
victor@0
|
6624 value = type;
|
victor@0
|
6625 type = (PyObject*) Py_TYPE(value);
|
victor@0
|
6626 } else if (PyExceptionClass_Check(type)) {
|
victor@0
|
6627 PyObject *instance_class = NULL;
|
victor@0
|
6628 if (value && PyExceptionInstance_Check(value)) {
|
victor@0
|
6629 instance_class = (PyObject*) Py_TYPE(value);
|
victor@0
|
6630 if (instance_class != type) {
|
victor@0
|
6631 if (PyObject_IsSubclass(instance_class, type)) {
|
victor@0
|
6632 type = instance_class;
|
victor@0
|
6633 } else {
|
victor@0
|
6634 instance_class = NULL;
|
victor@0
|
6635 }
|
victor@0
|
6636 }
|
victor@0
|
6637 }
|
victor@0
|
6638 if (!instance_class) {
|
victor@0
|
6639 PyObject *args;
|
victor@0
|
6640 if (!value)
|
victor@0
|
6641 args = PyTuple_New(0);
|
victor@0
|
6642 else if (PyTuple_Check(value)) {
|
victor@0
|
6643 Py_INCREF(value);
|
victor@0
|
6644 args = value;
|
victor@0
|
6645 } else
|
victor@0
|
6646 args = PyTuple_Pack(1, value);
|
victor@0
|
6647 if (!args)
|
victor@0
|
6648 goto bad;
|
victor@0
|
6649 owned_instance = PyObject_Call(type, args, NULL);
|
victor@0
|
6650 Py_DECREF(args);
|
victor@0
|
6651 if (!owned_instance)
|
victor@0
|
6652 goto bad;
|
victor@0
|
6653 value = owned_instance;
|
victor@0
|
6654 if (!PyExceptionInstance_Check(value)) {
|
victor@0
|
6655 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6656 "calling %R should have returned an instance of "
|
victor@0
|
6657 "BaseException, not %R",
|
victor@0
|
6658 type, Py_TYPE(value));
|
victor@0
|
6659 goto bad;
|
victor@0
|
6660 }
|
victor@0
|
6661 }
|
victor@0
|
6662 } else {
|
victor@0
|
6663 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6664 "raise: exception class must be a subclass of BaseException");
|
victor@0
|
6665 goto bad;
|
victor@0
|
6666 }
|
victor@0
|
6667 #if PY_VERSION_HEX >= 0x03030000
|
victor@0
|
6668 if (cause) {
|
victor@0
|
6669 #else
|
victor@0
|
6670 if (cause && cause != Py_None) {
|
victor@0
|
6671 #endif
|
victor@0
|
6672 PyObject *fixed_cause;
|
victor@0
|
6673 if (cause == Py_None) {
|
victor@0
|
6674 fixed_cause = NULL;
|
victor@0
|
6675 } else if (PyExceptionClass_Check(cause)) {
|
victor@0
|
6676 fixed_cause = PyObject_CallObject(cause, NULL);
|
victor@0
|
6677 if (fixed_cause == NULL)
|
victor@0
|
6678 goto bad;
|
victor@0
|
6679 } else if (PyExceptionInstance_Check(cause)) {
|
victor@0
|
6680 fixed_cause = cause;
|
victor@0
|
6681 Py_INCREF(fixed_cause);
|
victor@0
|
6682 } else {
|
victor@0
|
6683 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6684 "exception causes must derive from "
|
victor@0
|
6685 "BaseException");
|
victor@0
|
6686 goto bad;
|
victor@0
|
6687 }
|
victor@0
|
6688 PyException_SetCause(value, fixed_cause);
|
victor@0
|
6689 }
|
victor@0
|
6690 PyErr_SetObject(type, value);
|
victor@0
|
6691 if (tb) {
|
victor@0
|
6692 PyThreadState *tstate = PyThreadState_GET();
|
victor@0
|
6693 PyObject* tmp_tb = tstate->curexc_traceback;
|
victor@0
|
6694 if (tb != tmp_tb) {
|
victor@0
|
6695 Py_INCREF(tb);
|
victor@0
|
6696 tstate->curexc_traceback = tb;
|
victor@0
|
6697 Py_XDECREF(tmp_tb);
|
victor@0
|
6698 }
|
victor@0
|
6699 }
|
victor@0
|
6700 bad:
|
victor@0
|
6701 Py_XDECREF(owned_instance);
|
victor@0
|
6702 return;
|
victor@0
|
6703 }
|
victor@0
|
6704 #endif
|
victor@0
|
6705
|
victor@0
|
6706 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
|
victor@0
|
6707 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
|
victor@0
|
6708 }
|
victor@0
|
6709
|
victor@0
|
6710 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
|
victor@0
|
6711 PyObject* fake_module;
|
victor@0
|
6712 PyTypeObject* cached_type = NULL;
|
victor@0
|
6713 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
|
victor@0
|
6714 if (!fake_module) return NULL;
|
victor@0
|
6715 Py_INCREF(fake_module);
|
victor@0
|
6716 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
|
victor@0
|
6717 if (cached_type) {
|
victor@0
|
6718 if (!PyType_Check((PyObject*)cached_type)) {
|
victor@0
|
6719 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6720 "Shared Cython type %.200s is not a type object",
|
victor@0
|
6721 type->tp_name);
|
victor@0
|
6722 goto bad;
|
victor@0
|
6723 }
|
victor@0
|
6724 if (cached_type->tp_basicsize != type->tp_basicsize) {
|
victor@0
|
6725 PyErr_Format(PyExc_TypeError,
|
victor@0
|
6726 "Shared Cython type %.200s has the wrong size, try recompiling",
|
victor@0
|
6727 type->tp_name);
|
victor@0
|
6728 goto bad;
|
victor@0
|
6729 }
|
victor@0
|
6730 } else {
|
victor@0
|
6731 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
|
victor@0
|
6732 PyErr_Clear();
|
victor@0
|
6733 if (PyType_Ready(type) < 0) goto bad;
|
victor@0
|
6734 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
|
victor@0
|
6735 goto bad;
|
victor@0
|
6736 Py_INCREF(type);
|
victor@0
|
6737 cached_type = type;
|
victor@0
|
6738 }
|
victor@0
|
6739 done:
|
victor@0
|
6740 Py_DECREF(fake_module);
|
victor@0
|
6741 return cached_type;
|
victor@0
|
6742 bad:
|
victor@0
|
6743 Py_XDECREF(cached_type);
|
victor@0
|
6744 cached_type = NULL;
|
victor@0
|
6745 goto done;
|
victor@0
|
6746 }
|
victor@0
|
6747
|
victor@0
|
6748 static PyObject *
|
victor@0
|
6749 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
|
victor@0
|
6750 {
|
victor@0
|
6751 if (unlikely(op->func_doc == NULL)) {
|
victor@0
|
6752 if (op->func.m_ml->ml_doc) {
|
victor@0
|
6753 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
6754 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
|
victor@0
|
6755 #else
|
victor@0
|
6756 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
|
victor@0
|
6757 #endif
|
victor@0
|
6758 if (unlikely(op->func_doc == NULL))
|
victor@0
|
6759 return NULL;
|
victor@0
|
6760 } else {
|
victor@0
|
6761 Py_INCREF(Py_None);
|
victor@0
|
6762 return Py_None;
|
victor@0
|
6763 }
|
victor@0
|
6764 }
|
victor@0
|
6765 Py_INCREF(op->func_doc);
|
victor@0
|
6766 return op->func_doc;
|
victor@0
|
6767 }
|
victor@0
|
6768 static int
|
victor@0
|
6769 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
|
victor@0
|
6770 {
|
victor@0
|
6771 PyObject *tmp = op->func_doc;
|
victor@0
|
6772 if (value == NULL)
|
victor@0
|
6773 value = Py_None; /* Mark as deleted */
|
victor@0
|
6774 Py_INCREF(value);
|
victor@0
|
6775 op->func_doc = value;
|
victor@0
|
6776 Py_XDECREF(tmp);
|
victor@0
|
6777 return 0;
|
victor@0
|
6778 }
|
victor@0
|
6779 static PyObject *
|
victor@0
|
6780 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
|
victor@0
|
6781 {
|
victor@0
|
6782 if (unlikely(op->func_name == NULL)) {
|
victor@0
|
6783 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
6784 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
|
victor@0
|
6785 #else
|
victor@0
|
6786 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
|
victor@0
|
6787 #endif
|
victor@0
|
6788 if (unlikely(op->func_name == NULL))
|
victor@0
|
6789 return NULL;
|
victor@0
|
6790 }
|
victor@0
|
6791 Py_INCREF(op->func_name);
|
victor@0
|
6792 return op->func_name;
|
victor@0
|
6793 }
|
victor@0
|
6794 static int
|
victor@0
|
6795 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
|
victor@0
|
6796 {
|
victor@0
|
6797 PyObject *tmp;
|
victor@0
|
6798 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
6799 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
|
victor@0
|
6800 #else
|
victor@0
|
6801 if (unlikely(value == NULL || !PyString_Check(value))) {
|
victor@0
|
6802 #endif
|
victor@0
|
6803 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6804 "__name__ must be set to a string object");
|
victor@0
|
6805 return -1;
|
victor@0
|
6806 }
|
victor@0
|
6807 tmp = op->func_name;
|
victor@0
|
6808 Py_INCREF(value);
|
victor@0
|
6809 op->func_name = value;
|
victor@0
|
6810 Py_XDECREF(tmp);
|
victor@0
|
6811 return 0;
|
victor@0
|
6812 }
|
victor@0
|
6813 static PyObject *
|
victor@0
|
6814 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
|
victor@0
|
6815 {
|
victor@0
|
6816 Py_INCREF(op->func_qualname);
|
victor@0
|
6817 return op->func_qualname;
|
victor@0
|
6818 }
|
victor@0
|
6819 static int
|
victor@0
|
6820 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
|
victor@0
|
6821 {
|
victor@0
|
6822 PyObject *tmp;
|
victor@0
|
6823 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
6824 if (unlikely(value == NULL || !PyUnicode_Check(value))) {
|
victor@0
|
6825 #else
|
victor@0
|
6826 if (unlikely(value == NULL || !PyString_Check(value))) {
|
victor@0
|
6827 #endif
|
victor@0
|
6828 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6829 "__qualname__ must be set to a string object");
|
victor@0
|
6830 return -1;
|
victor@0
|
6831 }
|
victor@0
|
6832 tmp = op->func_qualname;
|
victor@0
|
6833 Py_INCREF(value);
|
victor@0
|
6834 op->func_qualname = value;
|
victor@0
|
6835 Py_XDECREF(tmp);
|
victor@0
|
6836 return 0;
|
victor@0
|
6837 }
|
victor@0
|
6838 static PyObject *
|
victor@0
|
6839 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
|
victor@0
|
6840 {
|
victor@0
|
6841 PyObject *self;
|
victor@0
|
6842 self = m->func_closure;
|
victor@0
|
6843 if (self == NULL)
|
victor@0
|
6844 self = Py_None;
|
victor@0
|
6845 Py_INCREF(self);
|
victor@0
|
6846 return self;
|
victor@0
|
6847 }
|
victor@0
|
6848 static PyObject *
|
victor@0
|
6849 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
|
victor@0
|
6850 {
|
victor@0
|
6851 if (unlikely(op->func_dict == NULL)) {
|
victor@0
|
6852 op->func_dict = PyDict_New();
|
victor@0
|
6853 if (unlikely(op->func_dict == NULL))
|
victor@0
|
6854 return NULL;
|
victor@0
|
6855 }
|
victor@0
|
6856 Py_INCREF(op->func_dict);
|
victor@0
|
6857 return op->func_dict;
|
victor@0
|
6858 }
|
victor@0
|
6859 static int
|
victor@0
|
6860 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
|
victor@0
|
6861 {
|
victor@0
|
6862 PyObject *tmp;
|
victor@0
|
6863 if (unlikely(value == NULL)) {
|
victor@0
|
6864 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6865 "function's dictionary may not be deleted");
|
victor@0
|
6866 return -1;
|
victor@0
|
6867 }
|
victor@0
|
6868 if (unlikely(!PyDict_Check(value))) {
|
victor@0
|
6869 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6870 "setting function's dictionary to a non-dict");
|
victor@0
|
6871 return -1;
|
victor@0
|
6872 }
|
victor@0
|
6873 tmp = op->func_dict;
|
victor@0
|
6874 Py_INCREF(value);
|
victor@0
|
6875 op->func_dict = value;
|
victor@0
|
6876 Py_XDECREF(tmp);
|
victor@0
|
6877 return 0;
|
victor@0
|
6878 }
|
victor@0
|
6879 static PyObject *
|
victor@0
|
6880 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
|
victor@0
|
6881 {
|
victor@0
|
6882 Py_INCREF(op->func_globals);
|
victor@0
|
6883 return op->func_globals;
|
victor@0
|
6884 }
|
victor@0
|
6885 static PyObject *
|
victor@0
|
6886 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
|
victor@0
|
6887 {
|
victor@0
|
6888 Py_INCREF(Py_None);
|
victor@0
|
6889 return Py_None;
|
victor@0
|
6890 }
|
victor@0
|
6891 static PyObject *
|
victor@0
|
6892 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
|
victor@0
|
6893 {
|
victor@0
|
6894 PyObject* result = (op->func_code) ? op->func_code : Py_None;
|
victor@0
|
6895 Py_INCREF(result);
|
victor@0
|
6896 return result;
|
victor@0
|
6897 }
|
victor@0
|
6898 static int
|
victor@0
|
6899 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
|
victor@0
|
6900 PyObject *res = op->defaults_getter((PyObject *) op);
|
victor@0
|
6901 if (unlikely(!res))
|
victor@0
|
6902 return -1;
|
victor@0
|
6903 op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
|
victor@0
|
6904 Py_INCREF(op->defaults_tuple);
|
victor@0
|
6905 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
|
victor@0
|
6906 Py_INCREF(op->defaults_kwdict);
|
victor@0
|
6907 Py_DECREF(res);
|
victor@0
|
6908 return 0;
|
victor@0
|
6909 }
|
victor@0
|
6910 static int
|
victor@0
|
6911 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
|
victor@0
|
6912 PyObject* tmp;
|
victor@0
|
6913 if (!value) {
|
victor@0
|
6914 value = Py_None;
|
victor@0
|
6915 } else if (value != Py_None && !PyTuple_Check(value)) {
|
victor@0
|
6916 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6917 "__defaults__ must be set to a tuple object");
|
victor@0
|
6918 return -1;
|
victor@0
|
6919 }
|
victor@0
|
6920 Py_INCREF(value);
|
victor@0
|
6921 tmp = op->defaults_tuple;
|
victor@0
|
6922 op->defaults_tuple = value;
|
victor@0
|
6923 Py_XDECREF(tmp);
|
victor@0
|
6924 return 0;
|
victor@0
|
6925 }
|
victor@0
|
6926 static PyObject *
|
victor@0
|
6927 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
|
victor@0
|
6928 PyObject* result = op->defaults_tuple;
|
victor@0
|
6929 if (unlikely(!result)) {
|
victor@0
|
6930 if (op->defaults_getter) {
|
victor@0
|
6931 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
|
victor@0
|
6932 result = op->defaults_tuple;
|
victor@0
|
6933 } else {
|
victor@0
|
6934 result = Py_None;
|
victor@0
|
6935 }
|
victor@0
|
6936 }
|
victor@0
|
6937 Py_INCREF(result);
|
victor@0
|
6938 return result;
|
victor@0
|
6939 }
|
victor@0
|
6940 static int
|
victor@0
|
6941 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
|
victor@0
|
6942 PyObject* tmp;
|
victor@0
|
6943 if (!value) {
|
victor@0
|
6944 value = Py_None;
|
victor@0
|
6945 } else if (value != Py_None && !PyDict_Check(value)) {
|
victor@0
|
6946 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6947 "__kwdefaults__ must be set to a dict object");
|
victor@0
|
6948 return -1;
|
victor@0
|
6949 }
|
victor@0
|
6950 Py_INCREF(value);
|
victor@0
|
6951 tmp = op->defaults_kwdict;
|
victor@0
|
6952 op->defaults_kwdict = value;
|
victor@0
|
6953 Py_XDECREF(tmp);
|
victor@0
|
6954 return 0;
|
victor@0
|
6955 }
|
victor@0
|
6956 static PyObject *
|
victor@0
|
6957 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
|
victor@0
|
6958 PyObject* result = op->defaults_kwdict;
|
victor@0
|
6959 if (unlikely(!result)) {
|
victor@0
|
6960 if (op->defaults_getter) {
|
victor@0
|
6961 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
|
victor@0
|
6962 result = op->defaults_kwdict;
|
victor@0
|
6963 } else {
|
victor@0
|
6964 result = Py_None;
|
victor@0
|
6965 }
|
victor@0
|
6966 }
|
victor@0
|
6967 Py_INCREF(result);
|
victor@0
|
6968 return result;
|
victor@0
|
6969 }
|
victor@0
|
6970 static int
|
victor@0
|
6971 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
|
victor@0
|
6972 PyObject* tmp;
|
victor@0
|
6973 if (!value || value == Py_None) {
|
victor@0
|
6974 value = NULL;
|
victor@0
|
6975 } else if (!PyDict_Check(value)) {
|
victor@0
|
6976 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
6977 "__annotations__ must be set to a dict object");
|
victor@0
|
6978 return -1;
|
victor@0
|
6979 }
|
victor@0
|
6980 Py_XINCREF(value);
|
victor@0
|
6981 tmp = op->func_annotations;
|
victor@0
|
6982 op->func_annotations = value;
|
victor@0
|
6983 Py_XDECREF(tmp);
|
victor@0
|
6984 return 0;
|
victor@0
|
6985 }
|
victor@0
|
6986 static PyObject *
|
victor@0
|
6987 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
|
victor@0
|
6988 PyObject* result = op->func_annotations;
|
victor@0
|
6989 if (unlikely(!result)) {
|
victor@0
|
6990 result = PyDict_New();
|
victor@0
|
6991 if (unlikely(!result)) return NULL;
|
victor@0
|
6992 op->func_annotations = result;
|
victor@0
|
6993 }
|
victor@0
|
6994 Py_INCREF(result);
|
victor@0
|
6995 return result;
|
victor@0
|
6996 }
|
victor@0
|
6997 static PyGetSetDef __pyx_CyFunction_getsets[] = {
|
victor@0
|
6998 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
|
victor@0
|
6999 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
|
victor@0
|
7000 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
|
victor@0
|
7001 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
|
victor@0
|
7002 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
|
victor@0
|
7003 {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
|
victor@0
|
7004 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
|
victor@0
|
7005 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
|
victor@0
|
7006 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
|
victor@0
|
7007 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
|
victor@0
|
7008 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
|
victor@0
|
7009 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
|
victor@0
|
7010 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
|
victor@0
|
7011 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
|
victor@0
|
7012 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
|
victor@0
|
7013 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
|
victor@0
|
7014 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
|
victor@0
|
7015 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
|
victor@0
|
7016 {0, 0, 0, 0, 0}
|
victor@0
|
7017 };
|
victor@0
|
7018 #ifndef PY_WRITE_RESTRICTED /* < Py2.5 */
|
victor@0
|
7019 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED
|
victor@0
|
7020 #endif
|
victor@0
|
7021 static PyMemberDef __pyx_CyFunction_members[] = {
|
victor@0
|
7022 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
|
victor@0
|
7023 {0, 0, 0, 0, 0}
|
victor@0
|
7024 };
|
victor@0
|
7025 static PyObject *
|
victor@0
|
7026 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
|
victor@0
|
7027 {
|
victor@0
|
7028 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
7029 return PyUnicode_FromString(m->func.m_ml->ml_name);
|
victor@0
|
7030 #else
|
victor@0
|
7031 return PyString_FromString(m->func.m_ml->ml_name);
|
victor@0
|
7032 #endif
|
victor@0
|
7033 }
|
victor@0
|
7034 static PyMethodDef __pyx_CyFunction_methods[] = {
|
victor@0
|
7035 {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
|
victor@0
|
7036 {0, 0, 0, 0}
|
victor@0
|
7037 };
|
victor@0
|
7038 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
|
victor@0
|
7039 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
|
victor@0
|
7040 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
|
victor@0
|
7041 if (op == NULL)
|
victor@0
|
7042 return NULL;
|
victor@0
|
7043 op->flags = flags;
|
victor@0
|
7044 op->func_weakreflist = NULL;
|
victor@0
|
7045 op->func.m_ml = ml;
|
victor@0
|
7046 op->func.m_self = (PyObject *) op;
|
victor@0
|
7047 Py_XINCREF(closure);
|
victor@0
|
7048 op->func_closure = closure;
|
victor@0
|
7049 Py_XINCREF(module);
|
victor@0
|
7050 op->func.m_module = module;
|
victor@0
|
7051 op->func_dict = NULL;
|
victor@0
|
7052 op->func_name = NULL;
|
victor@0
|
7053 Py_INCREF(qualname);
|
victor@0
|
7054 op->func_qualname = qualname;
|
victor@0
|
7055 op->func_doc = NULL;
|
victor@0
|
7056 op->func_classobj = NULL;
|
victor@0
|
7057 op->func_globals = globals;
|
victor@0
|
7058 Py_INCREF(op->func_globals);
|
victor@0
|
7059 Py_XINCREF(code);
|
victor@0
|
7060 op->func_code = code;
|
victor@0
|
7061 op->defaults_pyobjects = 0;
|
victor@0
|
7062 op->defaults = NULL;
|
victor@0
|
7063 op->defaults_tuple = NULL;
|
victor@0
|
7064 op->defaults_kwdict = NULL;
|
victor@0
|
7065 op->defaults_getter = NULL;
|
victor@0
|
7066 op->func_annotations = NULL;
|
victor@0
|
7067 PyObject_GC_Track(op);
|
victor@0
|
7068 return (PyObject *) op;
|
victor@0
|
7069 }
|
victor@0
|
7070 static int
|
victor@0
|
7071 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
|
victor@0
|
7072 {
|
victor@0
|
7073 Py_CLEAR(m->func_closure);
|
victor@0
|
7074 Py_CLEAR(m->func.m_module);
|
victor@0
|
7075 Py_CLEAR(m->func_dict);
|
victor@0
|
7076 Py_CLEAR(m->func_name);
|
victor@0
|
7077 Py_CLEAR(m->func_qualname);
|
victor@0
|
7078 Py_CLEAR(m->func_doc);
|
victor@0
|
7079 Py_CLEAR(m->func_globals);
|
victor@0
|
7080 Py_CLEAR(m->func_code);
|
victor@0
|
7081 Py_CLEAR(m->func_classobj);
|
victor@0
|
7082 Py_CLEAR(m->defaults_tuple);
|
victor@0
|
7083 Py_CLEAR(m->defaults_kwdict);
|
victor@0
|
7084 Py_CLEAR(m->func_annotations);
|
victor@0
|
7085 if (m->defaults) {
|
victor@0
|
7086 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
|
victor@0
|
7087 int i;
|
victor@0
|
7088 for (i = 0; i < m->defaults_pyobjects; i++)
|
victor@0
|
7089 Py_XDECREF(pydefaults[i]);
|
victor@0
|
7090 PyMem_Free(m->defaults);
|
victor@0
|
7091 m->defaults = NULL;
|
victor@0
|
7092 }
|
victor@0
|
7093 return 0;
|
victor@0
|
7094 }
|
victor@0
|
7095 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
|
victor@0
|
7096 {
|
victor@0
|
7097 PyObject_GC_UnTrack(m);
|
victor@0
|
7098 if (m->func_weakreflist != NULL)
|
victor@0
|
7099 PyObject_ClearWeakRefs((PyObject *) m);
|
victor@0
|
7100 __Pyx_CyFunction_clear(m);
|
victor@0
|
7101 PyObject_GC_Del(m);
|
victor@0
|
7102 }
|
victor@0
|
7103 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
|
victor@0
|
7104 {
|
victor@0
|
7105 Py_VISIT(m->func_closure);
|
victor@0
|
7106 Py_VISIT(m->func.m_module);
|
victor@0
|
7107 Py_VISIT(m->func_dict);
|
victor@0
|
7108 Py_VISIT(m->func_name);
|
victor@0
|
7109 Py_VISIT(m->func_qualname);
|
victor@0
|
7110 Py_VISIT(m->func_doc);
|
victor@0
|
7111 Py_VISIT(m->func_globals);
|
victor@0
|
7112 Py_VISIT(m->func_code);
|
victor@0
|
7113 Py_VISIT(m->func_classobj);
|
victor@0
|
7114 Py_VISIT(m->defaults_tuple);
|
victor@0
|
7115 Py_VISIT(m->defaults_kwdict);
|
victor@0
|
7116 if (m->defaults) {
|
victor@0
|
7117 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
|
victor@0
|
7118 int i;
|
victor@0
|
7119 for (i = 0; i < m->defaults_pyobjects; i++)
|
victor@0
|
7120 Py_VISIT(pydefaults[i]);
|
victor@0
|
7121 }
|
victor@0
|
7122 return 0;
|
victor@0
|
7123 }
|
victor@0
|
7124 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
|
victor@0
|
7125 {
|
victor@0
|
7126 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
victor@0
|
7127 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
|
victor@0
|
7128 Py_INCREF(func);
|
victor@0
|
7129 return func;
|
victor@0
|
7130 }
|
victor@0
|
7131 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
|
victor@0
|
7132 if (type == NULL)
|
victor@0
|
7133 type = (PyObject *)(Py_TYPE(obj));
|
victor@0
|
7134 return PyMethod_New(func,
|
victor@0
|
7135 type, (PyObject *)(Py_TYPE(type)));
|
victor@0
|
7136 }
|
victor@0
|
7137 if (obj == Py_None)
|
victor@0
|
7138 obj = NULL;
|
victor@0
|
7139 return PyMethod_New(func, obj, type);
|
victor@0
|
7140 }
|
victor@0
|
7141 static PyObject*
|
victor@0
|
7142 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
|
victor@0
|
7143 {
|
victor@0
|
7144 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
7145 return PyUnicode_FromFormat("<cyfunction %U at %p>",
|
victor@0
|
7146 op->func_qualname, (void *)op);
|
victor@0
|
7147 #else
|
victor@0
|
7148 return PyString_FromFormat("<cyfunction %s at %p>",
|
victor@0
|
7149 PyString_AsString(op->func_qualname), (void *)op);
|
victor@0
|
7150 #endif
|
victor@0
|
7151 }
|
victor@0
|
7152 #if CYTHON_COMPILING_IN_PYPY
|
victor@0
|
7153 static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
victor@0
|
7154 PyCFunctionObject* f = (PyCFunctionObject*)func;
|
victor@0
|
7155 PyCFunction meth = PyCFunction_GET_FUNCTION(func);
|
victor@0
|
7156 PyObject *self = PyCFunction_GET_SELF(func);
|
victor@0
|
7157 Py_ssize_t size;
|
victor@0
|
7158 switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) {
|
victor@0
|
7159 case METH_VARARGS:
|
victor@0
|
7160 if (likely(kw == NULL) || PyDict_Size(kw) == 0)
|
victor@0
|
7161 return (*meth)(self, arg);
|
victor@0
|
7162 break;
|
victor@0
|
7163 case METH_VARARGS | METH_KEYWORDS:
|
victor@0
|
7164 return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
|
victor@0
|
7165 case METH_NOARGS:
|
victor@0
|
7166 if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
|
victor@0
|
7167 size = PyTuple_GET_SIZE(arg);
|
victor@0
|
7168 if (size == 0)
|
victor@0
|
7169 return (*meth)(self, NULL);
|
victor@0
|
7170 PyErr_Format(PyExc_TypeError,
|
victor@0
|
7171 "%.200s() takes no arguments (%zd given)",
|
victor@0
|
7172 f->m_ml->ml_name, size);
|
victor@0
|
7173 return NULL;
|
victor@0
|
7174 }
|
victor@0
|
7175 break;
|
victor@0
|
7176 case METH_O:
|
victor@0
|
7177 if (likely(kw == NULL) || PyDict_Size(kw) == 0) {
|
victor@0
|
7178 size = PyTuple_GET_SIZE(arg);
|
victor@0
|
7179 if (size == 1)
|
victor@0
|
7180 return (*meth)(self, PyTuple_GET_ITEM(arg, 0));
|
victor@0
|
7181 PyErr_Format(PyExc_TypeError,
|
victor@0
|
7182 "%.200s() takes exactly one argument (%zd given)",
|
victor@0
|
7183 f->m_ml->ml_name, size);
|
victor@0
|
7184 return NULL;
|
victor@0
|
7185 }
|
victor@0
|
7186 break;
|
victor@0
|
7187 default:
|
victor@0
|
7188 PyErr_SetString(PyExc_SystemError, "Bad call flags in "
|
victor@0
|
7189 "__Pyx_CyFunction_Call. METH_OLDARGS is no "
|
victor@0
|
7190 "longer supported!");
|
victor@0
|
7191 return NULL;
|
victor@0
|
7192 }
|
victor@0
|
7193 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
|
victor@0
|
7194 f->m_ml->ml_name);
|
victor@0
|
7195 return NULL;
|
victor@0
|
7196 }
|
victor@0
|
7197 #else
|
victor@0
|
7198 static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
|
victor@0
|
7199 return PyCFunction_Call(func, arg, kw);
|
victor@0
|
7200 }
|
victor@0
|
7201 #endif
|
victor@0
|
7202 static PyTypeObject __pyx_CyFunctionType_type = {
|
victor@0
|
7203 PyVarObject_HEAD_INIT(0, 0)
|
victor@0
|
7204 __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/
|
victor@0
|
7205 sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/
|
victor@0
|
7206 0, /*tp_itemsize*/
|
victor@0
|
7207 (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/
|
victor@0
|
7208 0, /*tp_print*/
|
victor@0
|
7209 0, /*tp_getattr*/
|
victor@0
|
7210 0, /*tp_setattr*/
|
victor@0
|
7211 #if PY_MAJOR_VERSION < 3
|
victor@0
|
7212 0, /*tp_compare*/
|
victor@0
|
7213 #else
|
victor@0
|
7214 0, /*reserved*/
|
victor@0
|
7215 #endif
|
victor@0
|
7216 (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/
|
victor@0
|
7217 0, /*tp_as_number*/
|
victor@0
|
7218 0, /*tp_as_sequence*/
|
victor@0
|
7219 0, /*tp_as_mapping*/
|
victor@0
|
7220 0, /*tp_hash*/
|
victor@0
|
7221 __Pyx_CyFunction_Call, /*tp_call*/
|
victor@0
|
7222 0, /*tp_str*/
|
victor@0
|
7223 0, /*tp_getattro*/
|
victor@0
|
7224 0, /*tp_setattro*/
|
victor@0
|
7225 0, /*tp_as_buffer*/
|
victor@0
|
7226 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/
|
victor@0
|
7227 0, /*tp_doc*/
|
victor@0
|
7228 (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/
|
victor@0
|
7229 (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/
|
victor@0
|
7230 0, /*tp_richcompare*/
|
victor@0
|
7231 offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */
|
victor@0
|
7232 0, /*tp_iter*/
|
victor@0
|
7233 0, /*tp_iternext*/
|
victor@0
|
7234 __pyx_CyFunction_methods, /*tp_methods*/
|
victor@0
|
7235 __pyx_CyFunction_members, /*tp_members*/
|
victor@0
|
7236 __pyx_CyFunction_getsets, /*tp_getset*/
|
victor@0
|
7237 0, /*tp_base*/
|
victor@0
|
7238 0, /*tp_dict*/
|
victor@0
|
7239 __Pyx_CyFunction_descr_get, /*tp_descr_get*/
|
victor@0
|
7240 0, /*tp_descr_set*/
|
victor@0
|
7241 offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/
|
victor@0
|
7242 0, /*tp_init*/
|
victor@0
|
7243 0, /*tp_alloc*/
|
victor@0
|
7244 0, /*tp_new*/
|
victor@0
|
7245 0, /*tp_free*/
|
victor@0
|
7246 0, /*tp_is_gc*/
|
victor@0
|
7247 0, /*tp_bases*/
|
victor@0
|
7248 0, /*tp_mro*/
|
victor@0
|
7249 0, /*tp_cache*/
|
victor@0
|
7250 0, /*tp_subclasses*/
|
victor@0
|
7251 0, /*tp_weaklist*/
|
victor@0
|
7252 0, /*tp_del*/
|
victor@0
|
7253 #if PY_VERSION_HEX >= 0x02060000
|
victor@0
|
7254 0, /*tp_version_tag*/
|
victor@0
|
7255 #endif
|
victor@0
|
7256 #if PY_VERSION_HEX >= 0x030400a1
|
victor@0
|
7257 0, /*tp_finalize*/
|
victor@0
|
7258 #endif
|
victor@0
|
7259 };
|
victor@0
|
7260 static int __Pyx_CyFunction_init(void) {
|
victor@0
|
7261 #if !CYTHON_COMPILING_IN_PYPY
|
victor@0
|
7262 __pyx_CyFunctionType_type.tp_call = PyCFunction_Call;
|
victor@0
|
7263 #endif
|
victor@0
|
7264 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
|
victor@0
|
7265 if (__pyx_CyFunctionType == NULL) {
|
victor@0
|
7266 return -1;
|
victor@0
|
7267 }
|
victor@0
|
7268 return 0;
|
victor@0
|
7269 }
|
victor@0
|
7270 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
|
victor@0
|
7271 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
victor@0
|
7272 m->defaults = PyMem_Malloc(size);
|
victor@0
|
7273 if (!m->defaults)
|
victor@0
|
7274 return PyErr_NoMemory();
|
victor@0
|
7275 memset(m->defaults, 0, size);
|
victor@0
|
7276 m->defaults_pyobjects = pyobjects;
|
victor@0
|
7277 return m->defaults;
|
victor@0
|
7278 }
|
victor@0
|
7279 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
|
victor@0
|
7280 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
victor@0
|
7281 m->defaults_tuple = tuple;
|
victor@0
|
7282 Py_INCREF(tuple);
|
victor@0
|
7283 }
|
victor@0
|
7284 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
|
victor@0
|
7285 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
victor@0
|
7286 m->defaults_kwdict = dict;
|
victor@0
|
7287 Py_INCREF(dict);
|
victor@0
|
7288 }
|
victor@0
|
7289 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
|
victor@0
|
7290 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
|
victor@0
|
7291 m->func_annotations = dict;
|
victor@0
|
7292 Py_INCREF(dict);
|
victor@0
|
7293 }
|
victor@0
|
7294
|
victor@0
|
7295 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
|
victor@0
|
7296 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
|
victor@0
|
7297 for (i=0; i < nbases; i++) {
|
victor@0
|
7298 PyTypeObject *tmptype;
|
victor@0
|
7299 PyObject *tmp = PyTuple_GET_ITEM(bases, i);
|
victor@0
|
7300 tmptype = Py_TYPE(tmp);
|
victor@0
|
7301 #if PY_MAJOR_VERSION < 3
|
victor@0
|
7302 if (tmptype == &PyClass_Type)
|
victor@0
|
7303 continue;
|
victor@0
|
7304 #endif
|
victor@0
|
7305 if (!metaclass) {
|
victor@0
|
7306 metaclass = tmptype;
|
victor@0
|
7307 continue;
|
victor@0
|
7308 }
|
victor@0
|
7309 if (PyType_IsSubtype(metaclass, tmptype))
|
victor@0
|
7310 continue;
|
victor@0
|
7311 if (PyType_IsSubtype(tmptype, metaclass)) {
|
victor@0
|
7312 metaclass = tmptype;
|
victor@0
|
7313 continue;
|
victor@0
|
7314 }
|
victor@0
|
7315 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
7316 "metaclass conflict: "
|
victor@0
|
7317 "the metaclass of a derived class "
|
victor@0
|
7318 "must be a (non-strict) subclass "
|
victor@0
|
7319 "of the metaclasses of all its bases");
|
victor@0
|
7320 return NULL;
|
victor@0
|
7321 }
|
victor@0
|
7322 if (!metaclass) {
|
victor@0
|
7323 #if PY_MAJOR_VERSION < 3
|
victor@0
|
7324 metaclass = &PyClass_Type;
|
victor@0
|
7325 #else
|
victor@0
|
7326 metaclass = &PyType_Type;
|
victor@0
|
7327 #endif
|
victor@0
|
7328 }
|
victor@0
|
7329 Py_INCREF((PyObject*) metaclass);
|
victor@0
|
7330 return (PyObject*) metaclass;
|
victor@0
|
7331 }
|
victor@0
|
7332
|
victor@0
|
7333 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
|
victor@0
|
7334 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
|
victor@0
|
7335 PyObject *ns;
|
victor@0
|
7336 if (metaclass) {
|
victor@0
|
7337 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare);
|
victor@0
|
7338 if (prep) {
|
victor@0
|
7339 PyObject *pargs = PyTuple_Pack(2, name, bases);
|
victor@0
|
7340 if (unlikely(!pargs)) {
|
victor@0
|
7341 Py_DECREF(prep);
|
victor@0
|
7342 return NULL;
|
victor@0
|
7343 }
|
victor@0
|
7344 ns = PyObject_Call(prep, pargs, mkw);
|
victor@0
|
7345 Py_DECREF(prep);
|
victor@0
|
7346 Py_DECREF(pargs);
|
victor@0
|
7347 } else {
|
victor@0
|
7348 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError)))
|
victor@0
|
7349 return NULL;
|
victor@0
|
7350 PyErr_Clear();
|
victor@0
|
7351 ns = PyDict_New();
|
victor@0
|
7352 }
|
victor@0
|
7353 } else {
|
victor@0
|
7354 ns = PyDict_New();
|
victor@0
|
7355 }
|
victor@0
|
7356 if (unlikely(!ns))
|
victor@0
|
7357 return NULL;
|
victor@0
|
7358 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
|
victor@0
|
7359 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
|
victor@0
|
7360 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
|
victor@0
|
7361 return ns;
|
victor@0
|
7362 bad:
|
victor@0
|
7363 Py_DECREF(ns);
|
victor@0
|
7364 return NULL;
|
victor@0
|
7365 }
|
victor@0
|
7366 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
|
victor@0
|
7367 PyObject *dict, PyObject *mkw,
|
victor@0
|
7368 int calculate_metaclass, int allow_py2_metaclass) {
|
victor@0
|
7369 PyObject *result, *margs;
|
victor@0
|
7370 PyObject *owned_metaclass = NULL;
|
victor@0
|
7371 if (allow_py2_metaclass) {
|
victor@0
|
7372 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
|
victor@0
|
7373 if (owned_metaclass) {
|
victor@0
|
7374 metaclass = owned_metaclass;
|
victor@0
|
7375 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
|
victor@0
|
7376 PyErr_Clear();
|
victor@0
|
7377 } else {
|
victor@0
|
7378 return NULL;
|
victor@0
|
7379 }
|
victor@0
|
7380 }
|
victor@0
|
7381 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
|
victor@0
|
7382 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
|
victor@0
|
7383 Py_XDECREF(owned_metaclass);
|
victor@0
|
7384 if (unlikely(!metaclass))
|
victor@0
|
7385 return NULL;
|
victor@0
|
7386 owned_metaclass = metaclass;
|
victor@0
|
7387 }
|
victor@0
|
7388 margs = PyTuple_Pack(3, name, bases, dict);
|
victor@0
|
7389 if (unlikely(!margs)) {
|
victor@0
|
7390 result = NULL;
|
victor@0
|
7391 } else {
|
victor@0
|
7392 result = PyObject_Call(metaclass, margs, mkw);
|
victor@0
|
7393 Py_DECREF(margs);
|
victor@0
|
7394 }
|
victor@0
|
7395 Py_XDECREF(owned_metaclass);
|
victor@0
|
7396 return result;
|
victor@0
|
7397 }
|
victor@0
|
7398
|
victor@0
|
7399 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
|
victor@0
|
7400 PyObject *empty_list = 0;
|
victor@0
|
7401 PyObject *module = 0;
|
victor@0
|
7402 PyObject *global_dict = 0;
|
victor@0
|
7403 PyObject *empty_dict = 0;
|
victor@0
|
7404 PyObject *list;
|
victor@0
|
7405 #if PY_VERSION_HEX < 0x03030000
|
victor@0
|
7406 PyObject *py_import;
|
victor@0
|
7407 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
|
victor@0
|
7408 if (!py_import)
|
victor@0
|
7409 goto bad;
|
victor@0
|
7410 #endif
|
victor@0
|
7411 if (from_list)
|
victor@0
|
7412 list = from_list;
|
victor@0
|
7413 else {
|
victor@0
|
7414 empty_list = PyList_New(0);
|
victor@0
|
7415 if (!empty_list)
|
victor@0
|
7416 goto bad;
|
victor@0
|
7417 list = empty_list;
|
victor@0
|
7418 }
|
victor@0
|
7419 global_dict = PyModule_GetDict(__pyx_m);
|
victor@0
|
7420 if (!global_dict)
|
victor@0
|
7421 goto bad;
|
victor@0
|
7422 empty_dict = PyDict_New();
|
victor@0
|
7423 if (!empty_dict)
|
victor@0
|
7424 goto bad;
|
victor@0
|
7425 #if PY_VERSION_HEX >= 0x02050000
|
victor@0
|
7426 {
|
victor@0
|
7427 #if PY_MAJOR_VERSION >= 3
|
victor@0
|
7428 if (level == -1) {
|
victor@0
|
7429 if (strchr(__Pyx_MODULE_NAME, '.')) {
|
victor@0
|
7430 #if PY_VERSION_HEX < 0x03030000
|
victor@0
|
7431 PyObject *py_level = PyInt_FromLong(1);
|
victor@0
|
7432 if (!py_level)
|
victor@0
|
7433 goto bad;
|
victor@0
|
7434 module = PyObject_CallFunctionObjArgs(py_import,
|
victor@0
|
7435 name, global_dict, empty_dict, list, py_level, NULL);
|
victor@0
|
7436 Py_DECREF(py_level);
|
victor@0
|
7437 #else
|
victor@0
|
7438 module = PyImport_ImportModuleLevelObject(
|
victor@0
|
7439 name, global_dict, empty_dict, list, 1);
|
victor@0
|
7440 #endif
|
victor@0
|
7441 if (!module) {
|
victor@0
|
7442 if (!PyErr_ExceptionMatches(PyExc_ImportError))
|
victor@0
|
7443 goto bad;
|
victor@0
|
7444 PyErr_Clear();
|
victor@0
|
7445 }
|
victor@0
|
7446 }
|
victor@0
|
7447 level = 0; /* try absolute import on failure */
|
victor@0
|
7448 }
|
victor@0
|
7449 #endif
|
victor@0
|
7450 if (!module) {
|
victor@0
|
7451 #if PY_VERSION_HEX < 0x03030000
|
victor@0
|
7452 PyObject *py_level = PyInt_FromLong(level);
|
victor@0
|
7453 if (!py_level)
|
victor@0
|
7454 goto bad;
|
victor@0
|
7455 module = PyObject_CallFunctionObjArgs(py_import,
|
victor@0
|
7456 name, global_dict, empty_dict, list, py_level, NULL);
|
victor@0
|
7457 Py_DECREF(py_level);
|
victor@0
|
7458 #else
|
victor@0
|
7459 module = PyImport_ImportModuleLevelObject(
|
victor@0
|
7460 name, global_dict, empty_dict, list, level);
|
victor@0
|
7461 #endif
|
victor@0
|
7462 }
|
victor@0
|
7463 }
|
victor@0
|
7464 #else
|
victor@0
|
7465 if (level>0) {
|
victor@0
|
7466 PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4.");
|
victor@0
|
7467 goto bad;
|
victor@0
|
7468 }
|
victor@0
|
7469 module = PyObject_CallFunctionObjArgs(py_import,
|
victor@0
|
7470 name, global_dict, empty_dict, list, NULL);
|
victor@0
|
7471 #endif
|
victor@0
|
7472 bad:
|
victor@0
|
7473 #if PY_VERSION_HEX < 0x03030000
|
victor@0
|
7474 Py_XDECREF(py_import);
|
victor@0
|
7475 #endif
|
victor@0
|
7476 Py_XDECREF(empty_list);
|
victor@0
|
7477 Py_XDECREF(empty_dict);
|
victor@0
|
7478 return module;
|
victor@0
|
7479 }
|
victor@0
|
7480
|
victor@0
|
7481 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
|
victor@0
|
7482 const long neg_one = (long) -1, const_zero = 0;
|
victor@0
|
7483 const int is_unsigned = neg_one > const_zero;
|
victor@0
|
7484 if (is_unsigned) {
|
victor@0
|
7485 if (sizeof(long) < sizeof(long)) {
|
victor@0
|
7486 return PyInt_FromLong((long) value);
|
victor@0
|
7487 } else if (sizeof(long) <= sizeof(unsigned long)) {
|
victor@0
|
7488 return PyLong_FromUnsignedLong((unsigned long) value);
|
victor@0
|
7489 } else if (sizeof(long) <= sizeof(unsigned long long)) {
|
victor@0
|
7490 return PyLong_FromUnsignedLongLong((unsigned long long) value);
|
victor@0
|
7491 }
|
victor@0
|
7492 } else {
|
victor@0
|
7493 if (sizeof(long) <= sizeof(long)) {
|
victor@0
|
7494 return PyInt_FromLong((long) value);
|
victor@0
|
7495 } else if (sizeof(long) <= sizeof(long long)) {
|
victor@0
|
7496 return PyLong_FromLongLong((long long) value);
|
victor@0
|
7497 }
|
victor@0
|
7498 }
|
victor@0
|
7499 {
|
victor@0
|
7500 int one = 1; int little = (int)*(unsigned char *)&one;
|
victor@0
|
7501 unsigned char *bytes = (unsigned char *)&value;
|
victor@0
|
7502 return _PyLong_FromByteArray(bytes, sizeof(long),
|
victor@0
|
7503 little, !is_unsigned);
|
victor@0
|
7504 }
|
victor@0
|
7505 }
|
victor@0
|
7506
|
victor@0
|
7507 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \
|
victor@0
|
7508 { \
|
victor@0
|
7509 func_type value = func(x); \
|
victor@0
|
7510 if (sizeof(target_type) < sizeof(func_type)) { \
|
victor@0
|
7511 if (unlikely(value != (func_type) (target_type) value)) { \
|
victor@0
|
7512 func_type zero = 0; \
|
victor@0
|
7513 PyErr_SetString(PyExc_OverflowError, \
|
victor@0
|
7514 (is_unsigned && unlikely(value < zero)) ? \
|
victor@0
|
7515 "can't convert negative value to " #target_type : \
|
victor@0
|
7516 "value too large to convert to " #target_type); \
|
victor@0
|
7517 return (target_type) -1; \
|
victor@0
|
7518 } \
|
victor@0
|
7519 } \
|
victor@0
|
7520 return (target_type) value; \
|
victor@0
|
7521 }
|
victor@0
|
7522
|
victor@0
|
7523 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
7524 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
7525 #include "longintrepr.h"
|
victor@0
|
7526 #endif
|
victor@0
|
7527 #endif
|
victor@0
|
7528 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
|
victor@0
|
7529 const int neg_one = (int) -1, const_zero = 0;
|
victor@0
|
7530 const int is_unsigned = neg_one > const_zero;
|
victor@0
|
7531 #if PY_MAJOR_VERSION < 3
|
victor@0
|
7532 if (likely(PyInt_Check(x))) {
|
victor@0
|
7533 if (sizeof(int) < sizeof(long)) {
|
victor@0
|
7534 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG)
|
victor@0
|
7535 } else {
|
victor@0
|
7536 long val = PyInt_AS_LONG(x);
|
victor@0
|
7537 if (is_unsigned && unlikely(val < 0)) {
|
victor@0
|
7538 PyErr_SetString(PyExc_OverflowError,
|
victor@0
|
7539 "can't convert negative value to int");
|
victor@0
|
7540 return (int) -1;
|
victor@0
|
7541 }
|
victor@0
|
7542 return (int) val;
|
victor@0
|
7543 }
|
victor@0
|
7544 } else
|
victor@0
|
7545 #endif
|
victor@0
|
7546 if (likely(PyLong_Check(x))) {
|
victor@0
|
7547 if (is_unsigned) {
|
victor@0
|
7548 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
7549 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
7550 if (sizeof(digit) <= sizeof(int)) {
|
victor@0
|
7551 switch (Py_SIZE(x)) {
|
victor@0
|
7552 case 0: return 0;
|
victor@0
|
7553 case 1: return (int) ((PyLongObject*)x)->ob_digit[0];
|
victor@0
|
7554 }
|
victor@0
|
7555 }
|
victor@0
|
7556 #endif
|
victor@0
|
7557 #endif
|
victor@0
|
7558 if (unlikely(Py_SIZE(x) < 0)) {
|
victor@0
|
7559 PyErr_SetString(PyExc_OverflowError,
|
victor@0
|
7560 "can't convert negative value to int");
|
victor@0
|
7561 return (int) -1;
|
victor@0
|
7562 }
|
victor@0
|
7563 if (sizeof(int) <= sizeof(unsigned long)) {
|
victor@0
|
7564 __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong)
|
victor@0
|
7565 } else if (sizeof(int) <= sizeof(unsigned long long)) {
|
victor@0
|
7566 __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong)
|
victor@0
|
7567 }
|
victor@0
|
7568 } else {
|
victor@0
|
7569 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
7570 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
7571 if (sizeof(digit) <= sizeof(int)) {
|
victor@0
|
7572 switch (Py_SIZE(x)) {
|
victor@0
|
7573 case 0: return 0;
|
victor@0
|
7574 case 1: return +(int) ((PyLongObject*)x)->ob_digit[0];
|
victor@0
|
7575 case -1: return -(int) ((PyLongObject*)x)->ob_digit[0];
|
victor@0
|
7576 }
|
victor@0
|
7577 }
|
victor@0
|
7578 #endif
|
victor@0
|
7579 #endif
|
victor@0
|
7580 if (sizeof(int) <= sizeof(long)) {
|
victor@0
|
7581 __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong)
|
victor@0
|
7582 } else if (sizeof(int) <= sizeof(long long)) {
|
victor@0
|
7583 __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong)
|
victor@0
|
7584 }
|
victor@0
|
7585 }
|
victor@0
|
7586 {
|
victor@0
|
7587 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
|
victor@0
|
7588 PyErr_SetString(PyExc_RuntimeError,
|
victor@0
|
7589 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
|
victor@0
|
7590 #else
|
victor@0
|
7591 int val;
|
victor@0
|
7592 PyObject *v = __Pyx_PyNumber_Int(x);
|
victor@0
|
7593 #if PY_MAJOR_VERSION < 3
|
victor@0
|
7594 if (likely(v) && !PyLong_Check(v)) {
|
victor@0
|
7595 PyObject *tmp = v;
|
victor@0
|
7596 v = PyNumber_Long(tmp);
|
victor@0
|
7597 Py_DECREF(tmp);
|
victor@0
|
7598 }
|
victor@0
|
7599 #endif
|
victor@0
|
7600 if (likely(v)) {
|
victor@0
|
7601 int one = 1; int is_little = (int)*(unsigned char *)&one;
|
victor@0
|
7602 unsigned char *bytes = (unsigned char *)&val;
|
victor@0
|
7603 int ret = _PyLong_AsByteArray((PyLongObject *)v,
|
victor@0
|
7604 bytes, sizeof(val),
|
victor@0
|
7605 is_little, !is_unsigned);
|
victor@0
|
7606 Py_DECREF(v);
|
victor@0
|
7607 if (likely(!ret))
|
victor@0
|
7608 return val;
|
victor@0
|
7609 }
|
victor@0
|
7610 #endif
|
victor@0
|
7611 return (int) -1;
|
victor@0
|
7612 }
|
victor@0
|
7613 } else {
|
victor@0
|
7614 int val;
|
victor@0
|
7615 PyObject *tmp = __Pyx_PyNumber_Int(x);
|
victor@0
|
7616 if (!tmp) return (int) -1;
|
victor@0
|
7617 val = __Pyx_PyInt_As_int(tmp);
|
victor@0
|
7618 Py_DECREF(tmp);
|
victor@0
|
7619 return val;
|
victor@0
|
7620 }
|
victor@0
|
7621 }
|
victor@0
|
7622
|
victor@0
|
7623 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
|
victor@0
|
7624 const int neg_one = (int) -1, const_zero = 0;
|
victor@0
|
7625 const int is_unsigned = neg_one > const_zero;
|
victor@0
|
7626 if (is_unsigned) {
|
victor@0
|
7627 if (sizeof(int) < sizeof(long)) {
|
victor@0
|
7628 return PyInt_FromLong((long) value);
|
victor@0
|
7629 } else if (sizeof(int) <= sizeof(unsigned long)) {
|
victor@0
|
7630 return PyLong_FromUnsignedLong((unsigned long) value);
|
victor@0
|
7631 } else if (sizeof(int) <= sizeof(unsigned long long)) {
|
victor@0
|
7632 return PyLong_FromUnsignedLongLong((unsigned long long) value);
|
victor@0
|
7633 }
|
victor@0
|
7634 } else {
|
victor@0
|
7635 if (sizeof(int) <= sizeof(long)) {
|
victor@0
|
7636 return PyInt_FromLong((long) value);
|
victor@0
|
7637 } else if (sizeof(int) <= sizeof(long long)) {
|
victor@0
|
7638 return PyLong_FromLongLong((long long) value);
|
victor@0
|
7639 }
|
victor@0
|
7640 }
|
victor@0
|
7641 {
|
victor@0
|
7642 int one = 1; int little = (int)*(unsigned char *)&one;
|
victor@0
|
7643 unsigned char *bytes = (unsigned char *)&value;
|
victor@0
|
7644 return _PyLong_FromByteArray(bytes, sizeof(int),
|
victor@0
|
7645 little, !is_unsigned);
|
victor@0
|
7646 }
|
victor@0
|
7647 }
|
victor@0
|
7648
|
victor@0
|
7649 #if CYTHON_CCOMPLEX
|
victor@0
|
7650 #ifdef __cplusplus
|
victor@0
|
7651 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
|
victor@0
|
7652 return ::std::complex< float >(x, y);
|
victor@0
|
7653 }
|
victor@0
|
7654 #else
|
victor@0
|
7655 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
|
victor@0
|
7656 return x + y*(__pyx_t_float_complex)_Complex_I;
|
victor@0
|
7657 }
|
victor@0
|
7658 #endif
|
victor@0
|
7659 #else
|
victor@0
|
7660 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
|
victor@0
|
7661 __pyx_t_float_complex z;
|
victor@0
|
7662 z.real = x;
|
victor@0
|
7663 z.imag = y;
|
victor@0
|
7664 return z;
|
victor@0
|
7665 }
|
victor@0
|
7666 #endif
|
victor@0
|
7667
|
victor@0
|
7668 #if CYTHON_CCOMPLEX
|
victor@0
|
7669 #else
|
victor@0
|
7670 static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
|
victor@0
|
7671 return (a.real == b.real) && (a.imag == b.imag);
|
victor@0
|
7672 }
|
victor@0
|
7673 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
|
victor@0
|
7674 __pyx_t_float_complex z;
|
victor@0
|
7675 z.real = a.real + b.real;
|
victor@0
|
7676 z.imag = a.imag + b.imag;
|
victor@0
|
7677 return z;
|
victor@0
|
7678 }
|
victor@0
|
7679 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) {
|
victor@0
|
7680 __pyx_t_float_complex z;
|
victor@0
|
7681 z.real = a.real - b.real;
|
victor@0
|
7682 z.imag = a.imag - b.imag;
|
victor@0
|
7683 return z;
|
victor@0
|
7684 }
|
victor@0
|
7685 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
|
victor@0
|
7686 __pyx_t_float_complex z;
|
victor@0
|
7687 z.real = a.real * b.real - a.imag * b.imag;
|
victor@0
|
7688 z.imag = a.real * b.imag + a.imag * b.real;
|
victor@0
|
7689 return z;
|
victor@0
|
7690 }
|
victor@0
|
7691 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
|
victor@0
|
7692 __pyx_t_float_complex z;
|
victor@0
|
7693 float denom = b.real * b.real + b.imag * b.imag;
|
victor@0
|
7694 z.real = (a.real * b.real + a.imag * b.imag) / denom;
|
victor@0
|
7695 z.imag = (a.imag * b.real - a.real * b.imag) / denom;
|
victor@0
|
7696 return z;
|
victor@0
|
7697 }
|
victor@0
|
7698 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) {
|
victor@0
|
7699 __pyx_t_float_complex z;
|
victor@0
|
7700 z.real = -a.real;
|
victor@0
|
7701 z.imag = -a.imag;
|
victor@0
|
7702 return z;
|
victor@0
|
7703 }
|
victor@0
|
7704 static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) {
|
victor@0
|
7705 return (a.real == 0) && (a.imag == 0);
|
victor@0
|
7706 }
|
victor@0
|
7707 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) {
|
victor@0
|
7708 __pyx_t_float_complex z;
|
victor@0
|
7709 z.real = a.real;
|
victor@0
|
7710 z.imag = -a.imag;
|
victor@0
|
7711 return z;
|
victor@0
|
7712 }
|
victor@0
|
7713 #if 1
|
victor@0
|
7714 static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) {
|
victor@0
|
7715 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
|
victor@0
|
7716 return sqrtf(z.real*z.real + z.imag*z.imag);
|
victor@0
|
7717 #else
|
victor@0
|
7718 return hypotf(z.real, z.imag);
|
victor@0
|
7719 #endif
|
victor@0
|
7720 }
|
victor@0
|
7721 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) {
|
victor@0
|
7722 __pyx_t_float_complex z;
|
victor@0
|
7723 float r, lnr, theta, z_r, z_theta;
|
victor@0
|
7724 if (b.imag == 0 && b.real == (int)b.real) {
|
victor@0
|
7725 if (b.real < 0) {
|
victor@0
|
7726 float denom = a.real * a.real + a.imag * a.imag;
|
victor@0
|
7727 a.real = a.real / denom;
|
victor@0
|
7728 a.imag = -a.imag / denom;
|
victor@0
|
7729 b.real = -b.real;
|
victor@0
|
7730 }
|
victor@0
|
7731 switch ((int)b.real) {
|
victor@0
|
7732 case 0:
|
victor@0
|
7733 z.real = 1;
|
victor@0
|
7734 z.imag = 0;
|
victor@0
|
7735 return z;
|
victor@0
|
7736 case 1:
|
victor@0
|
7737 return a;
|
victor@0
|
7738 case 2:
|
victor@0
|
7739 z = __Pyx_c_prodf(a, a);
|
victor@0
|
7740 return __Pyx_c_prodf(a, a);
|
victor@0
|
7741 case 3:
|
victor@0
|
7742 z = __Pyx_c_prodf(a, a);
|
victor@0
|
7743 return __Pyx_c_prodf(z, a);
|
victor@0
|
7744 case 4:
|
victor@0
|
7745 z = __Pyx_c_prodf(a, a);
|
victor@0
|
7746 return __Pyx_c_prodf(z, z);
|
victor@0
|
7747 }
|
victor@0
|
7748 }
|
victor@0
|
7749 if (a.imag == 0) {
|
victor@0
|
7750 if (a.real == 0) {
|
victor@0
|
7751 return a;
|
victor@0
|
7752 }
|
victor@0
|
7753 r = a.real;
|
victor@0
|
7754 theta = 0;
|
victor@0
|
7755 } else {
|
victor@0
|
7756 r = __Pyx_c_absf(a);
|
victor@0
|
7757 theta = atan2f(a.imag, a.real);
|
victor@0
|
7758 }
|
victor@0
|
7759 lnr = logf(r);
|
victor@0
|
7760 z_r = expf(lnr * b.real - theta * b.imag);
|
victor@0
|
7761 z_theta = theta * b.real + lnr * b.imag;
|
victor@0
|
7762 z.real = z_r * cosf(z_theta);
|
victor@0
|
7763 z.imag = z_r * sinf(z_theta);
|
victor@0
|
7764 return z;
|
victor@0
|
7765 }
|
victor@0
|
7766 #endif
|
victor@0
|
7767 #endif
|
victor@0
|
7768
|
victor@0
|
7769 #if CYTHON_CCOMPLEX
|
victor@0
|
7770 #ifdef __cplusplus
|
victor@0
|
7771 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
|
victor@0
|
7772 return ::std::complex< double >(x, y);
|
victor@0
|
7773 }
|
victor@0
|
7774 #else
|
victor@0
|
7775 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
|
victor@0
|
7776 return x + y*(__pyx_t_double_complex)_Complex_I;
|
victor@0
|
7777 }
|
victor@0
|
7778 #endif
|
victor@0
|
7779 #else
|
victor@0
|
7780 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
|
victor@0
|
7781 __pyx_t_double_complex z;
|
victor@0
|
7782 z.real = x;
|
victor@0
|
7783 z.imag = y;
|
victor@0
|
7784 return z;
|
victor@0
|
7785 }
|
victor@0
|
7786 #endif
|
victor@0
|
7787
|
victor@0
|
7788 #if CYTHON_CCOMPLEX
|
victor@0
|
7789 #else
|
victor@0
|
7790 static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) {
|
victor@0
|
7791 return (a.real == b.real) && (a.imag == b.imag);
|
victor@0
|
7792 }
|
victor@0
|
7793 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) {
|
victor@0
|
7794 __pyx_t_double_complex z;
|
victor@0
|
7795 z.real = a.real + b.real;
|
victor@0
|
7796 z.imag = a.imag + b.imag;
|
victor@0
|
7797 return z;
|
victor@0
|
7798 }
|
victor@0
|
7799 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) {
|
victor@0
|
7800 __pyx_t_double_complex z;
|
victor@0
|
7801 z.real = a.real - b.real;
|
victor@0
|
7802 z.imag = a.imag - b.imag;
|
victor@0
|
7803 return z;
|
victor@0
|
7804 }
|
victor@0
|
7805 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) {
|
victor@0
|
7806 __pyx_t_double_complex z;
|
victor@0
|
7807 z.real = a.real * b.real - a.imag * b.imag;
|
victor@0
|
7808 z.imag = a.real * b.imag + a.imag * b.real;
|
victor@0
|
7809 return z;
|
victor@0
|
7810 }
|
victor@0
|
7811 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) {
|
victor@0
|
7812 __pyx_t_double_complex z;
|
victor@0
|
7813 double denom = b.real * b.real + b.imag * b.imag;
|
victor@0
|
7814 z.real = (a.real * b.real + a.imag * b.imag) / denom;
|
victor@0
|
7815 z.imag = (a.imag * b.real - a.real * b.imag) / denom;
|
victor@0
|
7816 return z;
|
victor@0
|
7817 }
|
victor@0
|
7818 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) {
|
victor@0
|
7819 __pyx_t_double_complex z;
|
victor@0
|
7820 z.real = -a.real;
|
victor@0
|
7821 z.imag = -a.imag;
|
victor@0
|
7822 return z;
|
victor@0
|
7823 }
|
victor@0
|
7824 static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) {
|
victor@0
|
7825 return (a.real == 0) && (a.imag == 0);
|
victor@0
|
7826 }
|
victor@0
|
7827 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) {
|
victor@0
|
7828 __pyx_t_double_complex z;
|
victor@0
|
7829 z.real = a.real;
|
victor@0
|
7830 z.imag = -a.imag;
|
victor@0
|
7831 return z;
|
victor@0
|
7832 }
|
victor@0
|
7833 #if 1
|
victor@0
|
7834 static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) {
|
victor@0
|
7835 #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
|
victor@0
|
7836 return sqrt(z.real*z.real + z.imag*z.imag);
|
victor@0
|
7837 #else
|
victor@0
|
7838 return hypot(z.real, z.imag);
|
victor@0
|
7839 #endif
|
victor@0
|
7840 }
|
victor@0
|
7841 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) {
|
victor@0
|
7842 __pyx_t_double_complex z;
|
victor@0
|
7843 double r, lnr, theta, z_r, z_theta;
|
victor@0
|
7844 if (b.imag == 0 && b.real == (int)b.real) {
|
victor@0
|
7845 if (b.real < 0) {
|
victor@0
|
7846 double denom = a.real * a.real + a.imag * a.imag;
|
victor@0
|
7847 a.real = a.real / denom;
|
victor@0
|
7848 a.imag = -a.imag / denom;
|
victor@0
|
7849 b.real = -b.real;
|
victor@0
|
7850 }
|
victor@0
|
7851 switch ((int)b.real) {
|
victor@0
|
7852 case 0:
|
victor@0
|
7853 z.real = 1;
|
victor@0
|
7854 z.imag = 0;
|
victor@0
|
7855 return z;
|
victor@0
|
7856 case 1:
|
victor@0
|
7857 return a;
|
victor@0
|
7858 case 2:
|
victor@0
|
7859 z = __Pyx_c_prod(a, a);
|
victor@0
|
7860 return __Pyx_c_prod(a, a);
|
victor@0
|
7861 case 3:
|
victor@0
|
7862 z = __Pyx_c_prod(a, a);
|
victor@0
|
7863 return __Pyx_c_prod(z, a);
|
victor@0
|
7864 case 4:
|
victor@0
|
7865 z = __Pyx_c_prod(a, a);
|
victor@0
|
7866 return __Pyx_c_prod(z, z);
|
victor@0
|
7867 }
|
victor@0
|
7868 }
|
victor@0
|
7869 if (a.imag == 0) {
|
victor@0
|
7870 if (a.real == 0) {
|
victor@0
|
7871 return a;
|
victor@0
|
7872 }
|
victor@0
|
7873 r = a.real;
|
victor@0
|
7874 theta = 0;
|
victor@0
|
7875 } else {
|
victor@0
|
7876 r = __Pyx_c_abs(a);
|
victor@0
|
7877 theta = atan2(a.imag, a.real);
|
victor@0
|
7878 }
|
victor@0
|
7879 lnr = log(r);
|
victor@0
|
7880 z_r = exp(lnr * b.real - theta * b.imag);
|
victor@0
|
7881 z_theta = theta * b.real + lnr * b.imag;
|
victor@0
|
7882 z.real = z_r * cos(z_theta);
|
victor@0
|
7883 z.imag = z_r * sin(z_theta);
|
victor@0
|
7884 return z;
|
victor@0
|
7885 }
|
victor@0
|
7886 #endif
|
victor@0
|
7887 #endif
|
victor@0
|
7888
|
victor@0
|
7889 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
7890 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
7891 #include "longintrepr.h"
|
victor@0
|
7892 #endif
|
victor@0
|
7893 #endif
|
victor@0
|
7894 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
|
victor@0
|
7895 const long neg_one = (long) -1, const_zero = 0;
|
victor@0
|
7896 const int is_unsigned = neg_one > const_zero;
|
victor@0
|
7897 #if PY_MAJOR_VERSION < 3
|
victor@0
|
7898 if (likely(PyInt_Check(x))) {
|
victor@0
|
7899 if (sizeof(long) < sizeof(long)) {
|
victor@0
|
7900 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG)
|
victor@0
|
7901 } else {
|
victor@0
|
7902 long val = PyInt_AS_LONG(x);
|
victor@0
|
7903 if (is_unsigned && unlikely(val < 0)) {
|
victor@0
|
7904 PyErr_SetString(PyExc_OverflowError,
|
victor@0
|
7905 "can't convert negative value to long");
|
victor@0
|
7906 return (long) -1;
|
victor@0
|
7907 }
|
victor@0
|
7908 return (long) val;
|
victor@0
|
7909 }
|
victor@0
|
7910 } else
|
victor@0
|
7911 #endif
|
victor@0
|
7912 if (likely(PyLong_Check(x))) {
|
victor@0
|
7913 if (is_unsigned) {
|
victor@0
|
7914 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
7915 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
7916 if (sizeof(digit) <= sizeof(long)) {
|
victor@0
|
7917 switch (Py_SIZE(x)) {
|
victor@0
|
7918 case 0: return 0;
|
victor@0
|
7919 case 1: return (long) ((PyLongObject*)x)->ob_digit[0];
|
victor@0
|
7920 }
|
victor@0
|
7921 }
|
victor@0
|
7922 #endif
|
victor@0
|
7923 #endif
|
victor@0
|
7924 if (unlikely(Py_SIZE(x) < 0)) {
|
victor@0
|
7925 PyErr_SetString(PyExc_OverflowError,
|
victor@0
|
7926 "can't convert negative value to long");
|
victor@0
|
7927 return (long) -1;
|
victor@0
|
7928 }
|
victor@0
|
7929 if (sizeof(long) <= sizeof(unsigned long)) {
|
victor@0
|
7930 __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong)
|
victor@0
|
7931 } else if (sizeof(long) <= sizeof(unsigned long long)) {
|
victor@0
|
7932 __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong)
|
victor@0
|
7933 }
|
victor@0
|
7934 } else {
|
victor@0
|
7935 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
7936 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
7937 if (sizeof(digit) <= sizeof(long)) {
|
victor@0
|
7938 switch (Py_SIZE(x)) {
|
victor@0
|
7939 case 0: return 0;
|
victor@0
|
7940 case 1: return +(long) ((PyLongObject*)x)->ob_digit[0];
|
victor@0
|
7941 case -1: return -(long) ((PyLongObject*)x)->ob_digit[0];
|
victor@0
|
7942 }
|
victor@0
|
7943 }
|
victor@0
|
7944 #endif
|
victor@0
|
7945 #endif
|
victor@0
|
7946 if (sizeof(long) <= sizeof(long)) {
|
victor@0
|
7947 __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong)
|
victor@0
|
7948 } else if (sizeof(long) <= sizeof(long long)) {
|
victor@0
|
7949 __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong)
|
victor@0
|
7950 }
|
victor@0
|
7951 }
|
victor@0
|
7952 {
|
victor@0
|
7953 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
|
victor@0
|
7954 PyErr_SetString(PyExc_RuntimeError,
|
victor@0
|
7955 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
|
victor@0
|
7956 #else
|
victor@0
|
7957 long val;
|
victor@0
|
7958 PyObject *v = __Pyx_PyNumber_Int(x);
|
victor@0
|
7959 #if PY_MAJOR_VERSION < 3
|
victor@0
|
7960 if (likely(v) && !PyLong_Check(v)) {
|
victor@0
|
7961 PyObject *tmp = v;
|
victor@0
|
7962 v = PyNumber_Long(tmp);
|
victor@0
|
7963 Py_DECREF(tmp);
|
victor@0
|
7964 }
|
victor@0
|
7965 #endif
|
victor@0
|
7966 if (likely(v)) {
|
victor@0
|
7967 int one = 1; int is_little = (int)*(unsigned char *)&one;
|
victor@0
|
7968 unsigned char *bytes = (unsigned char *)&val;
|
victor@0
|
7969 int ret = _PyLong_AsByteArray((PyLongObject *)v,
|
victor@0
|
7970 bytes, sizeof(val),
|
victor@0
|
7971 is_little, !is_unsigned);
|
victor@0
|
7972 Py_DECREF(v);
|
victor@0
|
7973 if (likely(!ret))
|
victor@0
|
7974 return val;
|
victor@0
|
7975 }
|
victor@0
|
7976 #endif
|
victor@0
|
7977 return (long) -1;
|
victor@0
|
7978 }
|
victor@0
|
7979 } else {
|
victor@0
|
7980 long val;
|
victor@0
|
7981 PyObject *tmp = __Pyx_PyNumber_Int(x);
|
victor@0
|
7982 if (!tmp) return (long) -1;
|
victor@0
|
7983 val = __Pyx_PyInt_As_long(tmp);
|
victor@0
|
7984 Py_DECREF(tmp);
|
victor@0
|
7985 return val;
|
victor@0
|
7986 }
|
victor@0
|
7987 }
|
victor@0
|
7988
|
victor@0
|
7989 static int __Pyx_check_binary_version(void) {
|
victor@0
|
7990 char ctversion[4], rtversion[4];
|
victor@0
|
7991 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
|
victor@0
|
7992 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
|
victor@0
|
7993 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
|
victor@0
|
7994 char message[200];
|
victor@0
|
7995 PyOS_snprintf(message, sizeof(message),
|
victor@0
|
7996 "compiletime version %s of module '%.100s' "
|
victor@0
|
7997 "does not match runtime version %s",
|
victor@0
|
7998 ctversion, __Pyx_MODULE_NAME, rtversion);
|
victor@0
|
7999 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
8000 return PyErr_Warn(NULL, message);
|
victor@0
|
8001 #else
|
victor@0
|
8002 return PyErr_WarnEx(NULL, message, 1);
|
victor@0
|
8003 #endif
|
victor@0
|
8004 }
|
victor@0
|
8005 return 0;
|
victor@0
|
8006 }
|
victor@0
|
8007
|
victor@0
|
8008 #ifndef __PYX_HAVE_RT_ImportModule
|
victor@0
|
8009 #define __PYX_HAVE_RT_ImportModule
|
victor@0
|
8010 static PyObject *__Pyx_ImportModule(const char *name) {
|
victor@0
|
8011 PyObject *py_name = 0;
|
victor@0
|
8012 PyObject *py_module = 0;
|
victor@0
|
8013 py_name = __Pyx_PyIdentifier_FromString(name);
|
victor@0
|
8014 if (!py_name)
|
victor@0
|
8015 goto bad;
|
victor@0
|
8016 py_module = PyImport_Import(py_name);
|
victor@0
|
8017 Py_DECREF(py_name);
|
victor@0
|
8018 return py_module;
|
victor@0
|
8019 bad:
|
victor@0
|
8020 Py_XDECREF(py_name);
|
victor@0
|
8021 return 0;
|
victor@0
|
8022 }
|
victor@0
|
8023 #endif
|
victor@0
|
8024
|
victor@0
|
8025 #ifndef __PYX_HAVE_RT_ImportType
|
victor@0
|
8026 #define __PYX_HAVE_RT_ImportType
|
victor@0
|
8027 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
|
victor@0
|
8028 size_t size, int strict)
|
victor@0
|
8029 {
|
victor@0
|
8030 PyObject *py_module = 0;
|
victor@0
|
8031 PyObject *result = 0;
|
victor@0
|
8032 PyObject *py_name = 0;
|
victor@0
|
8033 char warning[200];
|
victor@0
|
8034 Py_ssize_t basicsize;
|
victor@0
|
8035 #ifdef Py_LIMITED_API
|
victor@0
|
8036 PyObject *py_basicsize;
|
victor@0
|
8037 #endif
|
victor@0
|
8038 py_module = __Pyx_ImportModule(module_name);
|
victor@0
|
8039 if (!py_module)
|
victor@0
|
8040 goto bad;
|
victor@0
|
8041 py_name = __Pyx_PyIdentifier_FromString(class_name);
|
victor@0
|
8042 if (!py_name)
|
victor@0
|
8043 goto bad;
|
victor@0
|
8044 result = PyObject_GetAttr(py_module, py_name);
|
victor@0
|
8045 Py_DECREF(py_name);
|
victor@0
|
8046 py_name = 0;
|
victor@0
|
8047 Py_DECREF(py_module);
|
victor@0
|
8048 py_module = 0;
|
victor@0
|
8049 if (!result)
|
victor@0
|
8050 goto bad;
|
victor@0
|
8051 if (!PyType_Check(result)) {
|
victor@0
|
8052 PyErr_Format(PyExc_TypeError,
|
victor@0
|
8053 "%.200s.%.200s is not a type object",
|
victor@0
|
8054 module_name, class_name);
|
victor@0
|
8055 goto bad;
|
victor@0
|
8056 }
|
victor@0
|
8057 #ifndef Py_LIMITED_API
|
victor@0
|
8058 basicsize = ((PyTypeObject *)result)->tp_basicsize;
|
victor@0
|
8059 #else
|
victor@0
|
8060 py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
|
victor@0
|
8061 if (!py_basicsize)
|
victor@0
|
8062 goto bad;
|
victor@0
|
8063 basicsize = PyLong_AsSsize_t(py_basicsize);
|
victor@0
|
8064 Py_DECREF(py_basicsize);
|
victor@0
|
8065 py_basicsize = 0;
|
victor@0
|
8066 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
|
victor@0
|
8067 goto bad;
|
victor@0
|
8068 #endif
|
victor@0
|
8069 if (!strict && (size_t)basicsize > size) {
|
victor@0
|
8070 PyOS_snprintf(warning, sizeof(warning),
|
victor@0
|
8071 "%s.%s size changed, may indicate binary incompatibility",
|
victor@0
|
8072 module_name, class_name);
|
victor@0
|
8073 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
8074 if (PyErr_Warn(NULL, warning) < 0) goto bad;
|
victor@0
|
8075 #else
|
victor@0
|
8076 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
|
victor@0
|
8077 #endif
|
victor@0
|
8078 }
|
victor@0
|
8079 else if ((size_t)basicsize != size) {
|
victor@0
|
8080 PyErr_Format(PyExc_ValueError,
|
victor@0
|
8081 "%.200s.%.200s has the wrong size, try recompiling",
|
victor@0
|
8082 module_name, class_name);
|
victor@0
|
8083 goto bad;
|
victor@0
|
8084 }
|
victor@0
|
8085 return (PyTypeObject *)result;
|
victor@0
|
8086 bad:
|
victor@0
|
8087 Py_XDECREF(py_module);
|
victor@0
|
8088 Py_XDECREF(result);
|
victor@0
|
8089 return NULL;
|
victor@0
|
8090 }
|
victor@0
|
8091 #endif
|
victor@0
|
8092
|
victor@0
|
8093 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
|
victor@0
|
8094 int start = 0, mid = 0, end = count - 1;
|
victor@0
|
8095 if (end >= 0 && code_line > entries[end].code_line) {
|
victor@0
|
8096 return count;
|
victor@0
|
8097 }
|
victor@0
|
8098 while (start < end) {
|
victor@0
|
8099 mid = (start + end) / 2;
|
victor@0
|
8100 if (code_line < entries[mid].code_line) {
|
victor@0
|
8101 end = mid;
|
victor@0
|
8102 } else if (code_line > entries[mid].code_line) {
|
victor@0
|
8103 start = mid + 1;
|
victor@0
|
8104 } else {
|
victor@0
|
8105 return mid;
|
victor@0
|
8106 }
|
victor@0
|
8107 }
|
victor@0
|
8108 if (code_line <= entries[mid].code_line) {
|
victor@0
|
8109 return mid;
|
victor@0
|
8110 } else {
|
victor@0
|
8111 return mid + 1;
|
victor@0
|
8112 }
|
victor@0
|
8113 }
|
victor@0
|
8114 static PyCodeObject *__pyx_find_code_object(int code_line) {
|
victor@0
|
8115 PyCodeObject* code_object;
|
victor@0
|
8116 int pos;
|
victor@0
|
8117 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
|
victor@0
|
8118 return NULL;
|
victor@0
|
8119 }
|
victor@0
|
8120 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
victor@0
|
8121 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
|
victor@0
|
8122 return NULL;
|
victor@0
|
8123 }
|
victor@0
|
8124 code_object = __pyx_code_cache.entries[pos].code_object;
|
victor@0
|
8125 Py_INCREF(code_object);
|
victor@0
|
8126 return code_object;
|
victor@0
|
8127 }
|
victor@0
|
8128 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
|
victor@0
|
8129 int pos, i;
|
victor@0
|
8130 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
|
victor@0
|
8131 if (unlikely(!code_line)) {
|
victor@0
|
8132 return;
|
victor@0
|
8133 }
|
victor@0
|
8134 if (unlikely(!entries)) {
|
victor@0
|
8135 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
|
victor@0
|
8136 if (likely(entries)) {
|
victor@0
|
8137 __pyx_code_cache.entries = entries;
|
victor@0
|
8138 __pyx_code_cache.max_count = 64;
|
victor@0
|
8139 __pyx_code_cache.count = 1;
|
victor@0
|
8140 entries[0].code_line = code_line;
|
victor@0
|
8141 entries[0].code_object = code_object;
|
victor@0
|
8142 Py_INCREF(code_object);
|
victor@0
|
8143 }
|
victor@0
|
8144 return;
|
victor@0
|
8145 }
|
victor@0
|
8146 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
|
victor@0
|
8147 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
|
victor@0
|
8148 PyCodeObject* tmp = entries[pos].code_object;
|
victor@0
|
8149 entries[pos].code_object = code_object;
|
victor@0
|
8150 Py_DECREF(tmp);
|
victor@0
|
8151 return;
|
victor@0
|
8152 }
|
victor@0
|
8153 if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
|
victor@0
|
8154 int new_max = __pyx_code_cache.max_count + 64;
|
victor@0
|
8155 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
|
victor@0
|
8156 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
|
victor@0
|
8157 if (unlikely(!entries)) {
|
victor@0
|
8158 return;
|
victor@0
|
8159 }
|
victor@0
|
8160 __pyx_code_cache.entries = entries;
|
victor@0
|
8161 __pyx_code_cache.max_count = new_max;
|
victor@0
|
8162 }
|
victor@0
|
8163 for (i=__pyx_code_cache.count; i>pos; i--) {
|
victor@0
|
8164 entries[i] = entries[i-1];
|
victor@0
|
8165 }
|
victor@0
|
8166 entries[pos].code_line = code_line;
|
victor@0
|
8167 entries[pos].code_object = code_object;
|
victor@0
|
8168 __pyx_code_cache.count++;
|
victor@0
|
8169 Py_INCREF(code_object);
|
victor@0
|
8170 }
|
victor@0
|
8171
|
victor@0
|
8172 #include "compile.h"
|
victor@0
|
8173 #include "frameobject.h"
|
victor@0
|
8174 #include "traceback.h"
|
victor@0
|
8175 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
|
victor@0
|
8176 const char *funcname, int c_line,
|
victor@0
|
8177 int py_line, const char *filename) {
|
victor@0
|
8178 PyCodeObject *py_code = 0;
|
victor@0
|
8179 PyObject *py_srcfile = 0;
|
victor@0
|
8180 PyObject *py_funcname = 0;
|
victor@0
|
8181 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8182 py_srcfile = PyString_FromString(filename);
|
victor@0
|
8183 #else
|
victor@0
|
8184 py_srcfile = PyUnicode_FromString(filename);
|
victor@0
|
8185 #endif
|
victor@0
|
8186 if (!py_srcfile) goto bad;
|
victor@0
|
8187 if (c_line) {
|
victor@0
|
8188 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8189 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
victor@0
|
8190 #else
|
victor@0
|
8191 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
|
victor@0
|
8192 #endif
|
victor@0
|
8193 }
|
victor@0
|
8194 else {
|
victor@0
|
8195 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8196 py_funcname = PyString_FromString(funcname);
|
victor@0
|
8197 #else
|
victor@0
|
8198 py_funcname = PyUnicode_FromString(funcname);
|
victor@0
|
8199 #endif
|
victor@0
|
8200 }
|
victor@0
|
8201 if (!py_funcname) goto bad;
|
victor@0
|
8202 py_code = __Pyx_PyCode_New(
|
victor@0
|
8203 0, /*int argcount,*/
|
victor@0
|
8204 0, /*int kwonlyargcount,*/
|
victor@0
|
8205 0, /*int nlocals,*/
|
victor@0
|
8206 0, /*int stacksize,*/
|
victor@0
|
8207 0, /*int flags,*/
|
victor@0
|
8208 __pyx_empty_bytes, /*PyObject *code,*/
|
victor@0
|
8209 __pyx_empty_tuple, /*PyObject *consts,*/
|
victor@0
|
8210 __pyx_empty_tuple, /*PyObject *names,*/
|
victor@0
|
8211 __pyx_empty_tuple, /*PyObject *varnames,*/
|
victor@0
|
8212 __pyx_empty_tuple, /*PyObject *freevars,*/
|
victor@0
|
8213 __pyx_empty_tuple, /*PyObject *cellvars,*/
|
victor@0
|
8214 py_srcfile, /*PyObject *filename,*/
|
victor@0
|
8215 py_funcname, /*PyObject *name,*/
|
victor@0
|
8216 py_line, /*int firstlineno,*/
|
victor@0
|
8217 __pyx_empty_bytes /*PyObject *lnotab*/
|
victor@0
|
8218 );
|
victor@0
|
8219 Py_DECREF(py_srcfile);
|
victor@0
|
8220 Py_DECREF(py_funcname);
|
victor@0
|
8221 return py_code;
|
victor@0
|
8222 bad:
|
victor@0
|
8223 Py_XDECREF(py_srcfile);
|
victor@0
|
8224 Py_XDECREF(py_funcname);
|
victor@0
|
8225 return NULL;
|
victor@0
|
8226 }
|
victor@0
|
8227 static void __Pyx_AddTraceback(const char *funcname, int c_line,
|
victor@0
|
8228 int py_line, const char *filename) {
|
victor@0
|
8229 PyCodeObject *py_code = 0;
|
victor@0
|
8230 PyObject *py_globals = 0;
|
victor@0
|
8231 PyFrameObject *py_frame = 0;
|
victor@0
|
8232 py_code = __pyx_find_code_object(c_line ? c_line : py_line);
|
victor@0
|
8233 if (!py_code) {
|
victor@0
|
8234 py_code = __Pyx_CreateCodeObjectForTraceback(
|
victor@0
|
8235 funcname, c_line, py_line, filename);
|
victor@0
|
8236 if (!py_code) goto bad;
|
victor@0
|
8237 __pyx_insert_code_object(c_line ? c_line : py_line, py_code);
|
victor@0
|
8238 }
|
victor@0
|
8239 py_globals = PyModule_GetDict(__pyx_m);
|
victor@0
|
8240 if (!py_globals) goto bad;
|
victor@0
|
8241 py_frame = PyFrame_New(
|
victor@0
|
8242 PyThreadState_GET(), /*PyThreadState *tstate,*/
|
victor@0
|
8243 py_code, /*PyCodeObject *code,*/
|
victor@0
|
8244 py_globals, /*PyObject *globals,*/
|
victor@0
|
8245 0 /*PyObject *locals*/
|
victor@0
|
8246 );
|
victor@0
|
8247 if (!py_frame) goto bad;
|
victor@0
|
8248 py_frame->f_lineno = py_line;
|
victor@0
|
8249 PyTraceBack_Here(py_frame);
|
victor@0
|
8250 bad:
|
victor@0
|
8251 Py_XDECREF(py_code);
|
victor@0
|
8252 Py_XDECREF(py_frame);
|
victor@0
|
8253 }
|
victor@0
|
8254
|
victor@0
|
8255 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
|
victor@0
|
8256 while (t->p) {
|
victor@0
|
8257 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8258 if (t->is_unicode) {
|
victor@0
|
8259 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
|
victor@0
|
8260 } else if (t->intern) {
|
victor@0
|
8261 *t->p = PyString_InternFromString(t->s);
|
victor@0
|
8262 } else {
|
victor@0
|
8263 *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
|
victor@0
|
8264 }
|
victor@0
|
8265 #else /* Python 3+ has unicode identifiers */
|
victor@0
|
8266 if (t->is_unicode | t->is_str) {
|
victor@0
|
8267 if (t->intern) {
|
victor@0
|
8268 *t->p = PyUnicode_InternFromString(t->s);
|
victor@0
|
8269 } else if (t->encoding) {
|
victor@0
|
8270 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
|
victor@0
|
8271 } else {
|
victor@0
|
8272 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
|
victor@0
|
8273 }
|
victor@0
|
8274 } else {
|
victor@0
|
8275 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
|
victor@0
|
8276 }
|
victor@0
|
8277 #endif
|
victor@0
|
8278 if (!*t->p)
|
victor@0
|
8279 return -1;
|
victor@0
|
8280 ++t;
|
victor@0
|
8281 }
|
victor@0
|
8282 return 0;
|
victor@0
|
8283 }
|
victor@0
|
8284
|
victor@0
|
8285 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
|
victor@0
|
8286 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
|
victor@0
|
8287 }
|
victor@0
|
8288 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
|
victor@0
|
8289 Py_ssize_t ignore;
|
victor@0
|
8290 return __Pyx_PyObject_AsStringAndSize(o, &ignore);
|
victor@0
|
8291 }
|
victor@0
|
8292 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
|
victor@0
|
8293 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
|
victor@0
|
8294 if (
|
victor@0
|
8295 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
victor@0
|
8296 __Pyx_sys_getdefaultencoding_not_ascii &&
|
victor@0
|
8297 #endif
|
victor@0
|
8298 PyUnicode_Check(o)) {
|
victor@0
|
8299 #if PY_VERSION_HEX < 0x03030000
|
victor@0
|
8300 char* defenc_c;
|
victor@0
|
8301 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
|
victor@0
|
8302 if (!defenc) return NULL;
|
victor@0
|
8303 defenc_c = PyBytes_AS_STRING(defenc);
|
victor@0
|
8304 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
victor@0
|
8305 {
|
victor@0
|
8306 char* end = defenc_c + PyBytes_GET_SIZE(defenc);
|
victor@0
|
8307 char* c;
|
victor@0
|
8308 for (c = defenc_c; c < end; c++) {
|
victor@0
|
8309 if ((unsigned char) (*c) >= 128) {
|
victor@0
|
8310 PyUnicode_AsASCIIString(o);
|
victor@0
|
8311 return NULL;
|
victor@0
|
8312 }
|
victor@0
|
8313 }
|
victor@0
|
8314 }
|
victor@0
|
8315 #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/
|
victor@0
|
8316 *length = PyBytes_GET_SIZE(defenc);
|
victor@0
|
8317 return defenc_c;
|
victor@0
|
8318 #else /* PY_VERSION_HEX < 0x03030000 */
|
victor@0
|
8319 if (PyUnicode_READY(o) == -1) return NULL;
|
victor@0
|
8320 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
|
victor@0
|
8321 if (PyUnicode_IS_ASCII(o)) {
|
victor@0
|
8322 *length = PyUnicode_GET_LENGTH(o);
|
victor@0
|
8323 return PyUnicode_AsUTF8(o);
|
victor@0
|
8324 } else {
|
victor@0
|
8325 PyUnicode_AsASCIIString(o);
|
victor@0
|
8326 return NULL;
|
victor@0
|
8327 }
|
victor@0
|
8328 #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
|
victor@0
|
8329 return PyUnicode_AsUTF8AndSize(o, length);
|
victor@0
|
8330 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */
|
victor@0
|
8331 #endif /* PY_VERSION_HEX < 0x03030000 */
|
victor@0
|
8332 } else
|
victor@0
|
8333 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */
|
victor@0
|
8334 #if !CYTHON_COMPILING_IN_PYPY
|
victor@0
|
8335 #if PY_VERSION_HEX >= 0x02060000
|
victor@0
|
8336 if (PyByteArray_Check(o)) {
|
victor@0
|
8337 *length = PyByteArray_GET_SIZE(o);
|
victor@0
|
8338 return PyByteArray_AS_STRING(o);
|
victor@0
|
8339 } else
|
victor@0
|
8340 #endif
|
victor@0
|
8341 #endif
|
victor@0
|
8342 {
|
victor@0
|
8343 char* result;
|
victor@0
|
8344 int r = PyBytes_AsStringAndSize(o, &result, length);
|
victor@0
|
8345 if (unlikely(r < 0)) {
|
victor@0
|
8346 return NULL;
|
victor@0
|
8347 } else {
|
victor@0
|
8348 return result;
|
victor@0
|
8349 }
|
victor@0
|
8350 }
|
victor@0
|
8351 }
|
victor@0
|
8352 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
|
victor@0
|
8353 int is_true = x == Py_True;
|
victor@0
|
8354 if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
|
victor@0
|
8355 else return PyObject_IsTrue(x);
|
victor@0
|
8356 }
|
victor@0
|
8357 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) {
|
victor@0
|
8358 PyNumberMethods *m;
|
victor@0
|
8359 const char *name = NULL;
|
victor@0
|
8360 PyObject *res = NULL;
|
victor@0
|
8361 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8362 if (PyInt_Check(x) || PyLong_Check(x))
|
victor@0
|
8363 #else
|
victor@0
|
8364 if (PyLong_Check(x))
|
victor@0
|
8365 #endif
|
victor@0
|
8366 return Py_INCREF(x), x;
|
victor@0
|
8367 m = Py_TYPE(x)->tp_as_number;
|
victor@0
|
8368 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8369 if (m && m->nb_int) {
|
victor@0
|
8370 name = "int";
|
victor@0
|
8371 res = PyNumber_Int(x);
|
victor@0
|
8372 }
|
victor@0
|
8373 else if (m && m->nb_long) {
|
victor@0
|
8374 name = "long";
|
victor@0
|
8375 res = PyNumber_Long(x);
|
victor@0
|
8376 }
|
victor@0
|
8377 #else
|
victor@0
|
8378 if (m && m->nb_int) {
|
victor@0
|
8379 name = "int";
|
victor@0
|
8380 res = PyNumber_Long(x);
|
victor@0
|
8381 }
|
victor@0
|
8382 #endif
|
victor@0
|
8383 if (res) {
|
victor@0
|
8384 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8385 if (!PyInt_Check(res) && !PyLong_Check(res)) {
|
victor@0
|
8386 #else
|
victor@0
|
8387 if (!PyLong_Check(res)) {
|
victor@0
|
8388 #endif
|
victor@0
|
8389 PyErr_Format(PyExc_TypeError,
|
victor@0
|
8390 "__%.4s__ returned non-%.4s (type %.200s)",
|
victor@0
|
8391 name, name, Py_TYPE(res)->tp_name);
|
victor@0
|
8392 Py_DECREF(res);
|
victor@0
|
8393 return NULL;
|
victor@0
|
8394 }
|
victor@0
|
8395 }
|
victor@0
|
8396 else if (!PyErr_Occurred()) {
|
victor@0
|
8397 PyErr_SetString(PyExc_TypeError,
|
victor@0
|
8398 "an integer is required");
|
victor@0
|
8399 }
|
victor@0
|
8400 return res;
|
victor@0
|
8401 }
|
victor@0
|
8402 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
8403 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
8404 #include "longintrepr.h"
|
victor@0
|
8405 #endif
|
victor@0
|
8406 #endif
|
victor@0
|
8407 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
|
victor@0
|
8408 Py_ssize_t ival;
|
victor@0
|
8409 PyObject *x;
|
victor@0
|
8410 #if PY_MAJOR_VERSION < 3
|
victor@0
|
8411 if (likely(PyInt_CheckExact(b)))
|
victor@0
|
8412 return PyInt_AS_LONG(b);
|
victor@0
|
8413 #endif
|
victor@0
|
8414 if (likely(PyLong_CheckExact(b))) {
|
victor@0
|
8415 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3
|
victor@0
|
8416 #if CYTHON_USE_PYLONG_INTERNALS
|
victor@0
|
8417 switch (Py_SIZE(b)) {
|
victor@0
|
8418 case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0];
|
victor@0
|
8419 case 0: return 0;
|
victor@0
|
8420 case 1: return ((PyLongObject*)b)->ob_digit[0];
|
victor@0
|
8421 }
|
victor@0
|
8422 #endif
|
victor@0
|
8423 #endif
|
victor@0
|
8424 #if PY_VERSION_HEX < 0x02060000
|
victor@0
|
8425 return PyInt_AsSsize_t(b);
|
victor@0
|
8426 #else
|
victor@0
|
8427 return PyLong_AsSsize_t(b);
|
victor@0
|
8428 #endif
|
victor@0
|
8429 }
|
victor@0
|
8430 x = PyNumber_Index(b);
|
victor@0
|
8431 if (!x) return -1;
|
victor@0
|
8432 ival = PyInt_AsSsize_t(x);
|
victor@0
|
8433 Py_DECREF(x);
|
victor@0
|
8434 return ival;
|
victor@0
|
8435 }
|
victor@0
|
8436 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
|
victor@0
|
8437 #if PY_VERSION_HEX < 0x02050000
|
victor@0
|
8438 if (ival <= LONG_MAX)
|
victor@0
|
8439 return PyInt_FromLong((long)ival);
|
victor@0
|
8440 else {
|
victor@0
|
8441 unsigned char *bytes = (unsigned char *) &ival;
|
victor@0
|
8442 int one = 1; int little = (int)*(unsigned char*)&one;
|
victor@0
|
8443 return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0);
|
victor@0
|
8444 }
|
victor@0
|
8445 #else
|
victor@0
|
8446 return PyInt_FromSize_t(ival);
|
victor@0
|
8447 #endif
|
victor@0
|
8448 }
|
victor@0
|
8449
|
victor@0
|
8450
|
victor@0
|
8451 #endif /* Py_PYTHON_H */
|