Mercurial > hg > multiomr
comparison Alignment/FastAlignmentArrays.c @ 0:1eb6054a1f84
First Commit
author | Victor Padilla <victor.padilla.mc@gmail.com> |
---|---|
date | Mon, 04 May 2015 22:47:33 +0200 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:1eb6054a1f84 |
---|---|
1 /* Generated by Cython 0.20.2 on Fri Dec 12 12:34:51 2014 */ | |
2 | |
3 #define PY_SSIZE_T_CLEAN | |
4 #ifndef CYTHON_USE_PYLONG_INTERNALS | |
5 #ifdef PYLONG_BITS_IN_DIGIT | |
6 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
7 #else | |
8 #include "pyconfig.h" | |
9 #ifdef PYLONG_BITS_IN_DIGIT | |
10 #define CYTHON_USE_PYLONG_INTERNALS 1 | |
11 #else | |
12 #define CYTHON_USE_PYLONG_INTERNALS 0 | |
13 #endif | |
14 #endif | |
15 #endif | |
16 #include "Python.h" | |
17 #ifndef Py_PYTHON_H | |
18 #error Python headers needed to compile C extensions, please install development version of Python. | |
19 #elif PY_VERSION_HEX < 0x02040000 | |
20 #error Cython requires Python 2.4+. | |
21 #else | |
22 #define CYTHON_ABI "0_20_2" | |
23 #include <stddef.h> /* For offsetof */ | |
24 #ifndef offsetof | |
25 #define offsetof(type, member) ( (size_t) & ((type*)0) -> member ) | |
26 #endif | |
27 #if !defined(WIN32) && !defined(MS_WINDOWS) | |
28 #ifndef __stdcall | |
29 #define __stdcall | |
30 #endif | |
31 #ifndef __cdecl | |
32 #define __cdecl | |
33 #endif | |
34 #ifndef __fastcall | |
35 #define __fastcall | |
36 #endif | |
37 #endif | |
38 #ifndef DL_IMPORT | |
39 #define DL_IMPORT(t) t | |
40 #endif | |
41 #ifndef DL_EXPORT | |
42 #define DL_EXPORT(t) t | |
43 #endif | |
44 #ifndef PY_LONG_LONG | |
45 #define PY_LONG_LONG LONG_LONG | |
46 #endif | |
47 #ifndef Py_HUGE_VAL | |
48 #define Py_HUGE_VAL HUGE_VAL | |
49 #endif | |
50 #ifdef PYPY_VERSION | |
51 #define CYTHON_COMPILING_IN_PYPY 1 | |
52 #define CYTHON_COMPILING_IN_CPYTHON 0 | |
53 #else | |
54 #define CYTHON_COMPILING_IN_PYPY 0 | |
55 #define CYTHON_COMPILING_IN_CPYTHON 1 | |
56 #endif | |
57 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 | |
58 #define Py_OptimizeFlag 0 | |
59 #endif | |
60 #if PY_VERSION_HEX < 0x02050000 | |
61 typedef int Py_ssize_t; | |
62 #define PY_SSIZE_T_MAX INT_MAX | |
63 #define PY_SSIZE_T_MIN INT_MIN | |
64 #define PY_FORMAT_SIZE_T "" | |
65 #define CYTHON_FORMAT_SSIZE_T "" | |
66 #define PyInt_FromSsize_t(z) PyInt_FromLong(z) | |
67 #define PyInt_AsSsize_t(o) __Pyx_PyInt_As_int(o) | |
68 #define PyNumber_Index(o) ((PyNumber_Check(o) && !PyFloat_Check(o)) ? PyNumber_Int(o) : \ | |
69 (PyErr_Format(PyExc_TypeError, \ | |
70 "expected index value, got %.200s", Py_TYPE(o)->tp_name), \ | |
71 (PyObject*)0)) | |
72 #define __Pyx_PyIndex_Check(o) (PyNumber_Check(o) && !PyFloat_Check(o) && \ | |
73 !PyComplex_Check(o)) | |
74 #define PyIndex_Check __Pyx_PyIndex_Check | |
75 #define PyErr_WarnEx(category, message, stacklevel) PyErr_Warn(category, message) | |
76 #define __PYX_BUILD_PY_SSIZE_T "i" | |
77 #else | |
78 #define __PYX_BUILD_PY_SSIZE_T "n" | |
79 #define CYTHON_FORMAT_SSIZE_T "z" | |
80 #define __Pyx_PyIndex_Check PyIndex_Check | |
81 #endif | |
82 #if PY_VERSION_HEX < 0x02060000 | |
83 #define Py_REFCNT(ob) (((PyObject*)(ob))->ob_refcnt) | |
84 #define Py_TYPE(ob) (((PyObject*)(ob))->ob_type) | |
85 #define Py_SIZE(ob) (((PyVarObject*)(ob))->ob_size) | |
86 #define PyVarObject_HEAD_INIT(type, size) \ | |
87 PyObject_HEAD_INIT(type) size, | |
88 #define PyType_Modified(t) | |
89 typedef struct { | |
90 void *buf; | |
91 PyObject *obj; | |
92 Py_ssize_t len; | |
93 Py_ssize_t itemsize; | |
94 int readonly; | |
95 int ndim; | |
96 char *format; | |
97 Py_ssize_t *shape; | |
98 Py_ssize_t *strides; | |
99 Py_ssize_t *suboffsets; | |
100 void *internal; | |
101 } Py_buffer; | |
102 #define PyBUF_SIMPLE 0 | |
103 #define PyBUF_WRITABLE 0x0001 | |
104 #define PyBUF_FORMAT 0x0004 | |
105 #define PyBUF_ND 0x0008 | |
106 #define PyBUF_STRIDES (0x0010 | PyBUF_ND) | |
107 #define PyBUF_C_CONTIGUOUS (0x0020 | PyBUF_STRIDES) | |
108 #define PyBUF_F_CONTIGUOUS (0x0040 | PyBUF_STRIDES) | |
109 #define PyBUF_ANY_CONTIGUOUS (0x0080 | PyBUF_STRIDES) | |
110 #define PyBUF_INDIRECT (0x0100 | PyBUF_STRIDES) | |
111 #define PyBUF_RECORDS (PyBUF_STRIDES | PyBUF_FORMAT | PyBUF_WRITABLE) | |
112 #define PyBUF_FULL (PyBUF_INDIRECT | PyBUF_FORMAT | PyBUF_WRITABLE) | |
113 typedef int (*getbufferproc)(PyObject *, Py_buffer *, int); | |
114 typedef void (*releasebufferproc)(PyObject *, Py_buffer *); | |
115 #endif | |
116 #if PY_MAJOR_VERSION < 3 | |
117 #define __Pyx_BUILTIN_MODULE_NAME "__builtin__" | |
118 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ | |
119 PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
120 #define __Pyx_DefaultClassType PyClass_Type | |
121 #else | |
122 #define __Pyx_BUILTIN_MODULE_NAME "builtins" | |
123 #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ | |
124 PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) | |
125 #define __Pyx_DefaultClassType PyType_Type | |
126 #endif | |
127 #if PY_VERSION_HEX < 0x02060000 | |
128 #define PyUnicode_FromString(s) PyUnicode_Decode(s, strlen(s), "UTF-8", "strict") | |
129 #endif | |
130 #if PY_MAJOR_VERSION >= 3 | |
131 #define Py_TPFLAGS_CHECKTYPES 0 | |
132 #define Py_TPFLAGS_HAVE_INDEX 0 | |
133 #endif | |
134 #if (PY_VERSION_HEX < 0x02060000) || (PY_MAJOR_VERSION >= 3) | |
135 #define Py_TPFLAGS_HAVE_NEWBUFFER 0 | |
136 #endif | |
137 #if PY_VERSION_HEX < 0x02060000 | |
138 #define Py_TPFLAGS_HAVE_VERSION_TAG 0 | |
139 #endif | |
140 #if PY_VERSION_HEX < 0x02060000 && !defined(Py_TPFLAGS_IS_ABSTRACT) | |
141 #define Py_TPFLAGS_IS_ABSTRACT 0 | |
142 #endif | |
143 #if PY_VERSION_HEX < 0x030400a1 && !defined(Py_TPFLAGS_HAVE_FINALIZE) | |
144 #define Py_TPFLAGS_HAVE_FINALIZE 0 | |
145 #endif | |
146 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND) | |
147 #define CYTHON_PEP393_ENABLED 1 | |
148 #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ? \ | |
149 0 : _PyUnicode_Ready((PyObject *)(op))) | |
150 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u) | |
151 #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i) | |
152 #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u) | |
153 #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u) | |
154 #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i) | |
155 #else | |
156 #define CYTHON_PEP393_ENABLED 0 | |
157 #define __Pyx_PyUnicode_READY(op) (0) | |
158 #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u) | |
159 #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i])) | |
160 #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE)) | |
161 #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u)) | |
162 #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i])) | |
163 #endif | |
164 #if CYTHON_COMPILING_IN_PYPY | |
165 #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b) | |
166 #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b) | |
167 #else | |
168 #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b) | |
169 #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ? \ | |
170 PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b)) | |
171 #endif | |
172 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b)) | |
173 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b)) | |
174 #if PY_MAJOR_VERSION >= 3 | |
175 #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b) | |
176 #else | |
177 #define __Pyx_PyString_Format(a, b) PyString_Format(a, b) | |
178 #endif | |
179 #if PY_MAJOR_VERSION >= 3 | |
180 #define PyBaseString_Type PyUnicode_Type | |
181 #define PyStringObject PyUnicodeObject | |
182 #define PyString_Type PyUnicode_Type | |
183 #define PyString_Check PyUnicode_Check | |
184 #define PyString_CheckExact PyUnicode_CheckExact | |
185 #endif | |
186 #if PY_VERSION_HEX < 0x02060000 | |
187 #define PyBytesObject PyStringObject | |
188 #define PyBytes_Type PyString_Type | |
189 #define PyBytes_Check PyString_Check | |
190 #define PyBytes_CheckExact PyString_CheckExact | |
191 #define PyBytes_FromString PyString_FromString | |
192 #define PyBytes_FromStringAndSize PyString_FromStringAndSize | |
193 #define PyBytes_FromFormat PyString_FromFormat | |
194 #define PyBytes_DecodeEscape PyString_DecodeEscape | |
195 #define PyBytes_AsString PyString_AsString | |
196 #define PyBytes_AsStringAndSize PyString_AsStringAndSize | |
197 #define PyBytes_Size PyString_Size | |
198 #define PyBytes_AS_STRING PyString_AS_STRING | |
199 #define PyBytes_GET_SIZE PyString_GET_SIZE | |
200 #define PyBytes_Repr PyString_Repr | |
201 #define PyBytes_Concat PyString_Concat | |
202 #define PyBytes_ConcatAndDel PyString_ConcatAndDel | |
203 #endif | |
204 #if PY_MAJOR_VERSION >= 3 | |
205 #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj) | |
206 #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj) | |
207 #else | |
208 #define __Pyx_PyBaseString_Check(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj) || \ | |
209 PyString_Check(obj) || PyUnicode_Check(obj)) | |
210 #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj)) | |
211 #endif | |
212 #if PY_VERSION_HEX < 0x02060000 | |
213 #define PySet_Check(obj) PyObject_TypeCheck(obj, &PySet_Type) | |
214 #define PyFrozenSet_Check(obj) PyObject_TypeCheck(obj, &PyFrozenSet_Type) | |
215 #endif | |
216 #ifndef PySet_CheckExact | |
217 #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type) | |
218 #endif | |
219 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type) | |
220 #if PY_MAJOR_VERSION >= 3 | |
221 #define PyIntObject PyLongObject | |
222 #define PyInt_Type PyLong_Type | |
223 #define PyInt_Check(op) PyLong_Check(op) | |
224 #define PyInt_CheckExact(op) PyLong_CheckExact(op) | |
225 #define PyInt_FromString PyLong_FromString | |
226 #define PyInt_FromUnicode PyLong_FromUnicode | |
227 #define PyInt_FromLong PyLong_FromLong | |
228 #define PyInt_FromSize_t PyLong_FromSize_t | |
229 #define PyInt_FromSsize_t PyLong_FromSsize_t | |
230 #define PyInt_AsLong PyLong_AsLong | |
231 #define PyInt_AS_LONG PyLong_AS_LONG | |
232 #define PyInt_AsSsize_t PyLong_AsSsize_t | |
233 #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask | |
234 #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask | |
235 #define PyNumber_Int PyNumber_Long | |
236 #endif | |
237 #if PY_MAJOR_VERSION >= 3 | |
238 #define PyBoolObject PyLongObject | |
239 #endif | |
240 #if PY_VERSION_HEX < 0x030200A4 | |
241 typedef long Py_hash_t; | |
242 #define __Pyx_PyInt_FromHash_t PyInt_FromLong | |
243 #define __Pyx_PyInt_AsHash_t PyInt_AsLong | |
244 #else | |
245 #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t | |
246 #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t | |
247 #endif | |
248 #if (PY_MAJOR_VERSION < 3) || (PY_VERSION_HEX >= 0x03010300) | |
249 #define __Pyx_PySequence_GetSlice(obj, a, b) PySequence_GetSlice(obj, a, b) | |
250 #define __Pyx_PySequence_SetSlice(obj, a, b, value) PySequence_SetSlice(obj, a, b, value) | |
251 #define __Pyx_PySequence_DelSlice(obj, a, b) PySequence_DelSlice(obj, a, b) | |
252 #else | |
253 #define __Pyx_PySequence_GetSlice(obj, a, b) (unlikely(!(obj)) ? \ | |
254 (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), (PyObject*)0) : \ | |
255 (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_GetSlice(obj, a, b)) : \ | |
256 (PyErr_Format(PyExc_TypeError, "'%.200s' object is unsliceable", (obj)->ob_type->tp_name), (PyObject*)0))) | |
257 #define __Pyx_PySequence_SetSlice(obj, a, b, value) (unlikely(!(obj)) ? \ | |
258 (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ | |
259 (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_SetSlice(obj, a, b, value)) : \ | |
260 (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice assignment", (obj)->ob_type->tp_name), -1))) | |
261 #define __Pyx_PySequence_DelSlice(obj, a, b) (unlikely(!(obj)) ? \ | |
262 (PyErr_SetString(PyExc_SystemError, "null argument to internal routine"), -1) : \ | |
263 (likely((obj)->ob_type->tp_as_mapping) ? (PySequence_DelSlice(obj, a, b)) : \ | |
264 (PyErr_Format(PyExc_TypeError, "'%.200s' object doesn't support slice deletion", (obj)->ob_type->tp_name), -1))) | |
265 #endif | |
266 #if PY_MAJOR_VERSION >= 3 | |
267 #define PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func)) | |
268 #endif | |
269 #if PY_VERSION_HEX < 0x02050000 | |
270 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),((char *)(n))) | |
271 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),((char *)(n)),(a)) | |
272 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),((char *)(n))) | |
273 #else | |
274 #define __Pyx_GetAttrString(o,n) PyObject_GetAttrString((o),(n)) | |
275 #define __Pyx_SetAttrString(o,n,a) PyObject_SetAttrString((o),(n),(a)) | |
276 #define __Pyx_DelAttrString(o,n) PyObject_DelAttrString((o),(n)) | |
277 #endif | |
278 #if PY_VERSION_HEX < 0x02050000 | |
279 #define __Pyx_NAMESTR(n) ((char *)(n)) | |
280 #define __Pyx_DOCSTR(n) ((char *)(n)) | |
281 #else | |
282 #define __Pyx_NAMESTR(n) (n) | |
283 #define __Pyx_DOCSTR(n) (n) | |
284 #endif | |
285 #ifndef CYTHON_INLINE | |
286 #if defined(__GNUC__) | |
287 #define CYTHON_INLINE __inline__ | |
288 #elif defined(_MSC_VER) | |
289 #define CYTHON_INLINE __inline | |
290 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
291 #define CYTHON_INLINE inline | |
292 #else | |
293 #define CYTHON_INLINE | |
294 #endif | |
295 #endif | |
296 #ifndef CYTHON_RESTRICT | |
297 #if defined(__GNUC__) | |
298 #define CYTHON_RESTRICT __restrict__ | |
299 #elif defined(_MSC_VER) && _MSC_VER >= 1400 | |
300 #define CYTHON_RESTRICT __restrict | |
301 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L | |
302 #define CYTHON_RESTRICT restrict | |
303 #else | |
304 #define CYTHON_RESTRICT | |
305 #endif | |
306 #endif | |
307 #ifdef NAN | |
308 #define __PYX_NAN() ((float) NAN) | |
309 #else | |
310 static CYTHON_INLINE float __PYX_NAN() { | |
311 /* Initialize NaN. The sign is irrelevant, an exponent with all bits 1 and | |
312 a nonzero mantissa means NaN. If the first bit in the mantissa is 1, it is | |
313 a quiet NaN. */ | |
314 float value; | |
315 memset(&value, 0xFF, sizeof(value)); | |
316 return value; | |
317 } | |
318 #endif | |
319 #ifdef __cplusplus | |
320 template<typename T> | |
321 void __Pyx_call_destructor(T* x) { | |
322 x->~T(); | |
323 } | |
324 #endif | |
325 | |
326 | |
327 #if PY_MAJOR_VERSION >= 3 | |
328 #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y) | |
329 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y) | |
330 #else | |
331 #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y) | |
332 #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y) | |
333 #endif | |
334 | |
335 #ifndef __PYX_EXTERN_C | |
336 #ifdef __cplusplus | |
337 #define __PYX_EXTERN_C extern "C" | |
338 #else | |
339 #define __PYX_EXTERN_C extern | |
340 #endif | |
341 #endif | |
342 | |
343 #if defined(WIN32) || defined(MS_WINDOWS) | |
344 #define _USE_MATH_DEFINES | |
345 #endif | |
346 #include <math.h> | |
347 #define __PYX_HAVE__MultipleOMR__Alignment__FastAlignmentArrays | |
348 #define __PYX_HAVE_API__MultipleOMR__Alignment__FastAlignmentArrays | |
349 #include "string.h" | |
350 #include "stdio.h" | |
351 #include "stdlib.h" | |
352 #include "numpy/arrayobject.h" | |
353 #include "numpy/ufuncobject.h" | |
354 #include "pythread.h" | |
355 #ifdef _OPENMP | |
356 #include <omp.h> | |
357 #endif /* _OPENMP */ | |
358 | |
359 #ifdef PYREX_WITHOUT_ASSERTIONS | |
360 #define CYTHON_WITHOUT_ASSERTIONS | |
361 #endif | |
362 | |
363 #ifndef CYTHON_UNUSED | |
364 # if defined(__GNUC__) | |
365 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) | |
366 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
367 # else | |
368 # define CYTHON_UNUSED | |
369 # endif | |
370 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER)) | |
371 # define CYTHON_UNUSED __attribute__ ((__unused__)) | |
372 # else | |
373 # define CYTHON_UNUSED | |
374 # endif | |
375 #endif | |
376 typedef struct {PyObject **p; char *s; const Py_ssize_t n; const char* encoding; | |
377 const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry; /*proto*/ | |
378 | |
379 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0 | |
380 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0 | |
381 #define __PYX_DEFAULT_STRING_ENCODING "" | |
382 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString | |
383 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
384 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) ( \ | |
385 (sizeof(type) < sizeof(Py_ssize_t)) || \ | |
386 (sizeof(type) > sizeof(Py_ssize_t) && \ | |
387 likely(v < (type)PY_SSIZE_T_MAX || \ | |
388 v == (type)PY_SSIZE_T_MAX) && \ | |
389 (!is_signed || likely(v > (type)PY_SSIZE_T_MIN || \ | |
390 v == (type)PY_SSIZE_T_MIN))) || \ | |
391 (sizeof(type) == sizeof(Py_ssize_t) && \ | |
392 (is_signed || likely(v < (type)PY_SSIZE_T_MAX || \ | |
393 v == (type)PY_SSIZE_T_MAX))) ) | |
394 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*); | |
395 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length); | |
396 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s)) | |
397 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l) | |
398 #define __Pyx_PyBytes_FromString PyBytes_FromString | |
399 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize | |
400 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*); | |
401 #if PY_MAJOR_VERSION < 3 | |
402 #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString | |
403 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize | |
404 #else | |
405 #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString | |
406 #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize | |
407 #endif | |
408 #define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s)) | |
409 #define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s)) | |
410 #define __Pyx_PyObject_FromUString(s) __Pyx_PyObject_FromString((const char*)s) | |
411 #define __Pyx_PyBytes_FromUString(s) __Pyx_PyBytes_FromString((const char*)s) | |
412 #define __Pyx_PyByteArray_FromUString(s) __Pyx_PyByteArray_FromString((const char*)s) | |
413 #define __Pyx_PyStr_FromUString(s) __Pyx_PyStr_FromString((const char*)s) | |
414 #define __Pyx_PyUnicode_FromUString(s) __Pyx_PyUnicode_FromString((const char*)s) | |
415 #if PY_MAJOR_VERSION < 3 | |
416 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) | |
417 { | |
418 const Py_UNICODE *u_end = u; | |
419 while (*u_end++) ; | |
420 return (size_t)(u_end - u - 1); | |
421 } | |
422 #else | |
423 #define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen | |
424 #endif | |
425 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u)) | |
426 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode | |
427 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode | |
428 #define __Pyx_Owned_Py_None(b) (Py_INCREF(Py_None), Py_None) | |
429 #define __Pyx_PyBool_FromLong(b) ((b) ? (Py_INCREF(Py_True), Py_True) : (Py_INCREF(Py_False), Py_False)) | |
430 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*); | |
431 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x); | |
432 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*); | |
433 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t); | |
434 #if CYTHON_COMPILING_IN_CPYTHON | |
435 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x)) | |
436 #else | |
437 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x) | |
438 #endif | |
439 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x)) | |
440 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
441 static int __Pyx_sys_getdefaultencoding_not_ascii; | |
442 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
443 PyObject* sys; | |
444 PyObject* default_encoding = NULL; | |
445 PyObject* ascii_chars_u = NULL; | |
446 PyObject* ascii_chars_b = NULL; | |
447 const char* default_encoding_c; | |
448 sys = PyImport_ImportModule("sys"); | |
449 if (!sys) goto bad; | |
450 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); | |
451 Py_DECREF(sys); | |
452 if (!default_encoding) goto bad; | |
453 default_encoding_c = PyBytes_AsString(default_encoding); | |
454 if (!default_encoding_c) goto bad; | |
455 if (strcmp(default_encoding_c, "ascii") == 0) { | |
456 __Pyx_sys_getdefaultencoding_not_ascii = 0; | |
457 } else { | |
458 char ascii_chars[128]; | |
459 int c; | |
460 for (c = 0; c < 128; c++) { | |
461 ascii_chars[c] = c; | |
462 } | |
463 __Pyx_sys_getdefaultencoding_not_ascii = 1; | |
464 ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL); | |
465 if (!ascii_chars_u) goto bad; | |
466 ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL); | |
467 if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) { | |
468 PyErr_Format( | |
469 PyExc_ValueError, | |
470 "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.", | |
471 default_encoding_c); | |
472 goto bad; | |
473 } | |
474 Py_DECREF(ascii_chars_u); | |
475 Py_DECREF(ascii_chars_b); | |
476 } | |
477 Py_DECREF(default_encoding); | |
478 return 0; | |
479 bad: | |
480 Py_XDECREF(default_encoding); | |
481 Py_XDECREF(ascii_chars_u); | |
482 Py_XDECREF(ascii_chars_b); | |
483 return -1; | |
484 } | |
485 #endif | |
486 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3 | |
487 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL) | |
488 #else | |
489 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL) | |
490 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
491 static char* __PYX_DEFAULT_STRING_ENCODING; | |
492 static int __Pyx_init_sys_getdefaultencoding_params(void) { | |
493 PyObject* sys; | |
494 PyObject* default_encoding = NULL; | |
495 char* default_encoding_c; | |
496 sys = PyImport_ImportModule("sys"); | |
497 if (!sys) goto bad; | |
498 default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL); | |
499 Py_DECREF(sys); | |
500 if (!default_encoding) goto bad; | |
501 default_encoding_c = PyBytes_AsString(default_encoding); | |
502 if (!default_encoding_c) goto bad; | |
503 __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c)); | |
504 if (!__PYX_DEFAULT_STRING_ENCODING) goto bad; | |
505 strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c); | |
506 Py_DECREF(default_encoding); | |
507 return 0; | |
508 bad: | |
509 Py_XDECREF(default_encoding); | |
510 return -1; | |
511 } | |
512 #endif | |
513 #endif | |
514 | |
515 | |
516 /* Test for GCC > 2.95 */ | |
517 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95))) | |
518 #define likely(x) __builtin_expect(!!(x), 1) | |
519 #define unlikely(x) __builtin_expect(!!(x), 0) | |
520 #else /* !__GNUC__ or GCC < 2.95 */ | |
521 #define likely(x) (x) | |
522 #define unlikely(x) (x) | |
523 #endif /* __GNUC__ */ | |
524 | |
525 static PyObject *__pyx_m; | |
526 static PyObject *__pyx_d; | |
527 static PyObject *__pyx_b; | |
528 static PyObject *__pyx_empty_tuple; | |
529 static PyObject *__pyx_empty_bytes; | |
530 static int __pyx_lineno; | |
531 static int __pyx_clineno = 0; | |
532 static const char * __pyx_cfilenm= __FILE__; | |
533 static const char *__pyx_filename; | |
534 | |
535 #if !defined(CYTHON_CCOMPLEX) | |
536 #if defined(__cplusplus) | |
537 #define CYTHON_CCOMPLEX 1 | |
538 #elif defined(_Complex_I) | |
539 #define CYTHON_CCOMPLEX 1 | |
540 #else | |
541 #define CYTHON_CCOMPLEX 0 | |
542 #endif | |
543 #endif | |
544 #if CYTHON_CCOMPLEX | |
545 #ifdef __cplusplus | |
546 #include <complex> | |
547 #else | |
548 #include <complex.h> | |
549 #endif | |
550 #endif | |
551 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__) | |
552 #undef _Complex_I | |
553 #define _Complex_I 1.0fj | |
554 #endif | |
555 | |
556 | |
557 static const char *__pyx_f[] = { | |
558 "FastAlignmentArrays.pyx", | |
559 "__init__.pxd", | |
560 "type.pxd", | |
561 "bool.pxd", | |
562 "complex.pxd", | |
563 }; | |
564 | |
565 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":723 | |
566 * # in Cython to enable them only on the right systems. | |
567 * | |
568 * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<< | |
569 * ctypedef npy_int16 int16_t | |
570 * ctypedef npy_int32 int32_t | |
571 */ | |
572 typedef npy_int8 __pyx_t_5numpy_int8_t; | |
573 | |
574 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":724 | |
575 * | |
576 * ctypedef npy_int8 int8_t | |
577 * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<< | |
578 * ctypedef npy_int32 int32_t | |
579 * ctypedef npy_int64 int64_t | |
580 */ | |
581 typedef npy_int16 __pyx_t_5numpy_int16_t; | |
582 | |
583 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":725 | |
584 * ctypedef npy_int8 int8_t | |
585 * ctypedef npy_int16 int16_t | |
586 * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<< | |
587 * ctypedef npy_int64 int64_t | |
588 * #ctypedef npy_int96 int96_t | |
589 */ | |
590 typedef npy_int32 __pyx_t_5numpy_int32_t; | |
591 | |
592 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":726 | |
593 * ctypedef npy_int16 int16_t | |
594 * ctypedef npy_int32 int32_t | |
595 * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<< | |
596 * #ctypedef npy_int96 int96_t | |
597 * #ctypedef npy_int128 int128_t | |
598 */ | |
599 typedef npy_int64 __pyx_t_5numpy_int64_t; | |
600 | |
601 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":730 | |
602 * #ctypedef npy_int128 int128_t | |
603 * | |
604 * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<< | |
605 * ctypedef npy_uint16 uint16_t | |
606 * ctypedef npy_uint32 uint32_t | |
607 */ | |
608 typedef npy_uint8 __pyx_t_5numpy_uint8_t; | |
609 | |
610 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":731 | |
611 * | |
612 * ctypedef npy_uint8 uint8_t | |
613 * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<< | |
614 * ctypedef npy_uint32 uint32_t | |
615 * ctypedef npy_uint64 uint64_t | |
616 */ | |
617 typedef npy_uint16 __pyx_t_5numpy_uint16_t; | |
618 | |
619 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":732 | |
620 * ctypedef npy_uint8 uint8_t | |
621 * ctypedef npy_uint16 uint16_t | |
622 * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<< | |
623 * ctypedef npy_uint64 uint64_t | |
624 * #ctypedef npy_uint96 uint96_t | |
625 */ | |
626 typedef npy_uint32 __pyx_t_5numpy_uint32_t; | |
627 | |
628 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":733 | |
629 * ctypedef npy_uint16 uint16_t | |
630 * ctypedef npy_uint32 uint32_t | |
631 * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<< | |
632 * #ctypedef npy_uint96 uint96_t | |
633 * #ctypedef npy_uint128 uint128_t | |
634 */ | |
635 typedef npy_uint64 __pyx_t_5numpy_uint64_t; | |
636 | |
637 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":737 | |
638 * #ctypedef npy_uint128 uint128_t | |
639 * | |
640 * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<< | |
641 * ctypedef npy_float64 float64_t | |
642 * #ctypedef npy_float80 float80_t | |
643 */ | |
644 typedef npy_float32 __pyx_t_5numpy_float32_t; | |
645 | |
646 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":738 | |
647 * | |
648 * ctypedef npy_float32 float32_t | |
649 * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<< | |
650 * #ctypedef npy_float80 float80_t | |
651 * #ctypedef npy_float128 float128_t | |
652 */ | |
653 typedef npy_float64 __pyx_t_5numpy_float64_t; | |
654 | |
655 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":747 | |
656 * # The int types are mapped a bit surprising -- | |
657 * # numpy.int corresponds to 'l' and numpy.long to 'q' | |
658 * ctypedef npy_long int_t # <<<<<<<<<<<<<< | |
659 * ctypedef npy_longlong long_t | |
660 * ctypedef npy_longlong longlong_t | |
661 */ | |
662 typedef npy_long __pyx_t_5numpy_int_t; | |
663 | |
664 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":748 | |
665 * # numpy.int corresponds to 'l' and numpy.long to 'q' | |
666 * ctypedef npy_long int_t | |
667 * ctypedef npy_longlong long_t # <<<<<<<<<<<<<< | |
668 * ctypedef npy_longlong longlong_t | |
669 * | |
670 */ | |
671 typedef npy_longlong __pyx_t_5numpy_long_t; | |
672 | |
673 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":749 | |
674 * ctypedef npy_long int_t | |
675 * ctypedef npy_longlong long_t | |
676 * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<< | |
677 * | |
678 * ctypedef npy_ulong uint_t | |
679 */ | |
680 typedef npy_longlong __pyx_t_5numpy_longlong_t; | |
681 | |
682 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":751 | |
683 * ctypedef npy_longlong longlong_t | |
684 * | |
685 * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<< | |
686 * ctypedef npy_ulonglong ulong_t | |
687 * ctypedef npy_ulonglong ulonglong_t | |
688 */ | |
689 typedef npy_ulong __pyx_t_5numpy_uint_t; | |
690 | |
691 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":752 | |
692 * | |
693 * ctypedef npy_ulong uint_t | |
694 * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<< | |
695 * ctypedef npy_ulonglong ulonglong_t | |
696 * | |
697 */ | |
698 typedef npy_ulonglong __pyx_t_5numpy_ulong_t; | |
699 | |
700 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":753 | |
701 * ctypedef npy_ulong uint_t | |
702 * ctypedef npy_ulonglong ulong_t | |
703 * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<< | |
704 * | |
705 * ctypedef npy_intp intp_t | |
706 */ | |
707 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t; | |
708 | |
709 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":755 | |
710 * ctypedef npy_ulonglong ulonglong_t | |
711 * | |
712 * ctypedef npy_intp intp_t # <<<<<<<<<<<<<< | |
713 * ctypedef npy_uintp uintp_t | |
714 * | |
715 */ | |
716 typedef npy_intp __pyx_t_5numpy_intp_t; | |
717 | |
718 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":756 | |
719 * | |
720 * ctypedef npy_intp intp_t | |
721 * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<< | |
722 * | |
723 * ctypedef npy_double float_t | |
724 */ | |
725 typedef npy_uintp __pyx_t_5numpy_uintp_t; | |
726 | |
727 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":758 | |
728 * ctypedef npy_uintp uintp_t | |
729 * | |
730 * ctypedef npy_double float_t # <<<<<<<<<<<<<< | |
731 * ctypedef npy_double double_t | |
732 * ctypedef npy_longdouble longdouble_t | |
733 */ | |
734 typedef npy_double __pyx_t_5numpy_float_t; | |
735 | |
736 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":759 | |
737 * | |
738 * ctypedef npy_double float_t | |
739 * ctypedef npy_double double_t # <<<<<<<<<<<<<< | |
740 * ctypedef npy_longdouble longdouble_t | |
741 * | |
742 */ | |
743 typedef npy_double __pyx_t_5numpy_double_t; | |
744 | |
745 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":760 | |
746 * ctypedef npy_double float_t | |
747 * ctypedef npy_double double_t | |
748 * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<< | |
749 * | |
750 * ctypedef npy_cfloat cfloat_t | |
751 */ | |
752 typedef npy_longdouble __pyx_t_5numpy_longdouble_t; | |
753 #if CYTHON_CCOMPLEX | |
754 #ifdef __cplusplus | |
755 typedef ::std::complex< float > __pyx_t_float_complex; | |
756 #else | |
757 typedef float _Complex __pyx_t_float_complex; | |
758 #endif | |
759 #else | |
760 typedef struct { float real, imag; } __pyx_t_float_complex; | |
761 #endif | |
762 | |
763 #if CYTHON_CCOMPLEX | |
764 #ifdef __cplusplus | |
765 typedef ::std::complex< double > __pyx_t_double_complex; | |
766 #else | |
767 typedef double _Complex __pyx_t_double_complex; | |
768 #endif | |
769 #else | |
770 typedef struct { double real, imag; } __pyx_t_double_complex; | |
771 #endif | |
772 | |
773 | |
774 /*--- Type declarations ---*/ | |
775 | |
776 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":762 | |
777 * ctypedef npy_longdouble longdouble_t | |
778 * | |
779 * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<< | |
780 * ctypedef npy_cdouble cdouble_t | |
781 * ctypedef npy_clongdouble clongdouble_t | |
782 */ | |
783 typedef npy_cfloat __pyx_t_5numpy_cfloat_t; | |
784 | |
785 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":763 | |
786 * | |
787 * ctypedef npy_cfloat cfloat_t | |
788 * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<< | |
789 * ctypedef npy_clongdouble clongdouble_t | |
790 * | |
791 */ | |
792 typedef npy_cdouble __pyx_t_5numpy_cdouble_t; | |
793 | |
794 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":764 | |
795 * ctypedef npy_cfloat cfloat_t | |
796 * ctypedef npy_cdouble cdouble_t | |
797 * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<< | |
798 * | |
799 * ctypedef npy_cdouble complex_t | |
800 */ | |
801 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t; | |
802 | |
803 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":766 | |
804 * ctypedef npy_clongdouble clongdouble_t | |
805 * | |
806 * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<< | |
807 * | |
808 * cdef inline object PyArray_MultiIterNew1(a): | |
809 */ | |
810 typedef npy_cdouble __pyx_t_5numpy_complex_t; | |
811 #ifndef CYTHON_REFNANNY | |
812 #define CYTHON_REFNANNY 0 | |
813 #endif | |
814 #if CYTHON_REFNANNY | |
815 typedef struct { | |
816 void (*INCREF)(void*, PyObject*, int); | |
817 void (*DECREF)(void*, PyObject*, int); | |
818 void (*GOTREF)(void*, PyObject*, int); | |
819 void (*GIVEREF)(void*, PyObject*, int); | |
820 void* (*SetupContext)(const char*, int, const char*); | |
821 void (*FinishContext)(void**); | |
822 } __Pyx_RefNannyAPIStruct; | |
823 static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL; | |
824 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname); /*proto*/ | |
825 #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL; | |
826 #ifdef WITH_THREAD | |
827 #define __Pyx_RefNannySetupContext(name, acquire_gil) \ | |
828 if (acquire_gil) { \ | |
829 PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure(); \ | |
830 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ | |
831 PyGILState_Release(__pyx_gilstate_save); \ | |
832 } else { \ | |
833 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__); \ | |
834 } | |
835 #else | |
836 #define __Pyx_RefNannySetupContext(name, acquire_gil) \ | |
837 __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__) | |
838 #endif | |
839 #define __Pyx_RefNannyFinishContext() \ | |
840 __Pyx_RefNanny->FinishContext(&__pyx_refnanny) | |
841 #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
842 #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
843 #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
844 #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__) | |
845 #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0) | |
846 #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0) | |
847 #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0) | |
848 #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0) | |
849 #else | |
850 #define __Pyx_RefNannyDeclarations | |
851 #define __Pyx_RefNannySetupContext(name, acquire_gil) | |
852 #define __Pyx_RefNannyFinishContext() | |
853 #define __Pyx_INCREF(r) Py_INCREF(r) | |
854 #define __Pyx_DECREF(r) Py_DECREF(r) | |
855 #define __Pyx_GOTREF(r) | |
856 #define __Pyx_GIVEREF(r) | |
857 #define __Pyx_XINCREF(r) Py_XINCREF(r) | |
858 #define __Pyx_XDECREF(r) Py_XDECREF(r) | |
859 #define __Pyx_XGOTREF(r) | |
860 #define __Pyx_XGIVEREF(r) | |
861 #endif /* CYTHON_REFNANNY */ | |
862 #define __Pyx_XDECREF_SET(r, v) do { \ | |
863 PyObject *tmp = (PyObject *) r; \ | |
864 r = v; __Pyx_XDECREF(tmp); \ | |
865 } while (0) | |
866 #define __Pyx_DECREF_SET(r, v) do { \ | |
867 PyObject *tmp = (PyObject *) r; \ | |
868 r = v; __Pyx_DECREF(tmp); \ | |
869 } while (0) | |
870 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0) | |
871 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0) | |
872 | |
873 #if CYTHON_COMPILING_IN_CPYTHON | |
874 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) { | |
875 PyTypeObject* tp = Py_TYPE(obj); | |
876 if (likely(tp->tp_getattro)) | |
877 return tp->tp_getattro(obj, attr_name); | |
878 #if PY_MAJOR_VERSION < 3 | |
879 if (likely(tp->tp_getattr)) | |
880 return tp->tp_getattr(obj, PyString_AS_STRING(attr_name)); | |
881 #endif | |
882 return PyObject_GetAttr(obj, attr_name); | |
883 } | |
884 #else | |
885 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n) | |
886 #endif | |
887 | |
888 static PyObject *__Pyx_GetBuiltinName(PyObject *name); /*proto*/ | |
889 | |
890 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact, | |
891 Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found); /*proto*/ | |
892 | |
893 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name); /*proto*/ | |
894 | |
895 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[], \ | |
896 PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args, \ | |
897 const char* function_name); /*proto*/ | |
898 | |
899 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name); /*proto*/ | |
900 | |
901 #if CYTHON_COMPILING_IN_CPYTHON | |
902 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw); /*proto*/ | |
903 #else | |
904 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw) | |
905 #endif | |
906 | |
907 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type); /*proto*/ | |
908 | |
909 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ | |
910 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ | |
911 __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) : \ | |
912 (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) : \ | |
913 __Pyx_GetItemInt_Generic(o, to_py_func(i)))) | |
914 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ | |
915 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ | |
916 __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ | |
917 (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL)) | |
918 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
919 int wraparound, int boundscheck); | |
920 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck) \ | |
921 (__Pyx_fits_Py_ssize_t(i, type, is_signed) ? \ | |
922 __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) : \ | |
923 (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL)) | |
924 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
925 int wraparound, int boundscheck); | |
926 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j); | |
927 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, | |
928 int is_list, int wraparound, int boundscheck); | |
929 | |
930 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, | |
931 const char *name, int exact); /*proto*/ | |
932 | |
933 #if CYTHON_COMPILING_IN_CPYTHON | |
934 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) { | |
935 PyListObject* L = (PyListObject*) list; | |
936 Py_ssize_t len = Py_SIZE(list); | |
937 if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) { | |
938 Py_INCREF(x); | |
939 PyList_SET_ITEM(list, len, x); | |
940 Py_SIZE(list) = len+1; | |
941 return 0; | |
942 } | |
943 return PyList_Append(list, x); | |
944 } | |
945 #else | |
946 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x) | |
947 #endif | |
948 | |
949 #include <string.h> | |
950 | |
951 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ | |
952 | |
953 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals); /*proto*/ | |
954 | |
955 #if PY_MAJOR_VERSION >= 3 | |
956 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals | |
957 #else | |
958 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals | |
959 #endif | |
960 | |
961 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected); | |
962 | |
963 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index); | |
964 | |
965 static CYTHON_INLINE int __Pyx_IterFinish(void); /*proto*/ | |
966 | |
967 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected); /*proto*/ | |
968 | |
969 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb); /*proto*/ | |
970 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb); /*proto*/ | |
971 | |
972 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause); /*proto*/ | |
973 | |
974 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void); | |
975 | |
976 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type); | |
977 | |
978 #define __Pyx_CyFunction_USED 1 | |
979 #include <structmember.h> | |
980 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01 | |
981 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02 | |
982 #define __Pyx_CYFUNCTION_CCLASS 0x04 | |
983 #define __Pyx_CyFunction_GetClosure(f) \ | |
984 (((__pyx_CyFunctionObject *) (f))->func_closure) | |
985 #define __Pyx_CyFunction_GetClassObj(f) \ | |
986 (((__pyx_CyFunctionObject *) (f))->func_classobj) | |
987 #define __Pyx_CyFunction_Defaults(type, f) \ | |
988 ((type *)(((__pyx_CyFunctionObject *) (f))->defaults)) | |
989 #define __Pyx_CyFunction_SetDefaultsGetter(f, g) \ | |
990 ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g) | |
991 typedef struct { | |
992 PyCFunctionObject func; | |
993 PyObject *func_dict; | |
994 PyObject *func_weakreflist; | |
995 PyObject *func_name; | |
996 PyObject *func_qualname; | |
997 PyObject *func_doc; | |
998 PyObject *func_globals; | |
999 PyObject *func_code; | |
1000 PyObject *func_closure; | |
1001 PyObject *func_classobj; /* No-args super() class cell */ | |
1002 void *defaults; | |
1003 int defaults_pyobjects; | |
1004 int flags; | |
1005 PyObject *defaults_tuple; /* Const defaults tuple */ | |
1006 PyObject *defaults_kwdict; /* Const kwonly defaults dict */ | |
1007 PyObject *(*defaults_getter)(PyObject *); | |
1008 PyObject *func_annotations; /* function annotations dict */ | |
1009 } __pyx_CyFunctionObject; | |
1010 static PyTypeObject *__pyx_CyFunctionType = 0; | |
1011 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code) \ | |
1012 __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code) | |
1013 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml, | |
1014 int flags, PyObject* qualname, | |
1015 PyObject *self, | |
1016 PyObject *module, PyObject *globals, | |
1017 PyObject* code); | |
1018 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m, | |
1019 size_t size, | |
1020 int pyobjects); | |
1021 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m, | |
1022 PyObject *tuple); | |
1023 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m, | |
1024 PyObject *dict); | |
1025 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m, | |
1026 PyObject *dict); | |
1027 static int __Pyx_CyFunction_init(void); | |
1028 | |
1029 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases); | |
1030 | |
1031 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname, | |
1032 PyObject *mkw, PyObject *modname, PyObject *doc); /*proto*/ | |
1033 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict, | |
1034 PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass); /*proto*/ | |
1035 | |
1036 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level); /*proto*/ | |
1037 | |
1038 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value); | |
1039 | |
1040 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *); | |
1041 | |
1042 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value); | |
1043 | |
1044 #if CYTHON_CCOMPLEX | |
1045 #ifdef __cplusplus | |
1046 #define __Pyx_CREAL(z) ((z).real()) | |
1047 #define __Pyx_CIMAG(z) ((z).imag()) | |
1048 #else | |
1049 #define __Pyx_CREAL(z) (__real__(z)) | |
1050 #define __Pyx_CIMAG(z) (__imag__(z)) | |
1051 #endif | |
1052 #else | |
1053 #define __Pyx_CREAL(z) ((z).real) | |
1054 #define __Pyx_CIMAG(z) ((z).imag) | |
1055 #endif | |
1056 #if (defined(_WIN32) || defined(__clang__)) && defined(__cplusplus) && CYTHON_CCOMPLEX | |
1057 #define __Pyx_SET_CREAL(z,x) ((z).real(x)) | |
1058 #define __Pyx_SET_CIMAG(z,y) ((z).imag(y)) | |
1059 #else | |
1060 #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x) | |
1061 #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y) | |
1062 #endif | |
1063 | |
1064 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float); | |
1065 | |
1066 #if CYTHON_CCOMPLEX | |
1067 #define __Pyx_c_eqf(a, b) ((a)==(b)) | |
1068 #define __Pyx_c_sumf(a, b) ((a)+(b)) | |
1069 #define __Pyx_c_difff(a, b) ((a)-(b)) | |
1070 #define __Pyx_c_prodf(a, b) ((a)*(b)) | |
1071 #define __Pyx_c_quotf(a, b) ((a)/(b)) | |
1072 #define __Pyx_c_negf(a) (-(a)) | |
1073 #ifdef __cplusplus | |
1074 #define __Pyx_c_is_zerof(z) ((z)==(float)0) | |
1075 #define __Pyx_c_conjf(z) (::std::conj(z)) | |
1076 #if 1 | |
1077 #define __Pyx_c_absf(z) (::std::abs(z)) | |
1078 #define __Pyx_c_powf(a, b) (::std::pow(a, b)) | |
1079 #endif | |
1080 #else | |
1081 #define __Pyx_c_is_zerof(z) ((z)==0) | |
1082 #define __Pyx_c_conjf(z) (conjf(z)) | |
1083 #if 1 | |
1084 #define __Pyx_c_absf(z) (cabsf(z)) | |
1085 #define __Pyx_c_powf(a, b) (cpowf(a, b)) | |
1086 #endif | |
1087 #endif | |
1088 #else | |
1089 static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex, __pyx_t_float_complex); | |
1090 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex, __pyx_t_float_complex); | |
1091 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex, __pyx_t_float_complex); | |
1092 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex, __pyx_t_float_complex); | |
1093 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex, __pyx_t_float_complex); | |
1094 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex); | |
1095 static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex); | |
1096 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex); | |
1097 #if 1 | |
1098 static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex); | |
1099 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex, __pyx_t_float_complex); | |
1100 #endif | |
1101 #endif | |
1102 | |
1103 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double); | |
1104 | |
1105 #if CYTHON_CCOMPLEX | |
1106 #define __Pyx_c_eq(a, b) ((a)==(b)) | |
1107 #define __Pyx_c_sum(a, b) ((a)+(b)) | |
1108 #define __Pyx_c_diff(a, b) ((a)-(b)) | |
1109 #define __Pyx_c_prod(a, b) ((a)*(b)) | |
1110 #define __Pyx_c_quot(a, b) ((a)/(b)) | |
1111 #define __Pyx_c_neg(a) (-(a)) | |
1112 #ifdef __cplusplus | |
1113 #define __Pyx_c_is_zero(z) ((z)==(double)0) | |
1114 #define __Pyx_c_conj(z) (::std::conj(z)) | |
1115 #if 1 | |
1116 #define __Pyx_c_abs(z) (::std::abs(z)) | |
1117 #define __Pyx_c_pow(a, b) (::std::pow(a, b)) | |
1118 #endif | |
1119 #else | |
1120 #define __Pyx_c_is_zero(z) ((z)==0) | |
1121 #define __Pyx_c_conj(z) (conj(z)) | |
1122 #if 1 | |
1123 #define __Pyx_c_abs(z) (cabs(z)) | |
1124 #define __Pyx_c_pow(a, b) (cpow(a, b)) | |
1125 #endif | |
1126 #endif | |
1127 #else | |
1128 static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex, __pyx_t_double_complex); | |
1129 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex, __pyx_t_double_complex); | |
1130 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex, __pyx_t_double_complex); | |
1131 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex, __pyx_t_double_complex); | |
1132 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex, __pyx_t_double_complex); | |
1133 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex); | |
1134 static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex); | |
1135 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex); | |
1136 #if 1 | |
1137 static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex); | |
1138 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex, __pyx_t_double_complex); | |
1139 #endif | |
1140 #endif | |
1141 | |
1142 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *); | |
1143 | |
1144 static int __Pyx_check_binary_version(void); | |
1145 | |
1146 #if !defined(__Pyx_PyIdentifier_FromString) | |
1147 #if PY_MAJOR_VERSION < 3 | |
1148 #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s) | |
1149 #else | |
1150 #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s) | |
1151 #endif | |
1152 #endif | |
1153 | |
1154 static PyObject *__Pyx_ImportModule(const char *name); /*proto*/ | |
1155 | |
1156 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict); /*proto*/ | |
1157 | |
1158 typedef struct { | |
1159 int code_line; | |
1160 PyCodeObject* code_object; | |
1161 } __Pyx_CodeObjectCacheEntry; | |
1162 struct __Pyx_CodeObjectCache { | |
1163 int count; | |
1164 int max_count; | |
1165 __Pyx_CodeObjectCacheEntry* entries; | |
1166 }; | |
1167 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL}; | |
1168 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line); | |
1169 static PyCodeObject *__pyx_find_code_object(int code_line); | |
1170 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object); | |
1171 | |
1172 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
1173 int py_line, const char *filename); /*proto*/ | |
1174 | |
1175 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t); /*proto*/ | |
1176 | |
1177 | |
1178 /* Module declarations from 'cpython.buffer' */ | |
1179 | |
1180 /* Module declarations from 'cpython.ref' */ | |
1181 | |
1182 /* Module declarations from 'libc.string' */ | |
1183 | |
1184 /* Module declarations from 'libc.stdio' */ | |
1185 | |
1186 /* Module declarations from 'cpython.object' */ | |
1187 | |
1188 /* Module declarations from '__builtin__' */ | |
1189 | |
1190 /* Module declarations from 'cpython.type' */ | |
1191 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0; | |
1192 | |
1193 /* Module declarations from 'libc.stdlib' */ | |
1194 | |
1195 /* Module declarations from 'numpy' */ | |
1196 | |
1197 /* Module declarations from 'numpy' */ | |
1198 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0; | |
1199 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0; | |
1200 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0; | |
1201 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0; | |
1202 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0; | |
1203 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/ | |
1204 | |
1205 /* Module declarations from 'cpython.version' */ | |
1206 | |
1207 /* Module declarations from 'cpython.exc' */ | |
1208 | |
1209 /* Module declarations from 'cpython.module' */ | |
1210 | |
1211 /* Module declarations from 'cpython.mem' */ | |
1212 | |
1213 /* Module declarations from 'cpython.tuple' */ | |
1214 | |
1215 /* Module declarations from 'cpython.list' */ | |
1216 | |
1217 /* Module declarations from 'cpython.sequence' */ | |
1218 | |
1219 /* Module declarations from 'cpython.mapping' */ | |
1220 | |
1221 /* Module declarations from 'cpython.iterator' */ | |
1222 | |
1223 /* Module declarations from 'cpython.number' */ | |
1224 | |
1225 /* Module declarations from 'cpython.int' */ | |
1226 | |
1227 /* Module declarations from '__builtin__' */ | |
1228 | |
1229 /* Module declarations from 'cpython.bool' */ | |
1230 static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0; | |
1231 | |
1232 /* Module declarations from 'cpython.long' */ | |
1233 | |
1234 /* Module declarations from 'cpython.float' */ | |
1235 | |
1236 /* Module declarations from '__builtin__' */ | |
1237 | |
1238 /* Module declarations from 'cpython.complex' */ | |
1239 static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0; | |
1240 | |
1241 /* Module declarations from 'cpython.string' */ | |
1242 | |
1243 /* Module declarations from 'cpython.unicode' */ | |
1244 | |
1245 /* Module declarations from 'cpython.dict' */ | |
1246 | |
1247 /* Module declarations from 'cpython.instance' */ | |
1248 | |
1249 /* Module declarations from 'cpython.function' */ | |
1250 | |
1251 /* Module declarations from 'cpython.method' */ | |
1252 | |
1253 /* Module declarations from 'cpython.weakref' */ | |
1254 | |
1255 /* Module declarations from 'cpython.getargs' */ | |
1256 | |
1257 /* Module declarations from 'cpython.pythread' */ | |
1258 | |
1259 /* Module declarations from 'cpython.pystate' */ | |
1260 | |
1261 /* Module declarations from 'cpython.cobject' */ | |
1262 | |
1263 /* Module declarations from 'cpython.oldbuffer' */ | |
1264 | |
1265 /* Module declarations from 'cpython.set' */ | |
1266 | |
1267 /* Module declarations from 'cpython.bytes' */ | |
1268 | |
1269 /* Module declarations from 'cpython.pycapsule' */ | |
1270 | |
1271 /* Module declarations from 'cpython' */ | |
1272 | |
1273 /* Module declarations from 'MultipleOMR.Alignment.FastAlignmentArrays' */ | |
1274 static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG; | |
1275 static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP; | |
1276 static int __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT; | |
1277 static float __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_score; | |
1278 #define __Pyx_MODULE_NAME "MultipleOMR.Alignment.FastAlignmentArrays" | |
1279 int __pyx_module_is_main_MultipleOMR__Alignment__FastAlignmentArrays = 0; | |
1280 | |
1281 /* Implementation of 'MultipleOMR.Alignment.FastAlignmentArrays' */ | |
1282 static PyObject *__pyx_builtin_range; | |
1283 static PyObject *__pyx_builtin_ValueError; | |
1284 static PyObject *__pyx_builtin_RuntimeError; | |
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 */ | |
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 */ | |
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 */ | |
1288 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */ | |
1289 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */ | |
1290 static char __pyx_k_B[] = "B"; | |
1291 static char __pyx_k_H[] = "H"; | |
1292 static char __pyx_k_I[] = "I"; | |
1293 static char __pyx_k_L[] = "L"; | |
1294 static char __pyx_k_O[] = "O"; | |
1295 static char __pyx_k_Q[] = "Q"; | |
1296 static char __pyx_k_b[] = "b"; | |
1297 static char __pyx_k_d[] = "d"; | |
1298 static char __pyx_k_f[] = "f"; | |
1299 static char __pyx_k_g[] = "g"; | |
1300 static char __pyx_k_h[] = "h"; | |
1301 static char __pyx_k_i[] = "i"; | |
1302 static char __pyx_k_j[] = "j"; | |
1303 static char __pyx_k_l[] = "l"; | |
1304 static char __pyx_k_m[] = "m"; | |
1305 static char __pyx_k_n[] = "n"; | |
1306 static char __pyx_k_p[] = "p"; | |
1307 static char __pyx_k_q[] = "q"; | |
1308 static char __pyx_k_s[] = "s"; | |
1309 static char __pyx_k_Zd[] = "Zd"; | |
1310 static char __pyx_k_Zf[] = "Zf"; | |
1311 static char __pyx_k_Zg[] = "Zg"; | |
1312 static char __pyx_k__5[] = "*"; | |
1313 static char __pyx_k_np[] = "np"; | |
1314 static char __pyx_k_GAP[] = "[GAP]"; | |
1315 static char __pyx_k_doc[] = "__doc__"; | |
1316 static char __pyx_k_ptr[] = "ptr"; | |
1317 static char __pyx_k_curr[] = "curr"; | |
1318 static char __pyx_k_gap1[] = "gap1"; | |
1319 static char __pyx_k_gap2[] = "gap2"; | |
1320 static char __pyx_k_main[] = "__main__"; | |
1321 static char __pyx_k_self[] = "self"; | |
1322 static char __pyx_k_seq1[] = "seq1"; | |
1323 static char __pyx_k_seq2[] = "seq2"; | |
1324 static char __pyx_k_test[] = "__test__"; | |
1325 static char __pyx_k_dtype[] = "dtype"; | |
1326 static char __pyx_k_indel[] = "indel"; | |
1327 static char __pyx_k_index[] = "index"; | |
1328 static char __pyx_k_numpy[] = "numpy"; | |
1329 static char __pyx_k_range[] = "range"; | |
1330 static char __pyx_k_score[] = "score"; | |
1331 static char __pyx_k_zeros[] = "zeros"; | |
1332 static char __pyx_k_align1[] = "align1"; | |
1333 static char __pyx_k_align2[] = "align2"; | |
1334 static char __pyx_k_import[] = "__import__"; | |
1335 static char __pyx_k_isFast[] = "isFast"; | |
1336 static char __pyx_k_maxlen[] = "maxlen"; | |
1337 static char __pyx_k_module[] = "__module__"; | |
1338 static char __pyx_k_myseq1[] = "myseq1"; | |
1339 static char __pyx_k_myseq2[] = "myseq2"; | |
1340 static char __pyx_k_NWunsch[] = "NWunsch"; | |
1341 static char __pyx_k_prepare[] = "__prepare__"; | |
1342 static char __pyx_k_qualname[] = "__qualname__"; | |
1343 static char __pyx_k_alignment[] = "alignment"; | |
1344 static char __pyx_k_metaclass[] = "__metaclass__"; | |
1345 static char __pyx_k_ValueError[] = "ValueError"; | |
1346 static char __pyx_k_align1_gap[] = "align1_gap"; | |
1347 static char __pyx_k_align2_gap[] = "align2_gap"; | |
1348 static char __pyx_k_finalscore[] = "finalscore"; | |
1349 static char __pyx_k_RuntimeError[] = "RuntimeError"; | |
1350 static char __pyx_k_diagonalRange[] = "diagonalRange"; | |
1351 static char __pyx_k_needleman_wunsch[] = "needleman_wunsch"; | |
1352 static char __pyx_k_FastAlignmentArrays[] = "FastAlignmentArrays"; | |
1353 static char __pyx_k_NWunsch_getSimilarity[] = "NWunsch_getSimilarity"; | |
1354 static char __pyx_k_needleman_wunsch_trace[] = "__needleman_wunsch_trace"; | |
1355 static char __pyx_k_needleman_wunsch_matrix[] = "__needleman_wunsch_matrix"; | |
1356 static char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous"; | |
1357 static char __pyx_k_FastAlignmentArrays__needleman[] = "_FastAlignmentArrays__needleman_wunsch_matrix"; | |
1358 static char __pyx_k_C_LICA_OMR_PythonV4_MultipleOMR[] = "C:\\LICA\\OMR_PythonV4\\MultipleOMR\\Alignment\\FastAlignmentArrays.pyx"; | |
1359 static char __pyx_k_FastAlignmentArrays___needleman[] = "FastAlignmentArrays.__needleman_wunsch_matrix"; | |
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"; | |
1361 static char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)"; | |
1362 static char __pyx_k_FastAlignmentArrays__needleman_2[] = "_FastAlignmentArrays__needleman_wunsch_trace"; | |
1363 static char __pyx_k_FastAlignmentArrays_needleman_wu[] = "FastAlignmentArrays.needleman_wunsch"; | |
1364 static char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd"; | |
1365 static char __pyx_k_MultipleOMR_Alignment_FastAlignm[] = "MultipleOMR.Alignment.FastAlignmentArrays"; | |
1366 static char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported"; | |
1367 static char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous"; | |
1368 static char __pyx_k_FastAlignmentArrays___needleman_2[] = "FastAlignmentArrays.__needleman_wunsch_trace"; | |
1369 static char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short."; | |
1370 static PyObject *__pyx_kp_s_C_LICA_OMR_PythonV4_MultipleOMR; | |
1371 static PyObject *__pyx_n_s_FastAlignmentArrays; | |
1372 static PyObject *__pyx_n_s_FastAlignmentArrays___needleman; | |
1373 static PyObject *__pyx_n_s_FastAlignmentArrays___needleman_2; | |
1374 static PyObject *__pyx_n_s_FastAlignmentArrays__needleman; | |
1375 static PyObject *__pyx_n_s_FastAlignmentArrays__needleman_2; | |
1376 static PyObject *__pyx_n_s_FastAlignmentArrays_needleman_wu; | |
1377 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor; | |
1378 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2; | |
1379 static PyObject *__pyx_kp_s_GAP; | |
1380 static PyObject *__pyx_n_s_MultipleOMR_Alignment_FastAlignm; | |
1381 static PyObject *__pyx_n_s_NWunsch; | |
1382 static PyObject *__pyx_n_s_NWunsch_getSimilarity; | |
1383 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor; | |
1384 static PyObject *__pyx_n_s_RuntimeError; | |
1385 static PyObject *__pyx_n_s_ValueError; | |
1386 static PyObject *__pyx_kp_s__5; | |
1387 static PyObject *__pyx_n_s_align1; | |
1388 static PyObject *__pyx_n_s_align1_gap; | |
1389 static PyObject *__pyx_n_s_align2; | |
1390 static PyObject *__pyx_n_s_align2_gap; | |
1391 static PyObject *__pyx_n_s_alignment; | |
1392 static PyObject *__pyx_n_s_curr; | |
1393 static PyObject *__pyx_n_s_diagonalRange; | |
1394 static PyObject *__pyx_n_s_doc; | |
1395 static PyObject *__pyx_n_s_dtype; | |
1396 static PyObject *__pyx_n_s_finalscore; | |
1397 static PyObject *__pyx_n_s_gap1; | |
1398 static PyObject *__pyx_n_s_gap2; | |
1399 static PyObject *__pyx_n_s_i; | |
1400 static PyObject *__pyx_n_s_import; | |
1401 static PyObject *__pyx_n_s_indel; | |
1402 static PyObject *__pyx_n_s_index; | |
1403 static PyObject *__pyx_n_s_isFast; | |
1404 static PyObject *__pyx_n_s_j; | |
1405 static PyObject *__pyx_n_s_m; | |
1406 static PyObject *__pyx_n_s_main; | |
1407 static PyObject *__pyx_n_s_maxlen; | |
1408 static PyObject *__pyx_n_s_metaclass; | |
1409 static PyObject *__pyx_n_s_module; | |
1410 static PyObject *__pyx_n_s_myseq1; | |
1411 static PyObject *__pyx_n_s_myseq2; | |
1412 static PyObject *__pyx_n_s_n; | |
1413 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous; | |
1414 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou; | |
1415 static PyObject *__pyx_n_s_needleman_wunsch; | |
1416 static PyObject *__pyx_n_s_needleman_wunsch_matrix; | |
1417 static PyObject *__pyx_n_s_needleman_wunsch_trace; | |
1418 static PyObject *__pyx_n_s_np; | |
1419 static PyObject *__pyx_n_s_numpy; | |
1420 static PyObject *__pyx_n_s_p; | |
1421 static PyObject *__pyx_n_s_prepare; | |
1422 static PyObject *__pyx_n_s_ptr; | |
1423 static PyObject *__pyx_n_s_q; | |
1424 static PyObject *__pyx_n_s_qualname; | |
1425 static PyObject *__pyx_n_s_range; | |
1426 static PyObject *__pyx_n_s_s; | |
1427 static PyObject *__pyx_n_s_score; | |
1428 static PyObject *__pyx_n_s_self; | |
1429 static PyObject *__pyx_n_s_seq1; | |
1430 static PyObject *__pyx_n_s_seq2; | |
1431 static PyObject *__pyx_n_s_test; | |
1432 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd; | |
1433 static PyObject *__pyx_n_s_zeros; | |
1434 static PyObject *__pyx_int_0; | |
1435 static PyObject *__pyx_int_1; | |
1436 static PyObject *__pyx_int_3; | |
1437 static PyObject *__pyx_int_350; | |
1438 static PyObject *__pyx_int_neg_1; | |
1439 static PyObject *__pyx_slice_; | |
1440 static PyObject *__pyx_slice__3; | |
1441 static PyObject *__pyx_tuple__2; | |
1442 static PyObject *__pyx_tuple__4; | |
1443 static PyObject *__pyx_tuple__6; | |
1444 static PyObject *__pyx_tuple__7; | |
1445 static PyObject *__pyx_tuple__8; | |
1446 static PyObject *__pyx_tuple__9; | |
1447 static PyObject *__pyx_tuple__10; | |
1448 static PyObject *__pyx_tuple__11; | |
1449 static PyObject *__pyx_tuple__12; | |
1450 static PyObject *__pyx_tuple__14; | |
1451 static PyObject *__pyx_tuple__16; | |
1452 static PyObject *__pyx_tuple__18; | |
1453 static PyObject *__pyx_codeobj__13; | |
1454 static PyObject *__pyx_codeobj__15; | |
1455 static PyObject *__pyx_codeobj__17; | |
1456 | |
1457 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 | |
1458 * class FastAlignmentArrays: | |
1459 * | |
1460 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< | |
1461 * """ | |
1462 * fill in the DP matrix according to the Needleman-Wunsch algorithm. | |
1463 */ | |
1464 | |
1465 /* Python wrapper */ | |
1466 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
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 "; | |
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)}; | |
1469 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_1__needleman_wunsch_matrix(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
1470 CYTHON_UNUSED PyObject *__pyx_v_self = 0; | |
1471 PyObject *__pyx_v_seq1 = 0; | |
1472 PyObject *__pyx_v_seq2 = 0; | |
1473 PyObject *__pyx_v_isFast = 0; | |
1474 int __pyx_lineno = 0; | |
1475 const char *__pyx_filename = NULL; | |
1476 int __pyx_clineno = 0; | |
1477 PyObject *__pyx_r = 0; | |
1478 __Pyx_RefNannyDeclarations | |
1479 __Pyx_RefNannySetupContext("__needleman_wunsch_matrix (wrapper)", 0); | |
1480 { | |
1481 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_isFast,0}; | |
1482 PyObject* values[4] = {0,0,0,0}; | |
1483 if (unlikely(__pyx_kwds)) { | |
1484 Py_ssize_t kw_args; | |
1485 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
1486 switch (pos_args) { | |
1487 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
1488 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
1489 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
1490 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
1491 case 0: break; | |
1492 default: goto __pyx_L5_argtuple_error; | |
1493 } | |
1494 kw_args = PyDict_Size(__pyx_kwds); | |
1495 switch (pos_args) { | |
1496 case 0: | |
1497 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; | |
1498 else goto __pyx_L5_argtuple_error; | |
1499 case 1: | |
1500 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; | |
1501 else { | |
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;} | |
1503 } | |
1504 case 2: | |
1505 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; | |
1506 else { | |
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;} | |
1508 } | |
1509 case 3: | |
1510 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isFast)) != 0)) kw_args--; | |
1511 else { | |
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;} | |
1513 } | |
1514 } | |
1515 if (unlikely(kw_args > 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;} | |
1517 } | |
1518 } else if (PyTuple_GET_SIZE(__pyx_args) != 4) { | |
1519 goto __pyx_L5_argtuple_error; | |
1520 } else { | |
1521 values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
1522 values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
1523 values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
1524 values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
1525 } | |
1526 __pyx_v_self = values[0]; | |
1527 __pyx_v_seq1 = values[1]; | |
1528 __pyx_v_seq2 = values[2]; | |
1529 __pyx_v_isFast = values[3]; | |
1530 } | |
1531 goto __pyx_L4_argument_unpacking_done; | |
1532 __pyx_L5_argtuple_error:; | |
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;} | |
1534 __pyx_L3_error:; | |
1535 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
1536 __Pyx_RefNannyFinishContext(); | |
1537 return NULL; | |
1538 __pyx_L4_argument_unpacking_done:; | |
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); | |
1540 | |
1541 /* function exit code */ | |
1542 __Pyx_RefNannyFinishContext(); | |
1543 return __pyx_r; | |
1544 } | |
1545 | |
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) { | |
1547 PyObject *__pyx_v_indel = NULL; | |
1548 int __pyx_v_n; | |
1549 int __pyx_v_m; | |
1550 PyArrayObject *__pyx_v_s = 0; | |
1551 PyArrayObject *__pyx_v_ptr = 0; | |
1552 int __pyx_v_i; | |
1553 int __pyx_v_j; | |
1554 int __pyx_v_p; | |
1555 int __pyx_v_q; | |
1556 PyObject *__pyx_v_diagonalRange = NULL; | |
1557 PyObject *__pyx_v_myseq1 = NULL; | |
1558 PyObject *__pyx_v_myseq2 = NULL; | |
1559 PyObject *__pyx_v_score = NULL; | |
1560 PyObject *__pyx_r = NULL; | |
1561 __Pyx_RefNannyDeclarations | |
1562 Py_ssize_t __pyx_t_1; | |
1563 PyObject *__pyx_t_2 = NULL; | |
1564 PyObject *__pyx_t_3 = NULL; | |
1565 PyObject *__pyx_t_4 = NULL; | |
1566 PyObject *__pyx_t_5 = NULL; | |
1567 long __pyx_t_6; | |
1568 int __pyx_t_7; | |
1569 int __pyx_t_8; | |
1570 int __pyx_t_9; | |
1571 int __pyx_t_10; | |
1572 long __pyx_t_11; | |
1573 int __pyx_t_12; | |
1574 int __pyx_t_13; | |
1575 int __pyx_lineno = 0; | |
1576 const char *__pyx_filename = NULL; | |
1577 int __pyx_clineno = 0; | |
1578 __Pyx_RefNannySetupContext("__needleman_wunsch_matrix", 0); | |
1579 | |
1580 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":67 | |
1581 * """ | |
1582 * | |
1583 * indel = -1 # indel penalty # <<<<<<<<<<<<<< | |
1584 * | |
1585 * cdef int n = len(seq1) | |
1586 */ | |
1587 __Pyx_INCREF(__pyx_int_neg_1); | |
1588 __pyx_v_indel = __pyx_int_neg_1; | |
1589 | |
1590 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":69 | |
1591 * indel = -1 # indel penalty | |
1592 * | |
1593 * cdef int n = len(seq1) # <<<<<<<<<<<<<< | |
1594 * cdef int m = len(seq2) | |
1595 * | |
1596 */ | |
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;} | |
1598 __pyx_v_n = __pyx_t_1; | |
1599 | |
1600 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":70 | |
1601 * | |
1602 * cdef int n = len(seq1) | |
1603 * cdef int m = len(seq2) # <<<<<<<<<<<<<< | |
1604 * | |
1605 * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix | |
1606 */ | |
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;} | |
1608 __pyx_v_m = __pyx_t_1; | |
1609 | |
1610 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":72 | |
1611 * cdef int m = len(seq2) | |
1612 * | |
1613 * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix # <<<<<<<<<<<<<< | |
1614 * cdef np.ndarray ptr = np.zeros( (n+1, m+1), dtype=int ) # matrix of pointers | |
1615 * | |
1616 */ | |
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;} | |
1618 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
1620 __Pyx_GOTREF(__pyx_t_3); | |
1621 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;} | |
1623 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
1625 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
1627 __Pyx_GOTREF(__pyx_t_5); | |
1628 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); | |
1629 __Pyx_GIVEREF(__pyx_t_2); | |
1630 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); | |
1631 __Pyx_GIVEREF(__pyx_t_4); | |
1632 __pyx_t_2 = 0; | |
1633 __pyx_t_4 = 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;} | |
1635 __Pyx_GOTREF(__pyx_t_4); | |
1636 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); | |
1637 __Pyx_GIVEREF(__pyx_t_5); | |
1638 __pyx_t_5 = 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;} | |
1640 __Pyx_GOTREF(__pyx_t_5); | |
1641 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1642 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
1644 __pyx_v_s = ((PyArrayObject *)__pyx_t_5); | |
1645 __pyx_t_5 = 0; | |
1646 | |
1647 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":73 | |
1648 * | |
1649 * cdef np.ndarray s = np.zeros( (n+1, m+1) ) # DP matrix | |
1650 * cdef np.ndarray ptr = np.zeros( (n+1, m+1), dtype=int ) # matrix of pointers # <<<<<<<<<<<<<< | |
1651 * | |
1652 * ##### INITIALIZE SCORING MATRIX (base case) ##### | |
1653 */ | |
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;} | |
1655 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
1657 __Pyx_GOTREF(__pyx_t_4); | |
1658 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
1660 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
1662 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
1664 __Pyx_GOTREF(__pyx_t_2); | |
1665 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); | |
1666 __Pyx_GIVEREF(__pyx_t_5); | |
1667 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); | |
1668 __Pyx_GIVEREF(__pyx_t_3); | |
1669 __pyx_t_5 = 0; | |
1670 __pyx_t_3 = 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;} | |
1672 __Pyx_GOTREF(__pyx_t_3); | |
1673 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); | |
1674 __Pyx_GIVEREF(__pyx_t_2); | |
1675 __pyx_t_2 = 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;} | |
1677 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
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;} | |
1680 __Pyx_GOTREF(__pyx_t_5); | |
1681 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
1682 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1683 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;} | |
1685 __pyx_v_ptr = ((PyArrayObject *)__pyx_t_5); | |
1686 __pyx_t_5 = 0; | |
1687 | |
1688 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":79 | |
1689 * cdef int i | |
1690 * cdef int j | |
1691 * for i in range(1, n+1) : # <<<<<<<<<<<<<< | |
1692 * s[i,0] = indel * i | |
1693 * for j in range(1, m+1): | |
1694 */ | |
1695 __pyx_t_6 = (__pyx_v_n + 1); | |
1696 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { | |
1697 __pyx_v_i = __pyx_t_7; | |
1698 | |
1699 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":80 | |
1700 * cdef int j | |
1701 * for i in range(1, n+1) : | |
1702 * s[i,0] = indel * i # <<<<<<<<<<<<<< | |
1703 * for j in range(1, m+1): | |
1704 * s[0,j] = indel * j | |
1705 */ | |
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;} | |
1707 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
1709 __Pyx_GOTREF(__pyx_t_2); | |
1710 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
1712 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
1714 __Pyx_GOTREF(__pyx_t_3); | |
1715 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_5); | |
1716 __Pyx_GIVEREF(__pyx_t_5); | |
1717 __Pyx_INCREF(__pyx_int_0); | |
1718 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0); | |
1719 __Pyx_GIVEREF(__pyx_int_0); | |
1720 __pyx_t_5 = 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;} | |
1722 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1723 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
1724 } | |
1725 | |
1726 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":81 | |
1727 * for i in range(1, n+1) : | |
1728 * s[i,0] = indel * i | |
1729 * for j in range(1, m+1): # <<<<<<<<<<<<<< | |
1730 * s[0,j] = indel * j | |
1731 * | |
1732 */ | |
1733 __pyx_t_6 = (__pyx_v_m + 1); | |
1734 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { | |
1735 __pyx_v_j = __pyx_t_7; | |
1736 | |
1737 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":82 | |
1738 * s[i,0] = indel * i | |
1739 * for j in range(1, m+1): | |
1740 * s[0,j] = indel * j # <<<<<<<<<<<<<< | |
1741 * | |
1742 * ########## INITIALIZE TRACEBACK MATRIX ########## | |
1743 */ | |
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;} | |
1745 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
1747 __Pyx_GOTREF(__pyx_t_3); | |
1748 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;} | |
1750 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
1752 __Pyx_GOTREF(__pyx_t_5); | |
1753 __Pyx_INCREF(__pyx_int_0); | |
1754 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_int_0); | |
1755 __Pyx_GIVEREF(__pyx_int_0); | |
1756 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2); | |
1757 __Pyx_GIVEREF(__pyx_t_2); | |
1758 __pyx_t_2 = 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;} | |
1760 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
1761 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1762 } | |
1763 | |
1764 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":87 | |
1765 * | |
1766 * # Tag first row by LEFT, indicating initial "-"s | |
1767 * ptr[0,1:] = LEFT # <<<<<<<<<<<<<< | |
1768 * | |
1769 * # Tag first column by UP, indicating initial "-"s | |
1770 */ | |
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;} | |
1772 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
1774 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1775 | |
1776 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":90 | |
1777 * | |
1778 * # Tag first column by UP, indicating initial "-"s | |
1779 * ptr[1:,0] = UP # <<<<<<<<<<<<<< | |
1780 * | |
1781 * ##################################################### | |
1782 */ | |
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;} | |
1784 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
1786 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1787 | |
1788 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":97 | |
1789 * cdef int p | |
1790 * cdef int q | |
1791 * diagonalRange=350 # <<<<<<<<<<<<<< | |
1792 * for i in range(1,n+1): | |
1793 * p=i-diagonalRange | |
1794 */ | |
1795 __Pyx_INCREF(__pyx_int_350); | |
1796 __pyx_v_diagonalRange = __pyx_int_350; | |
1797 | |
1798 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":98 | |
1799 * cdef int q | |
1800 * diagonalRange=350 | |
1801 * for i in range(1,n+1): # <<<<<<<<<<<<<< | |
1802 * p=i-diagonalRange | |
1803 * q=i+diagonalRange | |
1804 */ | |
1805 __pyx_t_6 = (__pyx_v_n + 1); | |
1806 for (__pyx_t_7 = 1; __pyx_t_7 < __pyx_t_6; __pyx_t_7+=1) { | |
1807 __pyx_v_i = __pyx_t_7; | |
1808 | |
1809 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":99 | |
1810 * diagonalRange=350 | |
1811 * for i in range(1,n+1): | |
1812 * p=i-diagonalRange # <<<<<<<<<<<<<< | |
1813 * q=i+diagonalRange | |
1814 * if(p<1): | |
1815 */ | |
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;} | |
1817 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
1819 __Pyx_GOTREF(__pyx_t_5); | |
1820 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
1822 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
1823 __pyx_v_p = __pyx_t_8; | |
1824 | |
1825 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":100 | |
1826 * for i in range(1,n+1): | |
1827 * p=i-diagonalRange | |
1828 * q=i+diagonalRange # <<<<<<<<<<<<<< | |
1829 * if(p<1): | |
1830 * p=1 | |
1831 */ | |
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;} | |
1833 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
1835 __Pyx_GOTREF(__pyx_t_3); | |
1836 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
1838 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1839 __pyx_v_q = __pyx_t_8; | |
1840 | |
1841 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":101 | |
1842 * p=i-diagonalRange | |
1843 * q=i+diagonalRange | |
1844 * if(p<1): # <<<<<<<<<<<<<< | |
1845 * p=1 | |
1846 * if(q>m+1): | |
1847 */ | |
1848 __pyx_t_9 = ((__pyx_v_p < 1) != 0); | |
1849 if (__pyx_t_9) { | |
1850 | |
1851 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":102 | |
1852 * q=i+diagonalRange | |
1853 * if(p<1): | |
1854 * p=1 # <<<<<<<<<<<<<< | |
1855 * if(q>m+1): | |
1856 * q=m+1 | |
1857 */ | |
1858 __pyx_v_p = 1; | |
1859 goto __pyx_L9; | |
1860 } | |
1861 __pyx_L9:; | |
1862 | |
1863 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":103 | |
1864 * if(p<1): | |
1865 * p=1 | |
1866 * if(q>m+1): # <<<<<<<<<<<<<< | |
1867 * q=m+1 | |
1868 * for j in range(p,q): | |
1869 */ | |
1870 __pyx_t_9 = ((__pyx_v_q > (__pyx_v_m + 1)) != 0); | |
1871 if (__pyx_t_9) { | |
1872 | |
1873 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":104 | |
1874 * p=1 | |
1875 * if(q>m+1): | |
1876 * q=m+1 # <<<<<<<<<<<<<< | |
1877 * for j in range(p,q): | |
1878 * # match | |
1879 */ | |
1880 __pyx_v_q = (__pyx_v_m + 1); | |
1881 goto __pyx_L10; | |
1882 } | |
1883 __pyx_L10:; | |
1884 | |
1885 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":105 | |
1886 * if(q>m+1): | |
1887 * q=m+1 | |
1888 * for j in range(p,q): # <<<<<<<<<<<<<< | |
1889 * # match | |
1890 * myseq1=seq1[i-1] | |
1891 */ | |
1892 __pyx_t_8 = __pyx_v_q; | |
1893 for (__pyx_t_10 = __pyx_v_p; __pyx_t_10 < __pyx_t_8; __pyx_t_10+=1) { | |
1894 __pyx_v_j = __pyx_t_10; | |
1895 | |
1896 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":107 | |
1897 * for j in range(p,q): | |
1898 * # match | |
1899 * myseq1=seq1[i-1] # <<<<<<<<<<<<<< | |
1900 * myseq2=seq2[j-1] | |
1901 * if isinstance(myseq1,list): | |
1902 */ | |
1903 __pyx_t_11 = (__pyx_v_i - 1); | |
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;}; | |
1905 __Pyx_GOTREF(__pyx_t_3); | |
1906 __Pyx_XDECREF_SET(__pyx_v_myseq1, __pyx_t_3); | |
1907 __pyx_t_3 = 0; | |
1908 | |
1909 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":108 | |
1910 * # match | |
1911 * myseq1=seq1[i-1] | |
1912 * myseq2=seq2[j-1] # <<<<<<<<<<<<<< | |
1913 * if isinstance(myseq1,list): | |
1914 * myseq1=myseq1[0] | |
1915 */ | |
1916 __pyx_t_11 = (__pyx_v_j - 1); | |
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;}; | |
1918 __Pyx_GOTREF(__pyx_t_3); | |
1919 __Pyx_XDECREF_SET(__pyx_v_myseq2, __pyx_t_3); | |
1920 __pyx_t_3 = 0; | |
1921 | |
1922 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":109 | |
1923 * myseq1=seq1[i-1] | |
1924 * myseq2=seq2[j-1] | |
1925 * if isinstance(myseq1,list): # <<<<<<<<<<<<<< | |
1926 * myseq1=myseq1[0] | |
1927 * if isinstance(myseq2,list): | |
1928 */ | |
1929 __pyx_t_9 = PyList_Check(__pyx_v_myseq1); | |
1930 __pyx_t_12 = (__pyx_t_9 != 0); | |
1931 if (__pyx_t_12) { | |
1932 | |
1933 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":110 | |
1934 * myseq2=seq2[j-1] | |
1935 * if isinstance(myseq1,list): | |
1936 * myseq1=myseq1[0] # <<<<<<<<<<<<<< | |
1937 * if isinstance(myseq2,list): | |
1938 * myseq2=myseq2[0] | |
1939 */ | |
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;}; | |
1941 __Pyx_GOTREF(__pyx_t_3); | |
1942 __Pyx_DECREF_SET(__pyx_v_myseq1, __pyx_t_3); | |
1943 __pyx_t_3 = 0; | |
1944 goto __pyx_L13; | |
1945 } | |
1946 __pyx_L13:; | |
1947 | |
1948 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":111 | |
1949 * if isinstance(myseq1,list): | |
1950 * myseq1=myseq1[0] | |
1951 * if isinstance(myseq2,list): # <<<<<<<<<<<<<< | |
1952 * myseq2=myseq2[0] | |
1953 * | |
1954 */ | |
1955 __pyx_t_12 = PyList_Check(__pyx_v_myseq2); | |
1956 __pyx_t_9 = (__pyx_t_12 != 0); | |
1957 if (__pyx_t_9) { | |
1958 | |
1959 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":112 | |
1960 * myseq1=myseq1[0] | |
1961 * if isinstance(myseq2,list): | |
1962 * myseq2=myseq2[0] # <<<<<<<<<<<<<< | |
1963 * | |
1964 * | |
1965 */ | |
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;}; | |
1967 __Pyx_GOTREF(__pyx_t_3); | |
1968 __Pyx_DECREF_SET(__pyx_v_myseq2, __pyx_t_3); | |
1969 __pyx_t_3 = 0; | |
1970 goto __pyx_L14; | |
1971 } | |
1972 __pyx_L14:; | |
1973 | |
1974 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":115 | |
1975 * | |
1976 * | |
1977 * if(myseq1== myseq2): # <<<<<<<<<<<<<< | |
1978 * score=1 | |
1979 * else: | |
1980 */ | |
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;} | |
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;} | |
1983 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
1984 if (__pyx_t_9) { | |
1985 | |
1986 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":116 | |
1987 * | |
1988 * if(myseq1== myseq2): | |
1989 * score=1 # <<<<<<<<<<<<<< | |
1990 * else: | |
1991 * score=-1 | |
1992 */ | |
1993 __Pyx_INCREF(__pyx_int_1); | |
1994 __Pyx_XDECREF_SET(__pyx_v_score, __pyx_int_1); | |
1995 goto __pyx_L15; | |
1996 } | |
1997 /*else*/ { | |
1998 | |
1999 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":118 | |
2000 * score=1 | |
2001 * else: | |
2002 * score=-1 # <<<<<<<<<<<<<< | |
2003 * | |
2004 * if len(myseq1)==0 or len(myseq2)==0: | |
2005 */ | |
2006 __Pyx_INCREF(__pyx_int_neg_1); | |
2007 __Pyx_XDECREF_SET(__pyx_v_score, __pyx_int_neg_1); | |
2008 } | |
2009 __pyx_L15:; | |
2010 | |
2011 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":120 | |
2012 * score=-1 | |
2013 * | |
2014 * if len(myseq1)==0 or len(myseq2)==0: # <<<<<<<<<<<<<< | |
2015 * score=0 | |
2016 * | |
2017 */ | |
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;} | |
2019 __pyx_t_9 = ((__pyx_t_1 == 0) != 0); | |
2020 if (!__pyx_t_9) { | |
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;} | |
2022 __pyx_t_12 = ((__pyx_t_1 == 0) != 0); | |
2023 __pyx_t_13 = __pyx_t_12; | |
2024 } else { | |
2025 __pyx_t_13 = __pyx_t_9; | |
2026 } | |
2027 if (__pyx_t_13) { | |
2028 | |
2029 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":121 | |
2030 * | |
2031 * if len(myseq1)==0 or len(myseq2)==0: | |
2032 * score=0 # <<<<<<<<<<<<<< | |
2033 * | |
2034 * #####For double alignment### | |
2035 */ | |
2036 __Pyx_INCREF(__pyx_int_0); | |
2037 __Pyx_DECREF_SET(__pyx_v_score, __pyx_int_0); | |
2038 goto __pyx_L16; | |
2039 } | |
2040 __pyx_L16:; | |
2041 | |
2042 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":124 | |
2043 * | |
2044 * #####For double alignment### | |
2045 * if isFast==False: # <<<<<<<<<<<<<< | |
2046 * if len(myseq1)==0 or len(myseq2)==0: | |
2047 * score=0 | |
2048 */ | |
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;} | |
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;} | |
2051 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
2052 if (__pyx_t_13) { | |
2053 | |
2054 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":125 | |
2055 * #####For double alignment### | |
2056 * if isFast==False: | |
2057 * if len(myseq1)==0 or len(myseq2)==0: # <<<<<<<<<<<<<< | |
2058 * score=0 | |
2059 * else: | |
2060 */ | |
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;} | |
2062 __pyx_t_13 = ((__pyx_t_1 == 0) != 0); | |
2063 if (!__pyx_t_13) { | |
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;} | |
2065 __pyx_t_9 = ((__pyx_t_1 == 0) != 0); | |
2066 __pyx_t_12 = __pyx_t_9; | |
2067 } else { | |
2068 __pyx_t_12 = __pyx_t_13; | |
2069 } | |
2070 if (__pyx_t_12) { | |
2071 | |
2072 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":126 | |
2073 * if isFast==False: | |
2074 * if len(myseq1)==0 or len(myseq2)==0: | |
2075 * score=0 # <<<<<<<<<<<<<< | |
2076 * else: | |
2077 * score=NWunsch.NWunsch_getSimilarity(myseq1,myseq2) | |
2078 */ | |
2079 __Pyx_INCREF(__pyx_int_0); | |
2080 __Pyx_DECREF_SET(__pyx_v_score, __pyx_int_0); | |
2081 goto __pyx_L18; | |
2082 } | |
2083 /*else*/ { | |
2084 | |
2085 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":128 | |
2086 * score=0 | |
2087 * else: | |
2088 * score=NWunsch.NWunsch_getSimilarity(myseq1,myseq2) # <<<<<<<<<<<<<< | |
2089 * ############################ | |
2090 * | |
2091 */ | |
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;} | |
2093 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
2095 __Pyx_GOTREF(__pyx_t_5); | |
2096 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
2098 __Pyx_GOTREF(__pyx_t_3); | |
2099 __Pyx_INCREF(__pyx_v_myseq1); | |
2100 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_myseq1); | |
2101 __Pyx_GIVEREF(__pyx_v_myseq1); | |
2102 __Pyx_INCREF(__pyx_v_myseq2); | |
2103 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_myseq2); | |
2104 __Pyx_GIVEREF(__pyx_v_myseq2); | |
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;} | |
2106 __Pyx_GOTREF(__pyx_t_2); | |
2107 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
2108 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
2109 __Pyx_DECREF_SET(__pyx_v_score, __pyx_t_2); | |
2110 __pyx_t_2 = 0; | |
2111 } | |
2112 __pyx_L18:; | |
2113 goto __pyx_L17; | |
2114 } | |
2115 __pyx_L17:; | |
2116 | |
2117 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":131 | |
2118 * ############################ | |
2119 * | |
2120 * s[i,j] = s[i-1,j-1]+ score # <<<<<<<<<<<<<< | |
2121 * | |
2122 * | |
2123 */ | |
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;} | |
2125 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
2127 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
2129 __Pyx_GOTREF(__pyx_t_5); | |
2130 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); | |
2131 __Pyx_GIVEREF(__pyx_t_2); | |
2132 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); | |
2133 __Pyx_GIVEREF(__pyx_t_3); | |
2134 __pyx_t_2 = 0; | |
2135 __pyx_t_3 = 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;}; | |
2137 __Pyx_GOTREF(__pyx_t_3); | |
2138 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
2140 __Pyx_GOTREF(__pyx_t_5); | |
2141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
2143 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
2145 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
2147 __Pyx_GOTREF(__pyx_t_4); | |
2148 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); | |
2149 __Pyx_GIVEREF(__pyx_t_3); | |
2150 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); | |
2151 __Pyx_GIVEREF(__pyx_t_2); | |
2152 __pyx_t_3 = 0; | |
2153 __pyx_t_2 = 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;} | |
2155 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
2156 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
2157 | |
2158 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":135 | |
2159 * | |
2160 * # indel penalty | |
2161 * if s[i-1,j] + indel > s[i,j] : # <<<<<<<<<<<<<< | |
2162 * s[i,j] = s[i-1,j] + indel | |
2163 * ptr[i,j] = UP | |
2164 */ | |
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;} | |
2166 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2168 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2170 __Pyx_GOTREF(__pyx_t_2); | |
2171 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); | |
2172 __Pyx_GIVEREF(__pyx_t_5); | |
2173 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); | |
2174 __Pyx_GIVEREF(__pyx_t_4); | |
2175 __pyx_t_5 = 0; | |
2176 __pyx_t_4 = 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;}; | |
2178 __Pyx_GOTREF(__pyx_t_4); | |
2179 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;} | |
2181 __Pyx_GOTREF(__pyx_t_2); | |
2182 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
2184 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2186 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2188 __Pyx_GOTREF(__pyx_t_3); | |
2189 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); | |
2190 __Pyx_GIVEREF(__pyx_t_4); | |
2191 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); | |
2192 __Pyx_GIVEREF(__pyx_t_5); | |
2193 __pyx_t_4 = 0; | |
2194 __pyx_t_5 = 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;}; | |
2196 __Pyx_GOTREF(__pyx_t_5); | |
2197 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
2199 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
2200 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
2202 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
2203 if (__pyx_t_12) { | |
2204 | |
2205 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":136 | |
2206 * # indel penalty | |
2207 * if s[i-1,j] + indel > s[i,j] : | |
2208 * s[i,j] = s[i-1,j] + indel # <<<<<<<<<<<<<< | |
2209 * ptr[i,j] = UP | |
2210 * # indel penalty | |
2211 */ | |
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;} | |
2213 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
2215 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2217 __Pyx_GOTREF(__pyx_t_2); | |
2218 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); | |
2219 __Pyx_GIVEREF(__pyx_t_3); | |
2220 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_5); | |
2221 __Pyx_GIVEREF(__pyx_t_5); | |
2222 __pyx_t_3 = 0; | |
2223 __pyx_t_5 = 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;}; | |
2225 __Pyx_GOTREF(__pyx_t_5); | |
2226 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;} | |
2228 __Pyx_GOTREF(__pyx_t_2); | |
2229 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
2231 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2233 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
2235 __Pyx_GOTREF(__pyx_t_4); | |
2236 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); | |
2237 __Pyx_GIVEREF(__pyx_t_5); | |
2238 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3); | |
2239 __Pyx_GIVEREF(__pyx_t_3); | |
2240 __pyx_t_5 = 0; | |
2241 __pyx_t_3 = 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;} | |
2243 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
2244 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
2245 | |
2246 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":137 | |
2247 * if s[i-1,j] + indel > s[i,j] : | |
2248 * s[i,j] = s[i-1,j] + indel | |
2249 * ptr[i,j] = UP # <<<<<<<<<<<<<< | |
2250 * # indel penalty | |
2251 * if s[i, j-1] + indel > s[i,j]: | |
2252 */ | |
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;} | |
2254 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
2256 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2258 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
2260 __Pyx_GOTREF(__pyx_t_5); | |
2261 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); | |
2262 __Pyx_GIVEREF(__pyx_t_4); | |
2263 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_3); | |
2264 __Pyx_GIVEREF(__pyx_t_3); | |
2265 __pyx_t_4 = 0; | |
2266 __pyx_t_3 = 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;} | |
2268 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
2269 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
2270 goto __pyx_L19; | |
2271 } | |
2272 __pyx_L19:; | |
2273 | |
2274 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":139 | |
2275 * ptr[i,j] = UP | |
2276 * # indel penalty | |
2277 * if s[i, j-1] + indel > s[i,j]: # <<<<<<<<<<<<<< | |
2278 * s[i,j] = s[i, j-1] + indel | |
2279 * ptr[i,j] = LEFT | |
2280 */ | |
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;} | |
2282 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
2284 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2286 __Pyx_GOTREF(__pyx_t_3); | |
2287 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); | |
2288 __Pyx_GIVEREF(__pyx_t_2); | |
2289 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_5); | |
2290 __Pyx_GIVEREF(__pyx_t_5); | |
2291 __pyx_t_2 = 0; | |
2292 __pyx_t_5 = 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;}; | |
2294 __Pyx_GOTREF(__pyx_t_5); | |
2295 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
2297 __Pyx_GOTREF(__pyx_t_3); | |
2298 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
2300 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2302 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
2304 __Pyx_GOTREF(__pyx_t_4); | |
2305 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); | |
2306 __Pyx_GIVEREF(__pyx_t_5); | |
2307 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2); | |
2308 __Pyx_GIVEREF(__pyx_t_2); | |
2309 __pyx_t_5 = 0; | |
2310 __pyx_t_2 = 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;}; | |
2312 __Pyx_GOTREF(__pyx_t_2); | |
2313 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
2315 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
2316 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;} | |
2318 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
2319 if (__pyx_t_12) { | |
2320 | |
2321 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":140 | |
2322 * # indel penalty | |
2323 * if s[i, j-1] + indel > s[i,j]: | |
2324 * s[i,j] = s[i, j-1] + indel # <<<<<<<<<<<<<< | |
2325 * ptr[i,j] = LEFT | |
2326 * | |
2327 */ | |
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;} | |
2329 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2331 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
2333 __Pyx_GOTREF(__pyx_t_3); | |
2334 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4); | |
2335 __Pyx_GIVEREF(__pyx_t_4); | |
2336 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2); | |
2337 __Pyx_GIVEREF(__pyx_t_2); | |
2338 __pyx_t_4 = 0; | |
2339 __pyx_t_2 = 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;}; | |
2341 __Pyx_GOTREF(__pyx_t_2); | |
2342 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
2344 __Pyx_GOTREF(__pyx_t_3); | |
2345 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 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;} | |
2347 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
2349 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2351 __Pyx_GOTREF(__pyx_t_5); | |
2352 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); | |
2353 __Pyx_GIVEREF(__pyx_t_2); | |
2354 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); | |
2355 __Pyx_GIVEREF(__pyx_t_4); | |
2356 __pyx_t_2 = 0; | |
2357 __pyx_t_4 = 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;} | |
2359 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0; | |
2360 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
2361 | |
2362 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":141 | |
2363 * if s[i, j-1] + indel > s[i,j]: | |
2364 * s[i,j] = s[i, j-1] + indel | |
2365 * ptr[i,j] = LEFT # <<<<<<<<<<<<<< | |
2366 * | |
2367 * return s, ptr | |
2368 */ | |
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;} | |
2370 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
2372 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2374 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2376 __Pyx_GOTREF(__pyx_t_2); | |
2377 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_5); | |
2378 __Pyx_GIVEREF(__pyx_t_5); | |
2379 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4); | |
2380 __Pyx_GIVEREF(__pyx_t_4); | |
2381 __pyx_t_5 = 0; | |
2382 __pyx_t_4 = 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;} | |
2384 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
2385 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
2386 goto __pyx_L20; | |
2387 } | |
2388 __pyx_L20:; | |
2389 } | |
2390 } | |
2391 | |
2392 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":143 | |
2393 * ptr[i,j] = LEFT | |
2394 * | |
2395 * return s, ptr # <<<<<<<<<<<<<< | |
2396 * | |
2397 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : | |
2398 */ | |
2399 __Pyx_XDECREF(__pyx_r); | |
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;} | |
2401 __Pyx_GOTREF(__pyx_t_3); | |
2402 __Pyx_INCREF(((PyObject *)__pyx_v_s)); | |
2403 PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_s)); | |
2404 __Pyx_GIVEREF(((PyObject *)__pyx_v_s)); | |
2405 __Pyx_INCREF(((PyObject *)__pyx_v_ptr)); | |
2406 PyTuple_SET_ITEM(__pyx_t_3, 1, ((PyObject *)__pyx_v_ptr)); | |
2407 __Pyx_GIVEREF(((PyObject *)__pyx_v_ptr)); | |
2408 __pyx_r = __pyx_t_3; | |
2409 __pyx_t_3 = 0; | |
2410 goto __pyx_L0; | |
2411 | |
2412 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 | |
2413 * class FastAlignmentArrays: | |
2414 * | |
2415 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< | |
2416 * """ | |
2417 * fill in the DP matrix according to the Needleman-Wunsch algorithm. | |
2418 */ | |
2419 | |
2420 /* function exit code */ | |
2421 __pyx_L1_error:; | |
2422 __Pyx_XDECREF(__pyx_t_2); | |
2423 __Pyx_XDECREF(__pyx_t_3); | |
2424 __Pyx_XDECREF(__pyx_t_4); | |
2425 __Pyx_XDECREF(__pyx_t_5); | |
2426 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_matrix", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
2427 __pyx_r = NULL; | |
2428 __pyx_L0:; | |
2429 __Pyx_XDECREF(__pyx_v_indel); | |
2430 __Pyx_XDECREF((PyObject *)__pyx_v_s); | |
2431 __Pyx_XDECREF((PyObject *)__pyx_v_ptr); | |
2432 __Pyx_XDECREF(__pyx_v_diagonalRange); | |
2433 __Pyx_XDECREF(__pyx_v_myseq1); | |
2434 __Pyx_XDECREF(__pyx_v_myseq2); | |
2435 __Pyx_XDECREF(__pyx_v_score); | |
2436 __Pyx_XGIVEREF(__pyx_r); | |
2437 __Pyx_RefNannyFinishContext(); | |
2438 return __pyx_r; | |
2439 } | |
2440 | |
2441 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 | |
2442 * return s, ptr | |
2443 * | |
2444 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< | |
2445 * | |
2446 * #### TRACE BEST PATH TO GET ALIGNMENT #### | |
2447 */ | |
2448 | |
2449 /* Python wrapper */ | |
2450 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
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)}; | |
2452 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_3__needleman_wunsch_trace(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
2453 CYTHON_UNUSED PyObject *__pyx_v_self = 0; | |
2454 PyObject *__pyx_v_seq1 = 0; | |
2455 PyObject *__pyx_v_seq2 = 0; | |
2456 CYTHON_UNUSED PyArrayObject *__pyx_v_s = 0; | |
2457 PyArrayObject *__pyx_v_ptr = 0; | |
2458 int __pyx_lineno = 0; | |
2459 const char *__pyx_filename = NULL; | |
2460 int __pyx_clineno = 0; | |
2461 PyObject *__pyx_r = 0; | |
2462 __Pyx_RefNannyDeclarations | |
2463 __Pyx_RefNannySetupContext("__needleman_wunsch_trace (wrapper)", 0); | |
2464 { | |
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}; | |
2466 PyObject* values[5] = {0,0,0,0,0}; | |
2467 if (unlikely(__pyx_kwds)) { | |
2468 Py_ssize_t kw_args; | |
2469 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
2470 switch (pos_args) { | |
2471 case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
2472 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
2473 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
2474 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
2475 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
2476 case 0: break; | |
2477 default: goto __pyx_L5_argtuple_error; | |
2478 } | |
2479 kw_args = PyDict_Size(__pyx_kwds); | |
2480 switch (pos_args) { | |
2481 case 0: | |
2482 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; | |
2483 else goto __pyx_L5_argtuple_error; | |
2484 case 1: | |
2485 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; | |
2486 else { | |
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;} | |
2488 } | |
2489 case 2: | |
2490 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; | |
2491 else { | |
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;} | |
2493 } | |
2494 case 3: | |
2495 if (likely((values[3] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_s)) != 0)) kw_args--; | |
2496 else { | |
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;} | |
2498 } | |
2499 case 4: | |
2500 if (likely((values[4] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ptr)) != 0)) kw_args--; | |
2501 else { | |
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;} | |
2503 } | |
2504 } | |
2505 if (unlikely(kw_args > 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;} | |
2507 } | |
2508 } else if (PyTuple_GET_SIZE(__pyx_args) != 5) { | |
2509 goto __pyx_L5_argtuple_error; | |
2510 } else { | |
2511 values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
2512 values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
2513 values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
2514 values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
2515 values[4] = PyTuple_GET_ITEM(__pyx_args, 4); | |
2516 } | |
2517 __pyx_v_self = values[0]; | |
2518 __pyx_v_seq1 = values[1]; | |
2519 __pyx_v_seq2 = values[2]; | |
2520 __pyx_v_s = ((PyArrayObject *)values[3]); | |
2521 __pyx_v_ptr = ((PyArrayObject *)values[4]); | |
2522 } | |
2523 goto __pyx_L4_argument_unpacking_done; | |
2524 __pyx_L5_argtuple_error:; | |
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;} | |
2526 __pyx_L3_error:; | |
2527 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_trace", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
2528 __Pyx_RefNannyFinishContext(); | |
2529 return NULL; | |
2530 __pyx_L4_argument_unpacking_done:; | |
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;} | |
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;} | |
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); | |
2534 | |
2535 /* function exit code */ | |
2536 goto __pyx_L0; | |
2537 __pyx_L1_error:; | |
2538 __pyx_r = NULL; | |
2539 __pyx_L0:; | |
2540 __Pyx_RefNannyFinishContext(); | |
2541 return __pyx_r; | |
2542 } | |
2543 | |
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) { | |
2545 PyObject *__pyx_v_align1 = NULL; | |
2546 PyObject *__pyx_v_align2 = NULL; | |
2547 PyObject *__pyx_v_align1_gap = NULL; | |
2548 PyObject *__pyx_v_align2_gap = NULL; | |
2549 PyObject *__pyx_v_gap1 = NULL; | |
2550 PyObject *__pyx_v_gap2 = NULL; | |
2551 int __pyx_v_n; | |
2552 int __pyx_v_m; | |
2553 int __pyx_v_i; | |
2554 int __pyx_v_j; | |
2555 int __pyx_v_curr; | |
2556 Py_ssize_t __pyx_v_index; | |
2557 PyObject *__pyx_r = NULL; | |
2558 __Pyx_RefNannyDeclarations | |
2559 PyObject *__pyx_t_1 = NULL; | |
2560 Py_ssize_t __pyx_t_2; | |
2561 Py_ssize_t __pyx_t_3; | |
2562 PyObject *__pyx_t_4 = NULL; | |
2563 PyObject *__pyx_t_5 = NULL; | |
2564 int __pyx_t_6; | |
2565 int __pyx_t_7; | |
2566 int __pyx_t_8; | |
2567 int __pyx_t_9; | |
2568 long __pyx_t_10; | |
2569 int __pyx_t_11; | |
2570 int __pyx_lineno = 0; | |
2571 const char *__pyx_filename = NULL; | |
2572 int __pyx_clineno = 0; | |
2573 __Pyx_RefNannySetupContext("__needleman_wunsch_trace", 0); | |
2574 | |
2575 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":148 | |
2576 * | |
2577 * #### TRACE BEST PATH TO GET ALIGNMENT #### | |
2578 * align1 = [] # <<<<<<<<<<<<<< | |
2579 * align2 = [] | |
2580 * align1_gap = [] | |
2581 */ | |
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;} | |
2583 __Pyx_GOTREF(__pyx_t_1); | |
2584 __pyx_v_align1 = ((PyObject*)__pyx_t_1); | |
2585 __pyx_t_1 = 0; | |
2586 | |
2587 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":149 | |
2588 * #### TRACE BEST PATH TO GET ALIGNMENT #### | |
2589 * align1 = [] | |
2590 * align2 = [] # <<<<<<<<<<<<<< | |
2591 * align1_gap = [] | |
2592 * align2_gap = [] | |
2593 */ | |
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;} | |
2595 __Pyx_GOTREF(__pyx_t_1); | |
2596 __pyx_v_align2 = ((PyObject*)__pyx_t_1); | |
2597 __pyx_t_1 = 0; | |
2598 | |
2599 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":150 | |
2600 * align1 = [] | |
2601 * align2 = [] | |
2602 * align1_gap = [] # <<<<<<<<<<<<<< | |
2603 * align2_gap = [] | |
2604 * gap1=[] | |
2605 */ | |
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;} | |
2607 __Pyx_GOTREF(__pyx_t_1); | |
2608 __pyx_v_align1_gap = ((PyObject*)__pyx_t_1); | |
2609 __pyx_t_1 = 0; | |
2610 | |
2611 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":151 | |
2612 * align2 = [] | |
2613 * align1_gap = [] | |
2614 * align2_gap = [] # <<<<<<<<<<<<<< | |
2615 * gap1=[] | |
2616 * gap2=[] | |
2617 */ | |
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;} | |
2619 __Pyx_GOTREF(__pyx_t_1); | |
2620 __pyx_v_align2_gap = ((PyObject*)__pyx_t_1); | |
2621 __pyx_t_1 = 0; | |
2622 | |
2623 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":152 | |
2624 * align1_gap = [] | |
2625 * align2_gap = [] | |
2626 * gap1=[] # <<<<<<<<<<<<<< | |
2627 * gap2=[] | |
2628 * | |
2629 */ | |
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;} | |
2631 __Pyx_GOTREF(__pyx_t_1); | |
2632 __pyx_v_gap1 = ((PyObject*)__pyx_t_1); | |
2633 __pyx_t_1 = 0; | |
2634 | |
2635 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":153 | |
2636 * align2_gap = [] | |
2637 * gap1=[] | |
2638 * gap2=[] # <<<<<<<<<<<<<< | |
2639 * | |
2640 * cdef int n,m | |
2641 */ | |
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;} | |
2643 __Pyx_GOTREF(__pyx_t_1); | |
2644 __pyx_v_gap2 = ((PyObject*)__pyx_t_1); | |
2645 __pyx_t_1 = 0; | |
2646 | |
2647 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":156 | |
2648 * | |
2649 * cdef int n,m | |
2650 * n, m = (len(seq1), len(seq2)) # <<<<<<<<<<<<<< | |
2651 * cdef int i,j,curr | |
2652 * i = n | |
2653 */ | |
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;} | |
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;} | |
2656 __pyx_v_n = __pyx_t_2; | |
2657 __pyx_v_m = __pyx_t_3; | |
2658 | |
2659 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":158 | |
2660 * n, m = (len(seq1), len(seq2)) | |
2661 * cdef int i,j,curr | |
2662 * i = n # <<<<<<<<<<<<<< | |
2663 * j = m | |
2664 * curr = ptr[i, j] | |
2665 */ | |
2666 __pyx_v_i = __pyx_v_n; | |
2667 | |
2668 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":159 | |
2669 * cdef int i,j,curr | |
2670 * i = n | |
2671 * j = m # <<<<<<<<<<<<<< | |
2672 * curr = ptr[i, j] | |
2673 * while (i > 0 or j > 0): | |
2674 */ | |
2675 __pyx_v_j = __pyx_v_m; | |
2676 | |
2677 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":160 | |
2678 * i = n | |
2679 * j = m | |
2680 * curr = ptr[i, j] # <<<<<<<<<<<<<< | |
2681 * while (i > 0 or j > 0): | |
2682 * ptr[i,j] += 3 | |
2683 */ | |
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;} | |
2685 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2687 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2689 __Pyx_GOTREF(__pyx_t_5); | |
2690 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
2691 __Pyx_GIVEREF(__pyx_t_1); | |
2692 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); | |
2693 __Pyx_GIVEREF(__pyx_t_4); | |
2694 __pyx_t_1 = 0; | |
2695 __pyx_t_4 = 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;}; | |
2697 __Pyx_GOTREF(__pyx_t_4); | |
2698 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
2700 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
2701 __pyx_v_curr = __pyx_t_6; | |
2702 | |
2703 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":161 | |
2704 * j = m | |
2705 * curr = ptr[i, j] | |
2706 * while (i > 0 or j > 0): # <<<<<<<<<<<<<< | |
2707 * ptr[i,j] += 3 | |
2708 * if curr == DIAG : | |
2709 */ | |
2710 while (1) { | |
2711 __pyx_t_7 = ((__pyx_v_i > 0) != 0); | |
2712 if (!__pyx_t_7) { | |
2713 __pyx_t_8 = ((__pyx_v_j > 0) != 0); | |
2714 __pyx_t_9 = __pyx_t_8; | |
2715 } else { | |
2716 __pyx_t_9 = __pyx_t_7; | |
2717 } | |
2718 if (!__pyx_t_9) break; | |
2719 | |
2720 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":162 | |
2721 * curr = ptr[i, j] | |
2722 * while (i > 0 or j > 0): | |
2723 * ptr[i,j] += 3 # <<<<<<<<<<<<<< | |
2724 * if curr == DIAG : | |
2725 * align1.append(seq1[i-1]) | |
2726 */ | |
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;} | |
2728 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2730 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2732 __Pyx_GOTREF(__pyx_t_1); | |
2733 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_4); | |
2734 __Pyx_GIVEREF(__pyx_t_4); | |
2735 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_5); | |
2736 __Pyx_GIVEREF(__pyx_t_5); | |
2737 __pyx_t_4 = 0; | |
2738 __pyx_t_5 = 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;}; | |
2740 __Pyx_GOTREF(__pyx_t_5); | |
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;} | |
2742 __Pyx_GOTREF(__pyx_t_4); | |
2743 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
2745 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
2746 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2747 | |
2748 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":163 | |
2749 * while (i > 0 or j > 0): | |
2750 * ptr[i,j] += 3 | |
2751 * if curr == DIAG : # <<<<<<<<<<<<<< | |
2752 * align1.append(seq1[i-1]) | |
2753 * align2.append(seq2[j-1]) | |
2754 */ | |
2755 __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG) != 0); | |
2756 if (__pyx_t_9) { | |
2757 | |
2758 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":164 | |
2759 * ptr[i,j] += 3 | |
2760 * if curr == DIAG : | |
2761 * align1.append(seq1[i-1]) # <<<<<<<<<<<<<< | |
2762 * align2.append(seq2[j-1]) | |
2763 * align1_gap.append(seq1[i-1]) | |
2764 */ | |
2765 __pyx_t_10 = (__pyx_v_i - 1); | |
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;}; | |
2767 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2769 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2770 | |
2771 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":165 | |
2772 * if curr == DIAG : | |
2773 * align1.append(seq1[i-1]) | |
2774 * align2.append(seq2[j-1]) # <<<<<<<<<<<<<< | |
2775 * align1_gap.append(seq1[i-1]) | |
2776 * align2_gap.append(seq2[j-1]) | |
2777 */ | |
2778 __pyx_t_10 = (__pyx_v_j - 1); | |
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;}; | |
2780 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2782 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2783 | |
2784 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":166 | |
2785 * align1.append(seq1[i-1]) | |
2786 * align2.append(seq2[j-1]) | |
2787 * align1_gap.append(seq1[i-1]) # <<<<<<<<<<<<<< | |
2788 * align2_gap.append(seq2[j-1]) | |
2789 * i -= 1 | |
2790 */ | |
2791 __pyx_t_10 = (__pyx_v_i - 1); | |
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;}; | |
2793 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2795 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2796 | |
2797 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":167 | |
2798 * align2.append(seq2[j-1]) | |
2799 * align1_gap.append(seq1[i-1]) | |
2800 * align2_gap.append(seq2[j-1]) # <<<<<<<<<<<<<< | |
2801 * i -= 1 | |
2802 * j -= 1 | |
2803 */ | |
2804 __pyx_t_10 = (__pyx_v_j - 1); | |
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;}; | |
2806 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2808 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2809 | |
2810 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":168 | |
2811 * align1_gap.append(seq1[i-1]) | |
2812 * align2_gap.append(seq2[j-1]) | |
2813 * i -= 1 # <<<<<<<<<<<<<< | |
2814 * j -= 1 | |
2815 * elif curr == LEFT: | |
2816 */ | |
2817 __pyx_v_i = (__pyx_v_i - 1); | |
2818 | |
2819 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":169 | |
2820 * align2_gap.append(seq2[j-1]) | |
2821 * i -= 1 | |
2822 * j -= 1 # <<<<<<<<<<<<<< | |
2823 * elif curr == LEFT: | |
2824 * align1.append("*") | |
2825 */ | |
2826 __pyx_v_j = (__pyx_v_j - 1); | |
2827 goto __pyx_L5; | |
2828 } | |
2829 | |
2830 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":170 | |
2831 * i -= 1 | |
2832 * j -= 1 | |
2833 * elif curr == LEFT: # <<<<<<<<<<<<<< | |
2834 * align1.append("*") | |
2835 * align2.append(seq2[j-1]) | |
2836 */ | |
2837 __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT) != 0); | |
2838 if (__pyx_t_9) { | |
2839 | |
2840 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":171 | |
2841 * j -= 1 | |
2842 * elif curr == LEFT: | |
2843 * align1.append("*") # <<<<<<<<<<<<<< | |
2844 * align2.append(seq2[j-1]) | |
2845 * align1_gap.append("[GAP]") | |
2846 */ | |
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;} | |
2848 | |
2849 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":172 | |
2850 * elif curr == LEFT: | |
2851 * align1.append("*") | |
2852 * align2.append(seq2[j-1]) # <<<<<<<<<<<<<< | |
2853 * align1_gap.append("[GAP]") | |
2854 * align2_gap.append(seq2[j-1]) | |
2855 */ | |
2856 __pyx_t_10 = (__pyx_v_j - 1); | |
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;}; | |
2858 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2860 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2861 | |
2862 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":173 | |
2863 * align1.append("*") | |
2864 * align2.append(seq2[j-1]) | |
2865 * align1_gap.append("[GAP]") # <<<<<<<<<<<<<< | |
2866 * align2_gap.append(seq2[j-1]) | |
2867 * j -= 1 | |
2868 */ | |
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;} | |
2870 | |
2871 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":174 | |
2872 * align2.append(seq2[j-1]) | |
2873 * align1_gap.append("[GAP]") | |
2874 * align2_gap.append(seq2[j-1]) # <<<<<<<<<<<<<< | |
2875 * j -= 1 | |
2876 * elif curr == UP: | |
2877 */ | |
2878 __pyx_t_10 = (__pyx_v_j - 1); | |
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;}; | |
2880 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2882 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2883 | |
2884 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":175 | |
2885 * align1_gap.append("[GAP]") | |
2886 * align2_gap.append(seq2[j-1]) | |
2887 * j -= 1 # <<<<<<<<<<<<<< | |
2888 * elif curr == UP: | |
2889 * align1.append(seq1[i-1]) | |
2890 */ | |
2891 __pyx_v_j = (__pyx_v_j - 1); | |
2892 goto __pyx_L5; | |
2893 } | |
2894 | |
2895 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":176 | |
2896 * align2_gap.append(seq2[j-1]) | |
2897 * j -= 1 | |
2898 * elif curr == UP: # <<<<<<<<<<<<<< | |
2899 * align1.append(seq1[i-1]) | |
2900 * align2.append("*") | |
2901 */ | |
2902 __pyx_t_9 = ((__pyx_v_curr == __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP) != 0); | |
2903 if (__pyx_t_9) { | |
2904 | |
2905 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":177 | |
2906 * j -= 1 | |
2907 * elif curr == UP: | |
2908 * align1.append(seq1[i-1]) # <<<<<<<<<<<<<< | |
2909 * align2.append("*") | |
2910 * align1_gap.append(seq1[i-1]) | |
2911 */ | |
2912 __pyx_t_10 = (__pyx_v_i - 1); | |
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;}; | |
2914 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2916 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2917 | |
2918 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":178 | |
2919 * elif curr == UP: | |
2920 * align1.append(seq1[i-1]) | |
2921 * align2.append("*") # <<<<<<<<<<<<<< | |
2922 * align1_gap.append(seq1[i-1]) | |
2923 * align2_gap.append("[GAP]") | |
2924 */ | |
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;} | |
2926 | |
2927 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":179 | |
2928 * align1.append(seq1[i-1]) | |
2929 * align2.append("*") | |
2930 * align1_gap.append(seq1[i-1]) # <<<<<<<<<<<<<< | |
2931 * align2_gap.append("[GAP]") | |
2932 * i -= 1 | |
2933 */ | |
2934 __pyx_t_10 = (__pyx_v_i - 1); | |
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;}; | |
2936 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2938 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
2939 | |
2940 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":180 | |
2941 * align2.append("*") | |
2942 * align1_gap.append(seq1[i-1]) | |
2943 * align2_gap.append("[GAP]") # <<<<<<<<<<<<<< | |
2944 * i -= 1 | |
2945 * | |
2946 */ | |
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;} | |
2948 | |
2949 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":181 | |
2950 * align1_gap.append(seq1[i-1]) | |
2951 * align2_gap.append("[GAP]") | |
2952 * i -= 1 # <<<<<<<<<<<<<< | |
2953 * | |
2954 * curr = ptr[i,j] | |
2955 */ | |
2956 __pyx_v_i = (__pyx_v_i - 1); | |
2957 goto __pyx_L5; | |
2958 } | |
2959 __pyx_L5:; | |
2960 | |
2961 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":183 | |
2962 * i -= 1 | |
2963 * | |
2964 * curr = ptr[i,j] # <<<<<<<<<<<<<< | |
2965 * | |
2966 * align1.reverse() | |
2967 */ | |
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;} | |
2969 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
2971 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
2973 __Pyx_GOTREF(__pyx_t_5); | |
2974 PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1); | |
2975 __Pyx_GIVEREF(__pyx_t_1); | |
2976 PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4); | |
2977 __Pyx_GIVEREF(__pyx_t_4); | |
2978 __pyx_t_1 = 0; | |
2979 __pyx_t_4 = 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;}; | |
2981 __Pyx_GOTREF(__pyx_t_4); | |
2982 __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 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;} | |
2984 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
2985 __pyx_v_curr = __pyx_t_6; | |
2986 } | |
2987 | |
2988 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":185 | |
2989 * curr = ptr[i,j] | |
2990 * | |
2991 * align1.reverse() # <<<<<<<<<<<<<< | |
2992 * align2.reverse() | |
2993 * align1_gap.reverse() | |
2994 */ | |
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;} | |
2996 | |
2997 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":186 | |
2998 * | |
2999 * align1.reverse() | |
3000 * align2.reverse() # <<<<<<<<<<<<<< | |
3001 * align1_gap.reverse() | |
3002 * align2_gap.reverse() | |
3003 */ | |
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;} | |
3005 | |
3006 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":187 | |
3007 * align1.reverse() | |
3008 * align2.reverse() | |
3009 * align1_gap.reverse() # <<<<<<<<<<<<<< | |
3010 * align2_gap.reverse() | |
3011 * #gaps | |
3012 */ | |
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;} | |
3014 | |
3015 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":188 | |
3016 * align2.reverse() | |
3017 * align1_gap.reverse() | |
3018 * align2_gap.reverse() # <<<<<<<<<<<<<< | |
3019 * #gaps | |
3020 * for index in range(len(align1_gap)): | |
3021 */ | |
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;} | |
3023 | |
3024 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":190 | |
3025 * align2_gap.reverse() | |
3026 * #gaps | |
3027 * for index in range(len(align1_gap)): # <<<<<<<<<<<<<< | |
3028 * if(align1_gap[index])=="[GAP]": | |
3029 * gap1.append(index) | |
3030 */ | |
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;} | |
3032 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) { | |
3033 __pyx_v_index = __pyx_t_2; | |
3034 | |
3035 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":191 | |
3036 * #gaps | |
3037 * for index in range(len(align1_gap)): | |
3038 * if(align1_gap[index])=="[GAP]": # <<<<<<<<<<<<<< | |
3039 * gap1.append(index) | |
3040 * | |
3041 */ | |
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;}; | |
3043 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
3045 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3046 if (__pyx_t_9) { | |
3047 | |
3048 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":192 | |
3049 * for index in range(len(align1_gap)): | |
3050 * if(align1_gap[index])=="[GAP]": | |
3051 * gap1.append(index) # <<<<<<<<<<<<<< | |
3052 * | |
3053 * for index in range(len(align2_gap)): | |
3054 */ | |
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;} | |
3056 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
3058 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3059 goto __pyx_L8; | |
3060 } | |
3061 __pyx_L8:; | |
3062 } | |
3063 | |
3064 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":194 | |
3065 * gap1.append(index) | |
3066 * | |
3067 * for index in range(len(align2_gap)): # <<<<<<<<<<<<<< | |
3068 * if(align2_gap[index])=="[GAP]": | |
3069 * gap2.append(index) | |
3070 */ | |
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;} | |
3072 for (__pyx_t_2 = 0; __pyx_t_2 < __pyx_t_3; __pyx_t_2+=1) { | |
3073 __pyx_v_index = __pyx_t_2; | |
3074 | |
3075 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":195 | |
3076 * | |
3077 * for index in range(len(align2_gap)): | |
3078 * if(align2_gap[index])=="[GAP]": # <<<<<<<<<<<<<< | |
3079 * gap2.append(index) | |
3080 * | |
3081 */ | |
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;}; | |
3083 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
3085 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3086 if (__pyx_t_9) { | |
3087 | |
3088 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":196 | |
3089 * for index in range(len(align2_gap)): | |
3090 * if(align2_gap[index])=="[GAP]": | |
3091 * gap2.append(index) # <<<<<<<<<<<<<< | |
3092 * | |
3093 * | |
3094 */ | |
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;} | |
3096 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
3098 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3099 goto __pyx_L11; | |
3100 } | |
3101 __pyx_L11:; | |
3102 } | |
3103 | |
3104 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":199 | |
3105 * | |
3106 * | |
3107 * return align1, align2,gap1,gap2 # <<<<<<<<<<<<<< | |
3108 * | |
3109 * | |
3110 */ | |
3111 __Pyx_XDECREF(__pyx_r); | |
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;} | |
3113 __Pyx_GOTREF(__pyx_t_4); | |
3114 __Pyx_INCREF(__pyx_v_align1); | |
3115 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_align1); | |
3116 __Pyx_GIVEREF(__pyx_v_align1); | |
3117 __Pyx_INCREF(__pyx_v_align2); | |
3118 PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_align2); | |
3119 __Pyx_GIVEREF(__pyx_v_align2); | |
3120 __Pyx_INCREF(__pyx_v_gap1); | |
3121 PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_gap1); | |
3122 __Pyx_GIVEREF(__pyx_v_gap1); | |
3123 __Pyx_INCREF(__pyx_v_gap2); | |
3124 PyTuple_SET_ITEM(__pyx_t_4, 3, __pyx_v_gap2); | |
3125 __Pyx_GIVEREF(__pyx_v_gap2); | |
3126 __pyx_r = __pyx_t_4; | |
3127 __pyx_t_4 = 0; | |
3128 goto __pyx_L0; | |
3129 | |
3130 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 | |
3131 * return s, ptr | |
3132 * | |
3133 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< | |
3134 * | |
3135 * #### TRACE BEST PATH TO GET ALIGNMENT #### | |
3136 */ | |
3137 | |
3138 /* function exit code */ | |
3139 __pyx_L1_error:; | |
3140 __Pyx_XDECREF(__pyx_t_1); | |
3141 __Pyx_XDECREF(__pyx_t_4); | |
3142 __Pyx_XDECREF(__pyx_t_5); | |
3143 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.__needleman_wunsch_trace", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
3144 __pyx_r = NULL; | |
3145 __pyx_L0:; | |
3146 __Pyx_XDECREF(__pyx_v_align1); | |
3147 __Pyx_XDECREF(__pyx_v_align2); | |
3148 __Pyx_XDECREF(__pyx_v_align1_gap); | |
3149 __Pyx_XDECREF(__pyx_v_align2_gap); | |
3150 __Pyx_XDECREF(__pyx_v_gap1); | |
3151 __Pyx_XDECREF(__pyx_v_gap2); | |
3152 __Pyx_XGIVEREF(__pyx_r); | |
3153 __Pyx_RefNannyFinishContext(); | |
3154 return __pyx_r; | |
3155 } | |
3156 | |
3157 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 | |
3158 * | |
3159 * | |
3160 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< | |
3161 * """ | |
3162 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch | |
3163 */ | |
3164 | |
3165 /* Python wrapper */ | |
3166 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/ | |
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 "; | |
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)}; | |
3169 static PyObject *__pyx_pw_11MultipleOMR_9Alignment_19FastAlignmentArrays_19FastAlignmentArrays_5needleman_wunsch(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) { | |
3170 PyObject *__pyx_v_self = 0; | |
3171 PyObject *__pyx_v_seq1 = 0; | |
3172 PyObject *__pyx_v_seq2 = 0; | |
3173 PyObject *__pyx_v_isFast = 0; | |
3174 int __pyx_lineno = 0; | |
3175 const char *__pyx_filename = NULL; | |
3176 int __pyx_clineno = 0; | |
3177 PyObject *__pyx_r = 0; | |
3178 __Pyx_RefNannyDeclarations | |
3179 __Pyx_RefNannySetupContext("needleman_wunsch (wrapper)", 0); | |
3180 { | |
3181 static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_self,&__pyx_n_s_seq1,&__pyx_n_s_seq2,&__pyx_n_s_isFast,0}; | |
3182 PyObject* values[4] = {0,0,0,0}; | |
3183 values[3] = ((PyObject *)((PyObject *)Py_True)); | |
3184 if (unlikely(__pyx_kwds)) { | |
3185 Py_ssize_t kw_args; | |
3186 const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args); | |
3187 switch (pos_args) { | |
3188 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
3189 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
3190 case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
3191 case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
3192 case 0: break; | |
3193 default: goto __pyx_L5_argtuple_error; | |
3194 } | |
3195 kw_args = PyDict_Size(__pyx_kwds); | |
3196 switch (pos_args) { | |
3197 case 0: | |
3198 if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_self)) != 0)) kw_args--; | |
3199 else goto __pyx_L5_argtuple_error; | |
3200 case 1: | |
3201 if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq1)) != 0)) kw_args--; | |
3202 else { | |
3203 __Pyx_RaiseArgtupleInvalid("needleman_wunsch", 0, 3, 4, 1); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} | |
3204 } | |
3205 case 2: | |
3206 if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_seq2)) != 0)) kw_args--; | |
3207 else { | |
3208 __Pyx_RaiseArgtupleInvalid("needleman_wunsch", 0, 3, 4, 2); {__pyx_filename = __pyx_f[0]; __pyx_lineno = 202; __pyx_clineno = __LINE__; goto __pyx_L3_error;} | |
3209 } | |
3210 case 3: | |
3211 if (kw_args > 0) { | |
3212 PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_isFast); | |
3213 if (value) { values[3] = value; kw_args--; } | |
3214 } | |
3215 } | |
3216 if (unlikely(kw_args > 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;} | |
3218 } | |
3219 } else { | |
3220 switch (PyTuple_GET_SIZE(__pyx_args)) { | |
3221 case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3); | |
3222 case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2); | |
3223 values[1] = PyTuple_GET_ITEM(__pyx_args, 1); | |
3224 values[0] = PyTuple_GET_ITEM(__pyx_args, 0); | |
3225 break; | |
3226 default: goto __pyx_L5_argtuple_error; | |
3227 } | |
3228 } | |
3229 __pyx_v_self = values[0]; | |
3230 __pyx_v_seq1 = values[1]; | |
3231 __pyx_v_seq2 = values[2]; | |
3232 __pyx_v_isFast = values[3]; | |
3233 } | |
3234 goto __pyx_L4_argument_unpacking_done; | |
3235 __pyx_L5_argtuple_error:; | |
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;} | |
3237 __pyx_L3_error:; | |
3238 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.needleman_wunsch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
3239 __Pyx_RefNannyFinishContext(); | |
3240 return NULL; | |
3241 __pyx_L4_argument_unpacking_done:; | |
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); | |
3243 | |
3244 /* function exit code */ | |
3245 __Pyx_RefNannyFinishContext(); | |
3246 return __pyx_r; | |
3247 } | |
3248 | |
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) { | |
3250 PyObject *__pyx_v_s = NULL; | |
3251 PyObject *__pyx_v_ptr = NULL; | |
3252 PyObject *__pyx_v_alignment = NULL; | |
3253 int __pyx_v_maxlen; | |
3254 float __pyx_v_finalscore; | |
3255 PyObject *__pyx_r = NULL; | |
3256 __Pyx_RefNannyDeclarations | |
3257 PyObject *__pyx_t_1 = NULL; | |
3258 PyObject *__pyx_t_2 = NULL; | |
3259 PyObject *__pyx_t_3 = NULL; | |
3260 PyObject *__pyx_t_4 = NULL; | |
3261 PyObject *(*__pyx_t_5)(PyObject *); | |
3262 Py_ssize_t __pyx_t_6; | |
3263 Py_ssize_t __pyx_t_7; | |
3264 int __pyx_t_8; | |
3265 float __pyx_t_9; | |
3266 int __pyx_lineno = 0; | |
3267 const char *__pyx_filename = NULL; | |
3268 int __pyx_clineno = 0; | |
3269 __Pyx_RefNannySetupContext("needleman_wunsch", 0); | |
3270 | |
3271 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":229 | |
3272 * | |
3273 * """ | |
3274 * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast) # <<<<<<<<<<<<<< | |
3275 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) | |
3276 * cdef int maxlen=len(seq1) | |
3277 */ | |
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;} | |
3279 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
3281 __Pyx_GOTREF(__pyx_t_2); | |
3282 __Pyx_INCREF(__pyx_v_seq1); | |
3283 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_seq1); | |
3284 __Pyx_GIVEREF(__pyx_v_seq1); | |
3285 __Pyx_INCREF(__pyx_v_seq2); | |
3286 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_seq2); | |
3287 __Pyx_GIVEREF(__pyx_v_seq2); | |
3288 __Pyx_INCREF(__pyx_v_isFast); | |
3289 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_isFast); | |
3290 __Pyx_GIVEREF(__pyx_v_isFast); | |
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;} | |
3292 __Pyx_GOTREF(__pyx_t_3); | |
3293 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
3294 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
3295 if ((likely(PyTuple_CheckExact(__pyx_t_3))) || (PyList_CheckExact(__pyx_t_3))) { | |
3296 PyObject* sequence = __pyx_t_3; | |
3297 #if CYTHON_COMPILING_IN_CPYTHON | |
3298 Py_ssize_t size = Py_SIZE(sequence); | |
3299 #else | |
3300 Py_ssize_t size = PySequence_Size(sequence); | |
3301 #endif | |
3302 if (unlikely(size != 2)) { | |
3303 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
3304 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
3305 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
3306 } | |
3307 #if CYTHON_COMPILING_IN_CPYTHON | |
3308 if (likely(PyTuple_CheckExact(sequence))) { | |
3309 __pyx_t_2 = PyTuple_GET_ITEM(sequence, 0); | |
3310 __pyx_t_1 = PyTuple_GET_ITEM(sequence, 1); | |
3311 } else { | |
3312 __pyx_t_2 = PyList_GET_ITEM(sequence, 0); | |
3313 __pyx_t_1 = PyList_GET_ITEM(sequence, 1); | |
3314 } | |
3315 __Pyx_INCREF(__pyx_t_2); | |
3316 __Pyx_INCREF(__pyx_t_1); | |
3317 #else | |
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;} | |
3319 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
3321 __Pyx_GOTREF(__pyx_t_1); | |
3322 #endif | |
3323 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
3324 } else { | |
3325 Py_ssize_t index = -1; | |
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;} | |
3327 __Pyx_GOTREF(__pyx_t_4); | |
3328 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
3329 __pyx_t_5 = Py_TYPE(__pyx_t_4)->tp_iternext; | |
3330 index = 0; __pyx_t_2 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_2)) goto __pyx_L3_unpacking_failed; | |
3331 __Pyx_GOTREF(__pyx_t_2); | |
3332 index = 1; __pyx_t_1 = __pyx_t_5(__pyx_t_4); if (unlikely(!__pyx_t_1)) goto __pyx_L3_unpacking_failed; | |
3333 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
3335 __pyx_t_5 = NULL; | |
3336 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3337 goto __pyx_L4_unpacking_done; | |
3338 __pyx_L3_unpacking_failed:; | |
3339 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3340 __pyx_t_5 = NULL; | |
3341 if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index); | |
3342 {__pyx_filename = __pyx_f[0]; __pyx_lineno = 229; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
3343 __pyx_L4_unpacking_done:; | |
3344 } | |
3345 __pyx_v_s = __pyx_t_2; | |
3346 __pyx_t_2 = 0; | |
3347 __pyx_v_ptr = __pyx_t_1; | |
3348 __pyx_t_1 = 0; | |
3349 | |
3350 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":230 | |
3351 * """ | |
3352 * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast) | |
3353 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) # <<<<<<<<<<<<<< | |
3354 * cdef int maxlen=len(seq1) | |
3355 * if len(seq2)>len(seq1): | |
3356 */ | |
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;} | |
3358 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
3360 __Pyx_GOTREF(__pyx_t_1); | |
3361 __Pyx_INCREF(__pyx_v_seq1); | |
3362 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_seq1); | |
3363 __Pyx_GIVEREF(__pyx_v_seq1); | |
3364 __Pyx_INCREF(__pyx_v_seq2); | |
3365 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_seq2); | |
3366 __Pyx_GIVEREF(__pyx_v_seq2); | |
3367 __Pyx_INCREF(__pyx_v_s); | |
3368 PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_s); | |
3369 __Pyx_GIVEREF(__pyx_v_s); | |
3370 __Pyx_INCREF(__pyx_v_ptr); | |
3371 PyTuple_SET_ITEM(__pyx_t_1, 3, __pyx_v_ptr); | |
3372 __Pyx_GIVEREF(__pyx_v_ptr); | |
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;} | |
3374 __Pyx_GOTREF(__pyx_t_2); | |
3375 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
3376 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
3377 __pyx_v_alignment = __pyx_t_2; | |
3378 __pyx_t_2 = 0; | |
3379 | |
3380 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":231 | |
3381 * s,ptr = self.__needleman_wunsch_matrix(seq1, seq2,isFast) | |
3382 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) | |
3383 * cdef int maxlen=len(seq1) # <<<<<<<<<<<<<< | |
3384 * if len(seq2)>len(seq1): | |
3385 * maxlen=len(seq2) | |
3386 */ | |
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;} | |
3388 __pyx_v_maxlen = __pyx_t_6; | |
3389 | |
3390 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":232 | |
3391 * alignment = self.__needleman_wunsch_trace(seq1, seq2, s, ptr) | |
3392 * cdef int maxlen=len(seq1) | |
3393 * if len(seq2)>len(seq1): # <<<<<<<<<<<<<< | |
3394 * maxlen=len(seq2) | |
3395 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen | |
3396 */ | |
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;} | |
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;} | |
3399 __pyx_t_8 = ((__pyx_t_6 > __pyx_t_7) != 0); | |
3400 if (__pyx_t_8) { | |
3401 | |
3402 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":233 | |
3403 * cdef int maxlen=len(seq1) | |
3404 * if len(seq2)>len(seq1): | |
3405 * maxlen=len(seq2) # <<<<<<<<<<<<<< | |
3406 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen | |
3407 * return alignment, s[len(seq1), len(seq2)],finalscore | |
3408 */ | |
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;} | |
3410 __pyx_v_maxlen = __pyx_t_7; | |
3411 goto __pyx_L5; | |
3412 } | |
3413 __pyx_L5:; | |
3414 | |
3415 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":234 | |
3416 * if len(seq2)>len(seq1): | |
3417 * maxlen=len(seq2) | |
3418 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen # <<<<<<<<<<<<<< | |
3419 * return alignment, s[len(seq1), len(seq2)],finalscore | |
3420 * | |
3421 */ | |
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;} | |
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;} | |
3424 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
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;} | |
3427 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
3429 __Pyx_GOTREF(__pyx_t_3); | |
3430 PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); | |
3431 __Pyx_GIVEREF(__pyx_t_2); | |
3432 PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1); | |
3433 __Pyx_GIVEREF(__pyx_t_1); | |
3434 __pyx_t_2 = 0; | |
3435 __pyx_t_1 = 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;}; | |
3437 __Pyx_GOTREF(__pyx_t_1); | |
3438 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
3440 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
3442 __Pyx_GOTREF(__pyx_t_2); | |
3443 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
3444 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
3446 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
3447 __pyx_v_finalscore = __pyx_t_9; | |
3448 | |
3449 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":235 | |
3450 * maxlen=len(seq2) | |
3451 * cdef float finalscore=s[len(seq1), len(seq2)]/maxlen | |
3452 * return alignment, s[len(seq1), len(seq2)],finalscore # <<<<<<<<<<<<<< | |
3453 * | |
3454 * | |
3455 */ | |
3456 __Pyx_XDECREF(__pyx_r); | |
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;} | |
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;} | |
3459 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
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;} | |
3462 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
3464 __Pyx_GOTREF(__pyx_t_1); | |
3465 PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2); | |
3466 __Pyx_GIVEREF(__pyx_t_2); | |
3467 PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3); | |
3468 __Pyx_GIVEREF(__pyx_t_3); | |
3469 __pyx_t_2 = 0; | |
3470 __pyx_t_3 = 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;}; | |
3472 __Pyx_GOTREF(__pyx_t_3); | |
3473 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 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;} | |
3475 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
3477 __Pyx_GOTREF(__pyx_t_2); | |
3478 __Pyx_INCREF(__pyx_v_alignment); | |
3479 PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_alignment); | |
3480 __Pyx_GIVEREF(__pyx_v_alignment); | |
3481 PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3); | |
3482 __Pyx_GIVEREF(__pyx_t_3); | |
3483 PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_1); | |
3484 __Pyx_GIVEREF(__pyx_t_1); | |
3485 __pyx_t_3 = 0; | |
3486 __pyx_t_1 = 0; | |
3487 __pyx_r = __pyx_t_2; | |
3488 __pyx_t_2 = 0; | |
3489 goto __pyx_L0; | |
3490 | |
3491 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 | |
3492 * | |
3493 * | |
3494 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< | |
3495 * """ | |
3496 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch | |
3497 */ | |
3498 | |
3499 /* function exit code */ | |
3500 __pyx_L1_error:; | |
3501 __Pyx_XDECREF(__pyx_t_1); | |
3502 __Pyx_XDECREF(__pyx_t_2); | |
3503 __Pyx_XDECREF(__pyx_t_3); | |
3504 __Pyx_XDECREF(__pyx_t_4); | |
3505 __Pyx_AddTraceback("MultipleOMR.Alignment.FastAlignmentArrays.FastAlignmentArrays.needleman_wunsch", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
3506 __pyx_r = NULL; | |
3507 __pyx_L0:; | |
3508 __Pyx_XDECREF(__pyx_v_s); | |
3509 __Pyx_XDECREF(__pyx_v_ptr); | |
3510 __Pyx_XDECREF(__pyx_v_alignment); | |
3511 __Pyx_XGIVEREF(__pyx_r); | |
3512 __Pyx_RefNannyFinishContext(); | |
3513 return __pyx_r; | |
3514 } | |
3515 | |
3516 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194 | |
3517 * # experimental exception made for __getbuffer__ and __releasebuffer__ | |
3518 * # -- the details of this may change. | |
3519 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
3520 * # This implementation of getbuffer is geared towards Cython | |
3521 * # requirements, and does not yet fullfill the PEP. | |
3522 */ | |
3523 | |
3524 /* Python wrapper */ | |
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*/ | |
3526 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { | |
3527 int __pyx_r; | |
3528 __Pyx_RefNannyDeclarations | |
3529 __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0); | |
3530 __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags)); | |
3531 | |
3532 /* function exit code */ | |
3533 __Pyx_RefNannyFinishContext(); | |
3534 return __pyx_r; | |
3535 } | |
3536 | |
3537 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) { | |
3538 int __pyx_v_copy_shape; | |
3539 int __pyx_v_i; | |
3540 int __pyx_v_ndim; | |
3541 int __pyx_v_endian_detector; | |
3542 int __pyx_v_little_endian; | |
3543 int __pyx_v_t; | |
3544 char *__pyx_v_f; | |
3545 PyArray_Descr *__pyx_v_descr = 0; | |
3546 int __pyx_v_offset; | |
3547 int __pyx_v_hasfields; | |
3548 int __pyx_r; | |
3549 __Pyx_RefNannyDeclarations | |
3550 int __pyx_t_1; | |
3551 int __pyx_t_2; | |
3552 int __pyx_t_3; | |
3553 PyObject *__pyx_t_4 = NULL; | |
3554 int __pyx_t_5; | |
3555 int __pyx_t_6; | |
3556 int __pyx_t_7; | |
3557 PyObject *__pyx_t_8 = NULL; | |
3558 char *__pyx_t_9; | |
3559 int __pyx_lineno = 0; | |
3560 const char *__pyx_filename = NULL; | |
3561 int __pyx_clineno = 0; | |
3562 __Pyx_RefNannySetupContext("__getbuffer__", 0); | |
3563 if (__pyx_v_info != NULL) { | |
3564 __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None); | |
3565 __Pyx_GIVEREF(__pyx_v_info->obj); | |
3566 } | |
3567 | |
3568 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":200 | |
3569 * # of flags | |
3570 * | |
3571 * if info == NULL: return # <<<<<<<<<<<<<< | |
3572 * | |
3573 * cdef int copy_shape, i, ndim | |
3574 */ | |
3575 __pyx_t_1 = ((__pyx_v_info == NULL) != 0); | |
3576 if (__pyx_t_1) { | |
3577 __pyx_r = 0; | |
3578 goto __pyx_L0; | |
3579 } | |
3580 | |
3581 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":203 | |
3582 * | |
3583 * cdef int copy_shape, i, ndim | |
3584 * cdef int endian_detector = 1 # <<<<<<<<<<<<<< | |
3585 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) | |
3586 * | |
3587 */ | |
3588 __pyx_v_endian_detector = 1; | |
3589 | |
3590 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":204 | |
3591 * cdef int copy_shape, i, ndim | |
3592 * cdef int endian_detector = 1 | |
3593 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< | |
3594 * | |
3595 * ndim = PyArray_NDIM(self) | |
3596 */ | |
3597 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); | |
3598 | |
3599 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":206 | |
3600 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) | |
3601 * | |
3602 * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<< | |
3603 * | |
3604 * if sizeof(npy_intp) != sizeof(Py_ssize_t): | |
3605 */ | |
3606 __pyx_v_ndim = PyArray_NDIM(__pyx_v_self); | |
3607 | |
3608 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":208 | |
3609 * ndim = PyArray_NDIM(self) | |
3610 * | |
3611 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< | |
3612 * copy_shape = 1 | |
3613 * else: | |
3614 */ | |
3615 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); | |
3616 if (__pyx_t_1) { | |
3617 | |
3618 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":209 | |
3619 * | |
3620 * if sizeof(npy_intp) != sizeof(Py_ssize_t): | |
3621 * copy_shape = 1 # <<<<<<<<<<<<<< | |
3622 * else: | |
3623 * copy_shape = 0 | |
3624 */ | |
3625 __pyx_v_copy_shape = 1; | |
3626 goto __pyx_L4; | |
3627 } | |
3628 /*else*/ { | |
3629 | |
3630 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":211 | |
3631 * copy_shape = 1 | |
3632 * else: | |
3633 * copy_shape = 0 # <<<<<<<<<<<<<< | |
3634 * | |
3635 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) | |
3636 */ | |
3637 __pyx_v_copy_shape = 0; | |
3638 } | |
3639 __pyx_L4:; | |
3640 | |
3641 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":213 | |
3642 * copy_shape = 0 | |
3643 * | |
3644 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<< | |
3645 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): | |
3646 * raise ValueError(u"ndarray is not C contiguous") | |
3647 */ | |
3648 __pyx_t_1 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0); | |
3649 if (__pyx_t_1) { | |
3650 | |
3651 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":214 | |
3652 * | |
3653 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) | |
3654 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<< | |
3655 * raise ValueError(u"ndarray is not C contiguous") | |
3656 * | |
3657 */ | |
3658 __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0); | |
3659 __pyx_t_3 = __pyx_t_2; | |
3660 } else { | |
3661 __pyx_t_3 = __pyx_t_1; | |
3662 } | |
3663 if (__pyx_t_3) { | |
3664 | |
3665 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215 | |
3666 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) | |
3667 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): | |
3668 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< | |
3669 * | |
3670 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) | |
3671 */ | |
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;} | |
3673 __Pyx_GOTREF(__pyx_t_4); | |
3674 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
3675 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3676 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 215; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
3677 } | |
3678 | |
3679 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":217 | |
3680 * raise ValueError(u"ndarray is not C contiguous") | |
3681 * | |
3682 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<< | |
3683 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): | |
3684 * raise ValueError(u"ndarray is not Fortran contiguous") | |
3685 */ | |
3686 __pyx_t_3 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0); | |
3687 if (__pyx_t_3) { | |
3688 | |
3689 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":218 | |
3690 * | |
3691 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) | |
3692 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<< | |
3693 * raise ValueError(u"ndarray is not Fortran contiguous") | |
3694 * | |
3695 */ | |
3696 __pyx_t_1 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0); | |
3697 __pyx_t_2 = __pyx_t_1; | |
3698 } else { | |
3699 __pyx_t_2 = __pyx_t_3; | |
3700 } | |
3701 if (__pyx_t_2) { | |
3702 | |
3703 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219 | |
3704 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) | |
3705 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): | |
3706 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< | |
3707 * | |
3708 * info.buf = PyArray_DATA(self) | |
3709 */ | |
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;} | |
3711 __Pyx_GOTREF(__pyx_t_4); | |
3712 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
3713 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3714 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 219; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
3715 } | |
3716 | |
3717 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":221 | |
3718 * raise ValueError(u"ndarray is not Fortran contiguous") | |
3719 * | |
3720 * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<< | |
3721 * info.ndim = ndim | |
3722 * if copy_shape: | |
3723 */ | |
3724 __pyx_v_info->buf = PyArray_DATA(__pyx_v_self); | |
3725 | |
3726 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":222 | |
3727 * | |
3728 * info.buf = PyArray_DATA(self) | |
3729 * info.ndim = ndim # <<<<<<<<<<<<<< | |
3730 * if copy_shape: | |
3731 * # Allocate new buffer for strides and shape info. | |
3732 */ | |
3733 __pyx_v_info->ndim = __pyx_v_ndim; | |
3734 | |
3735 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":223 | |
3736 * info.buf = PyArray_DATA(self) | |
3737 * info.ndim = ndim | |
3738 * if copy_shape: # <<<<<<<<<<<<<< | |
3739 * # Allocate new buffer for strides and shape info. | |
3740 * # This is allocated as one block, strides first. | |
3741 */ | |
3742 __pyx_t_2 = (__pyx_v_copy_shape != 0); | |
3743 if (__pyx_t_2) { | |
3744 | |
3745 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":226 | |
3746 * # Allocate new buffer for strides and shape info. | |
3747 * # This is allocated as one block, strides first. | |
3748 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) # <<<<<<<<<<<<<< | |
3749 * info.shape = info.strides + ndim | |
3750 * for i in range(ndim): | |
3751 */ | |
3752 __pyx_v_info->strides = ((Py_ssize_t *)malloc((((sizeof(Py_ssize_t)) * ((size_t)__pyx_v_ndim)) * 2))); | |
3753 | |
3754 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":227 | |
3755 * # This is allocated as one block, strides first. | |
3756 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) | |
3757 * info.shape = info.strides + ndim # <<<<<<<<<<<<<< | |
3758 * for i in range(ndim): | |
3759 * info.strides[i] = PyArray_STRIDES(self)[i] | |
3760 */ | |
3761 __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim); | |
3762 | |
3763 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":228 | |
3764 * info.strides = <Py_ssize_t*>stdlib.malloc(sizeof(Py_ssize_t) * <size_t>ndim * 2) | |
3765 * info.shape = info.strides + ndim | |
3766 * for i in range(ndim): # <<<<<<<<<<<<<< | |
3767 * info.strides[i] = PyArray_STRIDES(self)[i] | |
3768 * info.shape[i] = PyArray_DIMS(self)[i] | |
3769 */ | |
3770 __pyx_t_5 = __pyx_v_ndim; | |
3771 for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) { | |
3772 __pyx_v_i = __pyx_t_6; | |
3773 | |
3774 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":229 | |
3775 * info.shape = info.strides + ndim | |
3776 * for i in range(ndim): | |
3777 * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<< | |
3778 * info.shape[i] = PyArray_DIMS(self)[i] | |
3779 * else: | |
3780 */ | |
3781 (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]); | |
3782 | |
3783 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":230 | |
3784 * for i in range(ndim): | |
3785 * info.strides[i] = PyArray_STRIDES(self)[i] | |
3786 * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<< | |
3787 * else: | |
3788 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) | |
3789 */ | |
3790 (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]); | |
3791 } | |
3792 goto __pyx_L7; | |
3793 } | |
3794 /*else*/ { | |
3795 | |
3796 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":232 | |
3797 * info.shape[i] = PyArray_DIMS(self)[i] | |
3798 * else: | |
3799 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<< | |
3800 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) | |
3801 * info.suboffsets = NULL | |
3802 */ | |
3803 __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self)); | |
3804 | |
3805 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":233 | |
3806 * else: | |
3807 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) | |
3808 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<< | |
3809 * info.suboffsets = NULL | |
3810 * info.itemsize = PyArray_ITEMSIZE(self) | |
3811 */ | |
3812 __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self)); | |
3813 } | |
3814 __pyx_L7:; | |
3815 | |
3816 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":234 | |
3817 * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) | |
3818 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) | |
3819 * info.suboffsets = NULL # <<<<<<<<<<<<<< | |
3820 * info.itemsize = PyArray_ITEMSIZE(self) | |
3821 * info.readonly = not PyArray_ISWRITEABLE(self) | |
3822 */ | |
3823 __pyx_v_info->suboffsets = NULL; | |
3824 | |
3825 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":235 | |
3826 * info.shape = <Py_ssize_t*>PyArray_DIMS(self) | |
3827 * info.suboffsets = NULL | |
3828 * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<< | |
3829 * info.readonly = not PyArray_ISWRITEABLE(self) | |
3830 * | |
3831 */ | |
3832 __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self); | |
3833 | |
3834 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":236 | |
3835 * info.suboffsets = NULL | |
3836 * info.itemsize = PyArray_ITEMSIZE(self) | |
3837 * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<< | |
3838 * | |
3839 * cdef int t | |
3840 */ | |
3841 __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0)); | |
3842 | |
3843 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":239 | |
3844 * | |
3845 * cdef int t | |
3846 * cdef char* f = NULL # <<<<<<<<<<<<<< | |
3847 * cdef dtype descr = self.descr | |
3848 * cdef list stack | |
3849 */ | |
3850 __pyx_v_f = NULL; | |
3851 | |
3852 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":240 | |
3853 * cdef int t | |
3854 * cdef char* f = NULL | |
3855 * cdef dtype descr = self.descr # <<<<<<<<<<<<<< | |
3856 * cdef list stack | |
3857 * cdef int offset | |
3858 */ | |
3859 __pyx_t_4 = ((PyObject *)__pyx_v_self->descr); | |
3860 __Pyx_INCREF(__pyx_t_4); | |
3861 __pyx_v_descr = ((PyArray_Descr *)__pyx_t_4); | |
3862 __pyx_t_4 = 0; | |
3863 | |
3864 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":244 | |
3865 * cdef int offset | |
3866 * | |
3867 * cdef bint hasfields = PyDataType_HASFIELDS(descr) # <<<<<<<<<<<<<< | |
3868 * | |
3869 * if not hasfields and not copy_shape: | |
3870 */ | |
3871 __pyx_v_hasfields = PyDataType_HASFIELDS(__pyx_v_descr); | |
3872 | |
3873 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":246 | |
3874 * cdef bint hasfields = PyDataType_HASFIELDS(descr) | |
3875 * | |
3876 * if not hasfields and not copy_shape: # <<<<<<<<<<<<<< | |
3877 * # do not call releasebuffer | |
3878 * info.obj = None | |
3879 */ | |
3880 __pyx_t_2 = ((!(__pyx_v_hasfields != 0)) != 0); | |
3881 if (__pyx_t_2) { | |
3882 __pyx_t_3 = ((!(__pyx_v_copy_shape != 0)) != 0); | |
3883 __pyx_t_1 = __pyx_t_3; | |
3884 } else { | |
3885 __pyx_t_1 = __pyx_t_2; | |
3886 } | |
3887 if (__pyx_t_1) { | |
3888 | |
3889 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":248 | |
3890 * if not hasfields and not copy_shape: | |
3891 * # do not call releasebuffer | |
3892 * info.obj = None # <<<<<<<<<<<<<< | |
3893 * else: | |
3894 * # need to call releasebuffer | |
3895 */ | |
3896 __Pyx_INCREF(Py_None); | |
3897 __Pyx_GIVEREF(Py_None); | |
3898 __Pyx_GOTREF(__pyx_v_info->obj); | |
3899 __Pyx_DECREF(__pyx_v_info->obj); | |
3900 __pyx_v_info->obj = Py_None; | |
3901 goto __pyx_L10; | |
3902 } | |
3903 /*else*/ { | |
3904 | |
3905 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":251 | |
3906 * else: | |
3907 * # need to call releasebuffer | |
3908 * info.obj = self # <<<<<<<<<<<<<< | |
3909 * | |
3910 * if not hasfields: | |
3911 */ | |
3912 __Pyx_INCREF(((PyObject *)__pyx_v_self)); | |
3913 __Pyx_GIVEREF(((PyObject *)__pyx_v_self)); | |
3914 __Pyx_GOTREF(__pyx_v_info->obj); | |
3915 __Pyx_DECREF(__pyx_v_info->obj); | |
3916 __pyx_v_info->obj = ((PyObject *)__pyx_v_self); | |
3917 } | |
3918 __pyx_L10:; | |
3919 | |
3920 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":253 | |
3921 * info.obj = self | |
3922 * | |
3923 * if not hasfields: # <<<<<<<<<<<<<< | |
3924 * t = descr.type_num | |
3925 * if ((descr.byteorder == c'>' and little_endian) or | |
3926 */ | |
3927 __pyx_t_1 = ((!(__pyx_v_hasfields != 0)) != 0); | |
3928 if (__pyx_t_1) { | |
3929 | |
3930 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":254 | |
3931 * | |
3932 * if not hasfields: | |
3933 * t = descr.type_num # <<<<<<<<<<<<<< | |
3934 * if ((descr.byteorder == c'>' and little_endian) or | |
3935 * (descr.byteorder == c'<' and not little_endian)): | |
3936 */ | |
3937 __pyx_t_5 = __pyx_v_descr->type_num; | |
3938 __pyx_v_t = __pyx_t_5; | |
3939 | |
3940 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":255 | |
3941 * if not hasfields: | |
3942 * t = descr.type_num | |
3943 * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< | |
3944 * (descr.byteorder == c'<' and not little_endian)): | |
3945 * raise ValueError(u"Non-native byte order not supported") | |
3946 */ | |
3947 __pyx_t_1 = ((__pyx_v_descr->byteorder == '>') != 0); | |
3948 if (__pyx_t_1) { | |
3949 __pyx_t_2 = (__pyx_v_little_endian != 0); | |
3950 } else { | |
3951 __pyx_t_2 = __pyx_t_1; | |
3952 } | |
3953 if (!__pyx_t_2) { | |
3954 | |
3955 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":256 | |
3956 * t = descr.type_num | |
3957 * if ((descr.byteorder == c'>' and little_endian) or | |
3958 * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< | |
3959 * raise ValueError(u"Non-native byte order not supported") | |
3960 * if t == NPY_BYTE: f = "b" | |
3961 */ | |
3962 __pyx_t_1 = ((__pyx_v_descr->byteorder == '<') != 0); | |
3963 if (__pyx_t_1) { | |
3964 __pyx_t_3 = ((!(__pyx_v_little_endian != 0)) != 0); | |
3965 __pyx_t_7 = __pyx_t_3; | |
3966 } else { | |
3967 __pyx_t_7 = __pyx_t_1; | |
3968 } | |
3969 __pyx_t_1 = __pyx_t_7; | |
3970 } else { | |
3971 __pyx_t_1 = __pyx_t_2; | |
3972 } | |
3973 if (__pyx_t_1) { | |
3974 | |
3975 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257 | |
3976 * if ((descr.byteorder == c'>' and little_endian) or | |
3977 * (descr.byteorder == c'<' and not little_endian)): | |
3978 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< | |
3979 * if t == NPY_BYTE: f = "b" | |
3980 * elif t == NPY_UBYTE: f = "B" | |
3981 */ | |
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;} | |
3983 __Pyx_GOTREF(__pyx_t_4); | |
3984 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
3985 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
3986 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 257; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
3987 } | |
3988 | |
3989 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274 | |
3990 * elif t == NPY_CDOUBLE: f = "Zd" | |
3991 * elif t == NPY_CLONGDOUBLE: f = "Zg" | |
3992 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< | |
3993 * else: | |
3994 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) | |
3995 */ | |
3996 switch (__pyx_v_t) { | |
3997 | |
3998 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":258 | |
3999 * (descr.byteorder == c'<' and not little_endian)): | |
4000 * raise ValueError(u"Non-native byte order not supported") | |
4001 * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<< | |
4002 * elif t == NPY_UBYTE: f = "B" | |
4003 * elif t == NPY_SHORT: f = "h" | |
4004 */ | |
4005 case NPY_BYTE: | |
4006 __pyx_v_f = __pyx_k_b; | |
4007 break; | |
4008 | |
4009 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":259 | |
4010 * raise ValueError(u"Non-native byte order not supported") | |
4011 * if t == NPY_BYTE: f = "b" | |
4012 * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<< | |
4013 * elif t == NPY_SHORT: f = "h" | |
4014 * elif t == NPY_USHORT: f = "H" | |
4015 */ | |
4016 case NPY_UBYTE: | |
4017 __pyx_v_f = __pyx_k_B; | |
4018 break; | |
4019 | |
4020 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":260 | |
4021 * if t == NPY_BYTE: f = "b" | |
4022 * elif t == NPY_UBYTE: f = "B" | |
4023 * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<< | |
4024 * elif t == NPY_USHORT: f = "H" | |
4025 * elif t == NPY_INT: f = "i" | |
4026 */ | |
4027 case NPY_SHORT: | |
4028 __pyx_v_f = __pyx_k_h; | |
4029 break; | |
4030 | |
4031 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":261 | |
4032 * elif t == NPY_UBYTE: f = "B" | |
4033 * elif t == NPY_SHORT: f = "h" | |
4034 * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<< | |
4035 * elif t == NPY_INT: f = "i" | |
4036 * elif t == NPY_UINT: f = "I" | |
4037 */ | |
4038 case NPY_USHORT: | |
4039 __pyx_v_f = __pyx_k_H; | |
4040 break; | |
4041 | |
4042 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":262 | |
4043 * elif t == NPY_SHORT: f = "h" | |
4044 * elif t == NPY_USHORT: f = "H" | |
4045 * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<< | |
4046 * elif t == NPY_UINT: f = "I" | |
4047 * elif t == NPY_LONG: f = "l" | |
4048 */ | |
4049 case NPY_INT: | |
4050 __pyx_v_f = __pyx_k_i; | |
4051 break; | |
4052 | |
4053 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":263 | |
4054 * elif t == NPY_USHORT: f = "H" | |
4055 * elif t == NPY_INT: f = "i" | |
4056 * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<< | |
4057 * elif t == NPY_LONG: f = "l" | |
4058 * elif t == NPY_ULONG: f = "L" | |
4059 */ | |
4060 case NPY_UINT: | |
4061 __pyx_v_f = __pyx_k_I; | |
4062 break; | |
4063 | |
4064 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":264 | |
4065 * elif t == NPY_INT: f = "i" | |
4066 * elif t == NPY_UINT: f = "I" | |
4067 * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<< | |
4068 * elif t == NPY_ULONG: f = "L" | |
4069 * elif t == NPY_LONGLONG: f = "q" | |
4070 */ | |
4071 case NPY_LONG: | |
4072 __pyx_v_f = __pyx_k_l; | |
4073 break; | |
4074 | |
4075 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":265 | |
4076 * elif t == NPY_UINT: f = "I" | |
4077 * elif t == NPY_LONG: f = "l" | |
4078 * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<< | |
4079 * elif t == NPY_LONGLONG: f = "q" | |
4080 * elif t == NPY_ULONGLONG: f = "Q" | |
4081 */ | |
4082 case NPY_ULONG: | |
4083 __pyx_v_f = __pyx_k_L; | |
4084 break; | |
4085 | |
4086 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":266 | |
4087 * elif t == NPY_LONG: f = "l" | |
4088 * elif t == NPY_ULONG: f = "L" | |
4089 * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<< | |
4090 * elif t == NPY_ULONGLONG: f = "Q" | |
4091 * elif t == NPY_FLOAT: f = "f" | |
4092 */ | |
4093 case NPY_LONGLONG: | |
4094 __pyx_v_f = __pyx_k_q; | |
4095 break; | |
4096 | |
4097 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":267 | |
4098 * elif t == NPY_ULONG: f = "L" | |
4099 * elif t == NPY_LONGLONG: f = "q" | |
4100 * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<< | |
4101 * elif t == NPY_FLOAT: f = "f" | |
4102 * elif t == NPY_DOUBLE: f = "d" | |
4103 */ | |
4104 case NPY_ULONGLONG: | |
4105 __pyx_v_f = __pyx_k_Q; | |
4106 break; | |
4107 | |
4108 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":268 | |
4109 * elif t == NPY_LONGLONG: f = "q" | |
4110 * elif t == NPY_ULONGLONG: f = "Q" | |
4111 * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<< | |
4112 * elif t == NPY_DOUBLE: f = "d" | |
4113 * elif t == NPY_LONGDOUBLE: f = "g" | |
4114 */ | |
4115 case NPY_FLOAT: | |
4116 __pyx_v_f = __pyx_k_f; | |
4117 break; | |
4118 | |
4119 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":269 | |
4120 * elif t == NPY_ULONGLONG: f = "Q" | |
4121 * elif t == NPY_FLOAT: f = "f" | |
4122 * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<< | |
4123 * elif t == NPY_LONGDOUBLE: f = "g" | |
4124 * elif t == NPY_CFLOAT: f = "Zf" | |
4125 */ | |
4126 case NPY_DOUBLE: | |
4127 __pyx_v_f = __pyx_k_d; | |
4128 break; | |
4129 | |
4130 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":270 | |
4131 * elif t == NPY_FLOAT: f = "f" | |
4132 * elif t == NPY_DOUBLE: f = "d" | |
4133 * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<< | |
4134 * elif t == NPY_CFLOAT: f = "Zf" | |
4135 * elif t == NPY_CDOUBLE: f = "Zd" | |
4136 */ | |
4137 case NPY_LONGDOUBLE: | |
4138 __pyx_v_f = __pyx_k_g; | |
4139 break; | |
4140 | |
4141 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":271 | |
4142 * elif t == NPY_DOUBLE: f = "d" | |
4143 * elif t == NPY_LONGDOUBLE: f = "g" | |
4144 * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<< | |
4145 * elif t == NPY_CDOUBLE: f = "Zd" | |
4146 * elif t == NPY_CLONGDOUBLE: f = "Zg" | |
4147 */ | |
4148 case NPY_CFLOAT: | |
4149 __pyx_v_f = __pyx_k_Zf; | |
4150 break; | |
4151 | |
4152 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":272 | |
4153 * elif t == NPY_LONGDOUBLE: f = "g" | |
4154 * elif t == NPY_CFLOAT: f = "Zf" | |
4155 * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<< | |
4156 * elif t == NPY_CLONGDOUBLE: f = "Zg" | |
4157 * elif t == NPY_OBJECT: f = "O" | |
4158 */ | |
4159 case NPY_CDOUBLE: | |
4160 __pyx_v_f = __pyx_k_Zd; | |
4161 break; | |
4162 | |
4163 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":273 | |
4164 * elif t == NPY_CFLOAT: f = "Zf" | |
4165 * elif t == NPY_CDOUBLE: f = "Zd" | |
4166 * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<< | |
4167 * elif t == NPY_OBJECT: f = "O" | |
4168 * else: | |
4169 */ | |
4170 case NPY_CLONGDOUBLE: | |
4171 __pyx_v_f = __pyx_k_Zg; | |
4172 break; | |
4173 | |
4174 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":274 | |
4175 * elif t == NPY_CDOUBLE: f = "Zd" | |
4176 * elif t == NPY_CLONGDOUBLE: f = "Zg" | |
4177 * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<< | |
4178 * else: | |
4179 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) | |
4180 */ | |
4181 case NPY_OBJECT: | |
4182 __pyx_v_f = __pyx_k_O; | |
4183 break; | |
4184 default: | |
4185 | |
4186 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":276 | |
4187 * elif t == NPY_OBJECT: f = "O" | |
4188 * else: | |
4189 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< | |
4190 * info.format = f | |
4191 * return | |
4192 */ | |
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;} | |
4194 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
4196 __Pyx_GOTREF(__pyx_t_8); | |
4197 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
4199 __Pyx_GOTREF(__pyx_t_4); | |
4200 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); | |
4201 __Pyx_GIVEREF(__pyx_t_8); | |
4202 __pyx_t_8 = 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;} | |
4204 __Pyx_GOTREF(__pyx_t_8); | |
4205 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
4206 __Pyx_Raise(__pyx_t_8, 0, 0, 0); | |
4207 __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0; | |
4208 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 276; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
4209 break; | |
4210 } | |
4211 | |
4212 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":277 | |
4213 * else: | |
4214 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) | |
4215 * info.format = f # <<<<<<<<<<<<<< | |
4216 * return | |
4217 * else: | |
4218 */ | |
4219 __pyx_v_info->format = __pyx_v_f; | |
4220 | |
4221 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":278 | |
4222 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) | |
4223 * info.format = f | |
4224 * return # <<<<<<<<<<<<<< | |
4225 * else: | |
4226 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) | |
4227 */ | |
4228 __pyx_r = 0; | |
4229 goto __pyx_L0; | |
4230 } | |
4231 /*else*/ { | |
4232 | |
4233 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":280 | |
4234 * return | |
4235 * else: | |
4236 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) # <<<<<<<<<<<<<< | |
4237 * info.format[0] = c'^' # Native data types, manual alignment | |
4238 * offset = 0 | |
4239 */ | |
4240 __pyx_v_info->format = ((char *)malloc(255)); | |
4241 | |
4242 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":281 | |
4243 * else: | |
4244 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) | |
4245 * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<< | |
4246 * offset = 0 | |
4247 * f = _util_dtypestring(descr, info.format + 1, | |
4248 */ | |
4249 (__pyx_v_info->format[0]) = '^'; | |
4250 | |
4251 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":282 | |
4252 * info.format = <char*>stdlib.malloc(_buffer_format_string_len) | |
4253 * info.format[0] = c'^' # Native data types, manual alignment | |
4254 * offset = 0 # <<<<<<<<<<<<<< | |
4255 * f = _util_dtypestring(descr, info.format + 1, | |
4256 * info.format + _buffer_format_string_len, | |
4257 */ | |
4258 __pyx_v_offset = 0; | |
4259 | |
4260 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":283 | |
4261 * info.format[0] = c'^' # Native data types, manual alignment | |
4262 * offset = 0 | |
4263 * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<< | |
4264 * info.format + _buffer_format_string_len, | |
4265 * &offset) | |
4266 */ | |
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;} | |
4268 __pyx_v_f = __pyx_t_9; | |
4269 | |
4270 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":286 | |
4271 * info.format + _buffer_format_string_len, | |
4272 * &offset) | |
4273 * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<< | |
4274 * | |
4275 * def __releasebuffer__(ndarray self, Py_buffer* info): | |
4276 */ | |
4277 (__pyx_v_f[0]) = '\x00'; | |
4278 } | |
4279 | |
4280 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":194 | |
4281 * # experimental exception made for __getbuffer__ and __releasebuffer__ | |
4282 * # -- the details of this may change. | |
4283 * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<< | |
4284 * # This implementation of getbuffer is geared towards Cython | |
4285 * # requirements, and does not yet fullfill the PEP. | |
4286 */ | |
4287 | |
4288 /* function exit code */ | |
4289 __pyx_r = 0; | |
4290 goto __pyx_L0; | |
4291 __pyx_L1_error:; | |
4292 __Pyx_XDECREF(__pyx_t_4); | |
4293 __Pyx_XDECREF(__pyx_t_8); | |
4294 __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
4295 __pyx_r = -1; | |
4296 if (__pyx_v_info != NULL && __pyx_v_info->obj != NULL) { | |
4297 __Pyx_GOTREF(__pyx_v_info->obj); | |
4298 __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = NULL; | |
4299 } | |
4300 goto __pyx_L2; | |
4301 __pyx_L0:; | |
4302 if (__pyx_v_info != NULL && __pyx_v_info->obj == Py_None) { | |
4303 __Pyx_GOTREF(Py_None); | |
4304 __Pyx_DECREF(Py_None); __pyx_v_info->obj = NULL; | |
4305 } | |
4306 __pyx_L2:; | |
4307 __Pyx_XDECREF((PyObject *)__pyx_v_descr); | |
4308 __Pyx_RefNannyFinishContext(); | |
4309 return __pyx_r; | |
4310 } | |
4311 | |
4312 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288 | |
4313 * f[0] = c'\0' # Terminate format string | |
4314 * | |
4315 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< | |
4316 * if PyArray_HASFIELDS(self): | |
4317 * stdlib.free(info.format) | |
4318 */ | |
4319 | |
4320 /* Python wrapper */ | |
4321 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/ | |
4322 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
4323 __Pyx_RefNannyDeclarations | |
4324 __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0); | |
4325 __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info)); | |
4326 | |
4327 /* function exit code */ | |
4328 __Pyx_RefNannyFinishContext(); | |
4329 } | |
4330 | |
4331 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) { | |
4332 __Pyx_RefNannyDeclarations | |
4333 int __pyx_t_1; | |
4334 __Pyx_RefNannySetupContext("__releasebuffer__", 0); | |
4335 | |
4336 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":289 | |
4337 * | |
4338 * def __releasebuffer__(ndarray self, Py_buffer* info): | |
4339 * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<< | |
4340 * stdlib.free(info.format) | |
4341 * if sizeof(npy_intp) != sizeof(Py_ssize_t): | |
4342 */ | |
4343 __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0); | |
4344 if (__pyx_t_1) { | |
4345 | |
4346 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":290 | |
4347 * def __releasebuffer__(ndarray self, Py_buffer* info): | |
4348 * if PyArray_HASFIELDS(self): | |
4349 * stdlib.free(info.format) # <<<<<<<<<<<<<< | |
4350 * if sizeof(npy_intp) != sizeof(Py_ssize_t): | |
4351 * stdlib.free(info.strides) | |
4352 */ | |
4353 free(__pyx_v_info->format); | |
4354 goto __pyx_L3; | |
4355 } | |
4356 __pyx_L3:; | |
4357 | |
4358 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":291 | |
4359 * if PyArray_HASFIELDS(self): | |
4360 * stdlib.free(info.format) | |
4361 * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<< | |
4362 * stdlib.free(info.strides) | |
4363 * # info.shape was stored after info.strides in the same block | |
4364 */ | |
4365 __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0); | |
4366 if (__pyx_t_1) { | |
4367 | |
4368 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":292 | |
4369 * stdlib.free(info.format) | |
4370 * if sizeof(npy_intp) != sizeof(Py_ssize_t): | |
4371 * stdlib.free(info.strides) # <<<<<<<<<<<<<< | |
4372 * # info.shape was stored after info.strides in the same block | |
4373 * | |
4374 */ | |
4375 free(__pyx_v_info->strides); | |
4376 goto __pyx_L4; | |
4377 } | |
4378 __pyx_L4:; | |
4379 | |
4380 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":288 | |
4381 * f[0] = c'\0' # Terminate format string | |
4382 * | |
4383 * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<< | |
4384 * if PyArray_HASFIELDS(self): | |
4385 * stdlib.free(info.format) | |
4386 */ | |
4387 | |
4388 /* function exit code */ | |
4389 __Pyx_RefNannyFinishContext(); | |
4390 } | |
4391 | |
4392 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768 | |
4393 * ctypedef npy_cdouble complex_t | |
4394 * | |
4395 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< | |
4396 * return PyArray_MultiIterNew(1, <void*>a) | |
4397 * | |
4398 */ | |
4399 | |
4400 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) { | |
4401 PyObject *__pyx_r = NULL; | |
4402 __Pyx_RefNannyDeclarations | |
4403 PyObject *__pyx_t_1 = NULL; | |
4404 int __pyx_lineno = 0; | |
4405 const char *__pyx_filename = NULL; | |
4406 int __pyx_clineno = 0; | |
4407 __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0); | |
4408 | |
4409 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":769 | |
4410 * | |
4411 * cdef inline object PyArray_MultiIterNew1(a): | |
4412 * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<< | |
4413 * | |
4414 * cdef inline object PyArray_MultiIterNew2(a, b): | |
4415 */ | |
4416 __Pyx_XDECREF(__pyx_r); | |
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;} | |
4418 __Pyx_GOTREF(__pyx_t_1); | |
4419 __pyx_r = __pyx_t_1; | |
4420 __pyx_t_1 = 0; | |
4421 goto __pyx_L0; | |
4422 | |
4423 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":768 | |
4424 * ctypedef npy_cdouble complex_t | |
4425 * | |
4426 * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<< | |
4427 * return PyArray_MultiIterNew(1, <void*>a) | |
4428 * | |
4429 */ | |
4430 | |
4431 /* function exit code */ | |
4432 __pyx_L1_error:; | |
4433 __Pyx_XDECREF(__pyx_t_1); | |
4434 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
4435 __pyx_r = 0; | |
4436 __pyx_L0:; | |
4437 __Pyx_XGIVEREF(__pyx_r); | |
4438 __Pyx_RefNannyFinishContext(); | |
4439 return __pyx_r; | |
4440 } | |
4441 | |
4442 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771 | |
4443 * return PyArray_MultiIterNew(1, <void*>a) | |
4444 * | |
4445 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< | |
4446 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) | |
4447 * | |
4448 */ | |
4449 | |
4450 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) { | |
4451 PyObject *__pyx_r = NULL; | |
4452 __Pyx_RefNannyDeclarations | |
4453 PyObject *__pyx_t_1 = NULL; | |
4454 int __pyx_lineno = 0; | |
4455 const char *__pyx_filename = NULL; | |
4456 int __pyx_clineno = 0; | |
4457 __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0); | |
4458 | |
4459 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":772 | |
4460 * | |
4461 * cdef inline object PyArray_MultiIterNew2(a, b): | |
4462 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<< | |
4463 * | |
4464 * cdef inline object PyArray_MultiIterNew3(a, b, c): | |
4465 */ | |
4466 __Pyx_XDECREF(__pyx_r); | |
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;} | |
4468 __Pyx_GOTREF(__pyx_t_1); | |
4469 __pyx_r = __pyx_t_1; | |
4470 __pyx_t_1 = 0; | |
4471 goto __pyx_L0; | |
4472 | |
4473 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":771 | |
4474 * return PyArray_MultiIterNew(1, <void*>a) | |
4475 * | |
4476 * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<< | |
4477 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) | |
4478 * | |
4479 */ | |
4480 | |
4481 /* function exit code */ | |
4482 __pyx_L1_error:; | |
4483 __Pyx_XDECREF(__pyx_t_1); | |
4484 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
4485 __pyx_r = 0; | |
4486 __pyx_L0:; | |
4487 __Pyx_XGIVEREF(__pyx_r); | |
4488 __Pyx_RefNannyFinishContext(); | |
4489 return __pyx_r; | |
4490 } | |
4491 | |
4492 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774 | |
4493 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) | |
4494 * | |
4495 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< | |
4496 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) | |
4497 * | |
4498 */ | |
4499 | |
4500 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) { | |
4501 PyObject *__pyx_r = NULL; | |
4502 __Pyx_RefNannyDeclarations | |
4503 PyObject *__pyx_t_1 = NULL; | |
4504 int __pyx_lineno = 0; | |
4505 const char *__pyx_filename = NULL; | |
4506 int __pyx_clineno = 0; | |
4507 __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0); | |
4508 | |
4509 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":775 | |
4510 * | |
4511 * cdef inline object PyArray_MultiIterNew3(a, b, c): | |
4512 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<< | |
4513 * | |
4514 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): | |
4515 */ | |
4516 __Pyx_XDECREF(__pyx_r); | |
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;} | |
4518 __Pyx_GOTREF(__pyx_t_1); | |
4519 __pyx_r = __pyx_t_1; | |
4520 __pyx_t_1 = 0; | |
4521 goto __pyx_L0; | |
4522 | |
4523 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":774 | |
4524 * return PyArray_MultiIterNew(2, <void*>a, <void*>b) | |
4525 * | |
4526 * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<< | |
4527 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) | |
4528 * | |
4529 */ | |
4530 | |
4531 /* function exit code */ | |
4532 __pyx_L1_error:; | |
4533 __Pyx_XDECREF(__pyx_t_1); | |
4534 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
4535 __pyx_r = 0; | |
4536 __pyx_L0:; | |
4537 __Pyx_XGIVEREF(__pyx_r); | |
4538 __Pyx_RefNannyFinishContext(); | |
4539 return __pyx_r; | |
4540 } | |
4541 | |
4542 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777 | |
4543 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) | |
4544 * | |
4545 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< | |
4546 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) | |
4547 * | |
4548 */ | |
4549 | |
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) { | |
4551 PyObject *__pyx_r = NULL; | |
4552 __Pyx_RefNannyDeclarations | |
4553 PyObject *__pyx_t_1 = NULL; | |
4554 int __pyx_lineno = 0; | |
4555 const char *__pyx_filename = NULL; | |
4556 int __pyx_clineno = 0; | |
4557 __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0); | |
4558 | |
4559 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":778 | |
4560 * | |
4561 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): | |
4562 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<< | |
4563 * | |
4564 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): | |
4565 */ | |
4566 __Pyx_XDECREF(__pyx_r); | |
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;} | |
4568 __Pyx_GOTREF(__pyx_t_1); | |
4569 __pyx_r = __pyx_t_1; | |
4570 __pyx_t_1 = 0; | |
4571 goto __pyx_L0; | |
4572 | |
4573 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":777 | |
4574 * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) | |
4575 * | |
4576 * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<< | |
4577 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) | |
4578 * | |
4579 */ | |
4580 | |
4581 /* function exit code */ | |
4582 __pyx_L1_error:; | |
4583 __Pyx_XDECREF(__pyx_t_1); | |
4584 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
4585 __pyx_r = 0; | |
4586 __pyx_L0:; | |
4587 __Pyx_XGIVEREF(__pyx_r); | |
4588 __Pyx_RefNannyFinishContext(); | |
4589 return __pyx_r; | |
4590 } | |
4591 | |
4592 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780 | |
4593 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) | |
4594 * | |
4595 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< | |
4596 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) | |
4597 * | |
4598 */ | |
4599 | |
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) { | |
4601 PyObject *__pyx_r = NULL; | |
4602 __Pyx_RefNannyDeclarations | |
4603 PyObject *__pyx_t_1 = NULL; | |
4604 int __pyx_lineno = 0; | |
4605 const char *__pyx_filename = NULL; | |
4606 int __pyx_clineno = 0; | |
4607 __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0); | |
4608 | |
4609 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":781 | |
4610 * | |
4611 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): | |
4612 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<< | |
4613 * | |
4614 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: | |
4615 */ | |
4616 __Pyx_XDECREF(__pyx_r); | |
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;} | |
4618 __Pyx_GOTREF(__pyx_t_1); | |
4619 __pyx_r = __pyx_t_1; | |
4620 __pyx_t_1 = 0; | |
4621 goto __pyx_L0; | |
4622 | |
4623 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":780 | |
4624 * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) | |
4625 * | |
4626 * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<< | |
4627 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) | |
4628 * | |
4629 */ | |
4630 | |
4631 /* function exit code */ | |
4632 __pyx_L1_error:; | |
4633 __Pyx_XDECREF(__pyx_t_1); | |
4634 __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
4635 __pyx_r = 0; | |
4636 __pyx_L0:; | |
4637 __Pyx_XGIVEREF(__pyx_r); | |
4638 __Pyx_RefNannyFinishContext(); | |
4639 return __pyx_r; | |
4640 } | |
4641 | |
4642 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783 | |
4643 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) | |
4644 * | |
4645 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< | |
4646 * # Recursive utility function used in __getbuffer__ to get format | |
4647 * # string. The new location in the format string is returned. | |
4648 */ | |
4649 | |
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) { | |
4651 PyArray_Descr *__pyx_v_child = 0; | |
4652 int __pyx_v_endian_detector; | |
4653 int __pyx_v_little_endian; | |
4654 PyObject *__pyx_v_fields = 0; | |
4655 PyObject *__pyx_v_childname = NULL; | |
4656 PyObject *__pyx_v_new_offset = NULL; | |
4657 PyObject *__pyx_v_t = NULL; | |
4658 char *__pyx_r; | |
4659 __Pyx_RefNannyDeclarations | |
4660 PyObject *__pyx_t_1 = NULL; | |
4661 Py_ssize_t __pyx_t_2; | |
4662 PyObject *__pyx_t_3 = NULL; | |
4663 PyObject *__pyx_t_4 = NULL; | |
4664 int __pyx_t_5; | |
4665 int __pyx_t_6; | |
4666 int __pyx_t_7; | |
4667 int __pyx_t_8; | |
4668 int __pyx_t_9; | |
4669 long __pyx_t_10; | |
4670 char *__pyx_t_11; | |
4671 int __pyx_lineno = 0; | |
4672 const char *__pyx_filename = NULL; | |
4673 int __pyx_clineno = 0; | |
4674 __Pyx_RefNannySetupContext("_util_dtypestring", 0); | |
4675 | |
4676 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":790 | |
4677 * cdef int delta_offset | |
4678 * cdef tuple i | |
4679 * cdef int endian_detector = 1 # <<<<<<<<<<<<<< | |
4680 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) | |
4681 * cdef tuple fields | |
4682 */ | |
4683 __pyx_v_endian_detector = 1; | |
4684 | |
4685 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":791 | |
4686 * cdef tuple i | |
4687 * cdef int endian_detector = 1 | |
4688 * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<< | |
4689 * cdef tuple fields | |
4690 * | |
4691 */ | |
4692 __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0); | |
4693 | |
4694 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":794 | |
4695 * cdef tuple fields | |
4696 * | |
4697 * for childname in descr.names: # <<<<<<<<<<<<<< | |
4698 * fields = descr.fields[childname] | |
4699 * child, new_offset = fields | |
4700 */ | |
4701 if (unlikely(__pyx_v_descr->names == Py_None)) { | |
4702 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); | |
4703 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 794; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
4704 } | |
4705 __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0; | |
4706 for (;;) { | |
4707 if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break; | |
4708 #if CYTHON_COMPILING_IN_CPYTHON | |
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;} | |
4710 #else | |
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;} | |
4712 #endif | |
4713 __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3); | |
4714 __pyx_t_3 = 0; | |
4715 | |
4716 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":795 | |
4717 * | |
4718 * for childname in descr.names: | |
4719 * fields = descr.fields[childname] # <<<<<<<<<<<<<< | |
4720 * child, new_offset = fields | |
4721 * | |
4722 */ | |
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;}; | |
4724 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
4726 __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3)); | |
4727 __pyx_t_3 = 0; | |
4728 | |
4729 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":796 | |
4730 * for childname in descr.names: | |
4731 * fields = descr.fields[childname] | |
4732 * child, new_offset = fields # <<<<<<<<<<<<<< | |
4733 * | |
4734 * if (end - f) - <int>(new_offset - offset[0]) < 15: | |
4735 */ | |
4736 if (likely(__pyx_v_fields != Py_None)) { | |
4737 PyObject* sequence = __pyx_v_fields; | |
4738 #if CYTHON_COMPILING_IN_CPYTHON | |
4739 Py_ssize_t size = Py_SIZE(sequence); | |
4740 #else | |
4741 Py_ssize_t size = PySequence_Size(sequence); | |
4742 #endif | |
4743 if (unlikely(size != 2)) { | |
4744 if (size > 2) __Pyx_RaiseTooManyValuesError(2); | |
4745 else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size); | |
4746 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
4747 } | |
4748 #if CYTHON_COMPILING_IN_CPYTHON | |
4749 __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0); | |
4750 __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1); | |
4751 __Pyx_INCREF(__pyx_t_3); | |
4752 __Pyx_INCREF(__pyx_t_4); | |
4753 #else | |
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;} | |
4755 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
4757 __Pyx_GOTREF(__pyx_t_4); | |
4758 #endif | |
4759 } else { | |
4760 __Pyx_RaiseNoneNotIterableError(); {__pyx_filename = __pyx_f[1]; __pyx_lineno = 796; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
4761 } | |
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;} | |
4763 __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3)); | |
4764 __pyx_t_3 = 0; | |
4765 __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4); | |
4766 __pyx_t_4 = 0; | |
4767 | |
4768 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":798 | |
4769 * child, new_offset = fields | |
4770 * | |
4771 * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<< | |
4772 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") | |
4773 * | |
4774 */ | |
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;} | |
4776 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
4778 __Pyx_GOTREF(__pyx_t_3); | |
4779 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
4781 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
4782 __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0); | |
4783 if (__pyx_t_6) { | |
4784 | |
4785 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799 | |
4786 * | |
4787 * if (end - f) - <int>(new_offset - offset[0]) < 15: | |
4788 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< | |
4789 * | |
4790 * if ((child.byteorder == c'>' and little_endian) or | |
4791 */ | |
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;} | |
4793 __Pyx_GOTREF(__pyx_t_3); | |
4794 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
4795 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
4796 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 799; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
4797 } | |
4798 | |
4799 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":801 | |
4800 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") | |
4801 * | |
4802 * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<< | |
4803 * (child.byteorder == c'<' and not little_endian)): | |
4804 * raise ValueError(u"Non-native byte order not supported") | |
4805 */ | |
4806 __pyx_t_6 = ((__pyx_v_child->byteorder == '>') != 0); | |
4807 if (__pyx_t_6) { | |
4808 __pyx_t_7 = (__pyx_v_little_endian != 0); | |
4809 } else { | |
4810 __pyx_t_7 = __pyx_t_6; | |
4811 } | |
4812 if (!__pyx_t_7) { | |
4813 | |
4814 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":802 | |
4815 * | |
4816 * if ((child.byteorder == c'>' and little_endian) or | |
4817 * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<< | |
4818 * raise ValueError(u"Non-native byte order not supported") | |
4819 * # One could encode it in the format string and have Cython | |
4820 */ | |
4821 __pyx_t_6 = ((__pyx_v_child->byteorder == '<') != 0); | |
4822 if (__pyx_t_6) { | |
4823 __pyx_t_8 = ((!(__pyx_v_little_endian != 0)) != 0); | |
4824 __pyx_t_9 = __pyx_t_8; | |
4825 } else { | |
4826 __pyx_t_9 = __pyx_t_6; | |
4827 } | |
4828 __pyx_t_6 = __pyx_t_9; | |
4829 } else { | |
4830 __pyx_t_6 = __pyx_t_7; | |
4831 } | |
4832 if (__pyx_t_6) { | |
4833 | |
4834 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803 | |
4835 * if ((child.byteorder == c'>' and little_endian) or | |
4836 * (child.byteorder == c'<' and not little_endian)): | |
4837 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< | |
4838 * # One could encode it in the format string and have Cython | |
4839 * # complain instead, BUT: < and > in format strings also imply | |
4840 */ | |
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;} | |
4842 __Pyx_GOTREF(__pyx_t_3); | |
4843 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
4844 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
4845 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 803; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
4846 } | |
4847 | |
4848 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":813 | |
4849 * | |
4850 * # Output padding bytes | |
4851 * while offset[0] < new_offset: # <<<<<<<<<<<<<< | |
4852 * f[0] = 120 # "x"; pad byte | |
4853 * f += 1 | |
4854 */ | |
4855 while (1) { | |
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;} | |
4857 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
4859 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
4861 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
4862 if (!__pyx_t_6) break; | |
4863 | |
4864 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":814 | |
4865 * # Output padding bytes | |
4866 * while offset[0] < new_offset: | |
4867 * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<< | |
4868 * f += 1 | |
4869 * offset[0] += 1 | |
4870 */ | |
4871 (__pyx_v_f[0]) = 120; | |
4872 | |
4873 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":815 | |
4874 * while offset[0] < new_offset: | |
4875 * f[0] = 120 # "x"; pad byte | |
4876 * f += 1 # <<<<<<<<<<<<<< | |
4877 * offset[0] += 1 | |
4878 * | |
4879 */ | |
4880 __pyx_v_f = (__pyx_v_f + 1); | |
4881 | |
4882 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":816 | |
4883 * f[0] = 120 # "x"; pad byte | |
4884 * f += 1 | |
4885 * offset[0] += 1 # <<<<<<<<<<<<<< | |
4886 * | |
4887 * offset[0] += child.itemsize | |
4888 */ | |
4889 __pyx_t_10 = 0; | |
4890 (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + 1); | |
4891 } | |
4892 | |
4893 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":818 | |
4894 * offset[0] += 1 | |
4895 * | |
4896 * offset[0] += child.itemsize # <<<<<<<<<<<<<< | |
4897 * | |
4898 * if not PyDataType_HASFIELDS(child): | |
4899 */ | |
4900 __pyx_t_10 = 0; | |
4901 (__pyx_v_offset[__pyx_t_10]) = ((__pyx_v_offset[__pyx_t_10]) + __pyx_v_child->elsize); | |
4902 | |
4903 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":820 | |
4904 * offset[0] += child.itemsize | |
4905 * | |
4906 * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<< | |
4907 * t = child.type_num | |
4908 * if end - f < 5: | |
4909 */ | |
4910 __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0); | |
4911 if (__pyx_t_6) { | |
4912 | |
4913 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":821 | |
4914 * | |
4915 * if not PyDataType_HASFIELDS(child): | |
4916 * t = child.type_num # <<<<<<<<<<<<<< | |
4917 * if end - f < 5: | |
4918 * raise RuntimeError(u"Format string allocated too short.") | |
4919 */ | |
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;} | |
4921 __Pyx_GOTREF(__pyx_t_4); | |
4922 __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4); | |
4923 __pyx_t_4 = 0; | |
4924 | |
4925 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":822 | |
4926 * if not PyDataType_HASFIELDS(child): | |
4927 * t = child.type_num | |
4928 * if end - f < 5: # <<<<<<<<<<<<<< | |
4929 * raise RuntimeError(u"Format string allocated too short.") | |
4930 * | |
4931 */ | |
4932 __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0); | |
4933 if (__pyx_t_6) { | |
4934 | |
4935 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823 | |
4936 * t = child.type_num | |
4937 * if end - f < 5: | |
4938 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< | |
4939 * | |
4940 * # Until ticket #99 is fixed, use integers to avoid warnings | |
4941 */ | |
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;} | |
4943 __Pyx_GOTREF(__pyx_t_4); | |
4944 __Pyx_Raise(__pyx_t_4, 0, 0, 0); | |
4945 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
4946 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 823; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
4947 } | |
4948 | |
4949 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":826 | |
4950 * | |
4951 * # Until ticket #99 is fixed, use integers to avoid warnings | |
4952 * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<< | |
4953 * elif t == NPY_UBYTE: f[0] = 66 #"B" | |
4954 * elif t == NPY_SHORT: f[0] = 104 #"h" | |
4955 */ | |
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;} | |
4957 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
4959 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
4961 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
4962 if (__pyx_t_6) { | |
4963 (__pyx_v_f[0]) = 98; | |
4964 goto __pyx_L11; | |
4965 } | |
4966 | |
4967 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":827 | |
4968 * # Until ticket #99 is fixed, use integers to avoid warnings | |
4969 * if t == NPY_BYTE: f[0] = 98 #"b" | |
4970 * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<< | |
4971 * elif t == NPY_SHORT: f[0] = 104 #"h" | |
4972 * elif t == NPY_USHORT: f[0] = 72 #"H" | |
4973 */ | |
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;} | |
4975 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
4977 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
4979 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
4980 if (__pyx_t_6) { | |
4981 (__pyx_v_f[0]) = 66; | |
4982 goto __pyx_L11; | |
4983 } | |
4984 | |
4985 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":828 | |
4986 * if t == NPY_BYTE: f[0] = 98 #"b" | |
4987 * elif t == NPY_UBYTE: f[0] = 66 #"B" | |
4988 * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<< | |
4989 * elif t == NPY_USHORT: f[0] = 72 #"H" | |
4990 * elif t == NPY_INT: f[0] = 105 #"i" | |
4991 */ | |
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;} | |
4993 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
4995 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
4997 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
4998 if (__pyx_t_6) { | |
4999 (__pyx_v_f[0]) = 104; | |
5000 goto __pyx_L11; | |
5001 } | |
5002 | |
5003 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":829 | |
5004 * elif t == NPY_UBYTE: f[0] = 66 #"B" | |
5005 * elif t == NPY_SHORT: f[0] = 104 #"h" | |
5006 * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<< | |
5007 * elif t == NPY_INT: f[0] = 105 #"i" | |
5008 * elif t == NPY_UINT: f[0] = 73 #"I" | |
5009 */ | |
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;} | |
5011 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5013 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
5015 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5016 if (__pyx_t_6) { | |
5017 (__pyx_v_f[0]) = 72; | |
5018 goto __pyx_L11; | |
5019 } | |
5020 | |
5021 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":830 | |
5022 * elif t == NPY_SHORT: f[0] = 104 #"h" | |
5023 * elif t == NPY_USHORT: f[0] = 72 #"H" | |
5024 * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<< | |
5025 * elif t == NPY_UINT: f[0] = 73 #"I" | |
5026 * elif t == NPY_LONG: f[0] = 108 #"l" | |
5027 */ | |
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;} | |
5029 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
5031 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
5033 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5034 if (__pyx_t_6) { | |
5035 (__pyx_v_f[0]) = 105; | |
5036 goto __pyx_L11; | |
5037 } | |
5038 | |
5039 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":831 | |
5040 * elif t == NPY_USHORT: f[0] = 72 #"H" | |
5041 * elif t == NPY_INT: f[0] = 105 #"i" | |
5042 * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<< | |
5043 * elif t == NPY_LONG: f[0] = 108 #"l" | |
5044 * elif t == NPY_ULONG: f[0] = 76 #"L" | |
5045 */ | |
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;} | |
5047 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5049 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
5051 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5052 if (__pyx_t_6) { | |
5053 (__pyx_v_f[0]) = 73; | |
5054 goto __pyx_L11; | |
5055 } | |
5056 | |
5057 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":832 | |
5058 * elif t == NPY_INT: f[0] = 105 #"i" | |
5059 * elif t == NPY_UINT: f[0] = 73 #"I" | |
5060 * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<< | |
5061 * elif t == NPY_ULONG: f[0] = 76 #"L" | |
5062 * elif t == NPY_LONGLONG: f[0] = 113 #"q" | |
5063 */ | |
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;} | |
5065 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
5067 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
5069 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5070 if (__pyx_t_6) { | |
5071 (__pyx_v_f[0]) = 108; | |
5072 goto __pyx_L11; | |
5073 } | |
5074 | |
5075 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":833 | |
5076 * elif t == NPY_UINT: f[0] = 73 #"I" | |
5077 * elif t == NPY_LONG: f[0] = 108 #"l" | |
5078 * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<< | |
5079 * elif t == NPY_LONGLONG: f[0] = 113 #"q" | |
5080 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" | |
5081 */ | |
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;} | |
5083 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5085 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
5087 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5088 if (__pyx_t_6) { | |
5089 (__pyx_v_f[0]) = 76; | |
5090 goto __pyx_L11; | |
5091 } | |
5092 | |
5093 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":834 | |
5094 * elif t == NPY_LONG: f[0] = 108 #"l" | |
5095 * elif t == NPY_ULONG: f[0] = 76 #"L" | |
5096 * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<< | |
5097 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" | |
5098 * elif t == NPY_FLOAT: f[0] = 102 #"f" | |
5099 */ | |
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;} | |
5101 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
5103 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
5105 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5106 if (__pyx_t_6) { | |
5107 (__pyx_v_f[0]) = 113; | |
5108 goto __pyx_L11; | |
5109 } | |
5110 | |
5111 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":835 | |
5112 * elif t == NPY_ULONG: f[0] = 76 #"L" | |
5113 * elif t == NPY_LONGLONG: f[0] = 113 #"q" | |
5114 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<< | |
5115 * elif t == NPY_FLOAT: f[0] = 102 #"f" | |
5116 * elif t == NPY_DOUBLE: f[0] = 100 #"d" | |
5117 */ | |
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;} | |
5119 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5121 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
5123 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5124 if (__pyx_t_6) { | |
5125 (__pyx_v_f[0]) = 81; | |
5126 goto __pyx_L11; | |
5127 } | |
5128 | |
5129 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":836 | |
5130 * elif t == NPY_LONGLONG: f[0] = 113 #"q" | |
5131 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" | |
5132 * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<< | |
5133 * elif t == NPY_DOUBLE: f[0] = 100 #"d" | |
5134 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" | |
5135 */ | |
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;} | |
5137 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
5139 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
5141 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5142 if (__pyx_t_6) { | |
5143 (__pyx_v_f[0]) = 102; | |
5144 goto __pyx_L11; | |
5145 } | |
5146 | |
5147 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":837 | |
5148 * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" | |
5149 * elif t == NPY_FLOAT: f[0] = 102 #"f" | |
5150 * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<< | |
5151 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" | |
5152 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf | |
5153 */ | |
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;} | |
5155 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5157 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
5159 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5160 if (__pyx_t_6) { | |
5161 (__pyx_v_f[0]) = 100; | |
5162 goto __pyx_L11; | |
5163 } | |
5164 | |
5165 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":838 | |
5166 * elif t == NPY_FLOAT: f[0] = 102 #"f" | |
5167 * elif t == NPY_DOUBLE: f[0] = 100 #"d" | |
5168 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<< | |
5169 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf | |
5170 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd | |
5171 */ | |
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;} | |
5173 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
5175 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
5177 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5178 if (__pyx_t_6) { | |
5179 (__pyx_v_f[0]) = 103; | |
5180 goto __pyx_L11; | |
5181 } | |
5182 | |
5183 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":839 | |
5184 * elif t == NPY_DOUBLE: f[0] = 100 #"d" | |
5185 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" | |
5186 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<< | |
5187 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd | |
5188 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg | |
5189 */ | |
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;} | |
5191 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5193 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
5195 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5196 if (__pyx_t_6) { | |
5197 (__pyx_v_f[0]) = 90; | |
5198 (__pyx_v_f[1]) = 102; | |
5199 __pyx_v_f = (__pyx_v_f + 1); | |
5200 goto __pyx_L11; | |
5201 } | |
5202 | |
5203 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":840 | |
5204 * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" | |
5205 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf | |
5206 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<< | |
5207 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg | |
5208 * elif t == NPY_OBJECT: f[0] = 79 #"O" | |
5209 */ | |
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;} | |
5211 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
5213 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
5215 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5216 if (__pyx_t_6) { | |
5217 (__pyx_v_f[0]) = 90; | |
5218 (__pyx_v_f[1]) = 100; | |
5219 __pyx_v_f = (__pyx_v_f + 1); | |
5220 goto __pyx_L11; | |
5221 } | |
5222 | |
5223 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":841 | |
5224 * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf | |
5225 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd | |
5226 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<< | |
5227 * elif t == NPY_OBJECT: f[0] = 79 #"O" | |
5228 * else: | |
5229 */ | |
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;} | |
5231 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5233 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 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;} | |
5235 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5236 if (__pyx_t_6) { | |
5237 (__pyx_v_f[0]) = 90; | |
5238 (__pyx_v_f[1]) = 103; | |
5239 __pyx_v_f = (__pyx_v_f + 1); | |
5240 goto __pyx_L11; | |
5241 } | |
5242 | |
5243 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":842 | |
5244 * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd | |
5245 * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg | |
5246 * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<< | |
5247 * else: | |
5248 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) | |
5249 */ | |
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;} | |
5251 __Pyx_GOTREF(__pyx_t_4); | |
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;} | |
5253 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 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;} | |
5255 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5256 if (__pyx_t_6) { | |
5257 (__pyx_v_f[0]) = 79; | |
5258 goto __pyx_L11; | |
5259 } | |
5260 /*else*/ { | |
5261 | |
5262 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":844 | |
5263 * elif t == NPY_OBJECT: f[0] = 79 #"O" | |
5264 * else: | |
5265 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<< | |
5266 * f += 1 | |
5267 * else: | |
5268 */ | |
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;} | |
5270 __Pyx_GOTREF(__pyx_t_3); | |
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;} | |
5272 __Pyx_GOTREF(__pyx_t_4); | |
5273 PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3); | |
5274 __Pyx_GIVEREF(__pyx_t_3); | |
5275 __pyx_t_3 = 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;} | |
5277 __Pyx_GOTREF(__pyx_t_3); | |
5278 __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0; | |
5279 __Pyx_Raise(__pyx_t_3, 0, 0, 0); | |
5280 __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0; | |
5281 {__pyx_filename = __pyx_f[1]; __pyx_lineno = 844; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5282 } | |
5283 __pyx_L11:; | |
5284 | |
5285 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":845 | |
5286 * else: | |
5287 * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) | |
5288 * f += 1 # <<<<<<<<<<<<<< | |
5289 * else: | |
5290 * # Cython ignores struct boundary information ("T{...}"), | |
5291 */ | |
5292 __pyx_v_f = (__pyx_v_f + 1); | |
5293 goto __pyx_L9; | |
5294 } | |
5295 /*else*/ { | |
5296 | |
5297 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":849 | |
5298 * # Cython ignores struct boundary information ("T{...}"), | |
5299 * # so don't output it | |
5300 * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<< | |
5301 * return f | |
5302 * | |
5303 */ | |
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;} | |
5305 __pyx_v_f = __pyx_t_11; | |
5306 } | |
5307 __pyx_L9:; | |
5308 } | |
5309 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
5310 | |
5311 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":850 | |
5312 * # so don't output it | |
5313 * f = _util_dtypestring(child, f, end, offset) | |
5314 * return f # <<<<<<<<<<<<<< | |
5315 * | |
5316 * | |
5317 */ | |
5318 __pyx_r = __pyx_v_f; | |
5319 goto __pyx_L0; | |
5320 | |
5321 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":783 | |
5322 * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) | |
5323 * | |
5324 * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<< | |
5325 * # Recursive utility function used in __getbuffer__ to get format | |
5326 * # string. The new location in the format string is returned. | |
5327 */ | |
5328 | |
5329 /* function exit code */ | |
5330 __pyx_L1_error:; | |
5331 __Pyx_XDECREF(__pyx_t_1); | |
5332 __Pyx_XDECREF(__pyx_t_3); | |
5333 __Pyx_XDECREF(__pyx_t_4); | |
5334 __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5335 __pyx_r = NULL; | |
5336 __pyx_L0:; | |
5337 __Pyx_XDECREF((PyObject *)__pyx_v_child); | |
5338 __Pyx_XDECREF(__pyx_v_fields); | |
5339 __Pyx_XDECREF(__pyx_v_childname); | |
5340 __Pyx_XDECREF(__pyx_v_new_offset); | |
5341 __Pyx_XDECREF(__pyx_v_t); | |
5342 __Pyx_RefNannyFinishContext(); | |
5343 return __pyx_r; | |
5344 } | |
5345 | |
5346 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966 | |
5347 * | |
5348 * | |
5349 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< | |
5350 * cdef PyObject* baseptr | |
5351 * if base is None: | |
5352 */ | |
5353 | |
5354 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) { | |
5355 PyObject *__pyx_v_baseptr; | |
5356 __Pyx_RefNannyDeclarations | |
5357 int __pyx_t_1; | |
5358 int __pyx_t_2; | |
5359 __Pyx_RefNannySetupContext("set_array_base", 0); | |
5360 | |
5361 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":968 | |
5362 * cdef inline void set_array_base(ndarray arr, object base): | |
5363 * cdef PyObject* baseptr | |
5364 * if base is None: # <<<<<<<<<<<<<< | |
5365 * baseptr = NULL | |
5366 * else: | |
5367 */ | |
5368 __pyx_t_1 = (__pyx_v_base == Py_None); | |
5369 __pyx_t_2 = (__pyx_t_1 != 0); | |
5370 if (__pyx_t_2) { | |
5371 | |
5372 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":969 | |
5373 * cdef PyObject* baseptr | |
5374 * if base is None: | |
5375 * baseptr = NULL # <<<<<<<<<<<<<< | |
5376 * else: | |
5377 * Py_INCREF(base) # important to do this before decref below! | |
5378 */ | |
5379 __pyx_v_baseptr = NULL; | |
5380 goto __pyx_L3; | |
5381 } | |
5382 /*else*/ { | |
5383 | |
5384 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":971 | |
5385 * baseptr = NULL | |
5386 * else: | |
5387 * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<< | |
5388 * baseptr = <PyObject*>base | |
5389 * Py_XDECREF(arr.base) | |
5390 */ | |
5391 Py_INCREF(__pyx_v_base); | |
5392 | |
5393 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":972 | |
5394 * else: | |
5395 * Py_INCREF(base) # important to do this before decref below! | |
5396 * baseptr = <PyObject*>base # <<<<<<<<<<<<<< | |
5397 * Py_XDECREF(arr.base) | |
5398 * arr.base = baseptr | |
5399 */ | |
5400 __pyx_v_baseptr = ((PyObject *)__pyx_v_base); | |
5401 } | |
5402 __pyx_L3:; | |
5403 | |
5404 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":973 | |
5405 * Py_INCREF(base) # important to do this before decref below! | |
5406 * baseptr = <PyObject*>base | |
5407 * Py_XDECREF(arr.base) # <<<<<<<<<<<<<< | |
5408 * arr.base = baseptr | |
5409 * | |
5410 */ | |
5411 Py_XDECREF(__pyx_v_arr->base); | |
5412 | |
5413 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":974 | |
5414 * baseptr = <PyObject*>base | |
5415 * Py_XDECREF(arr.base) | |
5416 * arr.base = baseptr # <<<<<<<<<<<<<< | |
5417 * | |
5418 * cdef inline object get_array_base(ndarray arr): | |
5419 */ | |
5420 __pyx_v_arr->base = __pyx_v_baseptr; | |
5421 | |
5422 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":966 | |
5423 * | |
5424 * | |
5425 * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<< | |
5426 * cdef PyObject* baseptr | |
5427 * if base is None: | |
5428 */ | |
5429 | |
5430 /* function exit code */ | |
5431 __Pyx_RefNannyFinishContext(); | |
5432 } | |
5433 | |
5434 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976 | |
5435 * arr.base = baseptr | |
5436 * | |
5437 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< | |
5438 * if arr.base is NULL: | |
5439 * return None | |
5440 */ | |
5441 | |
5442 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) { | |
5443 PyObject *__pyx_r = NULL; | |
5444 __Pyx_RefNannyDeclarations | |
5445 int __pyx_t_1; | |
5446 __Pyx_RefNannySetupContext("get_array_base", 0); | |
5447 | |
5448 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":977 | |
5449 * | |
5450 * cdef inline object get_array_base(ndarray arr): | |
5451 * if arr.base is NULL: # <<<<<<<<<<<<<< | |
5452 * return None | |
5453 * else: | |
5454 */ | |
5455 __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0); | |
5456 if (__pyx_t_1) { | |
5457 | |
5458 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":978 | |
5459 * cdef inline object get_array_base(ndarray arr): | |
5460 * if arr.base is NULL: | |
5461 * return None # <<<<<<<<<<<<<< | |
5462 * else: | |
5463 * return <object>arr.base | |
5464 */ | |
5465 __Pyx_XDECREF(__pyx_r); | |
5466 __Pyx_INCREF(Py_None); | |
5467 __pyx_r = Py_None; | |
5468 goto __pyx_L0; | |
5469 } | |
5470 /*else*/ { | |
5471 | |
5472 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":980 | |
5473 * return None | |
5474 * else: | |
5475 * return <object>arr.base # <<<<<<<<<<<<<< | |
5476 */ | |
5477 __Pyx_XDECREF(__pyx_r); | |
5478 __Pyx_INCREF(((PyObject *)__pyx_v_arr->base)); | |
5479 __pyx_r = ((PyObject *)__pyx_v_arr->base); | |
5480 goto __pyx_L0; | |
5481 } | |
5482 | |
5483 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976 | |
5484 * arr.base = baseptr | |
5485 * | |
5486 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< | |
5487 * if arr.base is NULL: | |
5488 * return None | |
5489 */ | |
5490 | |
5491 /* function exit code */ | |
5492 __pyx_L0:; | |
5493 __Pyx_XGIVEREF(__pyx_r); | |
5494 __Pyx_RefNannyFinishContext(); | |
5495 return __pyx_r; | |
5496 } | |
5497 | |
5498 static PyMethodDef __pyx_methods[] = { | |
5499 {0, 0, 0, 0} | |
5500 }; | |
5501 | |
5502 #if PY_MAJOR_VERSION >= 3 | |
5503 static struct PyModuleDef __pyx_moduledef = { | |
5504 #if PY_VERSION_HEX < 0x03020000 | |
5505 { PyObject_HEAD_INIT(NULL) NULL, 0, NULL }, | |
5506 #else | |
5507 PyModuleDef_HEAD_INIT, | |
5508 #endif | |
5509 __Pyx_NAMESTR("FastAlignmentArrays"), | |
5510 __Pyx_DOCSTR(__pyx_k_organization_Lancaster_Universi), /* m_doc */ | |
5511 -1, /* m_size */ | |
5512 __pyx_methods /* m_methods */, | |
5513 NULL, /* m_reload */ | |
5514 NULL, /* m_traverse */ | |
5515 NULL, /* m_clear */ | |
5516 NULL /* m_free */ | |
5517 }; | |
5518 #endif | |
5519 | |
5520 static __Pyx_StringTabEntry __pyx_string_tab[] = { | |
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}, | |
5522 {&__pyx_n_s_FastAlignmentArrays, __pyx_k_FastAlignmentArrays, sizeof(__pyx_k_FastAlignmentArrays), 0, 0, 1, 1}, | |
5523 {&__pyx_n_s_FastAlignmentArrays___needleman, __pyx_k_FastAlignmentArrays___needleman, sizeof(__pyx_k_FastAlignmentArrays___needleman), 0, 0, 1, 1}, | |
5524 {&__pyx_n_s_FastAlignmentArrays___needleman_2, __pyx_k_FastAlignmentArrays___needleman_2, sizeof(__pyx_k_FastAlignmentArrays___needleman_2), 0, 0, 1, 1}, | |
5525 {&__pyx_n_s_FastAlignmentArrays__needleman, __pyx_k_FastAlignmentArrays__needleman, sizeof(__pyx_k_FastAlignmentArrays__needleman), 0, 0, 1, 1}, | |
5526 {&__pyx_n_s_FastAlignmentArrays__needleman_2, __pyx_k_FastAlignmentArrays__needleman_2, sizeof(__pyx_k_FastAlignmentArrays__needleman_2), 0, 0, 1, 1}, | |
5527 {&__pyx_n_s_FastAlignmentArrays_needleman_wu, __pyx_k_FastAlignmentArrays_needleman_wu, sizeof(__pyx_k_FastAlignmentArrays_needleman_wu), 0, 0, 1, 1}, | |
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}, | |
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}, | |
5530 {&__pyx_kp_s_GAP, __pyx_k_GAP, sizeof(__pyx_k_GAP), 0, 0, 1, 0}, | |
5531 {&__pyx_n_s_MultipleOMR_Alignment_FastAlignm, __pyx_k_MultipleOMR_Alignment_FastAlignm, sizeof(__pyx_k_MultipleOMR_Alignment_FastAlignm), 0, 0, 1, 1}, | |
5532 {&__pyx_n_s_NWunsch, __pyx_k_NWunsch, sizeof(__pyx_k_NWunsch), 0, 0, 1, 1}, | |
5533 {&__pyx_n_s_NWunsch_getSimilarity, __pyx_k_NWunsch_getSimilarity, sizeof(__pyx_k_NWunsch_getSimilarity), 0, 0, 1, 1}, | |
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}, | |
5535 {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1}, | |
5536 {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1}, | |
5537 {&__pyx_kp_s__5, __pyx_k__5, sizeof(__pyx_k__5), 0, 0, 1, 0}, | |
5538 {&__pyx_n_s_align1, __pyx_k_align1, sizeof(__pyx_k_align1), 0, 0, 1, 1}, | |
5539 {&__pyx_n_s_align1_gap, __pyx_k_align1_gap, sizeof(__pyx_k_align1_gap), 0, 0, 1, 1}, | |
5540 {&__pyx_n_s_align2, __pyx_k_align2, sizeof(__pyx_k_align2), 0, 0, 1, 1}, | |
5541 {&__pyx_n_s_align2_gap, __pyx_k_align2_gap, sizeof(__pyx_k_align2_gap), 0, 0, 1, 1}, | |
5542 {&__pyx_n_s_alignment, __pyx_k_alignment, sizeof(__pyx_k_alignment), 0, 0, 1, 1}, | |
5543 {&__pyx_n_s_curr, __pyx_k_curr, sizeof(__pyx_k_curr), 0, 0, 1, 1}, | |
5544 {&__pyx_n_s_diagonalRange, __pyx_k_diagonalRange, sizeof(__pyx_k_diagonalRange), 0, 0, 1, 1}, | |
5545 {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1}, | |
5546 {&__pyx_n_s_dtype, __pyx_k_dtype, sizeof(__pyx_k_dtype), 0, 0, 1, 1}, | |
5547 {&__pyx_n_s_finalscore, __pyx_k_finalscore, sizeof(__pyx_k_finalscore), 0, 0, 1, 1}, | |
5548 {&__pyx_n_s_gap1, __pyx_k_gap1, sizeof(__pyx_k_gap1), 0, 0, 1, 1}, | |
5549 {&__pyx_n_s_gap2, __pyx_k_gap2, sizeof(__pyx_k_gap2), 0, 0, 1, 1}, | |
5550 {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1}, | |
5551 {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1}, | |
5552 {&__pyx_n_s_indel, __pyx_k_indel, sizeof(__pyx_k_indel), 0, 0, 1, 1}, | |
5553 {&__pyx_n_s_index, __pyx_k_index, sizeof(__pyx_k_index), 0, 0, 1, 1}, | |
5554 {&__pyx_n_s_isFast, __pyx_k_isFast, sizeof(__pyx_k_isFast), 0, 0, 1, 1}, | |
5555 {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1}, | |
5556 {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1}, | |
5557 {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1}, | |
5558 {&__pyx_n_s_maxlen, __pyx_k_maxlen, sizeof(__pyx_k_maxlen), 0, 0, 1, 1}, | |
5559 {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1}, | |
5560 {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1}, | |
5561 {&__pyx_n_s_myseq1, __pyx_k_myseq1, sizeof(__pyx_k_myseq1), 0, 0, 1, 1}, | |
5562 {&__pyx_n_s_myseq2, __pyx_k_myseq2, sizeof(__pyx_k_myseq2), 0, 0, 1, 1}, | |
5563 {&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1}, | |
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}, | |
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}, | |
5566 {&__pyx_n_s_needleman_wunsch, __pyx_k_needleman_wunsch, sizeof(__pyx_k_needleman_wunsch), 0, 0, 1, 1}, | |
5567 {&__pyx_n_s_needleman_wunsch_matrix, __pyx_k_needleman_wunsch_matrix, sizeof(__pyx_k_needleman_wunsch_matrix), 0, 0, 1, 1}, | |
5568 {&__pyx_n_s_needleman_wunsch_trace, __pyx_k_needleman_wunsch_trace, sizeof(__pyx_k_needleman_wunsch_trace), 0, 0, 1, 1}, | |
5569 {&__pyx_n_s_np, __pyx_k_np, sizeof(__pyx_k_np), 0, 0, 1, 1}, | |
5570 {&__pyx_n_s_numpy, __pyx_k_numpy, sizeof(__pyx_k_numpy), 0, 0, 1, 1}, | |
5571 {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1}, | |
5572 {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1}, | |
5573 {&__pyx_n_s_ptr, __pyx_k_ptr, sizeof(__pyx_k_ptr), 0, 0, 1, 1}, | |
5574 {&__pyx_n_s_q, __pyx_k_q, sizeof(__pyx_k_q), 0, 0, 1, 1}, | |
5575 {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1}, | |
5576 {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1}, | |
5577 {&__pyx_n_s_s, __pyx_k_s, sizeof(__pyx_k_s), 0, 0, 1, 1}, | |
5578 {&__pyx_n_s_score, __pyx_k_score, sizeof(__pyx_k_score), 0, 0, 1, 1}, | |
5579 {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1}, | |
5580 {&__pyx_n_s_seq1, __pyx_k_seq1, sizeof(__pyx_k_seq1), 0, 0, 1, 1}, | |
5581 {&__pyx_n_s_seq2, __pyx_k_seq2, sizeof(__pyx_k_seq2), 0, 0, 1, 1}, | |
5582 {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1}, | |
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}, | |
5584 {&__pyx_n_s_zeros, __pyx_k_zeros, sizeof(__pyx_k_zeros), 0, 0, 1, 1}, | |
5585 {0, 0, 0, 0, 0, 0, 0} | |
5586 }; | |
5587 static int __Pyx_InitCachedBuiltins(void) { | |
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;} | |
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;} | |
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;} | |
5591 return 0; | |
5592 __pyx_L1_error:; | |
5593 return -1; | |
5594 } | |
5595 | |
5596 static int __Pyx_InitCachedConstants(void) { | |
5597 __Pyx_RefNannyDeclarations | |
5598 __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0); | |
5599 | |
5600 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":87 | |
5601 * | |
5602 * # Tag first row by LEFT, indicating initial "-"s | |
5603 * ptr[0,1:] = LEFT # <<<<<<<<<<<<<< | |
5604 * | |
5605 * # Tag first column by UP, indicating initial "-"s | |
5606 */ | |
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;} | |
5608 __Pyx_GOTREF(__pyx_slice_); | |
5609 __Pyx_GIVEREF(__pyx_slice_); | |
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;} | |
5611 __Pyx_GOTREF(__pyx_tuple__2); | |
5612 __Pyx_GIVEREF(__pyx_tuple__2); | |
5613 | |
5614 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":90 | |
5615 * | |
5616 * # Tag first column by UP, indicating initial "-"s | |
5617 * ptr[1:,0] = UP # <<<<<<<<<<<<<< | |
5618 * | |
5619 * ##################################################### | |
5620 */ | |
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;} | |
5622 __Pyx_GOTREF(__pyx_slice__3); | |
5623 __Pyx_GIVEREF(__pyx_slice__3); | |
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;} | |
5625 __Pyx_GOTREF(__pyx_tuple__4); | |
5626 __Pyx_GIVEREF(__pyx_tuple__4); | |
5627 | |
5628 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":215 | |
5629 * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) | |
5630 * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): | |
5631 * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<< | |
5632 * | |
5633 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) | |
5634 */ | |
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;} | |
5636 __Pyx_GOTREF(__pyx_tuple__6); | |
5637 __Pyx_GIVEREF(__pyx_tuple__6); | |
5638 | |
5639 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":219 | |
5640 * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) | |
5641 * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): | |
5642 * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<< | |
5643 * | |
5644 * info.buf = PyArray_DATA(self) | |
5645 */ | |
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;} | |
5647 __Pyx_GOTREF(__pyx_tuple__7); | |
5648 __Pyx_GIVEREF(__pyx_tuple__7); | |
5649 | |
5650 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":257 | |
5651 * if ((descr.byteorder == c'>' and little_endian) or | |
5652 * (descr.byteorder == c'<' and not little_endian)): | |
5653 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< | |
5654 * if t == NPY_BYTE: f = "b" | |
5655 * elif t == NPY_UBYTE: f = "B" | |
5656 */ | |
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;} | |
5658 __Pyx_GOTREF(__pyx_tuple__8); | |
5659 __Pyx_GIVEREF(__pyx_tuple__8); | |
5660 | |
5661 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":799 | |
5662 * | |
5663 * if (end - f) - <int>(new_offset - offset[0]) < 15: | |
5664 * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<< | |
5665 * | |
5666 * if ((child.byteorder == c'>' and little_endian) or | |
5667 */ | |
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;} | |
5669 __Pyx_GOTREF(__pyx_tuple__9); | |
5670 __Pyx_GIVEREF(__pyx_tuple__9); | |
5671 | |
5672 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":803 | |
5673 * if ((child.byteorder == c'>' and little_endian) or | |
5674 * (child.byteorder == c'<' and not little_endian)): | |
5675 * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<< | |
5676 * # One could encode it in the format string and have Cython | |
5677 * # complain instead, BUT: < and > in format strings also imply | |
5678 */ | |
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;} | |
5680 __Pyx_GOTREF(__pyx_tuple__10); | |
5681 __Pyx_GIVEREF(__pyx_tuple__10); | |
5682 | |
5683 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":823 | |
5684 * t = child.type_num | |
5685 * if end - f < 5: | |
5686 * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<< | |
5687 * | |
5688 * # Until ticket #99 is fixed, use integers to avoid warnings | |
5689 */ | |
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;} | |
5691 __Pyx_GOTREF(__pyx_tuple__11); | |
5692 __Pyx_GIVEREF(__pyx_tuple__11); | |
5693 | |
5694 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 | |
5695 * class FastAlignmentArrays: | |
5696 * | |
5697 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< | |
5698 * """ | |
5699 * fill in the DP matrix according to the Needleman-Wunsch algorithm. | |
5700 */ | |
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;} | |
5702 __Pyx_GOTREF(__pyx_tuple__12); | |
5703 __Pyx_GIVEREF(__pyx_tuple__12); | |
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;} | |
5705 | |
5706 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 | |
5707 * return s, ptr | |
5708 * | |
5709 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< | |
5710 * | |
5711 * #### TRACE BEST PATH TO GET ALIGNMENT #### | |
5712 */ | |
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;} | |
5714 __Pyx_GOTREF(__pyx_tuple__14); | |
5715 __Pyx_GIVEREF(__pyx_tuple__14); | |
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;} | |
5717 | |
5718 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 | |
5719 * | |
5720 * | |
5721 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< | |
5722 * """ | |
5723 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch | |
5724 */ | |
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;} | |
5726 __Pyx_GOTREF(__pyx_tuple__16); | |
5727 __Pyx_GIVEREF(__pyx_tuple__16); | |
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;} | |
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;} | |
5730 __Pyx_GOTREF(__pyx_tuple__18); | |
5731 __Pyx_GIVEREF(__pyx_tuple__18); | |
5732 __Pyx_RefNannyFinishContext(); | |
5733 return 0; | |
5734 __pyx_L1_error:; | |
5735 __Pyx_RefNannyFinishContext(); | |
5736 return -1; | |
5737 } | |
5738 | |
5739 static int __Pyx_InitGlobals(void) { | |
5740 if (__Pyx_InitStrings(__pyx_string_tab) < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;}; | |
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;} | |
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;} | |
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;} | |
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;} | |
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;} | |
5746 return 0; | |
5747 __pyx_L1_error:; | |
5748 return -1; | |
5749 } | |
5750 | |
5751 #if PY_MAJOR_VERSION < 3 | |
5752 PyMODINIT_FUNC initFastAlignmentArrays(void); /*proto*/ | |
5753 PyMODINIT_FUNC initFastAlignmentArrays(void) | |
5754 #else | |
5755 PyMODINIT_FUNC PyInit_FastAlignmentArrays(void); /*proto*/ | |
5756 PyMODINIT_FUNC PyInit_FastAlignmentArrays(void) | |
5757 #endif | |
5758 { | |
5759 PyObject *__pyx_t_1 = NULL; | |
5760 PyObject *__pyx_t_2 = NULL; | |
5761 int __pyx_lineno = 0; | |
5762 const char *__pyx_filename = NULL; | |
5763 int __pyx_clineno = 0; | |
5764 __Pyx_RefNannyDeclarations | |
5765 #if CYTHON_REFNANNY | |
5766 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny"); | |
5767 if (!__Pyx_RefNanny) { | |
5768 PyErr_Clear(); | |
5769 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny"); | |
5770 if (!__Pyx_RefNanny) | |
5771 Py_FatalError("failed to import 'refnanny' module"); | |
5772 } | |
5773 #endif | |
5774 __Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_FastAlignmentArrays(void)", 0); | |
5775 if ( __Pyx_check_binary_version() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
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;} | |
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;} | |
5778 #ifdef __Pyx_CyFunction_USED | |
5779 if (__Pyx_CyFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5780 #endif | |
5781 #ifdef __Pyx_FusedFunction_USED | |
5782 if (__pyx_FusedFunction_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5783 #endif | |
5784 #ifdef __Pyx_Generator_USED | |
5785 if (__pyx_Generator_init() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5786 #endif | |
5787 /*--- Library function declarations ---*/ | |
5788 /*--- Threads initialization code ---*/ | |
5789 #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS | |
5790 #ifdef WITH_THREAD /* Python build with threading support? */ | |
5791 PyEval_InitThreads(); | |
5792 #endif | |
5793 #endif | |
5794 /*--- Module creation code ---*/ | |
5795 #if PY_MAJOR_VERSION < 3 | |
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); | |
5797 #else | |
5798 __pyx_m = PyModule_Create(&__pyx_moduledef); | |
5799 #endif | |
5800 if (unlikely(!__pyx_m)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
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;} | |
5802 Py_INCREF(__pyx_d); | |
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;} | |
5804 #if CYTHON_COMPILING_IN_PYPY | |
5805 Py_INCREF(__pyx_b); | |
5806 #endif | |
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;}; | |
5808 /*--- Initialize various global constants etc. ---*/ | |
5809 if (unlikely(__Pyx_InitGlobals() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5810 #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT) | |
5811 if (__Pyx_init_sys_getdefaultencoding_params() < 0) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5812 #endif | |
5813 if (__pyx_module_is_main_MultipleOMR__Alignment__FastAlignmentArrays) { | |
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;}; | |
5815 } | |
5816 #if PY_MAJOR_VERSION >= 3 | |
5817 { | |
5818 PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5819 if (!PyDict_GetItemString(modules, "MultipleOMR.Alignment.FastAlignmentArrays")) { | |
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;} | |
5821 } | |
5822 } | |
5823 #endif | |
5824 /*--- Builtin init code ---*/ | |
5825 if (unlikely(__Pyx_InitCachedBuiltins() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5826 /*--- Constants init code ---*/ | |
5827 if (unlikely(__Pyx_InitCachedConstants() < 0)) {__pyx_filename = __pyx_f[0]; __pyx_lineno = 1; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
5828 /*--- Global init code ---*/ | |
5829 /*--- Variable export code ---*/ | |
5830 /*--- Function export code ---*/ | |
5831 /*--- Type init code ---*/ | |
5832 /*--- Type import code ---*/ | |
5833 __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type", | |
5834 #if CYTHON_COMPILING_IN_PYPY | |
5835 sizeof(PyTypeObject), | |
5836 #else | |
5837 sizeof(PyHeapTypeObject), | |
5838 #endif | |
5839 0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) {__pyx_filename = __pyx_f[2]; __pyx_lineno = 9; __pyx_clineno = __LINE__; goto __pyx_L1_error;} | |
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;} | |
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;} | |
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;} | |
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;} | |
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;} | |
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;} | |
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;} | |
5847 /*--- Variable import code ---*/ | |
5848 /*--- Function import code ---*/ | |
5849 /*--- Execution code ---*/ | |
5850 | |
5851 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":40 | |
5852 * ''' | |
5853 * | |
5854 * import numpy as np # <<<<<<<<<<<<<< | |
5855 * cimport numpy as np | |
5856 * | |
5857 */ | |
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;} | |
5859 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
5861 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
5862 | |
5863 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":43 | |
5864 * cimport numpy as np | |
5865 * | |
5866 * import NWunsch # <<<<<<<<<<<<<< | |
5867 * | |
5868 * # -*- coding: utf-8 -*- | |
5869 */ | |
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;} | |
5871 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
5873 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
5874 | |
5875 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":50 | |
5876 * | |
5877 * # the three directions you can go in the traceback: | |
5878 * cdef int DIAG = 0 # <<<<<<<<<<<<<< | |
5879 * cdef int UP = 1 | |
5880 * cdef int LEFT = 2 | |
5881 */ | |
5882 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_DIAG = 0; | |
5883 | |
5884 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":51 | |
5885 * # the three directions you can go in the traceback: | |
5886 * cdef int DIAG = 0 | |
5887 * cdef int UP = 1 # <<<<<<<<<<<<<< | |
5888 * cdef int LEFT = 2 | |
5889 * cdef float score=0 | |
5890 */ | |
5891 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_UP = 1; | |
5892 | |
5893 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":52 | |
5894 * cdef int DIAG = 0 | |
5895 * cdef int UP = 1 | |
5896 * cdef int LEFT = 2 # <<<<<<<<<<<<<< | |
5897 * cdef float score=0 | |
5898 * | |
5899 */ | |
5900 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_LEFT = 2; | |
5901 | |
5902 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":53 | |
5903 * cdef int UP = 1 | |
5904 * cdef int LEFT = 2 | |
5905 * cdef float score=0 # <<<<<<<<<<<<<< | |
5906 * | |
5907 * class FastAlignmentArrays: | |
5908 */ | |
5909 __pyx_v_11MultipleOMR_9Alignment_19FastAlignmentArrays_score = 0.0; | |
5910 | |
5911 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":55 | |
5912 * cdef float score=0 | |
5913 * | |
5914 * class FastAlignmentArrays: # <<<<<<<<<<<<<< | |
5915 * | |
5916 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): | |
5917 */ | |
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;} | |
5919 __Pyx_GOTREF(__pyx_t_1); | |
5920 | |
5921 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":57 | |
5922 * class FastAlignmentArrays: | |
5923 * | |
5924 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): # <<<<<<<<<<<<<< | |
5925 * """ | |
5926 * fill in the DP matrix according to the Needleman-Wunsch algorithm. | |
5927 */ | |
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;} | |
5929 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
5931 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
5932 | |
5933 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":145 | |
5934 * return s, ptr | |
5935 * | |
5936 * def __needleman_wunsch_trace(self,seq1, seq2,np.ndarray s, np.ndarray ptr) : # <<<<<<<<<<<<<< | |
5937 * | |
5938 * #### TRACE BEST PATH TO GET ALIGNMENT #### | |
5939 */ | |
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;} | |
5941 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
5943 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
5944 | |
5945 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":202 | |
5946 * | |
5947 * | |
5948 * def needleman_wunsch(self,seq1, seq2,isFast=True) : # <<<<<<<<<<<<<< | |
5949 * """ | |
5950 * Computes an optimal global alignment of two sequences using the Needleman-Wunsch | |
5951 */ | |
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;} | |
5953 __Pyx_GOTREF(__pyx_t_2); | |
5954 __Pyx_CyFunction_SetDefaultsTuple(__pyx_t_2, __pyx_tuple__18); | |
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;} | |
5956 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
5957 | |
5958 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":55 | |
5959 * cdef float score=0 | |
5960 * | |
5961 * class FastAlignmentArrays: # <<<<<<<<<<<<<< | |
5962 * | |
5963 * def __needleman_wunsch_matrix(self,seq1,seq2,isFast): | |
5964 */ | |
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;} | |
5966 __Pyx_GOTREF(__pyx_t_2); | |
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;} | |
5968 __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0; | |
5969 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
5970 | |
5971 /* "MultipleOMR\Alignment\FastAlignmentArrays.pyx":1 | |
5972 * ''' # <<<<<<<<<<<<<< | |
5973 * @organization: Lancaster University & University of Leeds | |
5974 * @version: 1.0 | |
5975 */ | |
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;} | |
5977 __Pyx_GOTREF(__pyx_t_1); | |
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;} | |
5979 __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0; | |
5980 | |
5981 /* "C:\Python27\lib\site-packages\Cython\Includes\numpy\__init__.pxd":976 | |
5982 * arr.base = baseptr | |
5983 * | |
5984 * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<< | |
5985 * if arr.base is NULL: | |
5986 * return None | |
5987 */ | |
5988 goto __pyx_L0; | |
5989 __pyx_L1_error:; | |
5990 __Pyx_XDECREF(__pyx_t_1); | |
5991 __Pyx_XDECREF(__pyx_t_2); | |
5992 if (__pyx_m) { | |
5993 __Pyx_AddTraceback("init MultipleOMR.Alignment.FastAlignmentArrays", __pyx_clineno, __pyx_lineno, __pyx_filename); | |
5994 Py_DECREF(__pyx_m); __pyx_m = 0; | |
5995 } else if (!PyErr_Occurred()) { | |
5996 PyErr_SetString(PyExc_ImportError, "init MultipleOMR.Alignment.FastAlignmentArrays"); | |
5997 } | |
5998 __pyx_L0:; | |
5999 __Pyx_RefNannyFinishContext(); | |
6000 #if PY_MAJOR_VERSION < 3 | |
6001 return; | |
6002 #else | |
6003 return __pyx_m; | |
6004 #endif | |
6005 } | |
6006 | |
6007 /* Runtime support code */ | |
6008 #if CYTHON_REFNANNY | |
6009 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) { | |
6010 PyObject *m = NULL, *p = NULL; | |
6011 void *r = NULL; | |
6012 m = PyImport_ImportModule((char *)modname); | |
6013 if (!m) goto end; | |
6014 p = PyObject_GetAttrString(m, (char *)"RefNannyAPI"); | |
6015 if (!p) goto end; | |
6016 r = PyLong_AsVoidPtr(p); | |
6017 end: | |
6018 Py_XDECREF(p); | |
6019 Py_XDECREF(m); | |
6020 return (__Pyx_RefNannyAPIStruct *)r; | |
6021 } | |
6022 #endif /* CYTHON_REFNANNY */ | |
6023 | |
6024 static PyObject *__Pyx_GetBuiltinName(PyObject *name) { | |
6025 PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name); | |
6026 if (unlikely(!result)) { | |
6027 PyErr_Format(PyExc_NameError, | |
6028 #if PY_MAJOR_VERSION >= 3 | |
6029 "name '%U' is not defined", name); | |
6030 #else | |
6031 "name '%.200s' is not defined", PyString_AS_STRING(name)); | |
6032 #endif | |
6033 } | |
6034 return result; | |
6035 } | |
6036 | |
6037 static void __Pyx_RaiseArgtupleInvalid( | |
6038 const char* func_name, | |
6039 int exact, | |
6040 Py_ssize_t num_min, | |
6041 Py_ssize_t num_max, | |
6042 Py_ssize_t num_found) | |
6043 { | |
6044 Py_ssize_t num_expected; | |
6045 const char *more_or_less; | |
6046 if (num_found < num_min) { | |
6047 num_expected = num_min; | |
6048 more_or_less = "at least"; | |
6049 } else { | |
6050 num_expected = num_max; | |
6051 more_or_less = "at most"; | |
6052 } | |
6053 if (exact) { | |
6054 more_or_less = "exactly"; | |
6055 } | |
6056 PyErr_Format(PyExc_TypeError, | |
6057 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)", | |
6058 func_name, more_or_less, num_expected, | |
6059 (num_expected == 1) ? "" : "s", num_found); | |
6060 } | |
6061 | |
6062 static void __Pyx_RaiseDoubleKeywordsError( | |
6063 const char* func_name, | |
6064 PyObject* kw_name) | |
6065 { | |
6066 PyErr_Format(PyExc_TypeError, | |
6067 #if PY_MAJOR_VERSION >= 3 | |
6068 "%s() got multiple values for keyword argument '%U'", func_name, kw_name); | |
6069 #else | |
6070 "%s() got multiple values for keyword argument '%s'", func_name, | |
6071 PyString_AsString(kw_name)); | |
6072 #endif | |
6073 } | |
6074 | |
6075 static int __Pyx_ParseOptionalKeywords( | |
6076 PyObject *kwds, | |
6077 PyObject **argnames[], | |
6078 PyObject *kwds2, | |
6079 PyObject *values[], | |
6080 Py_ssize_t num_pos_args, | |
6081 const char* function_name) | |
6082 { | |
6083 PyObject *key = 0, *value = 0; | |
6084 Py_ssize_t pos = 0; | |
6085 PyObject*** name; | |
6086 PyObject*** first_kw_arg = argnames + num_pos_args; | |
6087 while (PyDict_Next(kwds, &pos, &key, &value)) { | |
6088 name = first_kw_arg; | |
6089 while (*name && (**name != key)) name++; | |
6090 if (*name) { | |
6091 values[name-argnames] = value; | |
6092 continue; | |
6093 } | |
6094 name = first_kw_arg; | |
6095 #if PY_MAJOR_VERSION < 3 | |
6096 if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) { | |
6097 while (*name) { | |
6098 if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key)) | |
6099 && _PyString_Eq(**name, key)) { | |
6100 values[name-argnames] = value; | |
6101 break; | |
6102 } | |
6103 name++; | |
6104 } | |
6105 if (*name) continue; | |
6106 else { | |
6107 PyObject*** argname = argnames; | |
6108 while (argname != first_kw_arg) { | |
6109 if ((**argname == key) || ( | |
6110 (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key)) | |
6111 && _PyString_Eq(**argname, key))) { | |
6112 goto arg_passed_twice; | |
6113 } | |
6114 argname++; | |
6115 } | |
6116 } | |
6117 } else | |
6118 #endif | |
6119 if (likely(PyUnicode_Check(key))) { | |
6120 while (*name) { | |
6121 int cmp = (**name == key) ? 0 : | |
6122 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
6123 (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 : | |
6124 #endif | |
6125 PyUnicode_Compare(**name, key); | |
6126 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
6127 if (cmp == 0) { | |
6128 values[name-argnames] = value; | |
6129 break; | |
6130 } | |
6131 name++; | |
6132 } | |
6133 if (*name) continue; | |
6134 else { | |
6135 PyObject*** argname = argnames; | |
6136 while (argname != first_kw_arg) { | |
6137 int cmp = (**argname == key) ? 0 : | |
6138 #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3 | |
6139 (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 : | |
6140 #endif | |
6141 PyUnicode_Compare(**argname, key); | |
6142 if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad; | |
6143 if (cmp == 0) goto arg_passed_twice; | |
6144 argname++; | |
6145 } | |
6146 } | |
6147 } else | |
6148 goto invalid_keyword_type; | |
6149 if (kwds2) { | |
6150 if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad; | |
6151 } else { | |
6152 goto invalid_keyword; | |
6153 } | |
6154 } | |
6155 return 0; | |
6156 arg_passed_twice: | |
6157 __Pyx_RaiseDoubleKeywordsError(function_name, key); | |
6158 goto bad; | |
6159 invalid_keyword_type: | |
6160 PyErr_Format(PyExc_TypeError, | |
6161 "%.200s() keywords must be strings", function_name); | |
6162 goto bad; | |
6163 invalid_keyword: | |
6164 PyErr_Format(PyExc_TypeError, | |
6165 #if PY_MAJOR_VERSION < 3 | |
6166 "%.200s() got an unexpected keyword argument '%.200s'", | |
6167 function_name, PyString_AsString(key)); | |
6168 #else | |
6169 "%s() got an unexpected keyword argument '%U'", | |
6170 function_name, key); | |
6171 #endif | |
6172 bad: | |
6173 return -1; | |
6174 } | |
6175 | |
6176 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) { | |
6177 PyObject *result; | |
6178 #if CYTHON_COMPILING_IN_CPYTHON | |
6179 result = PyDict_GetItem(__pyx_d, name); | |
6180 if (result) { | |
6181 Py_INCREF(result); | |
6182 } else { | |
6183 #else | |
6184 result = PyObject_GetItem(__pyx_d, name); | |
6185 if (!result) { | |
6186 PyErr_Clear(); | |
6187 #endif | |
6188 result = __Pyx_GetBuiltinName(name); | |
6189 } | |
6190 return result; | |
6191 } | |
6192 | |
6193 #if CYTHON_COMPILING_IN_CPYTHON | |
6194 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
6195 PyObject *result; | |
6196 ternaryfunc call = func->ob_type->tp_call; | |
6197 if (unlikely(!call)) | |
6198 return PyObject_Call(func, arg, kw); | |
6199 #if PY_VERSION_HEX >= 0x02060000 | |
6200 if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) | |
6201 return NULL; | |
6202 #endif | |
6203 result = (*call)(func, arg, kw); | |
6204 #if PY_VERSION_HEX >= 0x02060000 | |
6205 Py_LeaveRecursiveCall(); | |
6206 #endif | |
6207 if (unlikely(!result) && unlikely(!PyErr_Occurred())) { | |
6208 PyErr_SetString( | |
6209 PyExc_SystemError, | |
6210 "NULL result without error in PyObject_Call"); | |
6211 } | |
6212 return result; | |
6213 } | |
6214 #endif | |
6215 | |
6216 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) { | |
6217 if (unlikely(!type)) { | |
6218 PyErr_SetString(PyExc_SystemError, "Missing type object"); | |
6219 return 0; | |
6220 } | |
6221 if (likely(PyObject_TypeCheck(obj, type))) | |
6222 return 1; | |
6223 PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s", | |
6224 Py_TYPE(obj)->tp_name, type->tp_name); | |
6225 return 0; | |
6226 } | |
6227 | |
6228 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) { | |
6229 PyObject *r; | |
6230 if (!j) return NULL; | |
6231 r = PyObject_GetItem(o, j); | |
6232 Py_DECREF(j); | |
6233 return r; | |
6234 } | |
6235 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i, | |
6236 int wraparound, int boundscheck) { | |
6237 #if CYTHON_COMPILING_IN_CPYTHON | |
6238 if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o); | |
6239 if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) { | |
6240 PyObject *r = PyList_GET_ITEM(o, i); | |
6241 Py_INCREF(r); | |
6242 return r; | |
6243 } | |
6244 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
6245 #else | |
6246 return PySequence_GetItem(o, i); | |
6247 #endif | |
6248 } | |
6249 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i, | |
6250 int wraparound, int boundscheck) { | |
6251 #if CYTHON_COMPILING_IN_CPYTHON | |
6252 if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o); | |
6253 if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) { | |
6254 PyObject *r = PyTuple_GET_ITEM(o, i); | |
6255 Py_INCREF(r); | |
6256 return r; | |
6257 } | |
6258 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
6259 #else | |
6260 return PySequence_GetItem(o, i); | |
6261 #endif | |
6262 } | |
6263 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, | |
6264 int is_list, int wraparound, int boundscheck) { | |
6265 #if CYTHON_COMPILING_IN_CPYTHON | |
6266 if (is_list || PyList_CheckExact(o)) { | |
6267 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o); | |
6268 if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) { | |
6269 PyObject *r = PyList_GET_ITEM(o, n); | |
6270 Py_INCREF(r); | |
6271 return r; | |
6272 } | |
6273 } | |
6274 else if (PyTuple_CheckExact(o)) { | |
6275 Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o); | |
6276 if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) { | |
6277 PyObject *r = PyTuple_GET_ITEM(o, n); | |
6278 Py_INCREF(r); | |
6279 return r; | |
6280 } | |
6281 } else { | |
6282 PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence; | |
6283 if (likely(m && m->sq_item)) { | |
6284 if (wraparound && unlikely(i < 0) && likely(m->sq_length)) { | |
6285 Py_ssize_t l = m->sq_length(o); | |
6286 if (likely(l >= 0)) { | |
6287 i += l; | |
6288 } else { | |
6289 if (PyErr_ExceptionMatches(PyExc_OverflowError)) | |
6290 PyErr_Clear(); | |
6291 else | |
6292 return NULL; | |
6293 } | |
6294 } | |
6295 return m->sq_item(o, i); | |
6296 } | |
6297 } | |
6298 #else | |
6299 if (is_list || PySequence_Check(o)) { | |
6300 return PySequence_GetItem(o, i); | |
6301 } | |
6302 #endif | |
6303 return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i)); | |
6304 } | |
6305 | |
6306 static void __Pyx_RaiseArgumentTypeInvalid(const char* name, PyObject *obj, PyTypeObject *type) { | |
6307 PyErr_Format(PyExc_TypeError, | |
6308 "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)", | |
6309 name, type->tp_name, Py_TYPE(obj)->tp_name); | |
6310 } | |
6311 static CYTHON_INLINE int __Pyx_ArgTypeTest(PyObject *obj, PyTypeObject *type, int none_allowed, | |
6312 const char *name, int exact) | |
6313 { | |
6314 if (unlikely(!type)) { | |
6315 PyErr_SetString(PyExc_SystemError, "Missing type object"); | |
6316 return 0; | |
6317 } | |
6318 if (none_allowed && obj == Py_None) return 1; | |
6319 else if (exact) { | |
6320 if (likely(Py_TYPE(obj) == type)) return 1; | |
6321 #if PY_MAJOR_VERSION == 2 | |
6322 else if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1; | |
6323 #endif | |
6324 } | |
6325 else { | |
6326 if (likely(PyObject_TypeCheck(obj, type))) return 1; | |
6327 } | |
6328 __Pyx_RaiseArgumentTypeInvalid(name, obj, type); | |
6329 return 0; | |
6330 } | |
6331 | |
6332 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) { | |
6333 #if CYTHON_COMPILING_IN_PYPY | |
6334 return PyObject_RichCompareBool(s1, s2, equals); | |
6335 #else | |
6336 if (s1 == s2) { | |
6337 return (equals == Py_EQ); | |
6338 } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) { | |
6339 const char *ps1, *ps2; | |
6340 Py_ssize_t length = PyBytes_GET_SIZE(s1); | |
6341 if (length != PyBytes_GET_SIZE(s2)) | |
6342 return (equals == Py_NE); | |
6343 ps1 = PyBytes_AS_STRING(s1); | |
6344 ps2 = PyBytes_AS_STRING(s2); | |
6345 if (ps1[0] != ps2[0]) { | |
6346 return (equals == Py_NE); | |
6347 } else if (length == 1) { | |
6348 return (equals == Py_EQ); | |
6349 } else { | |
6350 int result = memcmp(ps1, ps2, (size_t)length); | |
6351 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
6352 } | |
6353 } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) { | |
6354 return (equals == Py_NE); | |
6355 } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) { | |
6356 return (equals == Py_NE); | |
6357 } else { | |
6358 int result; | |
6359 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
6360 if (!py_result) | |
6361 return -1; | |
6362 result = __Pyx_PyObject_IsTrue(py_result); | |
6363 Py_DECREF(py_result); | |
6364 return result; | |
6365 } | |
6366 #endif | |
6367 } | |
6368 | |
6369 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) { | |
6370 #if CYTHON_COMPILING_IN_PYPY | |
6371 return PyObject_RichCompareBool(s1, s2, equals); | |
6372 #else | |
6373 #if PY_MAJOR_VERSION < 3 | |
6374 PyObject* owned_ref = NULL; | |
6375 #endif | |
6376 int s1_is_unicode, s2_is_unicode; | |
6377 if (s1 == s2) { | |
6378 goto return_eq; | |
6379 } | |
6380 s1_is_unicode = PyUnicode_CheckExact(s1); | |
6381 s2_is_unicode = PyUnicode_CheckExact(s2); | |
6382 #if PY_MAJOR_VERSION < 3 | |
6383 if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) { | |
6384 owned_ref = PyUnicode_FromObject(s2); | |
6385 if (unlikely(!owned_ref)) | |
6386 return -1; | |
6387 s2 = owned_ref; | |
6388 s2_is_unicode = 1; | |
6389 } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) { | |
6390 owned_ref = PyUnicode_FromObject(s1); | |
6391 if (unlikely(!owned_ref)) | |
6392 return -1; | |
6393 s1 = owned_ref; | |
6394 s1_is_unicode = 1; | |
6395 } else if (((!s2_is_unicode) & (!s1_is_unicode))) { | |
6396 return __Pyx_PyBytes_Equals(s1, s2, equals); | |
6397 } | |
6398 #endif | |
6399 if (s1_is_unicode & s2_is_unicode) { | |
6400 Py_ssize_t length; | |
6401 int kind; | |
6402 void *data1, *data2; | |
6403 #if CYTHON_PEP393_ENABLED | |
6404 if (unlikely(PyUnicode_READY(s1) < 0) || unlikely(PyUnicode_READY(s2) < 0)) | |
6405 return -1; | |
6406 #endif | |
6407 length = __Pyx_PyUnicode_GET_LENGTH(s1); | |
6408 if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) { | |
6409 goto return_ne; | |
6410 } | |
6411 kind = __Pyx_PyUnicode_KIND(s1); | |
6412 if (kind != __Pyx_PyUnicode_KIND(s2)) { | |
6413 goto return_ne; | |
6414 } | |
6415 data1 = __Pyx_PyUnicode_DATA(s1); | |
6416 data2 = __Pyx_PyUnicode_DATA(s2); | |
6417 if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) { | |
6418 goto return_ne; | |
6419 } else if (length == 1) { | |
6420 goto return_eq; | |
6421 } else { | |
6422 int result = memcmp(data1, data2, (size_t)(length * kind)); | |
6423 #if PY_MAJOR_VERSION < 3 | |
6424 Py_XDECREF(owned_ref); | |
6425 #endif | |
6426 return (equals == Py_EQ) ? (result == 0) : (result != 0); | |
6427 } | |
6428 } else if ((s1 == Py_None) & s2_is_unicode) { | |
6429 goto return_ne; | |
6430 } else if ((s2 == Py_None) & s1_is_unicode) { | |
6431 goto return_ne; | |
6432 } else { | |
6433 int result; | |
6434 PyObject* py_result = PyObject_RichCompare(s1, s2, equals); | |
6435 if (!py_result) | |
6436 return -1; | |
6437 result = __Pyx_PyObject_IsTrue(py_result); | |
6438 Py_DECREF(py_result); | |
6439 return result; | |
6440 } | |
6441 return_eq: | |
6442 #if PY_MAJOR_VERSION < 3 | |
6443 Py_XDECREF(owned_ref); | |
6444 #endif | |
6445 return (equals == Py_EQ); | |
6446 return_ne: | |
6447 #if PY_MAJOR_VERSION < 3 | |
6448 Py_XDECREF(owned_ref); | |
6449 #endif | |
6450 return (equals == Py_NE); | |
6451 #endif | |
6452 } | |
6453 | |
6454 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) { | |
6455 PyErr_Format(PyExc_ValueError, | |
6456 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected); | |
6457 } | |
6458 | |
6459 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) { | |
6460 PyErr_Format(PyExc_ValueError, | |
6461 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack", | |
6462 index, (index == 1) ? "" : "s"); | |
6463 } | |
6464 | |
6465 static CYTHON_INLINE int __Pyx_IterFinish(void) { | |
6466 #if CYTHON_COMPILING_IN_CPYTHON | |
6467 PyThreadState *tstate = PyThreadState_GET(); | |
6468 PyObject* exc_type = tstate->curexc_type; | |
6469 if (unlikely(exc_type)) { | |
6470 if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) { | |
6471 PyObject *exc_value, *exc_tb; | |
6472 exc_value = tstate->curexc_value; | |
6473 exc_tb = tstate->curexc_traceback; | |
6474 tstate->curexc_type = 0; | |
6475 tstate->curexc_value = 0; | |
6476 tstate->curexc_traceback = 0; | |
6477 Py_DECREF(exc_type); | |
6478 Py_XDECREF(exc_value); | |
6479 Py_XDECREF(exc_tb); | |
6480 return 0; | |
6481 } else { | |
6482 return -1; | |
6483 } | |
6484 } | |
6485 return 0; | |
6486 #else | |
6487 if (unlikely(PyErr_Occurred())) { | |
6488 if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) { | |
6489 PyErr_Clear(); | |
6490 return 0; | |
6491 } else { | |
6492 return -1; | |
6493 } | |
6494 } | |
6495 return 0; | |
6496 #endif | |
6497 } | |
6498 | |
6499 static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) { | |
6500 if (unlikely(retval)) { | |
6501 Py_DECREF(retval); | |
6502 __Pyx_RaiseTooManyValuesError(expected); | |
6503 return -1; | |
6504 } else { | |
6505 return __Pyx_IterFinish(); | |
6506 } | |
6507 return 0; | |
6508 } | |
6509 | |
6510 static CYTHON_INLINE void __Pyx_ErrRestore(PyObject *type, PyObject *value, PyObject *tb) { | |
6511 #if CYTHON_COMPILING_IN_CPYTHON | |
6512 PyObject *tmp_type, *tmp_value, *tmp_tb; | |
6513 PyThreadState *tstate = PyThreadState_GET(); | |
6514 tmp_type = tstate->curexc_type; | |
6515 tmp_value = tstate->curexc_value; | |
6516 tmp_tb = tstate->curexc_traceback; | |
6517 tstate->curexc_type = type; | |
6518 tstate->curexc_value = value; | |
6519 tstate->curexc_traceback = tb; | |
6520 Py_XDECREF(tmp_type); | |
6521 Py_XDECREF(tmp_value); | |
6522 Py_XDECREF(tmp_tb); | |
6523 #else | |
6524 PyErr_Restore(type, value, tb); | |
6525 #endif | |
6526 } | |
6527 static CYTHON_INLINE void __Pyx_ErrFetch(PyObject **type, PyObject **value, PyObject **tb) { | |
6528 #if CYTHON_COMPILING_IN_CPYTHON | |
6529 PyThreadState *tstate = PyThreadState_GET(); | |
6530 *type = tstate->curexc_type; | |
6531 *value = tstate->curexc_value; | |
6532 *tb = tstate->curexc_traceback; | |
6533 tstate->curexc_type = 0; | |
6534 tstate->curexc_value = 0; | |
6535 tstate->curexc_traceback = 0; | |
6536 #else | |
6537 PyErr_Fetch(type, value, tb); | |
6538 #endif | |
6539 } | |
6540 | |
6541 #if PY_MAJOR_VERSION < 3 | |
6542 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, | |
6543 CYTHON_UNUSED PyObject *cause) { | |
6544 Py_XINCREF(type); | |
6545 if (!value || value == Py_None) | |
6546 value = NULL; | |
6547 else | |
6548 Py_INCREF(value); | |
6549 if (!tb || tb == Py_None) | |
6550 tb = NULL; | |
6551 else { | |
6552 Py_INCREF(tb); | |
6553 if (!PyTraceBack_Check(tb)) { | |
6554 PyErr_SetString(PyExc_TypeError, | |
6555 "raise: arg 3 must be a traceback or None"); | |
6556 goto raise_error; | |
6557 } | |
6558 } | |
6559 #if PY_VERSION_HEX < 0x02050000 | |
6560 if (PyClass_Check(type)) { | |
6561 #else | |
6562 if (PyType_Check(type)) { | |
6563 #endif | |
6564 #if CYTHON_COMPILING_IN_PYPY | |
6565 if (!value) { | |
6566 Py_INCREF(Py_None); | |
6567 value = Py_None; | |
6568 } | |
6569 #endif | |
6570 PyErr_NormalizeException(&type, &value, &tb); | |
6571 } else { | |
6572 if (value) { | |
6573 PyErr_SetString(PyExc_TypeError, | |
6574 "instance exception may not have a separate value"); | |
6575 goto raise_error; | |
6576 } | |
6577 value = type; | |
6578 #if PY_VERSION_HEX < 0x02050000 | |
6579 if (PyInstance_Check(type)) { | |
6580 type = (PyObject*) ((PyInstanceObject*)type)->in_class; | |
6581 Py_INCREF(type); | |
6582 } else { | |
6583 type = 0; | |
6584 PyErr_SetString(PyExc_TypeError, | |
6585 "raise: exception must be an old-style class or instance"); | |
6586 goto raise_error; | |
6587 } | |
6588 #else | |
6589 type = (PyObject*) Py_TYPE(type); | |
6590 Py_INCREF(type); | |
6591 if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) { | |
6592 PyErr_SetString(PyExc_TypeError, | |
6593 "raise: exception class must be a subclass of BaseException"); | |
6594 goto raise_error; | |
6595 } | |
6596 #endif | |
6597 } | |
6598 __Pyx_ErrRestore(type, value, tb); | |
6599 return; | |
6600 raise_error: | |
6601 Py_XDECREF(value); | |
6602 Py_XDECREF(type); | |
6603 Py_XDECREF(tb); | |
6604 return; | |
6605 } | |
6606 #else /* Python 3+ */ | |
6607 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) { | |
6608 PyObject* owned_instance = NULL; | |
6609 if (tb == Py_None) { | |
6610 tb = 0; | |
6611 } else if (tb && !PyTraceBack_Check(tb)) { | |
6612 PyErr_SetString(PyExc_TypeError, | |
6613 "raise: arg 3 must be a traceback or None"); | |
6614 goto bad; | |
6615 } | |
6616 if (value == Py_None) | |
6617 value = 0; | |
6618 if (PyExceptionInstance_Check(type)) { | |
6619 if (value) { | |
6620 PyErr_SetString(PyExc_TypeError, | |
6621 "instance exception may not have a separate value"); | |
6622 goto bad; | |
6623 } | |
6624 value = type; | |
6625 type = (PyObject*) Py_TYPE(value); | |
6626 } else if (PyExceptionClass_Check(type)) { | |
6627 PyObject *instance_class = NULL; | |
6628 if (value && PyExceptionInstance_Check(value)) { | |
6629 instance_class = (PyObject*) Py_TYPE(value); | |
6630 if (instance_class != type) { | |
6631 if (PyObject_IsSubclass(instance_class, type)) { | |
6632 type = instance_class; | |
6633 } else { | |
6634 instance_class = NULL; | |
6635 } | |
6636 } | |
6637 } | |
6638 if (!instance_class) { | |
6639 PyObject *args; | |
6640 if (!value) | |
6641 args = PyTuple_New(0); | |
6642 else if (PyTuple_Check(value)) { | |
6643 Py_INCREF(value); | |
6644 args = value; | |
6645 } else | |
6646 args = PyTuple_Pack(1, value); | |
6647 if (!args) | |
6648 goto bad; | |
6649 owned_instance = PyObject_Call(type, args, NULL); | |
6650 Py_DECREF(args); | |
6651 if (!owned_instance) | |
6652 goto bad; | |
6653 value = owned_instance; | |
6654 if (!PyExceptionInstance_Check(value)) { | |
6655 PyErr_Format(PyExc_TypeError, | |
6656 "calling %R should have returned an instance of " | |
6657 "BaseException, not %R", | |
6658 type, Py_TYPE(value)); | |
6659 goto bad; | |
6660 } | |
6661 } | |
6662 } else { | |
6663 PyErr_SetString(PyExc_TypeError, | |
6664 "raise: exception class must be a subclass of BaseException"); | |
6665 goto bad; | |
6666 } | |
6667 #if PY_VERSION_HEX >= 0x03030000 | |
6668 if (cause) { | |
6669 #else | |
6670 if (cause && cause != Py_None) { | |
6671 #endif | |
6672 PyObject *fixed_cause; | |
6673 if (cause == Py_None) { | |
6674 fixed_cause = NULL; | |
6675 } else if (PyExceptionClass_Check(cause)) { | |
6676 fixed_cause = PyObject_CallObject(cause, NULL); | |
6677 if (fixed_cause == NULL) | |
6678 goto bad; | |
6679 } else if (PyExceptionInstance_Check(cause)) { | |
6680 fixed_cause = cause; | |
6681 Py_INCREF(fixed_cause); | |
6682 } else { | |
6683 PyErr_SetString(PyExc_TypeError, | |
6684 "exception causes must derive from " | |
6685 "BaseException"); | |
6686 goto bad; | |
6687 } | |
6688 PyException_SetCause(value, fixed_cause); | |
6689 } | |
6690 PyErr_SetObject(type, value); | |
6691 if (tb) { | |
6692 PyThreadState *tstate = PyThreadState_GET(); | |
6693 PyObject* tmp_tb = tstate->curexc_traceback; | |
6694 if (tb != tmp_tb) { | |
6695 Py_INCREF(tb); | |
6696 tstate->curexc_traceback = tb; | |
6697 Py_XDECREF(tmp_tb); | |
6698 } | |
6699 } | |
6700 bad: | |
6701 Py_XDECREF(owned_instance); | |
6702 return; | |
6703 } | |
6704 #endif | |
6705 | |
6706 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) { | |
6707 PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable"); | |
6708 } | |
6709 | |
6710 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) { | |
6711 PyObject* fake_module; | |
6712 PyTypeObject* cached_type = NULL; | |
6713 fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI); | |
6714 if (!fake_module) return NULL; | |
6715 Py_INCREF(fake_module); | |
6716 cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name); | |
6717 if (cached_type) { | |
6718 if (!PyType_Check((PyObject*)cached_type)) { | |
6719 PyErr_Format(PyExc_TypeError, | |
6720 "Shared Cython type %.200s is not a type object", | |
6721 type->tp_name); | |
6722 goto bad; | |
6723 } | |
6724 if (cached_type->tp_basicsize != type->tp_basicsize) { | |
6725 PyErr_Format(PyExc_TypeError, | |
6726 "Shared Cython type %.200s has the wrong size, try recompiling", | |
6727 type->tp_name); | |
6728 goto bad; | |
6729 } | |
6730 } else { | |
6731 if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad; | |
6732 PyErr_Clear(); | |
6733 if (PyType_Ready(type) < 0) goto bad; | |
6734 if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0) | |
6735 goto bad; | |
6736 Py_INCREF(type); | |
6737 cached_type = type; | |
6738 } | |
6739 done: | |
6740 Py_DECREF(fake_module); | |
6741 return cached_type; | |
6742 bad: | |
6743 Py_XDECREF(cached_type); | |
6744 cached_type = NULL; | |
6745 goto done; | |
6746 } | |
6747 | |
6748 static PyObject * | |
6749 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure) | |
6750 { | |
6751 if (unlikely(op->func_doc == NULL)) { | |
6752 if (op->func.m_ml->ml_doc) { | |
6753 #if PY_MAJOR_VERSION >= 3 | |
6754 op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc); | |
6755 #else | |
6756 op->func_doc = PyString_FromString(op->func.m_ml->ml_doc); | |
6757 #endif | |
6758 if (unlikely(op->func_doc == NULL)) | |
6759 return NULL; | |
6760 } else { | |
6761 Py_INCREF(Py_None); | |
6762 return Py_None; | |
6763 } | |
6764 } | |
6765 Py_INCREF(op->func_doc); | |
6766 return op->func_doc; | |
6767 } | |
6768 static int | |
6769 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value) | |
6770 { | |
6771 PyObject *tmp = op->func_doc; | |
6772 if (value == NULL) | |
6773 value = Py_None; /* Mark as deleted */ | |
6774 Py_INCREF(value); | |
6775 op->func_doc = value; | |
6776 Py_XDECREF(tmp); | |
6777 return 0; | |
6778 } | |
6779 static PyObject * | |
6780 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op) | |
6781 { | |
6782 if (unlikely(op->func_name == NULL)) { | |
6783 #if PY_MAJOR_VERSION >= 3 | |
6784 op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name); | |
6785 #else | |
6786 op->func_name = PyString_InternFromString(op->func.m_ml->ml_name); | |
6787 #endif | |
6788 if (unlikely(op->func_name == NULL)) | |
6789 return NULL; | |
6790 } | |
6791 Py_INCREF(op->func_name); | |
6792 return op->func_name; | |
6793 } | |
6794 static int | |
6795 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value) | |
6796 { | |
6797 PyObject *tmp; | |
6798 #if PY_MAJOR_VERSION >= 3 | |
6799 if (unlikely(value == NULL || !PyUnicode_Check(value))) { | |
6800 #else | |
6801 if (unlikely(value == NULL || !PyString_Check(value))) { | |
6802 #endif | |
6803 PyErr_SetString(PyExc_TypeError, | |
6804 "__name__ must be set to a string object"); | |
6805 return -1; | |
6806 } | |
6807 tmp = op->func_name; | |
6808 Py_INCREF(value); | |
6809 op->func_name = value; | |
6810 Py_XDECREF(tmp); | |
6811 return 0; | |
6812 } | |
6813 static PyObject * | |
6814 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op) | |
6815 { | |
6816 Py_INCREF(op->func_qualname); | |
6817 return op->func_qualname; | |
6818 } | |
6819 static int | |
6820 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value) | |
6821 { | |
6822 PyObject *tmp; | |
6823 #if PY_MAJOR_VERSION >= 3 | |
6824 if (unlikely(value == NULL || !PyUnicode_Check(value))) { | |
6825 #else | |
6826 if (unlikely(value == NULL || !PyString_Check(value))) { | |
6827 #endif | |
6828 PyErr_SetString(PyExc_TypeError, | |
6829 "__qualname__ must be set to a string object"); | |
6830 return -1; | |
6831 } | |
6832 tmp = op->func_qualname; | |
6833 Py_INCREF(value); | |
6834 op->func_qualname = value; | |
6835 Py_XDECREF(tmp); | |
6836 return 0; | |
6837 } | |
6838 static PyObject * | |
6839 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure) | |
6840 { | |
6841 PyObject *self; | |
6842 self = m->func_closure; | |
6843 if (self == NULL) | |
6844 self = Py_None; | |
6845 Py_INCREF(self); | |
6846 return self; | |
6847 } | |
6848 static PyObject * | |
6849 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op) | |
6850 { | |
6851 if (unlikely(op->func_dict == NULL)) { | |
6852 op->func_dict = PyDict_New(); | |
6853 if (unlikely(op->func_dict == NULL)) | |
6854 return NULL; | |
6855 } | |
6856 Py_INCREF(op->func_dict); | |
6857 return op->func_dict; | |
6858 } | |
6859 static int | |
6860 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value) | |
6861 { | |
6862 PyObject *tmp; | |
6863 if (unlikely(value == NULL)) { | |
6864 PyErr_SetString(PyExc_TypeError, | |
6865 "function's dictionary may not be deleted"); | |
6866 return -1; | |
6867 } | |
6868 if (unlikely(!PyDict_Check(value))) { | |
6869 PyErr_SetString(PyExc_TypeError, | |
6870 "setting function's dictionary to a non-dict"); | |
6871 return -1; | |
6872 } | |
6873 tmp = op->func_dict; | |
6874 Py_INCREF(value); | |
6875 op->func_dict = value; | |
6876 Py_XDECREF(tmp); | |
6877 return 0; | |
6878 } | |
6879 static PyObject * | |
6880 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op) | |
6881 { | |
6882 Py_INCREF(op->func_globals); | |
6883 return op->func_globals; | |
6884 } | |
6885 static PyObject * | |
6886 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op) | |
6887 { | |
6888 Py_INCREF(Py_None); | |
6889 return Py_None; | |
6890 } | |
6891 static PyObject * | |
6892 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op) | |
6893 { | |
6894 PyObject* result = (op->func_code) ? op->func_code : Py_None; | |
6895 Py_INCREF(result); | |
6896 return result; | |
6897 } | |
6898 static int | |
6899 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) { | |
6900 PyObject *res = op->defaults_getter((PyObject *) op); | |
6901 if (unlikely(!res)) | |
6902 return -1; | |
6903 op->defaults_tuple = PyTuple_GET_ITEM(res, 0); | |
6904 Py_INCREF(op->defaults_tuple); | |
6905 op->defaults_kwdict = PyTuple_GET_ITEM(res, 1); | |
6906 Py_INCREF(op->defaults_kwdict); | |
6907 Py_DECREF(res); | |
6908 return 0; | |
6909 } | |
6910 static int | |
6911 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) { | |
6912 PyObject* tmp; | |
6913 if (!value) { | |
6914 value = Py_None; | |
6915 } else if (value != Py_None && !PyTuple_Check(value)) { | |
6916 PyErr_SetString(PyExc_TypeError, | |
6917 "__defaults__ must be set to a tuple object"); | |
6918 return -1; | |
6919 } | |
6920 Py_INCREF(value); | |
6921 tmp = op->defaults_tuple; | |
6922 op->defaults_tuple = value; | |
6923 Py_XDECREF(tmp); | |
6924 return 0; | |
6925 } | |
6926 static PyObject * | |
6927 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) { | |
6928 PyObject* result = op->defaults_tuple; | |
6929 if (unlikely(!result)) { | |
6930 if (op->defaults_getter) { | |
6931 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; | |
6932 result = op->defaults_tuple; | |
6933 } else { | |
6934 result = Py_None; | |
6935 } | |
6936 } | |
6937 Py_INCREF(result); | |
6938 return result; | |
6939 } | |
6940 static int | |
6941 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) { | |
6942 PyObject* tmp; | |
6943 if (!value) { | |
6944 value = Py_None; | |
6945 } else if (value != Py_None && !PyDict_Check(value)) { | |
6946 PyErr_SetString(PyExc_TypeError, | |
6947 "__kwdefaults__ must be set to a dict object"); | |
6948 return -1; | |
6949 } | |
6950 Py_INCREF(value); | |
6951 tmp = op->defaults_kwdict; | |
6952 op->defaults_kwdict = value; | |
6953 Py_XDECREF(tmp); | |
6954 return 0; | |
6955 } | |
6956 static PyObject * | |
6957 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) { | |
6958 PyObject* result = op->defaults_kwdict; | |
6959 if (unlikely(!result)) { | |
6960 if (op->defaults_getter) { | |
6961 if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL; | |
6962 result = op->defaults_kwdict; | |
6963 } else { | |
6964 result = Py_None; | |
6965 } | |
6966 } | |
6967 Py_INCREF(result); | |
6968 return result; | |
6969 } | |
6970 static int | |
6971 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) { | |
6972 PyObject* tmp; | |
6973 if (!value || value == Py_None) { | |
6974 value = NULL; | |
6975 } else if (!PyDict_Check(value)) { | |
6976 PyErr_SetString(PyExc_TypeError, | |
6977 "__annotations__ must be set to a dict object"); | |
6978 return -1; | |
6979 } | |
6980 Py_XINCREF(value); | |
6981 tmp = op->func_annotations; | |
6982 op->func_annotations = value; | |
6983 Py_XDECREF(tmp); | |
6984 return 0; | |
6985 } | |
6986 static PyObject * | |
6987 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) { | |
6988 PyObject* result = op->func_annotations; | |
6989 if (unlikely(!result)) { | |
6990 result = PyDict_New(); | |
6991 if (unlikely(!result)) return NULL; | |
6992 op->func_annotations = result; | |
6993 } | |
6994 Py_INCREF(result); | |
6995 return result; | |
6996 } | |
6997 static PyGetSetDef __pyx_CyFunction_getsets[] = { | |
6998 {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
6999 {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0}, | |
7000 {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
7001 {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0}, | |
7002 {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0}, | |
7003 {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0}, | |
7004 {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
7005 {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0}, | |
7006 {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
7007 {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0}, | |
7008 {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
7009 {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0}, | |
7010 {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
7011 {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0}, | |
7012 {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
7013 {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0}, | |
7014 {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0}, | |
7015 {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0}, | |
7016 {0, 0, 0, 0, 0} | |
7017 }; | |
7018 #ifndef PY_WRITE_RESTRICTED /* < Py2.5 */ | |
7019 #define PY_WRITE_RESTRICTED WRITE_RESTRICTED | |
7020 #endif | |
7021 static PyMemberDef __pyx_CyFunction_members[] = { | |
7022 {(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0}, | |
7023 {0, 0, 0, 0, 0} | |
7024 }; | |
7025 static PyObject * | |
7026 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args) | |
7027 { | |
7028 #if PY_MAJOR_VERSION >= 3 | |
7029 return PyUnicode_FromString(m->func.m_ml->ml_name); | |
7030 #else | |
7031 return PyString_FromString(m->func.m_ml->ml_name); | |
7032 #endif | |
7033 } | |
7034 static PyMethodDef __pyx_CyFunction_methods[] = { | |
7035 {__Pyx_NAMESTR("__reduce__"), (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0}, | |
7036 {0, 0, 0, 0} | |
7037 }; | |
7038 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname, | |
7039 PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) { | |
7040 __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type); | |
7041 if (op == NULL) | |
7042 return NULL; | |
7043 op->flags = flags; | |
7044 op->func_weakreflist = NULL; | |
7045 op->func.m_ml = ml; | |
7046 op->func.m_self = (PyObject *) op; | |
7047 Py_XINCREF(closure); | |
7048 op->func_closure = closure; | |
7049 Py_XINCREF(module); | |
7050 op->func.m_module = module; | |
7051 op->func_dict = NULL; | |
7052 op->func_name = NULL; | |
7053 Py_INCREF(qualname); | |
7054 op->func_qualname = qualname; | |
7055 op->func_doc = NULL; | |
7056 op->func_classobj = NULL; | |
7057 op->func_globals = globals; | |
7058 Py_INCREF(op->func_globals); | |
7059 Py_XINCREF(code); | |
7060 op->func_code = code; | |
7061 op->defaults_pyobjects = 0; | |
7062 op->defaults = NULL; | |
7063 op->defaults_tuple = NULL; | |
7064 op->defaults_kwdict = NULL; | |
7065 op->defaults_getter = NULL; | |
7066 op->func_annotations = NULL; | |
7067 PyObject_GC_Track(op); | |
7068 return (PyObject *) op; | |
7069 } | |
7070 static int | |
7071 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m) | |
7072 { | |
7073 Py_CLEAR(m->func_closure); | |
7074 Py_CLEAR(m->func.m_module); | |
7075 Py_CLEAR(m->func_dict); | |
7076 Py_CLEAR(m->func_name); | |
7077 Py_CLEAR(m->func_qualname); | |
7078 Py_CLEAR(m->func_doc); | |
7079 Py_CLEAR(m->func_globals); | |
7080 Py_CLEAR(m->func_code); | |
7081 Py_CLEAR(m->func_classobj); | |
7082 Py_CLEAR(m->defaults_tuple); | |
7083 Py_CLEAR(m->defaults_kwdict); | |
7084 Py_CLEAR(m->func_annotations); | |
7085 if (m->defaults) { | |
7086 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
7087 int i; | |
7088 for (i = 0; i < m->defaults_pyobjects; i++) | |
7089 Py_XDECREF(pydefaults[i]); | |
7090 PyMem_Free(m->defaults); | |
7091 m->defaults = NULL; | |
7092 } | |
7093 return 0; | |
7094 } | |
7095 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m) | |
7096 { | |
7097 PyObject_GC_UnTrack(m); | |
7098 if (m->func_weakreflist != NULL) | |
7099 PyObject_ClearWeakRefs((PyObject *) m); | |
7100 __Pyx_CyFunction_clear(m); | |
7101 PyObject_GC_Del(m); | |
7102 } | |
7103 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg) | |
7104 { | |
7105 Py_VISIT(m->func_closure); | |
7106 Py_VISIT(m->func.m_module); | |
7107 Py_VISIT(m->func_dict); | |
7108 Py_VISIT(m->func_name); | |
7109 Py_VISIT(m->func_qualname); | |
7110 Py_VISIT(m->func_doc); | |
7111 Py_VISIT(m->func_globals); | |
7112 Py_VISIT(m->func_code); | |
7113 Py_VISIT(m->func_classobj); | |
7114 Py_VISIT(m->defaults_tuple); | |
7115 Py_VISIT(m->defaults_kwdict); | |
7116 if (m->defaults) { | |
7117 PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m); | |
7118 int i; | |
7119 for (i = 0; i < m->defaults_pyobjects; i++) | |
7120 Py_VISIT(pydefaults[i]); | |
7121 } | |
7122 return 0; | |
7123 } | |
7124 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type) | |
7125 { | |
7126 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
7127 if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) { | |
7128 Py_INCREF(func); | |
7129 return func; | |
7130 } | |
7131 if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) { | |
7132 if (type == NULL) | |
7133 type = (PyObject *)(Py_TYPE(obj)); | |
7134 return PyMethod_New(func, | |
7135 type, (PyObject *)(Py_TYPE(type))); | |
7136 } | |
7137 if (obj == Py_None) | |
7138 obj = NULL; | |
7139 return PyMethod_New(func, obj, type); | |
7140 } | |
7141 static PyObject* | |
7142 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op) | |
7143 { | |
7144 #if PY_MAJOR_VERSION >= 3 | |
7145 return PyUnicode_FromFormat("<cyfunction %U at %p>", | |
7146 op->func_qualname, (void *)op); | |
7147 #else | |
7148 return PyString_FromFormat("<cyfunction %s at %p>", | |
7149 PyString_AsString(op->func_qualname), (void *)op); | |
7150 #endif | |
7151 } | |
7152 #if CYTHON_COMPILING_IN_PYPY | |
7153 static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
7154 PyCFunctionObject* f = (PyCFunctionObject*)func; | |
7155 PyCFunction meth = PyCFunction_GET_FUNCTION(func); | |
7156 PyObject *self = PyCFunction_GET_SELF(func); | |
7157 Py_ssize_t size; | |
7158 switch (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)) { | |
7159 case METH_VARARGS: | |
7160 if (likely(kw == NULL) || PyDict_Size(kw) == 0) | |
7161 return (*meth)(self, arg); | |
7162 break; | |
7163 case METH_VARARGS | METH_KEYWORDS: | |
7164 return (*(PyCFunctionWithKeywords)meth)(self, arg, kw); | |
7165 case METH_NOARGS: | |
7166 if (likely(kw == NULL) || PyDict_Size(kw) == 0) { | |
7167 size = PyTuple_GET_SIZE(arg); | |
7168 if (size == 0) | |
7169 return (*meth)(self, NULL); | |
7170 PyErr_Format(PyExc_TypeError, | |
7171 "%.200s() takes no arguments (%zd given)", | |
7172 f->m_ml->ml_name, size); | |
7173 return NULL; | |
7174 } | |
7175 break; | |
7176 case METH_O: | |
7177 if (likely(kw == NULL) || PyDict_Size(kw) == 0) { | |
7178 size = PyTuple_GET_SIZE(arg); | |
7179 if (size == 1) | |
7180 return (*meth)(self, PyTuple_GET_ITEM(arg, 0)); | |
7181 PyErr_Format(PyExc_TypeError, | |
7182 "%.200s() takes exactly one argument (%zd given)", | |
7183 f->m_ml->ml_name, size); | |
7184 return NULL; | |
7185 } | |
7186 break; | |
7187 default: | |
7188 PyErr_SetString(PyExc_SystemError, "Bad call flags in " | |
7189 "__Pyx_CyFunction_Call. METH_OLDARGS is no " | |
7190 "longer supported!"); | |
7191 return NULL; | |
7192 } | |
7193 PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments", | |
7194 f->m_ml->ml_name); | |
7195 return NULL; | |
7196 } | |
7197 #else | |
7198 static PyObject * __Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) { | |
7199 return PyCFunction_Call(func, arg, kw); | |
7200 } | |
7201 #endif | |
7202 static PyTypeObject __pyx_CyFunctionType_type = { | |
7203 PyVarObject_HEAD_INIT(0, 0) | |
7204 __Pyx_NAMESTR("cython_function_or_method"), /*tp_name*/ | |
7205 sizeof(__pyx_CyFunctionObject), /*tp_basicsize*/ | |
7206 0, /*tp_itemsize*/ | |
7207 (destructor) __Pyx_CyFunction_dealloc, /*tp_dealloc*/ | |
7208 0, /*tp_print*/ | |
7209 0, /*tp_getattr*/ | |
7210 0, /*tp_setattr*/ | |
7211 #if PY_MAJOR_VERSION < 3 | |
7212 0, /*tp_compare*/ | |
7213 #else | |
7214 0, /*reserved*/ | |
7215 #endif | |
7216 (reprfunc) __Pyx_CyFunction_repr, /*tp_repr*/ | |
7217 0, /*tp_as_number*/ | |
7218 0, /*tp_as_sequence*/ | |
7219 0, /*tp_as_mapping*/ | |
7220 0, /*tp_hash*/ | |
7221 __Pyx_CyFunction_Call, /*tp_call*/ | |
7222 0, /*tp_str*/ | |
7223 0, /*tp_getattro*/ | |
7224 0, /*tp_setattro*/ | |
7225 0, /*tp_as_buffer*/ | |
7226 Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC, /* tp_flags*/ | |
7227 0, /*tp_doc*/ | |
7228 (traverseproc) __Pyx_CyFunction_traverse, /*tp_traverse*/ | |
7229 (inquiry) __Pyx_CyFunction_clear, /*tp_clear*/ | |
7230 0, /*tp_richcompare*/ | |
7231 offsetof(__pyx_CyFunctionObject, func_weakreflist), /* tp_weaklistoffse */ | |
7232 0, /*tp_iter*/ | |
7233 0, /*tp_iternext*/ | |
7234 __pyx_CyFunction_methods, /*tp_methods*/ | |
7235 __pyx_CyFunction_members, /*tp_members*/ | |
7236 __pyx_CyFunction_getsets, /*tp_getset*/ | |
7237 0, /*tp_base*/ | |
7238 0, /*tp_dict*/ | |
7239 __Pyx_CyFunction_descr_get, /*tp_descr_get*/ | |
7240 0, /*tp_descr_set*/ | |
7241 offsetof(__pyx_CyFunctionObject, func_dict),/*tp_dictoffset*/ | |
7242 0, /*tp_init*/ | |
7243 0, /*tp_alloc*/ | |
7244 0, /*tp_new*/ | |
7245 0, /*tp_free*/ | |
7246 0, /*tp_is_gc*/ | |
7247 0, /*tp_bases*/ | |
7248 0, /*tp_mro*/ | |
7249 0, /*tp_cache*/ | |
7250 0, /*tp_subclasses*/ | |
7251 0, /*tp_weaklist*/ | |
7252 0, /*tp_del*/ | |
7253 #if PY_VERSION_HEX >= 0x02060000 | |
7254 0, /*tp_version_tag*/ | |
7255 #endif | |
7256 #if PY_VERSION_HEX >= 0x030400a1 | |
7257 0, /*tp_finalize*/ | |
7258 #endif | |
7259 }; | |
7260 static int __Pyx_CyFunction_init(void) { | |
7261 #if !CYTHON_COMPILING_IN_PYPY | |
7262 __pyx_CyFunctionType_type.tp_call = PyCFunction_Call; | |
7263 #endif | |
7264 __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type); | |
7265 if (__pyx_CyFunctionType == NULL) { | |
7266 return -1; | |
7267 } | |
7268 return 0; | |
7269 } | |
7270 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) { | |
7271 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
7272 m->defaults = PyMem_Malloc(size); | |
7273 if (!m->defaults) | |
7274 return PyErr_NoMemory(); | |
7275 memset(m->defaults, 0, size); | |
7276 m->defaults_pyobjects = pyobjects; | |
7277 return m->defaults; | |
7278 } | |
7279 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) { | |
7280 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
7281 m->defaults_tuple = tuple; | |
7282 Py_INCREF(tuple); | |
7283 } | |
7284 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) { | |
7285 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
7286 m->defaults_kwdict = dict; | |
7287 Py_INCREF(dict); | |
7288 } | |
7289 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) { | |
7290 __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func; | |
7291 m->func_annotations = dict; | |
7292 Py_INCREF(dict); | |
7293 } | |
7294 | |
7295 static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) { | |
7296 Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases); | |
7297 for (i=0; i < nbases; i++) { | |
7298 PyTypeObject *tmptype; | |
7299 PyObject *tmp = PyTuple_GET_ITEM(bases, i); | |
7300 tmptype = Py_TYPE(tmp); | |
7301 #if PY_MAJOR_VERSION < 3 | |
7302 if (tmptype == &PyClass_Type) | |
7303 continue; | |
7304 #endif | |
7305 if (!metaclass) { | |
7306 metaclass = tmptype; | |
7307 continue; | |
7308 } | |
7309 if (PyType_IsSubtype(metaclass, tmptype)) | |
7310 continue; | |
7311 if (PyType_IsSubtype(tmptype, metaclass)) { | |
7312 metaclass = tmptype; | |
7313 continue; | |
7314 } | |
7315 PyErr_SetString(PyExc_TypeError, | |
7316 "metaclass conflict: " | |
7317 "the metaclass of a derived class " | |
7318 "must be a (non-strict) subclass " | |
7319 "of the metaclasses of all its bases"); | |
7320 return NULL; | |
7321 } | |
7322 if (!metaclass) { | |
7323 #if PY_MAJOR_VERSION < 3 | |
7324 metaclass = &PyClass_Type; | |
7325 #else | |
7326 metaclass = &PyType_Type; | |
7327 #endif | |
7328 } | |
7329 Py_INCREF((PyObject*) metaclass); | |
7330 return (PyObject*) metaclass; | |
7331 } | |
7332 | |
7333 static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, | |
7334 PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) { | |
7335 PyObject *ns; | |
7336 if (metaclass) { | |
7337 PyObject *prep = __Pyx_PyObject_GetAttrStr(metaclass, __pyx_n_s_prepare); | |
7338 if (prep) { | |
7339 PyObject *pargs = PyTuple_Pack(2, name, bases); | |
7340 if (unlikely(!pargs)) { | |
7341 Py_DECREF(prep); | |
7342 return NULL; | |
7343 } | |
7344 ns = PyObject_Call(prep, pargs, mkw); | |
7345 Py_DECREF(prep); | |
7346 Py_DECREF(pargs); | |
7347 } else { | |
7348 if (unlikely(!PyErr_ExceptionMatches(PyExc_AttributeError))) | |
7349 return NULL; | |
7350 PyErr_Clear(); | |
7351 ns = PyDict_New(); | |
7352 } | |
7353 } else { | |
7354 ns = PyDict_New(); | |
7355 } | |
7356 if (unlikely(!ns)) | |
7357 return NULL; | |
7358 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad; | |
7359 if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad; | |
7360 if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad; | |
7361 return ns; | |
7362 bad: | |
7363 Py_DECREF(ns); | |
7364 return NULL; | |
7365 } | |
7366 static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, | |
7367 PyObject *dict, PyObject *mkw, | |
7368 int calculate_metaclass, int allow_py2_metaclass) { | |
7369 PyObject *result, *margs; | |
7370 PyObject *owned_metaclass = NULL; | |
7371 if (allow_py2_metaclass) { | |
7372 owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass); | |
7373 if (owned_metaclass) { | |
7374 metaclass = owned_metaclass; | |
7375 } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) { | |
7376 PyErr_Clear(); | |
7377 } else { | |
7378 return NULL; | |
7379 } | |
7380 } | |
7381 if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) { | |
7382 metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases); | |
7383 Py_XDECREF(owned_metaclass); | |
7384 if (unlikely(!metaclass)) | |
7385 return NULL; | |
7386 owned_metaclass = metaclass; | |
7387 } | |
7388 margs = PyTuple_Pack(3, name, bases, dict); | |
7389 if (unlikely(!margs)) { | |
7390 result = NULL; | |
7391 } else { | |
7392 result = PyObject_Call(metaclass, margs, mkw); | |
7393 Py_DECREF(margs); | |
7394 } | |
7395 Py_XDECREF(owned_metaclass); | |
7396 return result; | |
7397 } | |
7398 | |
7399 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) { | |
7400 PyObject *empty_list = 0; | |
7401 PyObject *module = 0; | |
7402 PyObject *global_dict = 0; | |
7403 PyObject *empty_dict = 0; | |
7404 PyObject *list; | |
7405 #if PY_VERSION_HEX < 0x03030000 | |
7406 PyObject *py_import; | |
7407 py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import); | |
7408 if (!py_import) | |
7409 goto bad; | |
7410 #endif | |
7411 if (from_list) | |
7412 list = from_list; | |
7413 else { | |
7414 empty_list = PyList_New(0); | |
7415 if (!empty_list) | |
7416 goto bad; | |
7417 list = empty_list; | |
7418 } | |
7419 global_dict = PyModule_GetDict(__pyx_m); | |
7420 if (!global_dict) | |
7421 goto bad; | |
7422 empty_dict = PyDict_New(); | |
7423 if (!empty_dict) | |
7424 goto bad; | |
7425 #if PY_VERSION_HEX >= 0x02050000 | |
7426 { | |
7427 #if PY_MAJOR_VERSION >= 3 | |
7428 if (level == -1) { | |
7429 if (strchr(__Pyx_MODULE_NAME, '.')) { | |
7430 #if PY_VERSION_HEX < 0x03030000 | |
7431 PyObject *py_level = PyInt_FromLong(1); | |
7432 if (!py_level) | |
7433 goto bad; | |
7434 module = PyObject_CallFunctionObjArgs(py_import, | |
7435 name, global_dict, empty_dict, list, py_level, NULL); | |
7436 Py_DECREF(py_level); | |
7437 #else | |
7438 module = PyImport_ImportModuleLevelObject( | |
7439 name, global_dict, empty_dict, list, 1); | |
7440 #endif | |
7441 if (!module) { | |
7442 if (!PyErr_ExceptionMatches(PyExc_ImportError)) | |
7443 goto bad; | |
7444 PyErr_Clear(); | |
7445 } | |
7446 } | |
7447 level = 0; /* try absolute import on failure */ | |
7448 } | |
7449 #endif | |
7450 if (!module) { | |
7451 #if PY_VERSION_HEX < 0x03030000 | |
7452 PyObject *py_level = PyInt_FromLong(level); | |
7453 if (!py_level) | |
7454 goto bad; | |
7455 module = PyObject_CallFunctionObjArgs(py_import, | |
7456 name, global_dict, empty_dict, list, py_level, NULL); | |
7457 Py_DECREF(py_level); | |
7458 #else | |
7459 module = PyImport_ImportModuleLevelObject( | |
7460 name, global_dict, empty_dict, list, level); | |
7461 #endif | |
7462 } | |
7463 } | |
7464 #else | |
7465 if (level>0) { | |
7466 PyErr_SetString(PyExc_RuntimeError, "Relative import is not supported for Python <=2.4."); | |
7467 goto bad; | |
7468 } | |
7469 module = PyObject_CallFunctionObjArgs(py_import, | |
7470 name, global_dict, empty_dict, list, NULL); | |
7471 #endif | |
7472 bad: | |
7473 #if PY_VERSION_HEX < 0x03030000 | |
7474 Py_XDECREF(py_import); | |
7475 #endif | |
7476 Py_XDECREF(empty_list); | |
7477 Py_XDECREF(empty_dict); | |
7478 return module; | |
7479 } | |
7480 | |
7481 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) { | |
7482 const long neg_one = (long) -1, const_zero = 0; | |
7483 const int is_unsigned = neg_one > const_zero; | |
7484 if (is_unsigned) { | |
7485 if (sizeof(long) < sizeof(long)) { | |
7486 return PyInt_FromLong((long) value); | |
7487 } else if (sizeof(long) <= sizeof(unsigned long)) { | |
7488 return PyLong_FromUnsignedLong((unsigned long) value); | |
7489 } else if (sizeof(long) <= sizeof(unsigned long long)) { | |
7490 return PyLong_FromUnsignedLongLong((unsigned long long) value); | |
7491 } | |
7492 } else { | |
7493 if (sizeof(long) <= sizeof(long)) { | |
7494 return PyInt_FromLong((long) value); | |
7495 } else if (sizeof(long) <= sizeof(long long)) { | |
7496 return PyLong_FromLongLong((long long) value); | |
7497 } | |
7498 } | |
7499 { | |
7500 int one = 1; int little = (int)*(unsigned char *)&one; | |
7501 unsigned char *bytes = (unsigned char *)&value; | |
7502 return _PyLong_FromByteArray(bytes, sizeof(long), | |
7503 little, !is_unsigned); | |
7504 } | |
7505 } | |
7506 | |
7507 #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func) \ | |
7508 { \ | |
7509 func_type value = func(x); \ | |
7510 if (sizeof(target_type) < sizeof(func_type)) { \ | |
7511 if (unlikely(value != (func_type) (target_type) value)) { \ | |
7512 func_type zero = 0; \ | |
7513 PyErr_SetString(PyExc_OverflowError, \ | |
7514 (is_unsigned && unlikely(value < zero)) ? \ | |
7515 "can't convert negative value to " #target_type : \ | |
7516 "value too large to convert to " #target_type); \ | |
7517 return (target_type) -1; \ | |
7518 } \ | |
7519 } \ | |
7520 return (target_type) value; \ | |
7521 } | |
7522 | |
7523 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7524 #if CYTHON_USE_PYLONG_INTERNALS | |
7525 #include "longintrepr.h" | |
7526 #endif | |
7527 #endif | |
7528 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) { | |
7529 const int neg_one = (int) -1, const_zero = 0; | |
7530 const int is_unsigned = neg_one > const_zero; | |
7531 #if PY_MAJOR_VERSION < 3 | |
7532 if (likely(PyInt_Check(x))) { | |
7533 if (sizeof(int) < sizeof(long)) { | |
7534 __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG) | |
7535 } else { | |
7536 long val = PyInt_AS_LONG(x); | |
7537 if (is_unsigned && unlikely(val < 0)) { | |
7538 PyErr_SetString(PyExc_OverflowError, | |
7539 "can't convert negative value to int"); | |
7540 return (int) -1; | |
7541 } | |
7542 return (int) val; | |
7543 } | |
7544 } else | |
7545 #endif | |
7546 if (likely(PyLong_Check(x))) { | |
7547 if (is_unsigned) { | |
7548 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7549 #if CYTHON_USE_PYLONG_INTERNALS | |
7550 if (sizeof(digit) <= sizeof(int)) { | |
7551 switch (Py_SIZE(x)) { | |
7552 case 0: return 0; | |
7553 case 1: return (int) ((PyLongObject*)x)->ob_digit[0]; | |
7554 } | |
7555 } | |
7556 #endif | |
7557 #endif | |
7558 if (unlikely(Py_SIZE(x) < 0)) { | |
7559 PyErr_SetString(PyExc_OverflowError, | |
7560 "can't convert negative value to int"); | |
7561 return (int) -1; | |
7562 } | |
7563 if (sizeof(int) <= sizeof(unsigned long)) { | |
7564 __PYX_VERIFY_RETURN_INT(int, unsigned long, PyLong_AsUnsignedLong) | |
7565 } else if (sizeof(int) <= sizeof(unsigned long long)) { | |
7566 __PYX_VERIFY_RETURN_INT(int, unsigned long long, PyLong_AsUnsignedLongLong) | |
7567 } | |
7568 } else { | |
7569 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7570 #if CYTHON_USE_PYLONG_INTERNALS | |
7571 if (sizeof(digit) <= sizeof(int)) { | |
7572 switch (Py_SIZE(x)) { | |
7573 case 0: return 0; | |
7574 case 1: return +(int) ((PyLongObject*)x)->ob_digit[0]; | |
7575 case -1: return -(int) ((PyLongObject*)x)->ob_digit[0]; | |
7576 } | |
7577 } | |
7578 #endif | |
7579 #endif | |
7580 if (sizeof(int) <= sizeof(long)) { | |
7581 __PYX_VERIFY_RETURN_INT(int, long, PyLong_AsLong) | |
7582 } else if (sizeof(int) <= sizeof(long long)) { | |
7583 __PYX_VERIFY_RETURN_INT(int, long long, PyLong_AsLongLong) | |
7584 } | |
7585 } | |
7586 { | |
7587 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) | |
7588 PyErr_SetString(PyExc_RuntimeError, | |
7589 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); | |
7590 #else | |
7591 int val; | |
7592 PyObject *v = __Pyx_PyNumber_Int(x); | |
7593 #if PY_MAJOR_VERSION < 3 | |
7594 if (likely(v) && !PyLong_Check(v)) { | |
7595 PyObject *tmp = v; | |
7596 v = PyNumber_Long(tmp); | |
7597 Py_DECREF(tmp); | |
7598 } | |
7599 #endif | |
7600 if (likely(v)) { | |
7601 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
7602 unsigned char *bytes = (unsigned char *)&val; | |
7603 int ret = _PyLong_AsByteArray((PyLongObject *)v, | |
7604 bytes, sizeof(val), | |
7605 is_little, !is_unsigned); | |
7606 Py_DECREF(v); | |
7607 if (likely(!ret)) | |
7608 return val; | |
7609 } | |
7610 #endif | |
7611 return (int) -1; | |
7612 } | |
7613 } else { | |
7614 int val; | |
7615 PyObject *tmp = __Pyx_PyNumber_Int(x); | |
7616 if (!tmp) return (int) -1; | |
7617 val = __Pyx_PyInt_As_int(tmp); | |
7618 Py_DECREF(tmp); | |
7619 return val; | |
7620 } | |
7621 } | |
7622 | |
7623 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) { | |
7624 const int neg_one = (int) -1, const_zero = 0; | |
7625 const int is_unsigned = neg_one > const_zero; | |
7626 if (is_unsigned) { | |
7627 if (sizeof(int) < sizeof(long)) { | |
7628 return PyInt_FromLong((long) value); | |
7629 } else if (sizeof(int) <= sizeof(unsigned long)) { | |
7630 return PyLong_FromUnsignedLong((unsigned long) value); | |
7631 } else if (sizeof(int) <= sizeof(unsigned long long)) { | |
7632 return PyLong_FromUnsignedLongLong((unsigned long long) value); | |
7633 } | |
7634 } else { | |
7635 if (sizeof(int) <= sizeof(long)) { | |
7636 return PyInt_FromLong((long) value); | |
7637 } else if (sizeof(int) <= sizeof(long long)) { | |
7638 return PyLong_FromLongLong((long long) value); | |
7639 } | |
7640 } | |
7641 { | |
7642 int one = 1; int little = (int)*(unsigned char *)&one; | |
7643 unsigned char *bytes = (unsigned char *)&value; | |
7644 return _PyLong_FromByteArray(bytes, sizeof(int), | |
7645 little, !is_unsigned); | |
7646 } | |
7647 } | |
7648 | |
7649 #if CYTHON_CCOMPLEX | |
7650 #ifdef __cplusplus | |
7651 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { | |
7652 return ::std::complex< float >(x, y); | |
7653 } | |
7654 #else | |
7655 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { | |
7656 return x + y*(__pyx_t_float_complex)_Complex_I; | |
7657 } | |
7658 #endif | |
7659 #else | |
7660 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) { | |
7661 __pyx_t_float_complex z; | |
7662 z.real = x; | |
7663 z.imag = y; | |
7664 return z; | |
7665 } | |
7666 #endif | |
7667 | |
7668 #if CYTHON_CCOMPLEX | |
7669 #else | |
7670 static CYTHON_INLINE int __Pyx_c_eqf(__pyx_t_float_complex a, __pyx_t_float_complex b) { | |
7671 return (a.real == b.real) && (a.imag == b.imag); | |
7672 } | |
7673 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sumf(__pyx_t_float_complex a, __pyx_t_float_complex b) { | |
7674 __pyx_t_float_complex z; | |
7675 z.real = a.real + b.real; | |
7676 z.imag = a.imag + b.imag; | |
7677 return z; | |
7678 } | |
7679 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_difff(__pyx_t_float_complex a, __pyx_t_float_complex b) { | |
7680 __pyx_t_float_complex z; | |
7681 z.real = a.real - b.real; | |
7682 z.imag = a.imag - b.imag; | |
7683 return z; | |
7684 } | |
7685 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prodf(__pyx_t_float_complex a, __pyx_t_float_complex b) { | |
7686 __pyx_t_float_complex z; | |
7687 z.real = a.real * b.real - a.imag * b.imag; | |
7688 z.imag = a.real * b.imag + a.imag * b.real; | |
7689 return z; | |
7690 } | |
7691 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quotf(__pyx_t_float_complex a, __pyx_t_float_complex b) { | |
7692 __pyx_t_float_complex z; | |
7693 float denom = b.real * b.real + b.imag * b.imag; | |
7694 z.real = (a.real * b.real + a.imag * b.imag) / denom; | |
7695 z.imag = (a.imag * b.real - a.real * b.imag) / denom; | |
7696 return z; | |
7697 } | |
7698 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_negf(__pyx_t_float_complex a) { | |
7699 __pyx_t_float_complex z; | |
7700 z.real = -a.real; | |
7701 z.imag = -a.imag; | |
7702 return z; | |
7703 } | |
7704 static CYTHON_INLINE int __Pyx_c_is_zerof(__pyx_t_float_complex a) { | |
7705 return (a.real == 0) && (a.imag == 0); | |
7706 } | |
7707 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conjf(__pyx_t_float_complex a) { | |
7708 __pyx_t_float_complex z; | |
7709 z.real = a.real; | |
7710 z.imag = -a.imag; | |
7711 return z; | |
7712 } | |
7713 #if 1 | |
7714 static CYTHON_INLINE float __Pyx_c_absf(__pyx_t_float_complex z) { | |
7715 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) | |
7716 return sqrtf(z.real*z.real + z.imag*z.imag); | |
7717 #else | |
7718 return hypotf(z.real, z.imag); | |
7719 #endif | |
7720 } | |
7721 static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_powf(__pyx_t_float_complex a, __pyx_t_float_complex b) { | |
7722 __pyx_t_float_complex z; | |
7723 float r, lnr, theta, z_r, z_theta; | |
7724 if (b.imag == 0 && b.real == (int)b.real) { | |
7725 if (b.real < 0) { | |
7726 float denom = a.real * a.real + a.imag * a.imag; | |
7727 a.real = a.real / denom; | |
7728 a.imag = -a.imag / denom; | |
7729 b.real = -b.real; | |
7730 } | |
7731 switch ((int)b.real) { | |
7732 case 0: | |
7733 z.real = 1; | |
7734 z.imag = 0; | |
7735 return z; | |
7736 case 1: | |
7737 return a; | |
7738 case 2: | |
7739 z = __Pyx_c_prodf(a, a); | |
7740 return __Pyx_c_prodf(a, a); | |
7741 case 3: | |
7742 z = __Pyx_c_prodf(a, a); | |
7743 return __Pyx_c_prodf(z, a); | |
7744 case 4: | |
7745 z = __Pyx_c_prodf(a, a); | |
7746 return __Pyx_c_prodf(z, z); | |
7747 } | |
7748 } | |
7749 if (a.imag == 0) { | |
7750 if (a.real == 0) { | |
7751 return a; | |
7752 } | |
7753 r = a.real; | |
7754 theta = 0; | |
7755 } else { | |
7756 r = __Pyx_c_absf(a); | |
7757 theta = atan2f(a.imag, a.real); | |
7758 } | |
7759 lnr = logf(r); | |
7760 z_r = expf(lnr * b.real - theta * b.imag); | |
7761 z_theta = theta * b.real + lnr * b.imag; | |
7762 z.real = z_r * cosf(z_theta); | |
7763 z.imag = z_r * sinf(z_theta); | |
7764 return z; | |
7765 } | |
7766 #endif | |
7767 #endif | |
7768 | |
7769 #if CYTHON_CCOMPLEX | |
7770 #ifdef __cplusplus | |
7771 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { | |
7772 return ::std::complex< double >(x, y); | |
7773 } | |
7774 #else | |
7775 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { | |
7776 return x + y*(__pyx_t_double_complex)_Complex_I; | |
7777 } | |
7778 #endif | |
7779 #else | |
7780 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) { | |
7781 __pyx_t_double_complex z; | |
7782 z.real = x; | |
7783 z.imag = y; | |
7784 return z; | |
7785 } | |
7786 #endif | |
7787 | |
7788 #if CYTHON_CCOMPLEX | |
7789 #else | |
7790 static CYTHON_INLINE int __Pyx_c_eq(__pyx_t_double_complex a, __pyx_t_double_complex b) { | |
7791 return (a.real == b.real) && (a.imag == b.imag); | |
7792 } | |
7793 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum(__pyx_t_double_complex a, __pyx_t_double_complex b) { | |
7794 __pyx_t_double_complex z; | |
7795 z.real = a.real + b.real; | |
7796 z.imag = a.imag + b.imag; | |
7797 return z; | |
7798 } | |
7799 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff(__pyx_t_double_complex a, __pyx_t_double_complex b) { | |
7800 __pyx_t_double_complex z; | |
7801 z.real = a.real - b.real; | |
7802 z.imag = a.imag - b.imag; | |
7803 return z; | |
7804 } | |
7805 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod(__pyx_t_double_complex a, __pyx_t_double_complex b) { | |
7806 __pyx_t_double_complex z; | |
7807 z.real = a.real * b.real - a.imag * b.imag; | |
7808 z.imag = a.real * b.imag + a.imag * b.real; | |
7809 return z; | |
7810 } | |
7811 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot(__pyx_t_double_complex a, __pyx_t_double_complex b) { | |
7812 __pyx_t_double_complex z; | |
7813 double denom = b.real * b.real + b.imag * b.imag; | |
7814 z.real = (a.real * b.real + a.imag * b.imag) / denom; | |
7815 z.imag = (a.imag * b.real - a.real * b.imag) / denom; | |
7816 return z; | |
7817 } | |
7818 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg(__pyx_t_double_complex a) { | |
7819 __pyx_t_double_complex z; | |
7820 z.real = -a.real; | |
7821 z.imag = -a.imag; | |
7822 return z; | |
7823 } | |
7824 static CYTHON_INLINE int __Pyx_c_is_zero(__pyx_t_double_complex a) { | |
7825 return (a.real == 0) && (a.imag == 0); | |
7826 } | |
7827 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj(__pyx_t_double_complex a) { | |
7828 __pyx_t_double_complex z; | |
7829 z.real = a.real; | |
7830 z.imag = -a.imag; | |
7831 return z; | |
7832 } | |
7833 #if 1 | |
7834 static CYTHON_INLINE double __Pyx_c_abs(__pyx_t_double_complex z) { | |
7835 #if !defined(HAVE_HYPOT) || defined(_MSC_VER) | |
7836 return sqrt(z.real*z.real + z.imag*z.imag); | |
7837 #else | |
7838 return hypot(z.real, z.imag); | |
7839 #endif | |
7840 } | |
7841 static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow(__pyx_t_double_complex a, __pyx_t_double_complex b) { | |
7842 __pyx_t_double_complex z; | |
7843 double r, lnr, theta, z_r, z_theta; | |
7844 if (b.imag == 0 && b.real == (int)b.real) { | |
7845 if (b.real < 0) { | |
7846 double denom = a.real * a.real + a.imag * a.imag; | |
7847 a.real = a.real / denom; | |
7848 a.imag = -a.imag / denom; | |
7849 b.real = -b.real; | |
7850 } | |
7851 switch ((int)b.real) { | |
7852 case 0: | |
7853 z.real = 1; | |
7854 z.imag = 0; | |
7855 return z; | |
7856 case 1: | |
7857 return a; | |
7858 case 2: | |
7859 z = __Pyx_c_prod(a, a); | |
7860 return __Pyx_c_prod(a, a); | |
7861 case 3: | |
7862 z = __Pyx_c_prod(a, a); | |
7863 return __Pyx_c_prod(z, a); | |
7864 case 4: | |
7865 z = __Pyx_c_prod(a, a); | |
7866 return __Pyx_c_prod(z, z); | |
7867 } | |
7868 } | |
7869 if (a.imag == 0) { | |
7870 if (a.real == 0) { | |
7871 return a; | |
7872 } | |
7873 r = a.real; | |
7874 theta = 0; | |
7875 } else { | |
7876 r = __Pyx_c_abs(a); | |
7877 theta = atan2(a.imag, a.real); | |
7878 } | |
7879 lnr = log(r); | |
7880 z_r = exp(lnr * b.real - theta * b.imag); | |
7881 z_theta = theta * b.real + lnr * b.imag; | |
7882 z.real = z_r * cos(z_theta); | |
7883 z.imag = z_r * sin(z_theta); | |
7884 return z; | |
7885 } | |
7886 #endif | |
7887 #endif | |
7888 | |
7889 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7890 #if CYTHON_USE_PYLONG_INTERNALS | |
7891 #include "longintrepr.h" | |
7892 #endif | |
7893 #endif | |
7894 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) { | |
7895 const long neg_one = (long) -1, const_zero = 0; | |
7896 const int is_unsigned = neg_one > const_zero; | |
7897 #if PY_MAJOR_VERSION < 3 | |
7898 if (likely(PyInt_Check(x))) { | |
7899 if (sizeof(long) < sizeof(long)) { | |
7900 __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG) | |
7901 } else { | |
7902 long val = PyInt_AS_LONG(x); | |
7903 if (is_unsigned && unlikely(val < 0)) { | |
7904 PyErr_SetString(PyExc_OverflowError, | |
7905 "can't convert negative value to long"); | |
7906 return (long) -1; | |
7907 } | |
7908 return (long) val; | |
7909 } | |
7910 } else | |
7911 #endif | |
7912 if (likely(PyLong_Check(x))) { | |
7913 if (is_unsigned) { | |
7914 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7915 #if CYTHON_USE_PYLONG_INTERNALS | |
7916 if (sizeof(digit) <= sizeof(long)) { | |
7917 switch (Py_SIZE(x)) { | |
7918 case 0: return 0; | |
7919 case 1: return (long) ((PyLongObject*)x)->ob_digit[0]; | |
7920 } | |
7921 } | |
7922 #endif | |
7923 #endif | |
7924 if (unlikely(Py_SIZE(x) < 0)) { | |
7925 PyErr_SetString(PyExc_OverflowError, | |
7926 "can't convert negative value to long"); | |
7927 return (long) -1; | |
7928 } | |
7929 if (sizeof(long) <= sizeof(unsigned long)) { | |
7930 __PYX_VERIFY_RETURN_INT(long, unsigned long, PyLong_AsUnsignedLong) | |
7931 } else if (sizeof(long) <= sizeof(unsigned long long)) { | |
7932 __PYX_VERIFY_RETURN_INT(long, unsigned long long, PyLong_AsUnsignedLongLong) | |
7933 } | |
7934 } else { | |
7935 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
7936 #if CYTHON_USE_PYLONG_INTERNALS | |
7937 if (sizeof(digit) <= sizeof(long)) { | |
7938 switch (Py_SIZE(x)) { | |
7939 case 0: return 0; | |
7940 case 1: return +(long) ((PyLongObject*)x)->ob_digit[0]; | |
7941 case -1: return -(long) ((PyLongObject*)x)->ob_digit[0]; | |
7942 } | |
7943 } | |
7944 #endif | |
7945 #endif | |
7946 if (sizeof(long) <= sizeof(long)) { | |
7947 __PYX_VERIFY_RETURN_INT(long, long, PyLong_AsLong) | |
7948 } else if (sizeof(long) <= sizeof(long long)) { | |
7949 __PYX_VERIFY_RETURN_INT(long, long long, PyLong_AsLongLong) | |
7950 } | |
7951 } | |
7952 { | |
7953 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray) | |
7954 PyErr_SetString(PyExc_RuntimeError, | |
7955 "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers"); | |
7956 #else | |
7957 long val; | |
7958 PyObject *v = __Pyx_PyNumber_Int(x); | |
7959 #if PY_MAJOR_VERSION < 3 | |
7960 if (likely(v) && !PyLong_Check(v)) { | |
7961 PyObject *tmp = v; | |
7962 v = PyNumber_Long(tmp); | |
7963 Py_DECREF(tmp); | |
7964 } | |
7965 #endif | |
7966 if (likely(v)) { | |
7967 int one = 1; int is_little = (int)*(unsigned char *)&one; | |
7968 unsigned char *bytes = (unsigned char *)&val; | |
7969 int ret = _PyLong_AsByteArray((PyLongObject *)v, | |
7970 bytes, sizeof(val), | |
7971 is_little, !is_unsigned); | |
7972 Py_DECREF(v); | |
7973 if (likely(!ret)) | |
7974 return val; | |
7975 } | |
7976 #endif | |
7977 return (long) -1; | |
7978 } | |
7979 } else { | |
7980 long val; | |
7981 PyObject *tmp = __Pyx_PyNumber_Int(x); | |
7982 if (!tmp) return (long) -1; | |
7983 val = __Pyx_PyInt_As_long(tmp); | |
7984 Py_DECREF(tmp); | |
7985 return val; | |
7986 } | |
7987 } | |
7988 | |
7989 static int __Pyx_check_binary_version(void) { | |
7990 char ctversion[4], rtversion[4]; | |
7991 PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION); | |
7992 PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion()); | |
7993 if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) { | |
7994 char message[200]; | |
7995 PyOS_snprintf(message, sizeof(message), | |
7996 "compiletime version %s of module '%.100s' " | |
7997 "does not match runtime version %s", | |
7998 ctversion, __Pyx_MODULE_NAME, rtversion); | |
7999 #if PY_VERSION_HEX < 0x02050000 | |
8000 return PyErr_Warn(NULL, message); | |
8001 #else | |
8002 return PyErr_WarnEx(NULL, message, 1); | |
8003 #endif | |
8004 } | |
8005 return 0; | |
8006 } | |
8007 | |
8008 #ifndef __PYX_HAVE_RT_ImportModule | |
8009 #define __PYX_HAVE_RT_ImportModule | |
8010 static PyObject *__Pyx_ImportModule(const char *name) { | |
8011 PyObject *py_name = 0; | |
8012 PyObject *py_module = 0; | |
8013 py_name = __Pyx_PyIdentifier_FromString(name); | |
8014 if (!py_name) | |
8015 goto bad; | |
8016 py_module = PyImport_Import(py_name); | |
8017 Py_DECREF(py_name); | |
8018 return py_module; | |
8019 bad: | |
8020 Py_XDECREF(py_name); | |
8021 return 0; | |
8022 } | |
8023 #endif | |
8024 | |
8025 #ifndef __PYX_HAVE_RT_ImportType | |
8026 #define __PYX_HAVE_RT_ImportType | |
8027 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, | |
8028 size_t size, int strict) | |
8029 { | |
8030 PyObject *py_module = 0; | |
8031 PyObject *result = 0; | |
8032 PyObject *py_name = 0; | |
8033 char warning[200]; | |
8034 Py_ssize_t basicsize; | |
8035 #ifdef Py_LIMITED_API | |
8036 PyObject *py_basicsize; | |
8037 #endif | |
8038 py_module = __Pyx_ImportModule(module_name); | |
8039 if (!py_module) | |
8040 goto bad; | |
8041 py_name = __Pyx_PyIdentifier_FromString(class_name); | |
8042 if (!py_name) | |
8043 goto bad; | |
8044 result = PyObject_GetAttr(py_module, py_name); | |
8045 Py_DECREF(py_name); | |
8046 py_name = 0; | |
8047 Py_DECREF(py_module); | |
8048 py_module = 0; | |
8049 if (!result) | |
8050 goto bad; | |
8051 if (!PyType_Check(result)) { | |
8052 PyErr_Format(PyExc_TypeError, | |
8053 "%.200s.%.200s is not a type object", | |
8054 module_name, class_name); | |
8055 goto bad; | |
8056 } | |
8057 #ifndef Py_LIMITED_API | |
8058 basicsize = ((PyTypeObject *)result)->tp_basicsize; | |
8059 #else | |
8060 py_basicsize = PyObject_GetAttrString(result, "__basicsize__"); | |
8061 if (!py_basicsize) | |
8062 goto bad; | |
8063 basicsize = PyLong_AsSsize_t(py_basicsize); | |
8064 Py_DECREF(py_basicsize); | |
8065 py_basicsize = 0; | |
8066 if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) | |
8067 goto bad; | |
8068 #endif | |
8069 if (!strict && (size_t)basicsize > size) { | |
8070 PyOS_snprintf(warning, sizeof(warning), | |
8071 "%s.%s size changed, may indicate binary incompatibility", | |
8072 module_name, class_name); | |
8073 #if PY_VERSION_HEX < 0x02050000 | |
8074 if (PyErr_Warn(NULL, warning) < 0) goto bad; | |
8075 #else | |
8076 if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad; | |
8077 #endif | |
8078 } | |
8079 else if ((size_t)basicsize != size) { | |
8080 PyErr_Format(PyExc_ValueError, | |
8081 "%.200s.%.200s has the wrong size, try recompiling", | |
8082 module_name, class_name); | |
8083 goto bad; | |
8084 } | |
8085 return (PyTypeObject *)result; | |
8086 bad: | |
8087 Py_XDECREF(py_module); | |
8088 Py_XDECREF(result); | |
8089 return NULL; | |
8090 } | |
8091 #endif | |
8092 | |
8093 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) { | |
8094 int start = 0, mid = 0, end = count - 1; | |
8095 if (end >= 0 && code_line > entries[end].code_line) { | |
8096 return count; | |
8097 } | |
8098 while (start < end) { | |
8099 mid = (start + end) / 2; | |
8100 if (code_line < entries[mid].code_line) { | |
8101 end = mid; | |
8102 } else if (code_line > entries[mid].code_line) { | |
8103 start = mid + 1; | |
8104 } else { | |
8105 return mid; | |
8106 } | |
8107 } | |
8108 if (code_line <= entries[mid].code_line) { | |
8109 return mid; | |
8110 } else { | |
8111 return mid + 1; | |
8112 } | |
8113 } | |
8114 static PyCodeObject *__pyx_find_code_object(int code_line) { | |
8115 PyCodeObject* code_object; | |
8116 int pos; | |
8117 if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) { | |
8118 return NULL; | |
8119 } | |
8120 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
8121 if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) { | |
8122 return NULL; | |
8123 } | |
8124 code_object = __pyx_code_cache.entries[pos].code_object; | |
8125 Py_INCREF(code_object); | |
8126 return code_object; | |
8127 } | |
8128 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) { | |
8129 int pos, i; | |
8130 __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries; | |
8131 if (unlikely(!code_line)) { | |
8132 return; | |
8133 } | |
8134 if (unlikely(!entries)) { | |
8135 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry)); | |
8136 if (likely(entries)) { | |
8137 __pyx_code_cache.entries = entries; | |
8138 __pyx_code_cache.max_count = 64; | |
8139 __pyx_code_cache.count = 1; | |
8140 entries[0].code_line = code_line; | |
8141 entries[0].code_object = code_object; | |
8142 Py_INCREF(code_object); | |
8143 } | |
8144 return; | |
8145 } | |
8146 pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line); | |
8147 if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) { | |
8148 PyCodeObject* tmp = entries[pos].code_object; | |
8149 entries[pos].code_object = code_object; | |
8150 Py_DECREF(tmp); | |
8151 return; | |
8152 } | |
8153 if (__pyx_code_cache.count == __pyx_code_cache.max_count) { | |
8154 int new_max = __pyx_code_cache.max_count + 64; | |
8155 entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc( | |
8156 __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry)); | |
8157 if (unlikely(!entries)) { | |
8158 return; | |
8159 } | |
8160 __pyx_code_cache.entries = entries; | |
8161 __pyx_code_cache.max_count = new_max; | |
8162 } | |
8163 for (i=__pyx_code_cache.count; i>pos; i--) { | |
8164 entries[i] = entries[i-1]; | |
8165 } | |
8166 entries[pos].code_line = code_line; | |
8167 entries[pos].code_object = code_object; | |
8168 __pyx_code_cache.count++; | |
8169 Py_INCREF(code_object); | |
8170 } | |
8171 | |
8172 #include "compile.h" | |
8173 #include "frameobject.h" | |
8174 #include "traceback.h" | |
8175 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback( | |
8176 const char *funcname, int c_line, | |
8177 int py_line, const char *filename) { | |
8178 PyCodeObject *py_code = 0; | |
8179 PyObject *py_srcfile = 0; | |
8180 PyObject *py_funcname = 0; | |
8181 #if PY_MAJOR_VERSION < 3 | |
8182 py_srcfile = PyString_FromString(filename); | |
8183 #else | |
8184 py_srcfile = PyUnicode_FromString(filename); | |
8185 #endif | |
8186 if (!py_srcfile) goto bad; | |
8187 if (c_line) { | |
8188 #if PY_MAJOR_VERSION < 3 | |
8189 py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
8190 #else | |
8191 py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line); | |
8192 #endif | |
8193 } | |
8194 else { | |
8195 #if PY_MAJOR_VERSION < 3 | |
8196 py_funcname = PyString_FromString(funcname); | |
8197 #else | |
8198 py_funcname = PyUnicode_FromString(funcname); | |
8199 #endif | |
8200 } | |
8201 if (!py_funcname) goto bad; | |
8202 py_code = __Pyx_PyCode_New( | |
8203 0, /*int argcount,*/ | |
8204 0, /*int kwonlyargcount,*/ | |
8205 0, /*int nlocals,*/ | |
8206 0, /*int stacksize,*/ | |
8207 0, /*int flags,*/ | |
8208 __pyx_empty_bytes, /*PyObject *code,*/ | |
8209 __pyx_empty_tuple, /*PyObject *consts,*/ | |
8210 __pyx_empty_tuple, /*PyObject *names,*/ | |
8211 __pyx_empty_tuple, /*PyObject *varnames,*/ | |
8212 __pyx_empty_tuple, /*PyObject *freevars,*/ | |
8213 __pyx_empty_tuple, /*PyObject *cellvars,*/ | |
8214 py_srcfile, /*PyObject *filename,*/ | |
8215 py_funcname, /*PyObject *name,*/ | |
8216 py_line, /*int firstlineno,*/ | |
8217 __pyx_empty_bytes /*PyObject *lnotab*/ | |
8218 ); | |
8219 Py_DECREF(py_srcfile); | |
8220 Py_DECREF(py_funcname); | |
8221 return py_code; | |
8222 bad: | |
8223 Py_XDECREF(py_srcfile); | |
8224 Py_XDECREF(py_funcname); | |
8225 return NULL; | |
8226 } | |
8227 static void __Pyx_AddTraceback(const char *funcname, int c_line, | |
8228 int py_line, const char *filename) { | |
8229 PyCodeObject *py_code = 0; | |
8230 PyObject *py_globals = 0; | |
8231 PyFrameObject *py_frame = 0; | |
8232 py_code = __pyx_find_code_object(c_line ? c_line : py_line); | |
8233 if (!py_code) { | |
8234 py_code = __Pyx_CreateCodeObjectForTraceback( | |
8235 funcname, c_line, py_line, filename); | |
8236 if (!py_code) goto bad; | |
8237 __pyx_insert_code_object(c_line ? c_line : py_line, py_code); | |
8238 } | |
8239 py_globals = PyModule_GetDict(__pyx_m); | |
8240 if (!py_globals) goto bad; | |
8241 py_frame = PyFrame_New( | |
8242 PyThreadState_GET(), /*PyThreadState *tstate,*/ | |
8243 py_code, /*PyCodeObject *code,*/ | |
8244 py_globals, /*PyObject *globals,*/ | |
8245 0 /*PyObject *locals*/ | |
8246 ); | |
8247 if (!py_frame) goto bad; | |
8248 py_frame->f_lineno = py_line; | |
8249 PyTraceBack_Here(py_frame); | |
8250 bad: | |
8251 Py_XDECREF(py_code); | |
8252 Py_XDECREF(py_frame); | |
8253 } | |
8254 | |
8255 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) { | |
8256 while (t->p) { | |
8257 #if PY_MAJOR_VERSION < 3 | |
8258 if (t->is_unicode) { | |
8259 *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL); | |
8260 } else if (t->intern) { | |
8261 *t->p = PyString_InternFromString(t->s); | |
8262 } else { | |
8263 *t->p = PyString_FromStringAndSize(t->s, t->n - 1); | |
8264 } | |
8265 #else /* Python 3+ has unicode identifiers */ | |
8266 if (t->is_unicode | t->is_str) { | |
8267 if (t->intern) { | |
8268 *t->p = PyUnicode_InternFromString(t->s); | |
8269 } else if (t->encoding) { | |
8270 *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL); | |
8271 } else { | |
8272 *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1); | |
8273 } | |
8274 } else { | |
8275 *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1); | |
8276 } | |
8277 #endif | |
8278 if (!*t->p) | |
8279 return -1; | |
8280 ++t; | |
8281 } | |
8282 return 0; | |
8283 } | |
8284 | |
8285 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) { | |
8286 return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str)); | |
8287 } | |
8288 static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) { | |
8289 Py_ssize_t ignore; | |
8290 return __Pyx_PyObject_AsStringAndSize(o, &ignore); | |
8291 } | |
8292 static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) { | |
8293 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT | |
8294 if ( | |
8295 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
8296 __Pyx_sys_getdefaultencoding_not_ascii && | |
8297 #endif | |
8298 PyUnicode_Check(o)) { | |
8299 #if PY_VERSION_HEX < 0x03030000 | |
8300 char* defenc_c; | |
8301 PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL); | |
8302 if (!defenc) return NULL; | |
8303 defenc_c = PyBytes_AS_STRING(defenc); | |
8304 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
8305 { | |
8306 char* end = defenc_c + PyBytes_GET_SIZE(defenc); | |
8307 char* c; | |
8308 for (c = defenc_c; c < end; c++) { | |
8309 if ((unsigned char) (*c) >= 128) { | |
8310 PyUnicode_AsASCIIString(o); | |
8311 return NULL; | |
8312 } | |
8313 } | |
8314 } | |
8315 #endif /*__PYX_DEFAULT_STRING_ENCODING_IS_ASCII*/ | |
8316 *length = PyBytes_GET_SIZE(defenc); | |
8317 return defenc_c; | |
8318 #else /* PY_VERSION_HEX < 0x03030000 */ | |
8319 if (PyUnicode_READY(o) == -1) return NULL; | |
8320 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII | |
8321 if (PyUnicode_IS_ASCII(o)) { | |
8322 *length = PyUnicode_GET_LENGTH(o); | |
8323 return PyUnicode_AsUTF8(o); | |
8324 } else { | |
8325 PyUnicode_AsASCIIString(o); | |
8326 return NULL; | |
8327 } | |
8328 #else /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ | |
8329 return PyUnicode_AsUTF8AndSize(o, length); | |
8330 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII */ | |
8331 #endif /* PY_VERSION_HEX < 0x03030000 */ | |
8332 } else | |
8333 #endif /* __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT */ | |
8334 #if !CYTHON_COMPILING_IN_PYPY | |
8335 #if PY_VERSION_HEX >= 0x02060000 | |
8336 if (PyByteArray_Check(o)) { | |
8337 *length = PyByteArray_GET_SIZE(o); | |
8338 return PyByteArray_AS_STRING(o); | |
8339 } else | |
8340 #endif | |
8341 #endif | |
8342 { | |
8343 char* result; | |
8344 int r = PyBytes_AsStringAndSize(o, &result, length); | |
8345 if (unlikely(r < 0)) { | |
8346 return NULL; | |
8347 } else { | |
8348 return result; | |
8349 } | |
8350 } | |
8351 } | |
8352 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) { | |
8353 int is_true = x == Py_True; | |
8354 if (is_true | (x == Py_False) | (x == Py_None)) return is_true; | |
8355 else return PyObject_IsTrue(x); | |
8356 } | |
8357 static CYTHON_INLINE PyObject* __Pyx_PyNumber_Int(PyObject* x) { | |
8358 PyNumberMethods *m; | |
8359 const char *name = NULL; | |
8360 PyObject *res = NULL; | |
8361 #if PY_MAJOR_VERSION < 3 | |
8362 if (PyInt_Check(x) || PyLong_Check(x)) | |
8363 #else | |
8364 if (PyLong_Check(x)) | |
8365 #endif | |
8366 return Py_INCREF(x), x; | |
8367 m = Py_TYPE(x)->tp_as_number; | |
8368 #if PY_MAJOR_VERSION < 3 | |
8369 if (m && m->nb_int) { | |
8370 name = "int"; | |
8371 res = PyNumber_Int(x); | |
8372 } | |
8373 else if (m && m->nb_long) { | |
8374 name = "long"; | |
8375 res = PyNumber_Long(x); | |
8376 } | |
8377 #else | |
8378 if (m && m->nb_int) { | |
8379 name = "int"; | |
8380 res = PyNumber_Long(x); | |
8381 } | |
8382 #endif | |
8383 if (res) { | |
8384 #if PY_MAJOR_VERSION < 3 | |
8385 if (!PyInt_Check(res) && !PyLong_Check(res)) { | |
8386 #else | |
8387 if (!PyLong_Check(res)) { | |
8388 #endif | |
8389 PyErr_Format(PyExc_TypeError, | |
8390 "__%.4s__ returned non-%.4s (type %.200s)", | |
8391 name, name, Py_TYPE(res)->tp_name); | |
8392 Py_DECREF(res); | |
8393 return NULL; | |
8394 } | |
8395 } | |
8396 else if (!PyErr_Occurred()) { | |
8397 PyErr_SetString(PyExc_TypeError, | |
8398 "an integer is required"); | |
8399 } | |
8400 return res; | |
8401 } | |
8402 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
8403 #if CYTHON_USE_PYLONG_INTERNALS | |
8404 #include "longintrepr.h" | |
8405 #endif | |
8406 #endif | |
8407 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) { | |
8408 Py_ssize_t ival; | |
8409 PyObject *x; | |
8410 #if PY_MAJOR_VERSION < 3 | |
8411 if (likely(PyInt_CheckExact(b))) | |
8412 return PyInt_AS_LONG(b); | |
8413 #endif | |
8414 if (likely(PyLong_CheckExact(b))) { | |
8415 #if CYTHON_COMPILING_IN_CPYTHON && PY_MAJOR_VERSION >= 3 | |
8416 #if CYTHON_USE_PYLONG_INTERNALS | |
8417 switch (Py_SIZE(b)) { | |
8418 case -1: return -(sdigit)((PyLongObject*)b)->ob_digit[0]; | |
8419 case 0: return 0; | |
8420 case 1: return ((PyLongObject*)b)->ob_digit[0]; | |
8421 } | |
8422 #endif | |
8423 #endif | |
8424 #if PY_VERSION_HEX < 0x02060000 | |
8425 return PyInt_AsSsize_t(b); | |
8426 #else | |
8427 return PyLong_AsSsize_t(b); | |
8428 #endif | |
8429 } | |
8430 x = PyNumber_Index(b); | |
8431 if (!x) return -1; | |
8432 ival = PyInt_AsSsize_t(x); | |
8433 Py_DECREF(x); | |
8434 return ival; | |
8435 } | |
8436 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) { | |
8437 #if PY_VERSION_HEX < 0x02050000 | |
8438 if (ival <= LONG_MAX) | |
8439 return PyInt_FromLong((long)ival); | |
8440 else { | |
8441 unsigned char *bytes = (unsigned char *) &ival; | |
8442 int one = 1; int little = (int)*(unsigned char*)&one; | |
8443 return _PyLong_FromByteArray(bytes, sizeof(size_t), little, 0); | |
8444 } | |
8445 #else | |
8446 return PyInt_FromSize_t(ival); | |
8447 #endif | |
8448 } | |
8449 | |
8450 | |
8451 #endif /* Py_PYTHON_H */ |