Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Download
241852 views
1
/* Generated by Cython 0.25.2 */
2
3
#define PY_SSIZE_T_CLEAN
4
#include "Python.h"
5
#ifndef Py_PYTHON_H
6
#error Python headers needed to compile C extensions, please install development version of Python.
7
#elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03020000)
8
#error Cython requires Python 2.6+ or Python 3.2+.
9
#else
10
#define CYTHON_ABI "0_25_2"
11
#include <stddef.h>
12
#ifndef offsetof
13
#define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
14
#endif
15
#if !defined(WIN32) && !defined(MS_WINDOWS)
16
#ifndef __stdcall
17
#define __stdcall
18
#endif
19
#ifndef __cdecl
20
#define __cdecl
21
#endif
22
#ifndef __fastcall
23
#define __fastcall
24
#endif
25
#endif
26
#ifndef DL_IMPORT
27
#define DL_IMPORT(t) t
28
#endif
29
#ifndef DL_EXPORT
30
#define DL_EXPORT(t) t
31
#endif
32
#ifndef HAVE_LONG_LONG
33
#if PY_VERSION_HEX >= 0x03030000 || (PY_MAJOR_VERSION == 2 && PY_VERSION_HEX >= 0x02070000)
34
#define HAVE_LONG_LONG
35
#endif
36
#endif
37
#ifndef PY_LONG_LONG
38
#define PY_LONG_LONG LONG_LONG
39
#endif
40
#ifndef Py_HUGE_VAL
41
#define Py_HUGE_VAL HUGE_VAL
42
#endif
43
#ifdef PYPY_VERSION
44
#define CYTHON_COMPILING_IN_PYPY 1
45
#define CYTHON_COMPILING_IN_PYSTON 0
46
#define CYTHON_COMPILING_IN_CPYTHON 0
47
#undef CYTHON_USE_TYPE_SLOTS
48
#define CYTHON_USE_TYPE_SLOTS 0
49
#undef CYTHON_USE_ASYNC_SLOTS
50
#define CYTHON_USE_ASYNC_SLOTS 0
51
#undef CYTHON_USE_PYLIST_INTERNALS
52
#define CYTHON_USE_PYLIST_INTERNALS 0
53
#undef CYTHON_USE_UNICODE_INTERNALS
54
#define CYTHON_USE_UNICODE_INTERNALS 0
55
#undef CYTHON_USE_UNICODE_WRITER
56
#define CYTHON_USE_UNICODE_WRITER 0
57
#undef CYTHON_USE_PYLONG_INTERNALS
58
#define CYTHON_USE_PYLONG_INTERNALS 0
59
#undef CYTHON_AVOID_BORROWED_REFS
60
#define CYTHON_AVOID_BORROWED_REFS 1
61
#undef CYTHON_ASSUME_SAFE_MACROS
62
#define CYTHON_ASSUME_SAFE_MACROS 0
63
#undef CYTHON_UNPACK_METHODS
64
#define CYTHON_UNPACK_METHODS 0
65
#undef CYTHON_FAST_THREAD_STATE
66
#define CYTHON_FAST_THREAD_STATE 0
67
#undef CYTHON_FAST_PYCALL
68
#define CYTHON_FAST_PYCALL 0
69
#elif defined(PYSTON_VERSION)
70
#define CYTHON_COMPILING_IN_PYPY 0
71
#define CYTHON_COMPILING_IN_PYSTON 1
72
#define CYTHON_COMPILING_IN_CPYTHON 0
73
#ifndef CYTHON_USE_TYPE_SLOTS
74
#define CYTHON_USE_TYPE_SLOTS 1
75
#endif
76
#undef CYTHON_USE_ASYNC_SLOTS
77
#define CYTHON_USE_ASYNC_SLOTS 0
78
#undef CYTHON_USE_PYLIST_INTERNALS
79
#define CYTHON_USE_PYLIST_INTERNALS 0
80
#ifndef CYTHON_USE_UNICODE_INTERNALS
81
#define CYTHON_USE_UNICODE_INTERNALS 1
82
#endif
83
#undef CYTHON_USE_UNICODE_WRITER
84
#define CYTHON_USE_UNICODE_WRITER 0
85
#undef CYTHON_USE_PYLONG_INTERNALS
86
#define CYTHON_USE_PYLONG_INTERNALS 0
87
#ifndef CYTHON_AVOID_BORROWED_REFS
88
#define CYTHON_AVOID_BORROWED_REFS 0
89
#endif
90
#ifndef CYTHON_ASSUME_SAFE_MACROS
91
#define CYTHON_ASSUME_SAFE_MACROS 1
92
#endif
93
#ifndef CYTHON_UNPACK_METHODS
94
#define CYTHON_UNPACK_METHODS 1
95
#endif
96
#undef CYTHON_FAST_THREAD_STATE
97
#define CYTHON_FAST_THREAD_STATE 0
98
#undef CYTHON_FAST_PYCALL
99
#define CYTHON_FAST_PYCALL 0
100
#else
101
#define CYTHON_COMPILING_IN_PYPY 0
102
#define CYTHON_COMPILING_IN_PYSTON 0
103
#define CYTHON_COMPILING_IN_CPYTHON 1
104
#ifndef CYTHON_USE_TYPE_SLOTS
105
#define CYTHON_USE_TYPE_SLOTS 1
106
#endif
107
#if PY_MAJOR_VERSION < 3
108
#undef CYTHON_USE_ASYNC_SLOTS
109
#define CYTHON_USE_ASYNC_SLOTS 0
110
#elif !defined(CYTHON_USE_ASYNC_SLOTS)
111
#define CYTHON_USE_ASYNC_SLOTS 1
112
#endif
113
#if PY_VERSION_HEX < 0x02070000
114
#undef CYTHON_USE_PYLONG_INTERNALS
115
#define CYTHON_USE_PYLONG_INTERNALS 0
116
#elif !defined(CYTHON_USE_PYLONG_INTERNALS)
117
#define CYTHON_USE_PYLONG_INTERNALS 1
118
#endif
119
#ifndef CYTHON_USE_PYLIST_INTERNALS
120
#define CYTHON_USE_PYLIST_INTERNALS 1
121
#endif
122
#ifndef CYTHON_USE_UNICODE_INTERNALS
123
#define CYTHON_USE_UNICODE_INTERNALS 1
124
#endif
125
#if PY_VERSION_HEX < 0x030300F0
126
#undef CYTHON_USE_UNICODE_WRITER
127
#define CYTHON_USE_UNICODE_WRITER 0
128
#elif !defined(CYTHON_USE_UNICODE_WRITER)
129
#define CYTHON_USE_UNICODE_WRITER 1
130
#endif
131
#ifndef CYTHON_AVOID_BORROWED_REFS
132
#define CYTHON_AVOID_BORROWED_REFS 0
133
#endif
134
#ifndef CYTHON_ASSUME_SAFE_MACROS
135
#define CYTHON_ASSUME_SAFE_MACROS 1
136
#endif
137
#ifndef CYTHON_UNPACK_METHODS
138
#define CYTHON_UNPACK_METHODS 1
139
#endif
140
#ifndef CYTHON_FAST_THREAD_STATE
141
#define CYTHON_FAST_THREAD_STATE 1
142
#endif
143
#ifndef CYTHON_FAST_PYCALL
144
#define CYTHON_FAST_PYCALL 1
145
#endif
146
#endif
147
#if !defined(CYTHON_FAST_PYCCALL)
148
#define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
149
#endif
150
#if CYTHON_USE_PYLONG_INTERNALS
151
#include "longintrepr.h"
152
#undef SHIFT
153
#undef BASE
154
#undef MASK
155
#endif
156
#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
157
#define Py_OptimizeFlag 0
158
#endif
159
#define __PYX_BUILD_PY_SSIZE_T "n"
160
#define CYTHON_FORMAT_SSIZE_T "z"
161
#if PY_MAJOR_VERSION < 3
162
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
163
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
164
PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
165
#define __Pyx_DefaultClassType PyClass_Type
166
#else
167
#define __Pyx_BUILTIN_MODULE_NAME "builtins"
168
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
169
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
170
#define __Pyx_DefaultClassType PyType_Type
171
#endif
172
#ifndef Py_TPFLAGS_CHECKTYPES
173
#define Py_TPFLAGS_CHECKTYPES 0
174
#endif
175
#ifndef Py_TPFLAGS_HAVE_INDEX
176
#define Py_TPFLAGS_HAVE_INDEX 0
177
#endif
178
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
179
#define Py_TPFLAGS_HAVE_NEWBUFFER 0
180
#endif
181
#ifndef Py_TPFLAGS_HAVE_FINALIZE
182
#define Py_TPFLAGS_HAVE_FINALIZE 0
183
#endif
184
#ifndef METH_FASTCALL
185
#define METH_FASTCALL 0x80
186
typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject **args,
187
Py_ssize_t nargs, PyObject *kwnames);
188
#else
189
#define __Pyx_PyCFunctionFast _PyCFunctionFast
190
#endif
191
#if CYTHON_FAST_PYCCALL
192
#define __Pyx_PyFastCFunction_Check(func)\
193
((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)))))
194
#else
195
#define __Pyx_PyFastCFunction_Check(func) 0
196
#endif
197
#if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
198
#define CYTHON_PEP393_ENABLED 1
199
#define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
200
0 : _PyUnicode_Ready((PyObject *)(op)))
201
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
202
#define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
203
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
204
#define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
205
#define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
206
#define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
207
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
208
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
209
#else
210
#define CYTHON_PEP393_ENABLED 0
211
#define PyUnicode_1BYTE_KIND 1
212
#define PyUnicode_2BYTE_KIND 2
213
#define PyUnicode_4BYTE_KIND 4
214
#define __Pyx_PyUnicode_READY(op) (0)
215
#define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
216
#define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
217
#define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
218
#define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
219
#define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
220
#define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
221
#define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
222
#define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
223
#endif
224
#if CYTHON_COMPILING_IN_PYPY
225
#define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
226
#define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
227
#else
228
#define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
229
#define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
230
PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
231
#endif
232
#if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
233
#define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
234
#endif
235
#if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
236
#define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
237
#endif
238
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
239
#define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
240
#endif
241
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
242
#define PyObject_Malloc(s) PyMem_Malloc(s)
243
#define PyObject_Free(p) PyMem_Free(p)
244
#define PyObject_Realloc(p) PyMem_Realloc(p)
245
#endif
246
#if CYTHON_COMPILING_IN_PYSTON
247
#define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
248
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
249
#else
250
#define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
251
#define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
252
#endif
253
#define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
254
#define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
255
#if PY_MAJOR_VERSION >= 3
256
#define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
257
#else
258
#define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
259
#endif
260
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
261
#define PyObject_ASCII(o) PyObject_Repr(o)
262
#endif
263
#if PY_MAJOR_VERSION >= 3
264
#define PyBaseString_Type PyUnicode_Type
265
#define PyStringObject PyUnicodeObject
266
#define PyString_Type PyUnicode_Type
267
#define PyString_Check PyUnicode_Check
268
#define PyString_CheckExact PyUnicode_CheckExact
269
#endif
270
#if PY_MAJOR_VERSION >= 3
271
#define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
272
#define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
273
#else
274
#define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
275
#define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
276
#endif
277
#ifndef PySet_CheckExact
278
#define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
279
#endif
280
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
281
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
282
#if PY_MAJOR_VERSION >= 3
283
#define PyIntObject PyLongObject
284
#define PyInt_Type PyLong_Type
285
#define PyInt_Check(op) PyLong_Check(op)
286
#define PyInt_CheckExact(op) PyLong_CheckExact(op)
287
#define PyInt_FromString PyLong_FromString
288
#define PyInt_FromUnicode PyLong_FromUnicode
289
#define PyInt_FromLong PyLong_FromLong
290
#define PyInt_FromSize_t PyLong_FromSize_t
291
#define PyInt_FromSsize_t PyLong_FromSsize_t
292
#define PyInt_AsLong PyLong_AsLong
293
#define PyInt_AS_LONG PyLong_AS_LONG
294
#define PyInt_AsSsize_t PyLong_AsSsize_t
295
#define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
296
#define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
297
#define PyNumber_Int PyNumber_Long
298
#endif
299
#if PY_MAJOR_VERSION >= 3
300
#define PyBoolObject PyLongObject
301
#endif
302
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
303
#ifndef PyUnicode_InternFromString
304
#define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
305
#endif
306
#endif
307
#if PY_VERSION_HEX < 0x030200A4
308
typedef long Py_hash_t;
309
#define __Pyx_PyInt_FromHash_t PyInt_FromLong
310
#define __Pyx_PyInt_AsHash_t PyInt_AsLong
311
#else
312
#define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
313
#define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
314
#endif
315
#if PY_MAJOR_VERSION >= 3
316
#define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : PyInstanceMethod_New(func))
317
#else
318
#define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
319
#endif
320
#if CYTHON_USE_ASYNC_SLOTS
321
#if PY_VERSION_HEX >= 0x030500B1
322
#define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
323
#define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
324
#else
325
typedef struct {
326
unaryfunc am_await;
327
unaryfunc am_aiter;
328
unaryfunc am_anext;
329
} __Pyx_PyAsyncMethodsStruct;
330
#define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
331
#endif
332
#else
333
#define __Pyx_PyType_AsAsync(obj) NULL
334
#endif
335
#ifndef CYTHON_RESTRICT
336
#if defined(__GNUC__)
337
#define CYTHON_RESTRICT __restrict__
338
#elif defined(_MSC_VER) && _MSC_VER >= 1400
339
#define CYTHON_RESTRICT __restrict
340
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
341
#define CYTHON_RESTRICT restrict
342
#else
343
#define CYTHON_RESTRICT
344
#endif
345
#endif
346
#ifndef CYTHON_UNUSED
347
# if defined(__GNUC__)
348
# if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
349
# define CYTHON_UNUSED __attribute__ ((__unused__))
350
# else
351
# define CYTHON_UNUSED
352
# endif
353
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
354
# define CYTHON_UNUSED __attribute__ ((__unused__))
355
# else
356
# define CYTHON_UNUSED
357
# endif
358
#endif
359
#ifndef CYTHON_MAYBE_UNUSED_VAR
360
# if defined(__cplusplus)
361
template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
362
# else
363
# define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
364
# endif
365
#endif
366
#ifndef CYTHON_NCP_UNUSED
367
# if CYTHON_COMPILING_IN_CPYTHON
368
# define CYTHON_NCP_UNUSED
369
# else
370
# define CYTHON_NCP_UNUSED CYTHON_UNUSED
371
# endif
372
#endif
373
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
374
375
#ifndef CYTHON_INLINE
376
#if defined(__clang__)
377
#define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
378
#elif defined(__GNUC__)
379
#define CYTHON_INLINE __inline__
380
#elif defined(_MSC_VER)
381
#define CYTHON_INLINE __inline
382
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
383
#define CYTHON_INLINE inline
384
#else
385
#define CYTHON_INLINE
386
#endif
387
#endif
388
389
#if defined(WIN32) || defined(MS_WINDOWS)
390
#define _USE_MATH_DEFINES
391
#endif
392
#include <math.h>
393
#ifdef NAN
394
#define __PYX_NAN() ((float) NAN)
395
#else
396
static CYTHON_INLINE float __PYX_NAN() {
397
float value;
398
memset(&value, 0xFF, sizeof(value));
399
return value;
400
}
401
#endif
402
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
403
#define __Pyx_truncl trunc
404
#else
405
#define __Pyx_truncl truncl
406
#endif
407
408
409
#define __PYX_ERR(f_index, lineno, Ln_error) \
410
{ \
411
__pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
412
}
413
414
#if PY_MAJOR_VERSION >= 3
415
#define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
416
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
417
#else
418
#define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
419
#define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
420
#endif
421
422
#ifndef __PYX_EXTERN_C
423
#ifdef __cplusplus
424
#define __PYX_EXTERN_C extern "C"
425
#else
426
#define __PYX_EXTERN_C extern
427
#endif
428
#endif
429
430
#define __PYX_HAVE__psage__modform__rational__padic_elliptic_lseries_fast
431
#define __PYX_HAVE_API__psage__modform__rational__padic_elliptic_lseries_fast
432
#include "struct_signals.h"
433
#include "pxi.h"
434
#include <string.h>
435
#include <stdlib.h>
436
#include <stdio.h>
437
#include "gmp.h"
438
#include "sage/libs/ntl/ntlwrap.h"
439
#include <stdint.h>
440
#include "pythread.h"
441
#include "sage/misc/cython_metaclass.h"
442
#ifdef _OPENMP
443
#include <omp.h>
444
#endif /* _OPENMP */
445
446
#ifdef PYREX_WITHOUT_ASSERTIONS
447
#define CYTHON_WITHOUT_ASSERTIONS
448
#endif
449
450
typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
451
const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
452
453
#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
454
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
455
#define __PYX_DEFAULT_STRING_ENCODING ""
456
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
457
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
458
#define __Pyx_uchar_cast(c) ((unsigned char)c)
459
#define __Pyx_long_cast(x) ((long)x)
460
#define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
461
(sizeof(type) < sizeof(Py_ssize_t)) ||\
462
(sizeof(type) > sizeof(Py_ssize_t) &&\
463
likely(v < (type)PY_SSIZE_T_MAX ||\
464
v == (type)PY_SSIZE_T_MAX) &&\
465
(!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
466
v == (type)PY_SSIZE_T_MIN))) ||\
467
(sizeof(type) == sizeof(Py_ssize_t) &&\
468
(is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
469
v == (type)PY_SSIZE_T_MAX))) )
470
#if defined (__cplusplus) && __cplusplus >= 201103L
471
#include <cstdlib>
472
#define __Pyx_sst_abs(value) std::abs(value)
473
#elif SIZEOF_INT >= SIZEOF_SIZE_T
474
#define __Pyx_sst_abs(value) abs(value)
475
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
476
#define __Pyx_sst_abs(value) labs(value)
477
#elif defined (_MSC_VER) && defined (_M_X64)
478
#define __Pyx_sst_abs(value) _abs64(value)
479
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
480
#define __Pyx_sst_abs(value) llabs(value)
481
#elif defined (__GNUC__)
482
#define __Pyx_sst_abs(value) __builtin_llabs(value)
483
#else
484
#define __Pyx_sst_abs(value) ((value<0) ? -value : value)
485
#endif
486
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject*);
487
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
488
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
489
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
490
#define __Pyx_PyBytes_FromString PyBytes_FromString
491
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
492
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
493
#if PY_MAJOR_VERSION < 3
494
#define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
495
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
496
#else
497
#define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
498
#define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
499
#endif
500
#define __Pyx_PyObject_AsSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
501
#define __Pyx_PyObject_AsUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
502
#define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
503
#define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
504
#define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
505
#define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
506
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
507
#if PY_MAJOR_VERSION < 3
508
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
509
{
510
const Py_UNICODE *u_end = u;
511
while (*u_end++) ;
512
return (size_t)(u_end - u - 1);
513
}
514
#else
515
#define __Pyx_Py_UNICODE_strlen Py_UNICODE_strlen
516
#endif
517
#define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
518
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
519
#define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
520
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
521
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
522
#define __Pyx_PyBool_FromLong(b) ((b) ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False))
523
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
524
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
525
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
526
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
527
#if CYTHON_ASSUME_SAFE_MACROS
528
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
529
#else
530
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
531
#endif
532
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
533
#if PY_MAJOR_VERSION >= 3
534
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
535
#else
536
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
537
#endif
538
#define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
539
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
540
static int __Pyx_sys_getdefaultencoding_not_ascii;
541
static int __Pyx_init_sys_getdefaultencoding_params(void) {
542
PyObject* sys;
543
PyObject* default_encoding = NULL;
544
PyObject* ascii_chars_u = NULL;
545
PyObject* ascii_chars_b = NULL;
546
const char* default_encoding_c;
547
sys = PyImport_ImportModule("sys");
548
if (!sys) goto bad;
549
default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
550
Py_DECREF(sys);
551
if (!default_encoding) goto bad;
552
default_encoding_c = PyBytes_AsString(default_encoding);
553
if (!default_encoding_c) goto bad;
554
if (strcmp(default_encoding_c, "ascii") == 0) {
555
__Pyx_sys_getdefaultencoding_not_ascii = 0;
556
} else {
557
char ascii_chars[128];
558
int c;
559
for (c = 0; c < 128; c++) {
560
ascii_chars[c] = c;
561
}
562
__Pyx_sys_getdefaultencoding_not_ascii = 1;
563
ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
564
if (!ascii_chars_u) goto bad;
565
ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
566
if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
567
PyErr_Format(
568
PyExc_ValueError,
569
"This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
570
default_encoding_c);
571
goto bad;
572
}
573
Py_DECREF(ascii_chars_u);
574
Py_DECREF(ascii_chars_b);
575
}
576
Py_DECREF(default_encoding);
577
return 0;
578
bad:
579
Py_XDECREF(default_encoding);
580
Py_XDECREF(ascii_chars_u);
581
Py_XDECREF(ascii_chars_b);
582
return -1;
583
}
584
#endif
585
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
586
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
587
#else
588
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
589
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
590
static char* __PYX_DEFAULT_STRING_ENCODING;
591
static int __Pyx_init_sys_getdefaultencoding_params(void) {
592
PyObject* sys;
593
PyObject* default_encoding = NULL;
594
char* default_encoding_c;
595
sys = PyImport_ImportModule("sys");
596
if (!sys) goto bad;
597
default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
598
Py_DECREF(sys);
599
if (!default_encoding) goto bad;
600
default_encoding_c = PyBytes_AsString(default_encoding);
601
if (!default_encoding_c) goto bad;
602
__PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
603
if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
604
strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
605
Py_DECREF(default_encoding);
606
return 0;
607
bad:
608
Py_XDECREF(default_encoding);
609
return -1;
610
}
611
#endif
612
#endif
613
614
615
/* Test for GCC > 2.95 */
616
#if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
617
#define likely(x) __builtin_expect(!!(x), 1)
618
#define unlikely(x) __builtin_expect(!!(x), 0)
619
#else /* !__GNUC__ or GCC < 2.95 */
620
#define likely(x) (x)
621
#define unlikely(x) (x)
622
#endif /* __GNUC__ */
623
624
static PyObject *__pyx_m;
625
static PyObject *__pyx_d;
626
static PyObject *__pyx_b;
627
static PyObject *__pyx_empty_tuple;
628
static PyObject *__pyx_empty_bytes;
629
static PyObject *__pyx_empty_unicode;
630
static int __pyx_lineno;
631
static int __pyx_clineno = 0;
632
static const char * __pyx_cfilenm= __FILE__;
633
static const char *__pyx_filename;
634
635
636
static const char *__pyx_f[] = {
637
"psage/modform/rational/padic_elliptic_lseries_fast.pyx",
638
"element.pxd",
639
"memory.pxd",
640
"sage_object.pxd",
641
"stdsage.pxd",
642
"psage/modform/rational/stringsource",
643
"type.pxd",
644
"bool.pxd",
645
"complex.pxd",
646
"category_object.pxd",
647
"coerce_dict.pxd",
648
"parent.pxd",
649
"inherit_comparison.pxd",
650
"map.pxd",
651
"morphism.pxd",
652
"integer.pxd",
653
"p1list.pxd",
654
"psage/modform/rational/modular_symbol_map.pxd",
655
"signals.pxi",
656
"stdsage.pxi",
657
"interrupt.pxi",
658
};
659
660
/*--- Type declarations ---*/
661
struct __pyx_obj_4sage_9structure_11sage_object_SageObject;
662
struct __pyx_obj_4sage_9structure_15category_object_CategoryObject;
663
struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict;
664
struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict;
665
struct __pyx_obj_4sage_9structure_6parent_Parent;
666
struct __pyx_obj_4sage_4misc_18inherit_comparison_InheritComparisonMetaclass;
667
struct __pyx_obj_4sage_9structure_7element_Element;
668
struct __pyx_obj_4sage_9structure_7element_ElementWithCachedMethod;
669
struct __pyx_obj_4sage_9structure_7element_ModuleElement;
670
struct __pyx_obj_4sage_9structure_7element_MonoidElement;
671
struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement;
672
struct __pyx_obj_4sage_9structure_7element_AdditiveGroupElement;
673
struct __pyx_obj_4sage_9structure_7element_RingElement;
674
struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement;
675
struct __pyx_obj_4sage_9structure_7element_IntegralDomainElement;
676
struct __pyx_obj_4sage_9structure_7element_DedekindDomainElement;
677
struct __pyx_obj_4sage_9structure_7element_PrincipalIdealDomainElement;
678
struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement;
679
struct __pyx_obj_4sage_9structure_7element_FieldElement;
680
struct __pyx_obj_4sage_9structure_7element_AlgebraElement;
681
struct __pyx_obj_4sage_9structure_7element_CommutativeAlgebraElement;
682
struct __pyx_obj_4sage_9structure_7element_InfinityElement;
683
struct __pyx_obj_4sage_9structure_7element_Vector;
684
struct __pyx_obj_4sage_9structure_7element_Matrix;
685
struct __pyx_obj_4sage_9structure_7element_CoercionModel;
686
struct __pyx_obj_4sage_10categories_3map_Map;
687
struct __pyx_obj_4sage_10categories_3map_Section;
688
struct __pyx_obj_4sage_10categories_3map_FormalCompositeMap;
689
struct __pyx_obj_4sage_10categories_8morphism_Morphism;
690
struct __pyx_obj_4sage_10categories_8morphism_SetMorphism;
691
struct __pyx_obj_4sage_5rings_7integer_Integer;
692
struct __pyx_obj_4sage_5rings_7integer_int_to_Z;
693
struct __pyx_obj_4sage_7modular_6modsym_6p1list_export;
694
struct __pyx_obj_4sage_7modular_6modsym_6p1list_P1List;
695
struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap;
696
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries;
697
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel;
698
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py;
699
struct __pyx_opt_args_4sage_9structure_6parent_6Parent_init_coerce;
700
struct __pyx_opt_args_4sage_9structure_6parent_6Parent_get_action;
701
struct __pyx_opt_args_4sage_9structure_6parent_6Parent_discover_action;
702
703
/* "parent.pxd":102
704
*
705
* # Flags for Parent.flags
706
* cdef enum: # <<<<<<<<<<<<<<
707
* # If this flag is set, call __richcmp__ on elements without
708
* # coercion. This allows a completely custom comparison function.
709
*/
710
enum {
711
__pyx_e_4sage_9structure_6parent_Parent_richcmp_element_without_coercion = 1
712
};
713
714
/* "parent.pxd":38
715
*
716
* # Called from the __init__ method to set up coercion.
717
* cdef int init_coerce(self, bint warn=*) except -1 # <<<<<<<<<<<<<<
718
*
719
* # returns whether or not there is a Morphism from S to self
720
*/
721
struct __pyx_opt_args_4sage_9structure_6parent_6Parent_init_coerce {
722
int __pyx_n;
723
int warn;
724
};
725
726
/* "parent.pxd":55
727
* # returns the Action by/on self on/by S
728
* # corresponding to op and self_on_left
729
* cpdef get_action(self, S, op=*, bint self_on_left=*, self_el=*, S_el=*) # <<<<<<<<<<<<<<
730
* cpdef _get_action_(self, S, op, bint self_on_left)
731
*
732
*/
733
struct __pyx_opt_args_4sage_9structure_6parent_6Parent_get_action {
734
int __pyx_n;
735
PyObject *op;
736
int self_on_left;
737
PyObject *self_el;
738
PyObject *S_el;
739
};
740
741
/* "parent.pxd":68
742
* cdef discover_coerce_map_from(self, S)
743
* cdef discover_convert_map_from(self, S)
744
* cdef discover_action(self, S, op, bint self_on_left, self_el=*, S_el=*) # <<<<<<<<<<<<<<
745
*
746
* # List consisting of Morphisms (from anything to self)
747
*/
748
struct __pyx_opt_args_4sage_9structure_6parent_6Parent_discover_action {
749
int __pyx_n;
750
PyObject *self_el;
751
PyObject *S_el;
752
};
753
struct __pyx_opt_args_4sage_10categories_3map_3Map__call_with_args;
754
755
/* "map.pxd":15
756
* # these methods require x is an element of domain, and returns an element with parent codomain
757
* cpdef Element _call_(self, x)
758
* cpdef Element _call_with_args(self, x, args=*, kwds=*) # <<<<<<<<<<<<<<
759
*
760
* cdef public domain # will be either a weakref or a constant map
761
*/
762
struct __pyx_opt_args_4sage_10categories_3map_3Map__call_with_args {
763
int __pyx_n;
764
PyObject *args;
765
PyObject *kwds;
766
};
767
768
/* "modular_symbol_map.pxd":22
769
* #################################################################################
770
*
771
* cdef enum: # <<<<<<<<<<<<<<
772
* MAX_CONTFRAC = 100
773
* MAX_DEG = 10000
774
*/
775
enum {
776
__pyx_e_5psage_7modform_8rational_18modular_symbol_map_MAX_CONTFRAC = 0x64,
777
__pyx_e_5psage_7modform_8rational_18modular_symbol_map_MAX_DEG = 0x2710
778
};
779
780
/* "sage_object.pxd":9
781
*
782
*
783
* cdef class SageObject: # <<<<<<<<<<<<<<
784
* pass
785
*
786
*/
787
struct __pyx_obj_4sage_9structure_11sage_object_SageObject {
788
PyObject_HEAD
789
};
790
791
792
/* "sage/structure/category_object.pxd":15
793
* cpdef check_default_category(default_category, category)
794
*
795
* cdef class CategoryObject(SageObject): # <<<<<<<<<<<<<<
796
* cdef public dict __cached_methods
797
* cdef _category
798
*/
799
struct __pyx_obj_4sage_9structure_15category_object_CategoryObject {
800
struct __pyx_obj_4sage_9structure_11sage_object_SageObject __pyx_base;
801
struct __pyx_vtabstruct_4sage_9structure_15category_object_CategoryObject *__pyx_vtab;
802
PyObject *__cached_methods;
803
PyObject *_category;
804
PyObject *_base;
805
PyObject *_names;
806
PyObject *_factory_data;
807
PyObject *__weakref__;
808
long _hash_value;
809
};
810
811
812
/* "sage/structure/coerce_dict.pxd":7
813
*
814
* @cython.final
815
* cdef class MonoDict: # <<<<<<<<<<<<<<
816
* cdef __weakref__
817
* cdef size_t mask
818
*/
819
struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict {
820
PyObject_HEAD
821
struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_MonoDict *__pyx_vtab;
822
PyObject *__weakref__;
823
size_t mask;
824
size_t used;
825
size_t fill;
826
struct __pyx_t_4sage_9structure_11coerce_dict_mono_cell *table;
827
int weak_values;
828
PyObject *eraser;
829
};
830
831
832
/* "sage/structure/coerce_dict.pxd":23
833
*
834
* @cython.final
835
* cdef class TripleDict: # <<<<<<<<<<<<<<
836
* cdef __weakref__
837
* cdef size_t mask
838
*/
839
struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict {
840
PyObject_HEAD
841
struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_TripleDict *__pyx_vtab;
842
PyObject *__weakref__;
843
size_t mask;
844
size_t used;
845
size_t fill;
846
struct __pyx_t_4sage_9structure_11coerce_dict_triple_cell *table;
847
int weak_values;
848
PyObject *eraser;
849
};
850
851
852
/* "parent.pxd":12
853
* from sage.structure.coerce_dict cimport MonoDict, TripleDict
854
*
855
* cdef class Parent(category_object.CategoryObject): # <<<<<<<<<<<<<<
856
* cdef public _element_constructor
857
* cdef public _convert_method_name
858
*/
859
struct __pyx_obj_4sage_9structure_6parent_Parent {
860
struct __pyx_obj_4sage_9structure_15category_object_CategoryObject __pyx_base;
861
PyObject *_element_constructor;
862
PyObject *_convert_method_name;
863
int _element_init_pass_parent;
864
PyObject *_initial_coerce_list;
865
PyObject *_initial_action_list;
866
PyObject *_initial_convert_list;
867
int _coercions_used;
868
int flags;
869
PyObject *_cache_an_element;
870
PyObject *_coerce_from_list;
871
PyObject *_registered_domains;
872
struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict *_coerce_from_hash;
873
PyObject *_action_list;
874
struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict *_action_hash;
875
PyObject *_convert_from_list;
876
struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict *_convert_from_hash;
877
PyObject *_embedding;
878
};
879
880
881
/* "sage/misc/inherit_comparison.pxd":3
882
* cimport sage.misc.cython_metaclass
883
*
884
* cdef class InheritComparisonMetaclass(type): # <<<<<<<<<<<<<<
885
* pass
886
*/
887
struct __pyx_obj_4sage_4misc_18inherit_comparison_InheritComparisonMetaclass {
888
PyHeapTypeObject __pyx_base;
889
};
890
891
892
/* "sage/structure/element.pxd":169
893
*
894
*
895
* cdef class Element(SageObject): # <<<<<<<<<<<<<<
896
* cdef Parent _parent
897
* cpdef _richcmp_(left, right, int op)
898
*/
899
struct __pyx_obj_4sage_9structure_7element_Element {
900
struct __pyx_obj_4sage_9structure_11sage_object_SageObject __pyx_base;
901
struct __pyx_vtabstruct_4sage_9structure_7element_Element *__pyx_vtab;
902
struct __pyx_obj_4sage_9structure_6parent_Parent *_parent;
903
};
904
905
906
/* "sage/structure/element.pxd":192
907
*
908
*
909
* cdef class ElementWithCachedMethod(Element): # <<<<<<<<<<<<<<
910
* cdef public dict __cached_methods
911
*
912
*/
913
struct __pyx_obj_4sage_9structure_7element_ElementWithCachedMethod {
914
struct __pyx_obj_4sage_9structure_7element_Element __pyx_base;
915
PyObject *__cached_methods;
916
};
917
918
919
/* "sage/structure/element.pxd":195
920
* cdef public dict __cached_methods
921
*
922
* cdef class ModuleElement(Element) # forward declaration # <<<<<<<<<<<<<<
923
*
924
* cdef class RingElement(ModuleElement) # forward declaration
925
*/
926
struct __pyx_obj_4sage_9structure_7element_ModuleElement {
927
struct __pyx_obj_4sage_9structure_7element_Element __pyx_base;
928
};
929
930
931
/* "sage/structure/element.pxd":208
932
* cpdef _rmul_(self, RingElement left)
933
*
934
* cdef class MonoidElement(Element): # <<<<<<<<<<<<<<
935
* pass
936
*
937
*/
938
struct __pyx_obj_4sage_9structure_7element_MonoidElement {
939
struct __pyx_obj_4sage_9structure_7element_Element __pyx_base;
940
};
941
942
943
/* "sage/structure/element.pxd":211
944
* pass
945
*
946
* cdef class MultiplicativeGroupElement(MonoidElement): # <<<<<<<<<<<<<<
947
* cpdef _div_(self, right)
948
*
949
*/
950
struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement {
951
struct __pyx_obj_4sage_9structure_7element_MonoidElement __pyx_base;
952
};
953
954
955
/* "sage/structure/element.pxd":214
956
* cpdef _div_(self, right)
957
*
958
* cdef class AdditiveGroupElement(ModuleElement): # <<<<<<<<<<<<<<
959
* pass
960
*
961
*/
962
struct __pyx_obj_4sage_9structure_7element_AdditiveGroupElement {
963
struct __pyx_obj_4sage_9structure_7element_ModuleElement __pyx_base;
964
};
965
966
967
/* "sage/structure/element.pxd":197
968
* cdef class ModuleElement(Element) # forward declaration
969
*
970
* cdef class RingElement(ModuleElement) # forward declaration # <<<<<<<<<<<<<<
971
*
972
* cdef class ModuleElement(Element):
973
*/
974
struct __pyx_obj_4sage_9structure_7element_RingElement {
975
struct __pyx_obj_4sage_9structure_7element_ModuleElement __pyx_base;
976
};
977
978
979
/* "sage/structure/element.pxd":220
980
* cpdef _div_(self, right)
981
*
982
* cdef class CommutativeRingElement(RingElement): # <<<<<<<<<<<<<<
983
* pass
984
*
985
*/
986
struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement {
987
struct __pyx_obj_4sage_9structure_7element_RingElement __pyx_base;
988
};
989
990
991
/* "sage/structure/element.pxd":223
992
* pass
993
*
994
* cdef class IntegralDomainElement(CommutativeRingElement): # <<<<<<<<<<<<<<
995
* pass
996
*
997
*/
998
struct __pyx_obj_4sage_9structure_7element_IntegralDomainElement {
999
struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement __pyx_base;
1000
};
1001
1002
1003
/* "sage/structure/element.pxd":226
1004
* pass
1005
*
1006
* cdef class DedekindDomainElement(IntegralDomainElement): # <<<<<<<<<<<<<<
1007
* pass
1008
*
1009
*/
1010
struct __pyx_obj_4sage_9structure_7element_DedekindDomainElement {
1011
struct __pyx_obj_4sage_9structure_7element_IntegralDomainElement __pyx_base;
1012
};
1013
1014
1015
/* "sage/structure/element.pxd":229
1016
* pass
1017
*
1018
* cdef class PrincipalIdealDomainElement(DedekindDomainElement): # <<<<<<<<<<<<<<
1019
* pass
1020
*
1021
*/
1022
struct __pyx_obj_4sage_9structure_7element_PrincipalIdealDomainElement {
1023
struct __pyx_obj_4sage_9structure_7element_DedekindDomainElement __pyx_base;
1024
};
1025
1026
1027
/* "sage/structure/element.pxd":232
1028
* pass
1029
*
1030
* cdef class EuclideanDomainElement(PrincipalIdealDomainElement): # <<<<<<<<<<<<<<
1031
* cpdef _floordiv_(self, right)
1032
* cpdef _mod_(self, right)
1033
*/
1034
struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement {
1035
struct __pyx_obj_4sage_9structure_7element_PrincipalIdealDomainElement __pyx_base;
1036
};
1037
1038
1039
/* "sage/structure/element.pxd":236
1040
* cpdef _mod_(self, right)
1041
*
1042
* cdef class FieldElement(CommutativeRingElement): # <<<<<<<<<<<<<<
1043
* cpdef _floordiv_(self, right)
1044
*
1045
*/
1046
struct __pyx_obj_4sage_9structure_7element_FieldElement {
1047
struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement __pyx_base;
1048
};
1049
1050
1051
/* "sage/structure/element.pxd":239
1052
* cpdef _floordiv_(self, right)
1053
*
1054
* cdef class AlgebraElement(RingElement): # <<<<<<<<<<<<<<
1055
* pass
1056
*
1057
*/
1058
struct __pyx_obj_4sage_9structure_7element_AlgebraElement {
1059
struct __pyx_obj_4sage_9structure_7element_RingElement __pyx_base;
1060
};
1061
1062
1063
/* "sage/structure/element.pxd":242
1064
* pass
1065
*
1066
* cdef class CommutativeAlgebraElement(CommutativeRingElement): # <<<<<<<<<<<<<<
1067
* pass
1068
*
1069
*/
1070
struct __pyx_obj_4sage_9structure_7element_CommutativeAlgebraElement {
1071
struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement __pyx_base;
1072
};
1073
1074
1075
/* "sage/structure/element.pxd":245
1076
* pass
1077
*
1078
* cdef class InfinityElement(RingElement): # <<<<<<<<<<<<<<
1079
* pass
1080
*
1081
*/
1082
struct __pyx_obj_4sage_9structure_7element_InfinityElement {
1083
struct __pyx_obj_4sage_9structure_7element_RingElement __pyx_base;
1084
};
1085
1086
1087
/* "sage/structure/element.pxd":249
1088
*
1089
*
1090
* cdef class Vector(ModuleElement): # <<<<<<<<<<<<<<
1091
* cdef Py_ssize_t _degree
1092
*
1093
*/
1094
struct __pyx_obj_4sage_9structure_7element_Vector {
1095
struct __pyx_obj_4sage_9structure_7element_ModuleElement __pyx_base;
1096
Py_ssize_t _degree;
1097
};
1098
1099
1100
/* "sage/structure/element.pxd":264
1101
*
1102
*
1103
* cdef class Matrix(ModuleElement): # <<<<<<<<<<<<<<
1104
* # All matrix classes must be written in Cython
1105
* cdef Py_ssize_t _nrows
1106
*/
1107
struct __pyx_obj_4sage_9structure_7element_Matrix {
1108
struct __pyx_obj_4sage_9structure_7element_ModuleElement __pyx_base;
1109
Py_ssize_t _nrows;
1110
Py_ssize_t _ncols;
1111
};
1112
1113
1114
/* "sage/structure/element.pxd":277
1115
*
1116
*
1117
* cdef class CoercionModel: # <<<<<<<<<<<<<<
1118
* cpdef canonical_coercion(self, x, y)
1119
* cpdef bin_op(self, x, y, op)
1120
*/
1121
struct __pyx_obj_4sage_9structure_7element_CoercionModel {
1122
PyObject_HEAD
1123
struct __pyx_vtabstruct_4sage_9structure_7element_CoercionModel *__pyx_vtab;
1124
};
1125
1126
1127
/* "map.pxd":4
1128
* from sage.structure.element cimport Element
1129
*
1130
* cdef class Map(Element): # <<<<<<<<<<<<<<
1131
* cdef object __weakref__
1132
*
1133
*/
1134
struct __pyx_obj_4sage_10categories_3map_Map {
1135
struct __pyx_obj_4sage_9structure_7element_Element __pyx_base;
1136
PyObject *__weakref__;
1137
int _coerce_cost;
1138
PyObject *domain;
1139
PyObject *codomain;
1140
struct __pyx_obj_4sage_9structure_6parent_Parent *_codomain;
1141
PyObject *_category_for;
1142
PyObject *_repr_type_str;
1143
};
1144
1145
1146
/* "map.pxd":25
1147
*
1148
*
1149
* cdef class Section(Map): # <<<<<<<<<<<<<<
1150
* cdef Map _inverse
1151
*
1152
*/
1153
struct __pyx_obj_4sage_10categories_3map_Section {
1154
struct __pyx_obj_4sage_10categories_3map_Map __pyx_base;
1155
struct __pyx_obj_4sage_10categories_3map_Map *_inverse;
1156
};
1157
1158
1159
/* "map.pxd":28
1160
* cdef Map _inverse
1161
*
1162
* cdef class FormalCompositeMap(Map): # <<<<<<<<<<<<<<
1163
* cdef __list
1164
*/
1165
struct __pyx_obj_4sage_10categories_3map_FormalCompositeMap {
1166
struct __pyx_obj_4sage_10categories_3map_Map __pyx_base;
1167
PyObject *__pyx___list;
1168
};
1169
1170
1171
/* "sage/categories/morphism.pxd":5
1172
* from .map cimport Map
1173
*
1174
* cdef class Morphism(Map): # <<<<<<<<<<<<<<
1175
* pass
1176
*
1177
*/
1178
struct __pyx_obj_4sage_10categories_8morphism_Morphism {
1179
struct __pyx_obj_4sage_10categories_3map_Map __pyx_base;
1180
};
1181
1182
1183
/* "sage/categories/morphism.pxd":8
1184
* pass
1185
*
1186
* cdef class SetMorphism(Morphism): # <<<<<<<<<<<<<<
1187
* cdef object _function
1188
* cpdef bint _eq_c_impl(left, Element right)
1189
*/
1190
struct __pyx_obj_4sage_10categories_8morphism_SetMorphism {
1191
struct __pyx_obj_4sage_10categories_8morphism_Morphism __pyx_base;
1192
PyObject *_function;
1193
};
1194
1195
1196
/* "sage/rings/integer.pxd":7
1197
* from sage.categories.morphism cimport Morphism
1198
*
1199
* cdef class Integer(EuclideanDomainElement): # <<<<<<<<<<<<<<
1200
* cdef mpz_t value
1201
*
1202
*/
1203
struct __pyx_obj_4sage_5rings_7integer_Integer {
1204
struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement __pyx_base;
1205
mpz_t value;
1206
};
1207
1208
1209
/* "sage/rings/integer.pxd":37
1210
* cdef Integer smallInteger(long value)
1211
*
1212
* cdef class int_to_Z(Morphism): # <<<<<<<<<<<<<<
1213
* pass
1214
*/
1215
struct __pyx_obj_4sage_5rings_7integer_int_to_Z {
1216
struct __pyx_obj_4sage_10categories_8morphism_Morphism __pyx_base;
1217
};
1218
1219
1220
/* "sage/modular/modsym/p1list.pxd":3
1221
*
1222
*
1223
* cdef class export: # <<<<<<<<<<<<<<
1224
* cdef int c_p1_normalize_int(self, int N, int u, int v,
1225
* int* uu, int* vv, int* ss,
1226
*/
1227
struct __pyx_obj_4sage_7modular_6modsym_6p1list_export {
1228
PyObject_HEAD
1229
struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_export *__pyx_vtab;
1230
};
1231
1232
1233
/* "sage/modular/modsym/p1list.pxd":13
1234
*
1235
*
1236
* cdef class P1List: # <<<<<<<<<<<<<<
1237
* cdef int __N
1238
* cdef object __list, __end_hash
1239
*/
1240
struct __pyx_obj_4sage_7modular_6modsym_6p1list_P1List {
1241
PyObject_HEAD
1242
struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_P1List *__pyx_vtab;
1243
int __pyx___N;
1244
PyObject *__pyx___list;
1245
PyObject *__pyx___end_hash;
1246
int *g;
1247
int *s;
1248
int *t;
1249
int (*__pyx___normalize)(int, int, int, int *, int *, int *, int);
1250
};
1251
1252
1253
/* "modular_symbol_map.pxd":28
1254
* from sage.modular.modsym.p1list cimport P1List
1255
*
1256
* cdef class ModularSymbolMap: # <<<<<<<<<<<<<<
1257
* cdef long d, N
1258
* cdef public long denom
1259
*/
1260
struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap {
1261
PyObject_HEAD
1262
struct __pyx_vtabstruct_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *__pyx_vtab;
1263
long d;
1264
long N;
1265
long denom;
1266
long *X;
1267
PyObject *C;
1268
struct __pyx_obj_4sage_7modular_6modsym_6p1list_P1List *P1;
1269
};
1270
1271
1272
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":49
1273
* return mpz_fdiv_ui(cc.value, n)
1274
*
1275
* cdef class pAdicLseries: # <<<<<<<<<<<<<<
1276
* cdef bint parallel
1277
* cdef public object E
1278
*/
1279
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries {
1280
PyObject_HEAD
1281
struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_vtab;
1282
int parallel;
1283
PyObject *E;
1284
long p;
1285
long prec;
1286
long normalization;
1287
long normalization_mulmod;
1288
long _alpha;
1289
long alpha_inv[64];
1290
long alpha_inv_mulmod[64];
1291
long p_pow[64];
1292
long *teich;
1293
long *teich_mulmod;
1294
struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *modsym;
1295
};
1296
1297
1298
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":467
1299
* return sha, L, reg
1300
*
1301
* def series_parallel(L, n, prec, ser_prec=5, verb=False, force_mulmod=False, ncpus=None): # <<<<<<<<<<<<<<
1302
* # Use @parallel to do this computation by dividing it up into
1303
* # p separate tasks, doing those in separate processes,
1304
*/
1305
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel {
1306
PyObject_HEAD
1307
PyObject *__pyx_v_L;
1308
PyObject *__pyx_v_force_mulmod;
1309
PyObject *__pyx_v_n;
1310
PyObject *__pyx_v_prec;
1311
PyObject *__pyx_v_ser_prec;
1312
PyObject *__pyx_v_verb;
1313
};
1314
1315
1316
/* "cfunc.to_py":64
1317
*
1318
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
1319
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ): # <<<<<<<<<<<<<<
1320
* def wrap(object arg0, object arg1, int arg2):
1321
* """wrap(arg0, arg1, arg2: 'int')"""
1322
*/
1323
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py {
1324
PyObject_HEAD
1325
PyObject *(*__pyx_v_f)(PyObject *, PyObject *, int);
1326
};
1327
1328
1329
1330
/* "sage/structure/category_object.pxd":15
1331
* cpdef check_default_category(default_category, category)
1332
*
1333
* cdef class CategoryObject(SageObject): # <<<<<<<<<<<<<<
1334
* cdef public dict __cached_methods
1335
* cdef _category
1336
*/
1337
1338
struct __pyx_vtabstruct_4sage_9structure_15category_object_CategoryObject {
1339
PyObject *(*getattr_from_category)(struct __pyx_obj_4sage_9structure_15category_object_CategoryObject *, PyObject *);
1340
};
1341
static struct __pyx_vtabstruct_4sage_9structure_15category_object_CategoryObject *__pyx_vtabptr_4sage_9structure_15category_object_CategoryObject;
1342
1343
1344
/* "sage/structure/coerce_dict.pxd":7
1345
*
1346
* @cython.final
1347
* cdef class MonoDict: # <<<<<<<<<<<<<<
1348
* cdef __weakref__
1349
* cdef size_t mask
1350
*/
1351
1352
struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_MonoDict {
1353
struct __pyx_t_4sage_9structure_11coerce_dict_mono_cell *(*lookup)(struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict *, PyObject *);
1354
PyObject *(*get)(struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict *, PyObject *);
1355
PyObject *(*set)(struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict *, PyObject *, PyObject *);
1356
int (*resize)(struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict *);
1357
};
1358
static struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_MonoDict *__pyx_vtabptr_4sage_9structure_11coerce_dict_MonoDict;
1359
1360
1361
/* "sage/structure/coerce_dict.pxd":23
1362
*
1363
* @cython.final
1364
* cdef class TripleDict: # <<<<<<<<<<<<<<
1365
* cdef __weakref__
1366
* cdef size_t mask
1367
*/
1368
1369
struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_TripleDict {
1370
struct __pyx_t_4sage_9structure_11coerce_dict_triple_cell *(*lookup)(struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict *, PyObject *, PyObject *, PyObject *);
1371
PyObject *(*get)(struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict *, PyObject *, PyObject *, PyObject *);
1372
PyObject *(*set)(struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict *, PyObject *, PyObject *, PyObject *, PyObject *);
1373
int (*resize)(struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict *);
1374
};
1375
static struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_TripleDict *__pyx_vtabptr_4sage_9structure_11coerce_dict_TripleDict;
1376
1377
1378
/* "parent.pxd":12
1379
* from sage.structure.coerce_dict cimport MonoDict, TripleDict
1380
*
1381
* cdef class Parent(category_object.CategoryObject): # <<<<<<<<<<<<<<
1382
* cdef public _element_constructor
1383
* cdef public _convert_method_name
1384
*/
1385
1386
struct __pyx_vtabstruct_4sage_9structure_6parent_Parent {
1387
struct __pyx_vtabstruct_4sage_9structure_15category_object_CategoryObject __pyx_base;
1388
int (*get_flag)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int);
1389
int (*is_coercion_cached)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1390
int (*is_conversion_cached)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1391
PyObject *(*register_coercion)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1392
PyObject *(*register_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1393
PyObject *(*register_conversion)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1394
PyObject *(*register_embedding)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1395
int (*_richcmp)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int, int __pyx_skip_dispatch);
1396
int (*_cmp_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1397
int (*is_exact)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch);
1398
int (*init_coerce)(struct __pyx_obj_4sage_9structure_6parent_Parent *, struct __pyx_opt_args_4sage_9structure_6parent_6Parent_init_coerce *__pyx_optional_args);
1399
int (*has_coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1400
PyObject *(*coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1401
PyObject *(*_internal_coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1402
PyObject *(*_coerce_map_from_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1403
PyObject *(*convert_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1404
PyObject *(*_internal_convert_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1405
PyObject *(*_convert_map_from_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1406
PyObject *(*get_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4sage_9structure_6parent_6Parent_get_action *__pyx_optional_args);
1407
PyObject *(*_get_action_)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
1408
PyObject *(*coerce)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1409
PyObject *(*an_element)(struct __pyx_obj_4sage_9structure_6parent_Parent *, int __pyx_skip_dispatch);
1410
PyObject *(*_generic_convert_map)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, int __pyx_skip_dispatch);
1411
PyObject *(*discover_coerce_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *);
1412
PyObject *(*discover_convert_map_from)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *);
1413
PyObject *(*discover_action)(struct __pyx_obj_4sage_9structure_6parent_Parent *, PyObject *, PyObject *, int, struct __pyx_opt_args_4sage_9structure_6parent_6Parent_discover_action *__pyx_optional_args);
1414
};
1415
static struct __pyx_vtabstruct_4sage_9structure_6parent_Parent *__pyx_vtabptr_4sage_9structure_6parent_Parent;
1416
static CYTHON_INLINE int __pyx_f_4sage_9structure_6parent_6Parent_get_flag(struct __pyx_obj_4sage_9structure_6parent_Parent *, int);
1417
1418
1419
/* "sage/structure/element.pxd":169
1420
*
1421
*
1422
* cdef class Element(SageObject): # <<<<<<<<<<<<<<
1423
* cdef Parent _parent
1424
* cpdef _richcmp_(left, right, int op)
1425
*/
1426
1427
struct __pyx_vtabstruct_4sage_9structure_7element_Element {
1428
PyObject *(*_richcmp_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int, int __pyx_skip_dispatch);
1429
int (*_cmp_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int __pyx_skip_dispatch);
1430
PyObject *(*base_extend)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int __pyx_skip_dispatch);
1431
PyObject *(*getattr_from_category)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
1432
PyObject *(*_act_on_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int, int __pyx_skip_dispatch);
1433
PyObject *(*_acted_upon_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *, int, int __pyx_skip_dispatch);
1434
PyObject *(*_add_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
1435
PyObject *(*_sub_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
1436
PyObject *(*_neg_)(struct __pyx_obj_4sage_9structure_7element_Element *);
1437
PyObject *(*_add_long)(struct __pyx_obj_4sage_9structure_7element_Element *, long);
1438
PyObject *(*_mul_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
1439
PyObject *(*_mul_long)(struct __pyx_obj_4sage_9structure_7element_Element *, long);
1440
PyObject *(*_div_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
1441
PyObject *(*_floordiv_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
1442
PyObject *(*_mod_)(struct __pyx_obj_4sage_9structure_7element_Element *, PyObject *);
1443
};
1444
static struct __pyx_vtabstruct_4sage_9structure_7element_Element *__pyx_vtabptr_4sage_9structure_7element_Element;
1445
1446
1447
/* "sage/structure/element.pxd":192
1448
*
1449
*
1450
* cdef class ElementWithCachedMethod(Element): # <<<<<<<<<<<<<<
1451
* cdef public dict __cached_methods
1452
*
1453
*/
1454
1455
struct __pyx_vtabstruct_4sage_9structure_7element_ElementWithCachedMethod {
1456
struct __pyx_vtabstruct_4sage_9structure_7element_Element __pyx_base;
1457
};
1458
static struct __pyx_vtabstruct_4sage_9structure_7element_ElementWithCachedMethod *__pyx_vtabptr_4sage_9structure_7element_ElementWithCachedMethod;
1459
1460
1461
/* "sage/structure/element.pxd":195
1462
* cdef public dict __cached_methods
1463
*
1464
* cdef class ModuleElement(Element) # forward declaration # <<<<<<<<<<<<<<
1465
*
1466
* cdef class RingElement(ModuleElement) # forward declaration
1467
*/
1468
1469
struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement {
1470
struct __pyx_vtabstruct_4sage_9structure_7element_Element __pyx_base;
1471
PyObject *(*_sub_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, PyObject *, int __pyx_skip_dispatch);
1472
PyObject *(*_neg_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, int __pyx_skip_dispatch);
1473
PyObject *(*_lmul_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
1474
PyObject *(*_rmul_)(struct __pyx_obj_4sage_9structure_7element_ModuleElement *, struct __pyx_obj_4sage_9structure_7element_RingElement *, int __pyx_skip_dispatch);
1475
};
1476
static struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement *__pyx_vtabptr_4sage_9structure_7element_ModuleElement;
1477
1478
1479
/* "sage/structure/element.pxd":197
1480
* cdef class ModuleElement(Element) # forward declaration
1481
*
1482
* cdef class RingElement(ModuleElement) # forward declaration # <<<<<<<<<<<<<<
1483
*
1484
* cdef class ModuleElement(Element):
1485
*/
1486
1487
struct __pyx_vtabstruct_4sage_9structure_7element_RingElement {
1488
struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement __pyx_base;
1489
PyObject *(*_div_)(struct __pyx_obj_4sage_9structure_7element_RingElement *, PyObject *, int __pyx_skip_dispatch);
1490
};
1491
static struct __pyx_vtabstruct_4sage_9structure_7element_RingElement *__pyx_vtabptr_4sage_9structure_7element_RingElement;
1492
1493
1494
/* "sage/structure/element.pxd":208
1495
* cpdef _rmul_(self, RingElement left)
1496
*
1497
* cdef class MonoidElement(Element): # <<<<<<<<<<<<<<
1498
* pass
1499
*
1500
*/
1501
1502
struct __pyx_vtabstruct_4sage_9structure_7element_MonoidElement {
1503
struct __pyx_vtabstruct_4sage_9structure_7element_Element __pyx_base;
1504
};
1505
static struct __pyx_vtabstruct_4sage_9structure_7element_MonoidElement *__pyx_vtabptr_4sage_9structure_7element_MonoidElement;
1506
1507
1508
/* "sage/structure/element.pxd":211
1509
* pass
1510
*
1511
* cdef class MultiplicativeGroupElement(MonoidElement): # <<<<<<<<<<<<<<
1512
* cpdef _div_(self, right)
1513
*
1514
*/
1515
1516
struct __pyx_vtabstruct_4sage_9structure_7element_MultiplicativeGroupElement {
1517
struct __pyx_vtabstruct_4sage_9structure_7element_MonoidElement __pyx_base;
1518
PyObject *(*_div_)(struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement *, PyObject *, int __pyx_skip_dispatch);
1519
};
1520
static struct __pyx_vtabstruct_4sage_9structure_7element_MultiplicativeGroupElement *__pyx_vtabptr_4sage_9structure_7element_MultiplicativeGroupElement;
1521
1522
1523
/* "sage/structure/element.pxd":214
1524
* cpdef _div_(self, right)
1525
*
1526
* cdef class AdditiveGroupElement(ModuleElement): # <<<<<<<<<<<<<<
1527
* pass
1528
*
1529
*/
1530
1531
struct __pyx_vtabstruct_4sage_9structure_7element_AdditiveGroupElement {
1532
struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement __pyx_base;
1533
};
1534
static struct __pyx_vtabstruct_4sage_9structure_7element_AdditiveGroupElement *__pyx_vtabptr_4sage_9structure_7element_AdditiveGroupElement;
1535
1536
1537
/* "sage/structure/element.pxd":220
1538
* cpdef _div_(self, right)
1539
*
1540
* cdef class CommutativeRingElement(RingElement): # <<<<<<<<<<<<<<
1541
* pass
1542
*
1543
*/
1544
1545
struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement {
1546
struct __pyx_vtabstruct_4sage_9structure_7element_RingElement __pyx_base;
1547
};
1548
static struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement *__pyx_vtabptr_4sage_9structure_7element_CommutativeRingElement;
1549
1550
1551
/* "sage/structure/element.pxd":223
1552
* pass
1553
*
1554
* cdef class IntegralDomainElement(CommutativeRingElement): # <<<<<<<<<<<<<<
1555
* pass
1556
*
1557
*/
1558
1559
struct __pyx_vtabstruct_4sage_9structure_7element_IntegralDomainElement {
1560
struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement __pyx_base;
1561
};
1562
static struct __pyx_vtabstruct_4sage_9structure_7element_IntegralDomainElement *__pyx_vtabptr_4sage_9structure_7element_IntegralDomainElement;
1563
1564
1565
/* "sage/structure/element.pxd":226
1566
* pass
1567
*
1568
* cdef class DedekindDomainElement(IntegralDomainElement): # <<<<<<<<<<<<<<
1569
* pass
1570
*
1571
*/
1572
1573
struct __pyx_vtabstruct_4sage_9structure_7element_DedekindDomainElement {
1574
struct __pyx_vtabstruct_4sage_9structure_7element_IntegralDomainElement __pyx_base;
1575
};
1576
static struct __pyx_vtabstruct_4sage_9structure_7element_DedekindDomainElement *__pyx_vtabptr_4sage_9structure_7element_DedekindDomainElement;
1577
1578
1579
/* "sage/structure/element.pxd":229
1580
* pass
1581
*
1582
* cdef class PrincipalIdealDomainElement(DedekindDomainElement): # <<<<<<<<<<<<<<
1583
* pass
1584
*
1585
*/
1586
1587
struct __pyx_vtabstruct_4sage_9structure_7element_PrincipalIdealDomainElement {
1588
struct __pyx_vtabstruct_4sage_9structure_7element_DedekindDomainElement __pyx_base;
1589
};
1590
static struct __pyx_vtabstruct_4sage_9structure_7element_PrincipalIdealDomainElement *__pyx_vtabptr_4sage_9structure_7element_PrincipalIdealDomainElement;
1591
1592
1593
/* "sage/structure/element.pxd":232
1594
* pass
1595
*
1596
* cdef class EuclideanDomainElement(PrincipalIdealDomainElement): # <<<<<<<<<<<<<<
1597
* cpdef _floordiv_(self, right)
1598
* cpdef _mod_(self, right)
1599
*/
1600
1601
struct __pyx_vtabstruct_4sage_9structure_7element_EuclideanDomainElement {
1602
struct __pyx_vtabstruct_4sage_9structure_7element_PrincipalIdealDomainElement __pyx_base;
1603
PyObject *(*_floordiv_)(struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement *, PyObject *, int __pyx_skip_dispatch);
1604
PyObject *(*_mod_)(struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement *, PyObject *, int __pyx_skip_dispatch);
1605
};
1606
static struct __pyx_vtabstruct_4sage_9structure_7element_EuclideanDomainElement *__pyx_vtabptr_4sage_9structure_7element_EuclideanDomainElement;
1607
1608
1609
/* "sage/structure/element.pxd":236
1610
* cpdef _mod_(self, right)
1611
*
1612
* cdef class FieldElement(CommutativeRingElement): # <<<<<<<<<<<<<<
1613
* cpdef _floordiv_(self, right)
1614
*
1615
*/
1616
1617
struct __pyx_vtabstruct_4sage_9structure_7element_FieldElement {
1618
struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement __pyx_base;
1619
PyObject *(*_floordiv_)(struct __pyx_obj_4sage_9structure_7element_FieldElement *, PyObject *, int __pyx_skip_dispatch);
1620
};
1621
static struct __pyx_vtabstruct_4sage_9structure_7element_FieldElement *__pyx_vtabptr_4sage_9structure_7element_FieldElement;
1622
1623
1624
/* "sage/structure/element.pxd":239
1625
* cpdef _floordiv_(self, right)
1626
*
1627
* cdef class AlgebraElement(RingElement): # <<<<<<<<<<<<<<
1628
* pass
1629
*
1630
*/
1631
1632
struct __pyx_vtabstruct_4sage_9structure_7element_AlgebraElement {
1633
struct __pyx_vtabstruct_4sage_9structure_7element_RingElement __pyx_base;
1634
};
1635
static struct __pyx_vtabstruct_4sage_9structure_7element_AlgebraElement *__pyx_vtabptr_4sage_9structure_7element_AlgebraElement;
1636
1637
1638
/* "sage/structure/element.pxd":242
1639
* pass
1640
*
1641
* cdef class CommutativeAlgebraElement(CommutativeRingElement): # <<<<<<<<<<<<<<
1642
* pass
1643
*
1644
*/
1645
1646
struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeAlgebraElement {
1647
struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement __pyx_base;
1648
};
1649
static struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeAlgebraElement *__pyx_vtabptr_4sage_9structure_7element_CommutativeAlgebraElement;
1650
1651
1652
/* "sage/structure/element.pxd":245
1653
* pass
1654
*
1655
* cdef class InfinityElement(RingElement): # <<<<<<<<<<<<<<
1656
* pass
1657
*
1658
*/
1659
1660
struct __pyx_vtabstruct_4sage_9structure_7element_InfinityElement {
1661
struct __pyx_vtabstruct_4sage_9structure_7element_RingElement __pyx_base;
1662
};
1663
static struct __pyx_vtabstruct_4sage_9structure_7element_InfinityElement *__pyx_vtabptr_4sage_9structure_7element_InfinityElement;
1664
1665
1666
/* "sage/structure/element.pxd":249
1667
*
1668
*
1669
* cdef class Vector(ModuleElement): # <<<<<<<<<<<<<<
1670
* cdef Py_ssize_t _degree
1671
*
1672
*/
1673
1674
struct __pyx_vtabstruct_4sage_9structure_7element_Vector {
1675
struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement __pyx_base;
1676
PyObject *(*_dot_product_)(struct __pyx_obj_4sage_9structure_7element_Vector *, struct __pyx_obj_4sage_9structure_7element_Vector *, int __pyx_skip_dispatch);
1677
PyObject *(*_dot_product_coerce_)(struct __pyx_obj_4sage_9structure_7element_Vector *, struct __pyx_obj_4sage_9structure_7element_Vector *, int __pyx_skip_dispatch);
1678
PyObject *(*_pairwise_product_)(struct __pyx_obj_4sage_9structure_7element_Vector *, struct __pyx_obj_4sage_9structure_7element_Vector *, int __pyx_skip_dispatch);
1679
int (*is_sparse_c)(struct __pyx_obj_4sage_9structure_7element_Vector *);
1680
int (*is_dense_c)(struct __pyx_obj_4sage_9structure_7element_Vector *);
1681
};
1682
static struct __pyx_vtabstruct_4sage_9structure_7element_Vector *__pyx_vtabptr_4sage_9structure_7element_Vector;
1683
1684
1685
/* "sage/structure/element.pxd":264
1686
*
1687
*
1688
* cdef class Matrix(ModuleElement): # <<<<<<<<<<<<<<
1689
* # All matrix classes must be written in Cython
1690
* cdef Py_ssize_t _nrows
1691
*/
1692
1693
struct __pyx_vtabstruct_4sage_9structure_7element_Matrix {
1694
struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement __pyx_base;
1695
PyObject *(*_vector_times_matrix_)(struct __pyx_obj_4sage_9structure_7element_Matrix *, struct __pyx_obj_4sage_9structure_7element_Vector *);
1696
PyObject *(*_matrix_times_vector_)(struct __pyx_obj_4sage_9structure_7element_Matrix *, struct __pyx_obj_4sage_9structure_7element_Vector *);
1697
PyObject *(*_matrix_times_matrix_)(struct __pyx_obj_4sage_9structure_7element_Matrix *, struct __pyx_obj_4sage_9structure_7element_Matrix *);
1698
int (*is_sparse_c)(struct __pyx_obj_4sage_9structure_7element_Matrix *);
1699
int (*is_dense_c)(struct __pyx_obj_4sage_9structure_7element_Matrix *);
1700
};
1701
static struct __pyx_vtabstruct_4sage_9structure_7element_Matrix *__pyx_vtabptr_4sage_9structure_7element_Matrix;
1702
1703
1704
/* "sage/structure/element.pxd":277
1705
*
1706
*
1707
* cdef class CoercionModel: # <<<<<<<<<<<<<<
1708
* cpdef canonical_coercion(self, x, y)
1709
* cpdef bin_op(self, x, y, op)
1710
*/
1711
1712
struct __pyx_vtabstruct_4sage_9structure_7element_CoercionModel {
1713
PyObject *(*canonical_coercion)(struct __pyx_obj_4sage_9structure_7element_CoercionModel *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1714
PyObject *(*bin_op)(struct __pyx_obj_4sage_9structure_7element_CoercionModel *, PyObject *, PyObject *, PyObject *, int __pyx_skip_dispatch);
1715
PyObject *(*richcmp)(struct __pyx_obj_4sage_9structure_7element_CoercionModel *, PyObject *, PyObject *, int, int __pyx_skip_dispatch);
1716
};
1717
static struct __pyx_vtabstruct_4sage_9structure_7element_CoercionModel *__pyx_vtabptr_4sage_9structure_7element_CoercionModel;
1718
1719
1720
/* "map.pxd":4
1721
* from sage.structure.element cimport Element
1722
*
1723
* cdef class Map(Element): # <<<<<<<<<<<<<<
1724
* cdef object __weakref__
1725
*
1726
*/
1727
1728
struct __pyx_vtabstruct_4sage_10categories_3map_Map {
1729
struct __pyx_vtabstruct_4sage_9structure_7element_Element __pyx_base;
1730
PyObject *(*_update_slots)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *);
1731
PyObject *(*_extra_slots)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *);
1732
struct __pyx_obj_4sage_9structure_7element_Element *(*_call_)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *, int __pyx_skip_dispatch);
1733
struct __pyx_obj_4sage_9structure_7element_Element *(*_call_with_args)(struct __pyx_obj_4sage_10categories_3map_Map *, PyObject *, int __pyx_skip_dispatch, struct __pyx_opt_args_4sage_10categories_3map_3Map__call_with_args *__pyx_optional_args);
1734
};
1735
static struct __pyx_vtabstruct_4sage_10categories_3map_Map *__pyx_vtabptr_4sage_10categories_3map_Map;
1736
1737
1738
/* "map.pxd":25
1739
*
1740
*
1741
* cdef class Section(Map): # <<<<<<<<<<<<<<
1742
* cdef Map _inverse
1743
*
1744
*/
1745
1746
struct __pyx_vtabstruct_4sage_10categories_3map_Section {
1747
struct __pyx_vtabstruct_4sage_10categories_3map_Map __pyx_base;
1748
};
1749
static struct __pyx_vtabstruct_4sage_10categories_3map_Section *__pyx_vtabptr_4sage_10categories_3map_Section;
1750
1751
1752
/* "map.pxd":28
1753
* cdef Map _inverse
1754
*
1755
* cdef class FormalCompositeMap(Map): # <<<<<<<<<<<<<<
1756
* cdef __list
1757
*/
1758
1759
struct __pyx_vtabstruct_4sage_10categories_3map_FormalCompositeMap {
1760
struct __pyx_vtabstruct_4sage_10categories_3map_Map __pyx_base;
1761
};
1762
static struct __pyx_vtabstruct_4sage_10categories_3map_FormalCompositeMap *__pyx_vtabptr_4sage_10categories_3map_FormalCompositeMap;
1763
1764
1765
/* "sage/categories/morphism.pxd":5
1766
* from .map cimport Map
1767
*
1768
* cdef class Morphism(Map): # <<<<<<<<<<<<<<
1769
* pass
1770
*
1771
*/
1772
1773
struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism {
1774
struct __pyx_vtabstruct_4sage_10categories_3map_Map __pyx_base;
1775
};
1776
static struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism *__pyx_vtabptr_4sage_10categories_8morphism_Morphism;
1777
1778
1779
/* "sage/categories/morphism.pxd":8
1780
* pass
1781
*
1782
* cdef class SetMorphism(Morphism): # <<<<<<<<<<<<<<
1783
* cdef object _function
1784
* cpdef bint _eq_c_impl(left, Element right)
1785
*/
1786
1787
struct __pyx_vtabstruct_4sage_10categories_8morphism_SetMorphism {
1788
struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism __pyx_base;
1789
int (*_eq_c_impl)(struct __pyx_obj_4sage_10categories_8morphism_SetMorphism *, struct __pyx_obj_4sage_9structure_7element_Element *, int __pyx_skip_dispatch);
1790
};
1791
static struct __pyx_vtabstruct_4sage_10categories_8morphism_SetMorphism *__pyx_vtabptr_4sage_10categories_8morphism_SetMorphism;
1792
1793
1794
/* "sage/rings/integer.pxd":7
1795
* from sage.categories.morphism cimport Morphism
1796
*
1797
* cdef class Integer(EuclideanDomainElement): # <<<<<<<<<<<<<<
1798
* cdef mpz_t value
1799
*
1800
*/
1801
1802
struct __pyx_vtabstruct_4sage_5rings_7integer_Integer {
1803
struct __pyx_vtabstruct_4sage_9structure_7element_EuclideanDomainElement __pyx_base;
1804
int (*_to_ZZ)(struct __pyx_obj_4sage_5rings_7integer_Integer *, ZZ *);
1805
void (*set_from_mpz)(struct __pyx_obj_4sage_5rings_7integer_Integer *, __mpz_struct *);
1806
PyObject *(*hash_c)(struct __pyx_obj_4sage_5rings_7integer_Integer *);
1807
PyObject *(*_pari_)(struct __pyx_obj_4sage_5rings_7integer_Integer *, int __pyx_skip_dispatch);
1808
PyObject *(*_shift_helper)(struct __pyx_obj_4sage_5rings_7integer_Integer *, PyObject *, int, int __pyx_skip_dispatch);
1809
PyObject *(*_and)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *);
1810
PyObject *(*_or)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *);
1811
PyObject *(*_xor)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *);
1812
size_t (*_exact_log_log2_iter)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *, int __pyx_skip_dispatch);
1813
size_t (*_exact_log_mpfi_log)(struct __pyx_obj_4sage_5rings_7integer_Integer *, PyObject *, int __pyx_skip_dispatch);
1814
struct __pyx_obj_4sage_9structure_7element_RingElement *(*_valuation)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *, int __pyx_skip_dispatch);
1815
PyObject *(*_val_unit)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *);
1816
struct __pyx_obj_4sage_5rings_7integer_Integer *(*_divide_knowing_divisible_by)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *);
1817
int (*_is_power_of)(struct __pyx_obj_4sage_5rings_7integer_Integer *, struct __pyx_obj_4sage_5rings_7integer_Integer *);
1818
int (*_pseudoprime_is_prime)(struct __pyx_obj_4sage_5rings_7integer_Integer *, PyObject *);
1819
PyObject *(*_pari_divisors_small)(struct __pyx_obj_4sage_5rings_7integer_Integer *, int __pyx_skip_dispatch);
1820
PyObject *(*_reduce_set)(struct __pyx_obj_4sage_5rings_7integer_Integer *, PyObject *);
1821
};
1822
static struct __pyx_vtabstruct_4sage_5rings_7integer_Integer *__pyx_vtabptr_4sage_5rings_7integer_Integer;
1823
1824
1825
/* "sage/rings/integer.pxd":37
1826
* cdef Integer smallInteger(long value)
1827
*
1828
* cdef class int_to_Z(Morphism): # <<<<<<<<<<<<<<
1829
* pass
1830
*/
1831
1832
struct __pyx_vtabstruct_4sage_5rings_7integer_int_to_Z {
1833
struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism __pyx_base;
1834
};
1835
static struct __pyx_vtabstruct_4sage_5rings_7integer_int_to_Z *__pyx_vtabptr_4sage_5rings_7integer_int_to_Z;
1836
1837
1838
/* "sage/modular/modsym/p1list.pxd":3
1839
*
1840
*
1841
* cdef class export: # <<<<<<<<<<<<<<
1842
* cdef int c_p1_normalize_int(self, int N, int u, int v,
1843
* int* uu, int* vv, int* ss,
1844
*/
1845
1846
struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_export {
1847
int (*c_p1_normalize_int)(struct __pyx_obj_4sage_7modular_6modsym_6p1list_export *, int, int, int, int *, int *, int *, int);
1848
int (*c_p1_normalize_llong)(struct __pyx_obj_4sage_7modular_6modsym_6p1list_export *, int, int, int, int *, int *, int *, int);
1849
};
1850
static struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_export *__pyx_vtabptr_4sage_7modular_6modsym_6p1list_export;
1851
1852
1853
/* "sage/modular/modsym/p1list.pxd":13
1854
*
1855
*
1856
* cdef class P1List: # <<<<<<<<<<<<<<
1857
* cdef int __N
1858
* cdef object __list, __end_hash
1859
*/
1860
1861
struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_P1List {
1862
PyObject *(*index)(struct __pyx_obj_4sage_7modular_6modsym_6p1list_P1List *, int, int, int __pyx_skip_dispatch);
1863
PyObject *(*index_and_scalar)(struct __pyx_obj_4sage_7modular_6modsym_6p1list_P1List *, int, int, int *, int *);
1864
};
1865
static struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_P1List *__pyx_vtabptr_4sage_7modular_6modsym_6p1list_P1List;
1866
1867
1868
/* "modular_symbol_map.pxd":28
1869
* from sage.modular.modsym.p1list cimport P1List
1870
*
1871
* cdef class ModularSymbolMap: # <<<<<<<<<<<<<<
1872
* cdef long d, N
1873
* cdef public long denom
1874
*/
1875
1876
struct __pyx_vtabstruct_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap {
1877
int (*evaluate)(struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *, long *, long, long);
1878
};
1879
static struct __pyx_vtabstruct_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *__pyx_vtabptr_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap;
1880
1881
1882
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":49
1883
* return mpz_fdiv_ui(cc.value, n)
1884
*
1885
* cdef class pAdicLseries: # <<<<<<<<<<<<<<
1886
* cdef bint parallel
1887
* cdef public object E
1888
*/
1889
1890
struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries {
1891
long (*modular_symbol)(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *, long, long, int __pyx_skip_dispatch);
1892
long (*measure)(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *, long, int, int __pyx_skip_dispatch);
1893
long (*measure_mulmod)(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *, long, int, long, int __pyx_skip_dispatch);
1894
};
1895
static struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_vtabptr_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries;
1896
1897
/* --- Runtime support code (head) --- */
1898
/* Refnanny.proto */
1899
#ifndef CYTHON_REFNANNY
1900
#define CYTHON_REFNANNY 0
1901
#endif
1902
#if CYTHON_REFNANNY
1903
typedef struct {
1904
void (*INCREF)(void*, PyObject*, int);
1905
void (*DECREF)(void*, PyObject*, int);
1906
void (*GOTREF)(void*, PyObject*, int);
1907
void (*GIVEREF)(void*, PyObject*, int);
1908
void* (*SetupContext)(const char*, int, const char*);
1909
void (*FinishContext)(void**);
1910
} __Pyx_RefNannyAPIStruct;
1911
static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1912
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1913
#define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1914
#ifdef WITH_THREAD
1915
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
1916
if (acquire_gil) {\
1917
PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1918
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1919
PyGILState_Release(__pyx_gilstate_save);\
1920
} else {\
1921
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1922
}
1923
#else
1924
#define __Pyx_RefNannySetupContext(name, acquire_gil)\
1925
__pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1926
#endif
1927
#define __Pyx_RefNannyFinishContext()\
1928
__Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1929
#define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1930
#define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1931
#define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1932
#define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1933
#define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1934
#define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1935
#define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1936
#define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1937
#else
1938
#define __Pyx_RefNannyDeclarations
1939
#define __Pyx_RefNannySetupContext(name, acquire_gil)
1940
#define __Pyx_RefNannyFinishContext()
1941
#define __Pyx_INCREF(r) Py_INCREF(r)
1942
#define __Pyx_DECREF(r) Py_DECREF(r)
1943
#define __Pyx_GOTREF(r)
1944
#define __Pyx_GIVEREF(r)
1945
#define __Pyx_XINCREF(r) Py_XINCREF(r)
1946
#define __Pyx_XDECREF(r) Py_XDECREF(r)
1947
#define __Pyx_XGOTREF(r)
1948
#define __Pyx_XGIVEREF(r)
1949
#endif
1950
#define __Pyx_XDECREF_SET(r, v) do {\
1951
PyObject *tmp = (PyObject *) r;\
1952
r = v; __Pyx_XDECREF(tmp);\
1953
} while (0)
1954
#define __Pyx_DECREF_SET(r, v) do {\
1955
PyObject *tmp = (PyObject *) r;\
1956
r = v; __Pyx_DECREF(tmp);\
1957
} while (0)
1958
#define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1959
#define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1960
1961
/* PyObjectGetAttrStr.proto */
1962
#if CYTHON_USE_TYPE_SLOTS
1963
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
1964
PyTypeObject* tp = Py_TYPE(obj);
1965
if (likely(tp->tp_getattro))
1966
return tp->tp_getattro(obj, attr_name);
1967
#if PY_MAJOR_VERSION < 3
1968
if (likely(tp->tp_getattr))
1969
return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
1970
#endif
1971
return PyObject_GetAttr(obj, attr_name);
1972
}
1973
#else
1974
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1975
#endif
1976
1977
/* GetBuiltinName.proto */
1978
static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1979
1980
/* RaiseArgTupleInvalid.proto */
1981
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1982
Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1983
1984
/* KeywordStringCheck.proto */
1985
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1986
1987
/* RaiseDoubleKeywords.proto */
1988
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1989
1990
/* ParseKeywords.proto */
1991
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1992
PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1993
const char* function_name);
1994
1995
/* GetModuleGlobalName.proto */
1996
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1997
1998
/* PyObjectCall.proto */
1999
#if CYTHON_COMPILING_IN_CPYTHON
2000
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
2001
#else
2002
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
2003
#endif
2004
2005
/* PyCFunctionFastCall.proto */
2006
#if CYTHON_FAST_PYCCALL
2007
static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
2008
#else
2009
#define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
2010
#endif
2011
2012
/* PyFunctionFastCall.proto */
2013
#if CYTHON_FAST_PYCALL
2014
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
2015
__Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
2016
#if 1 || PY_VERSION_HEX < 0x030600B1
2017
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
2018
#else
2019
#define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
2020
#endif
2021
#endif
2022
2023
/* PyObjectCallMethO.proto */
2024
#if CYTHON_COMPILING_IN_CPYTHON
2025
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
2026
#endif
2027
2028
/* PyObjectCallOneArg.proto */
2029
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
2030
2031
/* PyObjectCallNoArg.proto */
2032
#if CYTHON_COMPILING_IN_CPYTHON
2033
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
2034
#else
2035
#define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
2036
#endif
2037
2038
/* IncludeStringH.proto */
2039
#include <string.h>
2040
2041
/* BytesEquals.proto */
2042
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
2043
2044
/* UnicodeEquals.proto */
2045
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
2046
2047
/* StrEquals.proto */
2048
#if PY_MAJOR_VERSION >= 3
2049
#define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
2050
#else
2051
#define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
2052
#endif
2053
2054
/* PyThreadStateGet.proto */
2055
#if CYTHON_FAST_THREAD_STATE
2056
#define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
2057
#define __Pyx_PyThreadState_assign __pyx_tstate = PyThreadState_GET();
2058
#else
2059
#define __Pyx_PyThreadState_declare
2060
#define __Pyx_PyThreadState_assign
2061
#endif
2062
2063
/* PyErrFetchRestore.proto */
2064
#if CYTHON_FAST_THREAD_STATE
2065
#define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
2066
#define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
2067
#define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
2068
#define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
2069
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2070
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2071
#else
2072
#define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
2073
#define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
2074
#define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
2075
#define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
2076
#endif
2077
2078
/* RaiseException.proto */
2079
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
2080
2081
/* RaiseTooManyValuesToUnpack.proto */
2082
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
2083
2084
/* RaiseNeedMoreValuesToUnpack.proto */
2085
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
2086
2087
/* IterFinish.proto */
2088
static CYTHON_INLINE int __Pyx_IterFinish(void);
2089
2090
/* UnpackItemEndCheck.proto */
2091
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);
2092
2093
/* GetItemInt.proto */
2094
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2095
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2096
__Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
2097
(is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
2098
__Pyx_GetItemInt_Generic(o, to_py_func(i))))
2099
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2100
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2101
__Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2102
(PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
2103
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
2104
int wraparound, int boundscheck);
2105
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
2106
(__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
2107
__Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
2108
(PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
2109
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
2110
int wraparound, int boundscheck);
2111
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
2112
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
2113
int is_list, int wraparound, int boundscheck);
2114
2115
/* None.proto */
2116
static CYTHON_INLINE long __Pyx_div_long(long, long);
2117
2118
/* None.proto */
2119
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
2120
2121
/* WriteUnraisableException.proto */
2122
static void __Pyx_WriteUnraisable(const char *name, int clineno,
2123
int lineno, const char *filename,
2124
int full_traceback, int nogil);
2125
2126
/* PyIntBinop.proto */
2127
#if !CYTHON_COMPILING_IN_PYPY
2128
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace);
2129
#else
2130
#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace)\
2131
(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2132
#endif
2133
2134
/* None.proto */
2135
static CYTHON_INLINE long __Pyx_mod_long(long, long);
2136
2137
/* PyIntBinop.proto */
2138
#if !CYTHON_COMPILING_IN_PYPY
2139
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
2140
#else
2141
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace)\
2142
(inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2143
#endif
2144
2145
/* ListAppend.proto */
2146
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2147
static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
2148
PyListObject* L = (PyListObject*) list;
2149
Py_ssize_t len = Py_SIZE(list);
2150
if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
2151
Py_INCREF(x);
2152
PyList_SET_ITEM(list, len, x);
2153
Py_SIZE(list) = len+1;
2154
return 0;
2155
}
2156
return PyList_Append(list, x);
2157
}
2158
#else
2159
#define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
2160
#endif
2161
2162
/* ListCompAppend.proto */
2163
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
2164
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
2165
PyListObject* L = (PyListObject*) list;
2166
Py_ssize_t len = Py_SIZE(list);
2167
if (likely(L->allocated > len)) {
2168
Py_INCREF(x);
2169
PyList_SET_ITEM(list, len, x);
2170
Py_SIZE(list) = len+1;
2171
return 0;
2172
}
2173
return PyList_Append(list, x);
2174
}
2175
#else
2176
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
2177
#endif
2178
2179
/* PyIntBinop.proto */
2180
#if !CYTHON_COMPILING_IN_PYPY
2181
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
2182
#else
2183
#define __Pyx_PyInt_EqObjC(op1, op2, intval, inplace)\
2184
PyObject_RichCompare(op1, op2, Py_EQ)
2185
#endif
2186
2187
/* PyIntBinop.proto */
2188
#if !CYTHON_COMPILING_IN_PYPY
2189
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
2190
#else
2191
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
2192
(inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
2193
#endif
2194
2195
/* PyIntBinop.proto */
2196
#if !CYTHON_COMPILING_IN_PYPY
2197
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace);
2198
#else
2199
#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace)\
2200
(inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
2201
#endif
2202
2203
/* ExtTypeTest.proto */
2204
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
2205
2206
/* None.proto */
2207
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
2208
2209
/* Import.proto */
2210
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
2211
2212
/* ImportFrom.proto */
2213
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
2214
2215
/* FetchCommonType.proto */
2216
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
2217
2218
/* CythonFunction.proto */
2219
#define __Pyx_CyFunction_USED 1
2220
#include <structmember.h>
2221
#define __Pyx_CYFUNCTION_STATICMETHOD 0x01
2222
#define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
2223
#define __Pyx_CYFUNCTION_CCLASS 0x04
2224
#define __Pyx_CyFunction_GetClosure(f)\
2225
(((__pyx_CyFunctionObject *) (f))->func_closure)
2226
#define __Pyx_CyFunction_GetClassObj(f)\
2227
(((__pyx_CyFunctionObject *) (f))->func_classobj)
2228
#define __Pyx_CyFunction_Defaults(type, f)\
2229
((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
2230
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
2231
((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
2232
typedef struct {
2233
PyCFunctionObject func;
2234
#if PY_VERSION_HEX < 0x030500A0
2235
PyObject *func_weakreflist;
2236
#endif
2237
PyObject *func_dict;
2238
PyObject *func_name;
2239
PyObject *func_qualname;
2240
PyObject *func_doc;
2241
PyObject *func_globals;
2242
PyObject *func_code;
2243
PyObject *func_closure;
2244
PyObject *func_classobj;
2245
void *defaults;
2246
int defaults_pyobjects;
2247
int flags;
2248
PyObject *defaults_tuple;
2249
PyObject *defaults_kwdict;
2250
PyObject *(*defaults_getter)(PyObject *);
2251
PyObject *func_annotations;
2252
} __pyx_CyFunctionObject;
2253
static PyTypeObject *__pyx_CyFunctionType = 0;
2254
#define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
2255
__Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
2256
static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
2257
int flags, PyObject* qualname,
2258
PyObject *self,
2259
PyObject *module, PyObject *globals,
2260
PyObject* code);
2261
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
2262
size_t size,
2263
int pyobjects);
2264
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
2265
PyObject *tuple);
2266
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
2267
PyObject *dict);
2268
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
2269
PyObject *dict);
2270
static int __pyx_CyFunction_init(void);
2271
2272
/* SaveResetException.proto */
2273
#if CYTHON_FAST_THREAD_STATE
2274
#define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
2275
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2276
#define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
2277
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
2278
#else
2279
#define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
2280
#define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
2281
#endif
2282
2283
/* PyErrExceptionMatches.proto */
2284
#if CYTHON_FAST_THREAD_STATE
2285
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
2286
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
2287
#else
2288
#define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
2289
#endif
2290
2291
/* GetException.proto */
2292
#if CYTHON_FAST_THREAD_STATE
2293
#define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
2294
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
2295
#else
2296
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
2297
#endif
2298
2299
/* SetVTable.proto */
2300
static int __Pyx_SetVtable(PyObject *dict, void *vtable);
2301
2302
/* GetVTable.proto */
2303
static void* __Pyx_GetVtable(PyObject *dict);
2304
2305
/* CodeObjectCache.proto */
2306
typedef struct {
2307
PyCodeObject* code_object;
2308
int code_line;
2309
} __Pyx_CodeObjectCacheEntry;
2310
struct __Pyx_CodeObjectCache {
2311
int count;
2312
int max_count;
2313
__Pyx_CodeObjectCacheEntry* entries;
2314
};
2315
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
2316
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
2317
static PyCodeObject *__pyx_find_code_object(int code_line);
2318
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
2319
2320
/* AddTraceback.proto */
2321
static void __Pyx_AddTraceback(const char *funcname, int c_line,
2322
int py_line, const char *filename);
2323
2324
/* CIntToPy.proto */
2325
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
2326
2327
/* CIntToPy.proto */
2328
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
2329
2330
/* Print.proto */
2331
static int __Pyx_Print(PyObject*, PyObject *, int);
2332
#if CYTHON_COMPILING_IN_PYPY || PY_MAJOR_VERSION >= 3
2333
static PyObject* __pyx_print = 0;
2334
static PyObject* __pyx_print_kwargs = 0;
2335
#endif
2336
2337
/* CIntFromPy.proto */
2338
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2339
2340
/* CIntFromPy.proto */
2341
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2342
2343
/* PrintOne.proto */
2344
static int __Pyx_PrintOne(PyObject* stream, PyObject *o);
2345
2346
/* CheckBinaryVersion.proto */
2347
static int __Pyx_check_binary_version(void);
2348
2349
/* PyIdentifierFromString.proto */
2350
#if !defined(__Pyx_PyIdentifier_FromString)
2351
#if PY_MAJOR_VERSION < 3
2352
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2353
#else
2354
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2355
#endif
2356
#endif
2357
2358
/* ModuleImport.proto */
2359
static PyObject *__Pyx_ImportModule(const char *name);
2360
2361
/* TypeImport.proto */
2362
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
2363
2364
/* VoidPtrImport.proto */
2365
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig);
2366
2367
/* InitStrings.proto */
2368
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2369
2370
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modular_symbol(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, long __pyx_v_b, int __pyx_skip_dispatch); /* proto*/
2371
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n, int __pyx_skip_dispatch); /* proto*/
2372
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure_mulmod(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n, long __pyx_v_pp, int __pyx_skip_dispatch); /* proto*/
2373
static CYTHON_INLINE int __pyx_f_4sage_9structure_6parent_6Parent_get_flag(struct __pyx_obj_4sage_9structure_6parent_Parent *__pyx_v_self, int __pyx_v_flag); /* proto*/
2374
2375
/* Module declarations from 'cysignals.__init__' */
2376
2377
/* Module declarations from 'cysignals' */
2378
2379
/* Module declarations from 'cysignals.signals' */
2380
static cysigs_t *__pyx_vp_9cysignals_7signals_cysigs = 0;
2381
#define cysigs (*__pyx_vp_9cysignals_7signals_cysigs)
2382
static void (*__pyx_f_9cysignals_7signals_print_backtrace)(void); /*proto*/
2383
static void (*__pyx_f_9cysignals_7signals__sig_on_interrupt_received)(void); /*proto*/
2384
static void (*__pyx_f_9cysignals_7signals__sig_on_recover)(void); /*proto*/
2385
static void (*__pyx_f_9cysignals_7signals__sig_off_warning)(char const *, int); /*proto*/
2386
2387
/* Module declarations from 'cython' */
2388
2389
/* Module declarations from 'libc.string' */
2390
2391
/* Module declarations from 'libc.stdlib' */
2392
2393
/* Module declarations from 'cysignals.memory' */
2394
static CYTHON_INLINE void *sig_malloc(size_t); /*proto*/
2395
static CYTHON_INLINE void *sig_realloc(void *, size_t); /*proto*/
2396
static CYTHON_INLINE void *sig_calloc(size_t, size_t); /*proto*/
2397
static CYTHON_INLINE void sig_free(void *); /*proto*/
2398
static CYTHON_INLINE size_t __pyx_f_9cysignals_6memory_mul_overflowcheck(size_t, size_t); /*proto*/
2399
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_allocarray(size_t, size_t); /*proto*/
2400
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_reallocarray(void *, size_t, size_t); /*proto*/
2401
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_malloc(size_t); /*proto*/
2402
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_realloc(void *, size_t); /*proto*/
2403
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_calloc(size_t, size_t); /*proto*/
2404
2405
/* Module declarations from 'libc.stdio' */
2406
2407
/* Module declarations from '__builtin__' */
2408
2409
/* Module declarations from 'cpython.type' */
2410
static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2411
2412
/* Module declarations from 'cpython.version' */
2413
2414
/* Module declarations from 'cpython.ref' */
2415
2416
/* Module declarations from 'cpython.exc' */
2417
2418
/* Module declarations from 'cpython.module' */
2419
2420
/* Module declarations from 'cpython.mem' */
2421
2422
/* Module declarations from 'cpython.tuple' */
2423
2424
/* Module declarations from 'cpython.list' */
2425
2426
/* Module declarations from 'cpython.sequence' */
2427
2428
/* Module declarations from 'cpython.mapping' */
2429
2430
/* Module declarations from 'cpython.iterator' */
2431
2432
/* Module declarations from 'cpython.number' */
2433
2434
/* Module declarations from 'cpython.int' */
2435
2436
/* Module declarations from '__builtin__' */
2437
2438
/* Module declarations from 'cpython.bool' */
2439
static PyTypeObject *__pyx_ptype_7cpython_4bool_bool = 0;
2440
2441
/* Module declarations from 'cpython.long' */
2442
2443
/* Module declarations from 'cpython.float' */
2444
2445
/* Module declarations from '__builtin__' */
2446
2447
/* Module declarations from 'cpython.complex' */
2448
static PyTypeObject *__pyx_ptype_7cpython_7complex_complex = 0;
2449
2450
/* Module declarations from 'cpython.string' */
2451
2452
/* Module declarations from 'cpython.unicode' */
2453
2454
/* Module declarations from 'cpython.dict' */
2455
2456
/* Module declarations from 'cpython.instance' */
2457
2458
/* Module declarations from 'cpython.function' */
2459
2460
/* Module declarations from 'cpython.method' */
2461
2462
/* Module declarations from 'cpython.weakref' */
2463
2464
/* Module declarations from 'cpython.getargs' */
2465
2466
/* Module declarations from 'cpython.pythread' */
2467
2468
/* Module declarations from 'cpython.pystate' */
2469
2470
/* Module declarations from 'cpython.cobject' */
2471
2472
/* Module declarations from 'cpython.oldbuffer' */
2473
2474
/* Module declarations from 'cpython.set' */
2475
2476
/* Module declarations from 'cpython.buffer' */
2477
2478
/* Module declarations from 'cpython.bytes' */
2479
2480
/* Module declarations from 'cpython.pycapsule' */
2481
2482
/* Module declarations from 'cpython' */
2483
2484
/* Module declarations from 'cpython.object' */
2485
2486
/* Module declarations from 'sage.ext.stdsage' */
2487
static CYTHON_INLINE PyObject *__pyx_f_4sage_3ext_7stdsage_PY_NEW(PyTypeObject *); /*proto*/
2488
static CYTHON_INLINE int __pyx_f_4sage_3ext_7stdsage_HAS_DICTIONARY(PyObject *); /*proto*/
2489
2490
/* Module declarations from 'sage.libs.gmp.types' */
2491
2492
/* Module declarations from 'sage.libs.ntl.types' */
2493
2494
/* Module declarations from 'libc.stdint' */
2495
2496
/* Module declarations from 'sage.structure.sage_object' */
2497
static PyTypeObject *__pyx_ptype_4sage_9structure_11sage_object_SageObject = 0;
2498
static CYTHON_INLINE PyObject *__pyx_f_4sage_9structure_11sage_object_richcmp_not_equal(PyObject *, PyObject *, int, int __pyx_skip_dispatch); /*proto*/
2499
static CYTHON_INLINE int __pyx_f_4sage_9structure_11sage_object_rich_to_bool(int, int, int __pyx_skip_dispatch); /*proto*/
2500
static CYTHON_INLINE int __pyx_f_4sage_9structure_11sage_object_rich_to_bool_sgn(int, int, int __pyx_skip_dispatch); /*proto*/
2501
2502
/* Module declarations from 'sage.structure.category_object' */
2503
static PyTypeObject *__pyx_ptype_4sage_9structure_15category_object_CategoryObject = 0;
2504
2505
/* Module declarations from 'sage.structure' */
2506
2507
/* Module declarations from 'sage.misc.cython_metaclass' */
2508
2509
/* Module declarations from 'sage.misc' */
2510
2511
/* Module declarations from 'sage' */
2512
2513
/* Module declarations from 'sage.structure.coerce_dict' */
2514
static PyTypeObject *__pyx_ptype_4sage_9structure_11coerce_dict_MonoDict = 0;
2515
static PyTypeObject *__pyx_ptype_4sage_9structure_11coerce_dict_TripleDict = 0;
2516
2517
/* Module declarations from 'sage.structure.parent' */
2518
static PyTypeObject *__pyx_ptype_4sage_9structure_6parent_Parent = 0;
2519
2520
/* Module declarations from 'sage.misc.inherit_comparison' */
2521
static PyTypeObject *__pyx_ptype_4sage_4misc_18inherit_comparison_InheritComparisonMetaclass = 0;
2522
2523
/* Module declarations from 'sage.structure.element' */
2524
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_Element = 0;
2525
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_ElementWithCachedMethod = 0;
2526
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_ModuleElement = 0;
2527
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_RingElement = 0;
2528
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_MonoidElement = 0;
2529
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement = 0;
2530
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_AdditiveGroupElement = 0;
2531
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_CommutativeRingElement = 0;
2532
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_IntegralDomainElement = 0;
2533
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_DedekindDomainElement = 0;
2534
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement = 0;
2535
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_EuclideanDomainElement = 0;
2536
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_FieldElement = 0;
2537
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_AlgebraElement = 0;
2538
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement = 0;
2539
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_InfinityElement = 0;
2540
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_Vector = 0;
2541
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_Matrix = 0;
2542
static PyTypeObject *__pyx_ptype_4sage_9structure_7element_CoercionModel = 0;
2543
static struct __pyx_obj_4sage_9structure_7element_CoercionModel **__pyx_vp_4sage_9structure_7element_coercion_model = 0;
2544
#define __pyx_v_4sage_9structure_7element_coercion_model (*__pyx_vp_4sage_9structure_7element_coercion_model)
2545
static CYTHON_INLINE PyObject *__pyx_f_4sage_9structure_7element_parent(PyObject *, int __pyx_skip_dispatch); /*proto*/
2546
static CYTHON_INLINE int __pyx_f_4sage_9structure_7element_classify_elements(PyObject *, PyObject *); /*proto*/
2547
static CYTHON_INLINE int __pyx_f_4sage_9structure_7element_HAVE_SAME_PARENT(int); /*proto*/
2548
static CYTHON_INLINE int __pyx_f_4sage_9structure_7element_have_same_parent(PyObject *, PyObject *, int __pyx_skip_dispatch); /*proto*/
2549
2550
/* Module declarations from 'sage.categories.map' */
2551
static PyTypeObject *__pyx_ptype_4sage_10categories_3map_Map = 0;
2552
static PyTypeObject *__pyx_ptype_4sage_10categories_3map_Section = 0;
2553
static PyTypeObject *__pyx_ptype_4sage_10categories_3map_FormalCompositeMap = 0;
2554
2555
/* Module declarations from 'sage.categories.morphism' */
2556
static PyTypeObject *__pyx_ptype_4sage_10categories_8morphism_Morphism = 0;
2557
static PyTypeObject *__pyx_ptype_4sage_10categories_8morphism_SetMorphism = 0;
2558
2559
/* Module declarations from 'sage.rings.integer' */
2560
static PyTypeObject *__pyx_ptype_4sage_5rings_7integer_Integer = 0;
2561
static PyTypeObject *__pyx_ptype_4sage_5rings_7integer_int_to_Z = 0;
2562
2563
/* Module declarations from 'sage.modular.modsym.p1list' */
2564
static PyTypeObject *__pyx_ptype_4sage_7modular_6modsym_6p1list_export = 0;
2565
static PyTypeObject *__pyx_ptype_4sage_7modular_6modsym_6p1list_P1List = 0;
2566
2567
/* Module declarations from 'psage.modform.rational.modular_symbol_map' */
2568
static PyTypeObject *__pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap = 0;
2569
2570
/* Module declarations from 'sage.libs.gmp.mpz' */
2571
2572
/* Module declarations from 'psage.modform.rational.padic_elliptic_lseries_fast' */
2573
static PyTypeObject *__pyx_ptype_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries = 0;
2574
static PyTypeObject *__pyx_ptype_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel = 0;
2575
static PyTypeObject *__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py = 0;
2576
static struct __pyx_obj_4sage_5rings_7integer_Integer *__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_aa = 0;
2577
static struct __pyx_obj_4sage_5rings_7integer_Integer *__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_bb = 0;
2578
static struct __pyx_obj_4sage_5rings_7integer_Integer *__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_cc = 0;
2579
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_mulmod(long, long, long); /*proto*/
2580
static PyObject *__Pyx_CFunc_object____object____object____int___to_py(PyObject *(*)(PyObject *, PyObject *, int)); /*proto*/
2581
#define __Pyx_MODULE_NAME "psage.modform.rational.padic_elliptic_lseries_fast"
2582
int __pyx_module_is_main_psage__modform__rational__padic_elliptic_lseries_fast = 0;
2583
2584
/* Implementation of 'psage.modform.rational.padic_elliptic_lseries_fast' */
2585
static PyObject *__pyx_builtin_ValueError;
2586
static PyObject *__pyx_builtin_range;
2587
static PyObject *__pyx_builtin_min;
2588
static PyObject *__pyx_builtin_AttributeError;
2589
static PyObject *__pyx_builtin_MemoryError;
2590
static const char __pyx_k_E[] = "E";
2591
static const char __pyx_k_L[] = "L = ";
2592
static const char __pyx_k_O[] = "O";
2593
static const char __pyx_k_P[] = "P";
2594
static const char __pyx_k_T[] = "T";
2595
static const char __pyx_k_a[] = "a";
2596
static const char __pyx_k_b[] = "b";
2597
static const char __pyx_k_c[] = "c";
2598
static const char __pyx_k_f[] = "f";
2599
static const char __pyx_k_i[] = "i";
2600
static const char __pyx_k_n[] = "n";
2601
static const char __pyx_k_p[] = "p";
2602
static const char __pyx_k_x[] = "x";
2603
static const char __pyx_k_y[] = "y";
2604
static const char __pyx_k_Qp[] = "Qp";
2605
static const char __pyx_k_ZZ[] = "ZZ";
2606
static const char __pyx_k_Zp[] = "Zp";
2607
static const char __pyx_k_ap[] = "ap";
2608
static const char __pyx_k_op[] = "op";
2609
static const char __pyx_k_pp[] = "pp";
2610
static const char __pyx_k_L_2[] = "L";
2611
static const char __pyx_k_Mod[] = "Mod";
2612
static const char __pyx_k_end[] = "end";
2613
static const char __pyx_k_gen[] = "gen";
2614
static const char __pyx_k_log[] = "log";
2615
static const char __pyx_k_min[] = "min";
2616
static const char __pyx_k_arg0[] = "arg0";
2617
static const char __pyx_k_arg1[] = "arg1";
2618
static const char __pyx_k_arg2[] = "arg2";
2619
static const char __pyx_k_file[] = "file";
2620
static const char __pyx_k_last[] = "last";
2621
static const char __pyx_k_left[] = "left";
2622
static const char __pyx_k_lift[] = "lift";
2623
static const char __pyx_k_list[] = "list";
2624
static const char __pyx_k_main[] = "__main__";
2625
static const char __pyx_k_prec[] = "prec";
2626
static const char __pyx_k_rank[] = "rank";
2627
static const char __pyx_k_sage[] = "sage";
2628
static const char __pyx_k_sign[] = "sign";
2629
static const char __pyx_k_stop[] = "stop";
2630
static const char __pyx_k_test[] = "__test__";
2631
static const char __pyx_k_verb[] = "verb";
2632
static const char __pyx_k_wrap[] = "wrap";
2633
static const char __pyx_k_alpha[] = "alpha";
2634
static const char __pyx_k_check[] = "check";
2635
static const char __pyx_k_eclib[] = "eclib";
2636
static const char __pyx_k_ncpus[] = "ncpus";
2637
static const char __pyx_k_print[] = "print";
2638
static const char __pyx_k_range[] = "range";
2639
static const char __pyx_k_right[] = "right";
2640
static const char __pyx_k_start[] = "start";
2641
static const char __pyx_k_extend[] = "extend";
2642
static const char __pyx_k_import[] = "__import__";
2643
static const char __pyx_k_modsym[] = "modsym";
2644
static const char __pyx_k_parent[] = "parent";
2645
static const char __pyx_k_series[] = "_series";
2646
static const char __pyx_k_is_good[] = "is_good";
2647
static const char __pyx_k_measure[] = "measure";
2648
static const char __pyx_k_Integers[] = "Integers";
2649
static const char __pyx_k_binomial[] = "binomial";
2650
static const char __pyx_k_infinity[] = "infinity";
2651
static const char __pyx_k_parallel[] = "parallel";
2652
static const char __pyx_k_sage_all[] = "sage.all";
2653
static const char __pyx_k_ser_prec[] = "ser_prec";
2654
static const char __pyx_k_series_2[] = "series";
2655
static const char __pyx_k_truncate[] = "truncate";
2656
static const char __pyx_k_algorithm[] = "algorithm";
2657
static const char __pyx_k_exact_log[] = "exact_log";
2658
static const char __pyx_k_intervals[] = "intervals";
2659
static const char __pyx_k_use_eclib[] = "use_eclib";
2660
static const char __pyx_k_valuation[] = "valuation";
2661
static const char __pyx_k_ValueError[] = "ValueError";
2662
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2663
static const char __pyx_k_MemoryError[] = "MemoryError";
2664
static const char __pyx_k_cfunc_to_py[] = "cfunc.to_py";
2665
static const char __pyx_k_change_ring[] = "change_ring";
2666
static const char __pyx_k_deprecation[] = "deprecation";
2667
static const char __pyx_k_inverse_mod[] = "inverse_mod";
2668
static const char __pyx_k_is_ordinary[] = "is_ordinary";
2669
static const char __pyx_k_prec_bounds[] = "_prec_bounds";
2670
static const char __pyx_k_teichmuller[] = "teichmuller";
2671
static const char __pyx_k_Using_mulmod[] = "Using mulmod";
2672
static const char __pyx_k_a_invariants[] = "a_invariants";
2673
static const char __pyx_k_factor_padic[] = "factor_padic";
2674
static const char __pyx_k_force_mulmod[] = "force_mulmod";
2675
static const char __pyx_k_stringsource[] = "stringsource";
2676
static const char __pyx_k_is_surjective[] = "is_surjective";
2677
static const char __pyx_k_torsion_order[] = "torsion_order";
2678
static const char __pyx_k_AttributeError[] = "AttributeError";
2679
static const char __pyx_k_is_pseudoprime[] = "is_pseudoprime";
2680
static const char __pyx_k_measure_mulmod[] = "measure_mulmod";
2681
static const char __pyx_k_modular_symbol[] = "modular_symbol";
2682
static const char __pyx_k_sage_rings_all[] = "sage.rings.all";
2683
static const char __pyx_k_padic_regulator[] = "padic_regulator";
2684
static const char __pyx_k_real_components[] = "real_components";
2685
static const char __pyx_k_sage_ext_memory[] = "sage.ext.memory";
2686
static const char __pyx_k_series_parallel[] = "series_parallel";
2687
static const char __pyx_k_tamagawa_product[] = "tamagawa_product";
2688
static const char __pyx_k_p_s_must_be_prime[] = "p (=%s) must be prime";
2689
static const char __pyx_k_series_parallel_2[] = "_series_parallel";
2690
static const char __pyx_k_precision_absolute[] = "precision_absolute";
2691
static const char __pyx_k_sage_parallel_ncpus[] = "sage.parallel.ncpus";
2692
static const char __pyx_k_unknown_algorithm_s[] = "unknown algorithm '%s'";
2693
static const char __pyx_k_modular_symbol_space[] = "modular_symbol_space";
2694
static const char __pyx_k_s_adic_L_series_of_s[] = "%s-adic L-series of %s";
2695
static const char __pyx_k_sage_misc_superseded[] = "sage.misc.superseded";
2696
static const char __pyx_k_galois_representation[] = "galois_representation";
2697
static const char __pyx_k_init_memory_functions[] = "init_memory_functions";
2698
static const char __pyx_k_series_to_enough_prec[] = "series_to_enough_prec";
2699
static const char __pyx_k_p_s_must_be_good_for_E[] = "p (=%s) must be good for E";
2700
static const char __pyx_k_series_parallel_locals_f[] = "series_parallel.<locals>.f";
2701
static const char __pyx_k_Pyx_CFunc_object____object[] = "__Pyx_CFunc_object____object____object____int___to_py.<locals>.wrap";
2702
static const char __pyx_k_failed_to_allocate_s_bytes[] = "failed to allocate %s bytes";
2703
static const char __pyx_k_p_s_must_be_ordinary_for_E[] = "p (=%s) must be ordinary for E";
2704
static const char __pyx_k_series_s_computing_mod_p_s[] = "_series %s computing mod p^%s";
2705
static const char __pyx_k_bug_must_have_unit_root_p_s[] = "bug -- must have unit root (p=%s)";
2706
static const char __pyx_k_failed_to_allocate_s_s_bytes[] = "failed to allocate %s * %s bytes";
2707
static const char __pyx_k_p_s_must_be_surjective_for_E[] = "p (=%s) must be surjective for E";
2708
static const char __pyx_k_n_too_large_to_compute_measure[] = "n too large to compute measure";
2709
static const char __pyx_k_projects_68c8b2b8_03ba_44d4_a0d[] = "/projects/68c8b2b8-03ba-44d4-a0d1-5d771c8cb465/code/alex/psage/psage/modform/rational/padic_elliptic_lseries_fast.pyx";
2710
static const char __pyx_k_requested_precision_s_too_large[] = "requested precision (%s) too large (max: %s)";
2711
static const char __pyx_k_File_padic_elliptic_lseries_fast[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 1)";
2712
static const char __pyx_k_bug_in_computing_p_adic_L_series[] = "bug in computing p-adic L-series for %s and p=%s";
2713
static const char __pyx_k_import_cysignals_signals_pxi_ins[] = "import \"cysignals/signals.pxi\" instead of \"sage/ext/interrupt.pxi\"";
2714
static const char __pyx_k_internal_modsym_denominator_must[] = "internal modsym denominator must be a p(=%s)-unit, but it is %s";
2715
static const char __pyx_k_prec_s_must_be_as_large_as_appro[] = "prec (=%s) must be as large as approximation n (=%s)";
2716
static const char __pyx_k_psage_modform_rational_padic_ell[] = "psage.modform.rational.padic_elliptic_lseries_fast";
2717
static PyObject *__pyx_n_s_AttributeError;
2718
static PyObject *__pyx_n_s_E;
2719
static PyObject *__pyx_n_s_Integers;
2720
static PyObject *__pyx_kp_s_L;
2721
static PyObject *__pyx_n_s_L_2;
2722
static PyObject *__pyx_n_s_MemoryError;
2723
static PyObject *__pyx_n_s_Mod;
2724
static PyObject *__pyx_n_s_O;
2725
static PyObject *__pyx_n_s_P;
2726
static PyObject *__pyx_n_s_Pyx_CFunc_object____object;
2727
static PyObject *__pyx_n_s_Qp;
2728
static PyObject *__pyx_n_s_T;
2729
static PyObject *__pyx_kp_s_Using_mulmod;
2730
static PyObject *__pyx_n_s_ValueError;
2731
static PyObject *__pyx_n_s_ZZ;
2732
static PyObject *__pyx_n_s_Zp;
2733
static PyObject *__pyx_n_s_a;
2734
static PyObject *__pyx_n_s_a_invariants;
2735
static PyObject *__pyx_n_s_algorithm;
2736
static PyObject *__pyx_n_s_alpha;
2737
static PyObject *__pyx_n_s_ap;
2738
static PyObject *__pyx_n_s_arg0;
2739
static PyObject *__pyx_n_s_arg1;
2740
static PyObject *__pyx_n_s_arg2;
2741
static PyObject *__pyx_n_s_b;
2742
static PyObject *__pyx_n_s_binomial;
2743
static PyObject *__pyx_kp_s_bug_in_computing_p_adic_L_series;
2744
static PyObject *__pyx_kp_s_bug_must_have_unit_root_p_s;
2745
static PyObject *__pyx_n_s_c;
2746
static PyObject *__pyx_n_s_cfunc_to_py;
2747
static PyObject *__pyx_n_s_change_ring;
2748
static PyObject *__pyx_n_s_check;
2749
static PyObject *__pyx_n_s_deprecation;
2750
static PyObject *__pyx_n_s_eclib;
2751
static PyObject *__pyx_n_s_end;
2752
static PyObject *__pyx_n_s_exact_log;
2753
static PyObject *__pyx_n_s_extend;
2754
static PyObject *__pyx_n_s_f;
2755
static PyObject *__pyx_n_s_factor_padic;
2756
static PyObject *__pyx_kp_s_failed_to_allocate_s_bytes;
2757
static PyObject *__pyx_kp_s_failed_to_allocate_s_s_bytes;
2758
static PyObject *__pyx_n_s_file;
2759
static PyObject *__pyx_n_s_force_mulmod;
2760
static PyObject *__pyx_n_s_galois_representation;
2761
static PyObject *__pyx_n_s_gen;
2762
static PyObject *__pyx_n_s_i;
2763
static PyObject *__pyx_n_s_import;
2764
static PyObject *__pyx_kp_s_import_cysignals_signals_pxi_ins;
2765
static PyObject *__pyx_n_s_infinity;
2766
static PyObject *__pyx_n_s_init_memory_functions;
2767
static PyObject *__pyx_kp_s_internal_modsym_denominator_must;
2768
static PyObject *__pyx_n_s_intervals;
2769
static PyObject *__pyx_n_s_inverse_mod;
2770
static PyObject *__pyx_n_s_is_good;
2771
static PyObject *__pyx_n_s_is_ordinary;
2772
static PyObject *__pyx_n_s_is_pseudoprime;
2773
static PyObject *__pyx_n_s_is_surjective;
2774
static PyObject *__pyx_n_s_last;
2775
static PyObject *__pyx_n_s_left;
2776
static PyObject *__pyx_n_s_lift;
2777
static PyObject *__pyx_n_s_list;
2778
static PyObject *__pyx_n_s_log;
2779
static PyObject *__pyx_n_s_main;
2780
static PyObject *__pyx_n_s_measure;
2781
static PyObject *__pyx_n_s_measure_mulmod;
2782
static PyObject *__pyx_n_s_min;
2783
static PyObject *__pyx_n_s_modsym;
2784
static PyObject *__pyx_n_s_modular_symbol;
2785
static PyObject *__pyx_n_s_modular_symbol_space;
2786
static PyObject *__pyx_n_s_n;
2787
static PyObject *__pyx_kp_s_n_too_large_to_compute_measure;
2788
static PyObject *__pyx_n_s_ncpus;
2789
static PyObject *__pyx_n_s_op;
2790
static PyObject *__pyx_n_s_p;
2791
static PyObject *__pyx_kp_s_p_s_must_be_good_for_E;
2792
static PyObject *__pyx_kp_s_p_s_must_be_ordinary_for_E;
2793
static PyObject *__pyx_kp_s_p_s_must_be_prime;
2794
static PyObject *__pyx_kp_s_p_s_must_be_surjective_for_E;
2795
static PyObject *__pyx_n_s_padic_regulator;
2796
static PyObject *__pyx_n_s_parallel;
2797
static PyObject *__pyx_n_s_parent;
2798
static PyObject *__pyx_n_s_pp;
2799
static PyObject *__pyx_n_s_prec;
2800
static PyObject *__pyx_n_s_prec_bounds;
2801
static PyObject *__pyx_kp_s_prec_s_must_be_as_large_as_appro;
2802
static PyObject *__pyx_n_s_precision_absolute;
2803
static PyObject *__pyx_n_s_print;
2804
static PyObject *__pyx_kp_s_projects_68c8b2b8_03ba_44d4_a0d;
2805
static PyObject *__pyx_n_s_psage_modform_rational_padic_ell;
2806
static PyObject *__pyx_n_s_pyx_vtable;
2807
static PyObject *__pyx_n_s_range;
2808
static PyObject *__pyx_n_s_rank;
2809
static PyObject *__pyx_n_s_real_components;
2810
static PyObject *__pyx_kp_s_requested_precision_s_too_large;
2811
static PyObject *__pyx_n_s_right;
2812
static PyObject *__pyx_kp_s_s_adic_L_series_of_s;
2813
static PyObject *__pyx_n_s_sage;
2814
static PyObject *__pyx_n_s_sage_all;
2815
static PyObject *__pyx_n_s_sage_ext_memory;
2816
static PyObject *__pyx_n_s_sage_misc_superseded;
2817
static PyObject *__pyx_n_s_sage_parallel_ncpus;
2818
static PyObject *__pyx_n_s_sage_rings_all;
2819
static PyObject *__pyx_n_s_ser_prec;
2820
static PyObject *__pyx_n_s_series;
2821
static PyObject *__pyx_n_s_series_2;
2822
static PyObject *__pyx_n_s_series_parallel;
2823
static PyObject *__pyx_n_s_series_parallel_2;
2824
static PyObject *__pyx_n_s_series_parallel_locals_f;
2825
static PyObject *__pyx_kp_s_series_s_computing_mod_p_s;
2826
static PyObject *__pyx_n_s_series_to_enough_prec;
2827
static PyObject *__pyx_n_s_sign;
2828
static PyObject *__pyx_n_s_start;
2829
static PyObject *__pyx_n_s_stop;
2830
static PyObject *__pyx_kp_s_stringsource;
2831
static PyObject *__pyx_n_s_tamagawa_product;
2832
static PyObject *__pyx_n_s_teichmuller;
2833
static PyObject *__pyx_n_s_test;
2834
static PyObject *__pyx_n_s_torsion_order;
2835
static PyObject *__pyx_n_s_truncate;
2836
static PyObject *__pyx_kp_s_unknown_algorithm_s;
2837
static PyObject *__pyx_n_s_use_eclib;
2838
static PyObject *__pyx_n_s_valuation;
2839
static PyObject *__pyx_n_s_verb;
2840
static PyObject *__pyx_n_s_wrap;
2841
static PyObject *__pyx_n_s_x;
2842
static PyObject *__pyx_n_s_y;
2843
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries___cinit__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2844
static void __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_2__dealloc__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2845
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_E, PyObject *__pyx_v_p, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_parallel); /* proto */
2846
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2847
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_8alpha(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2848
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_10modular_symbol(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, long __pyx_v_b); /* proto */
2849
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_12measure(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n); /* proto */
2850
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_14measure_mulmod(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n, long __pyx_v_pp); /* proto */
2851
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_16_series(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, int __pyx_v_verb, int __pyx_v_force_mulmod, long __pyx_v_start, long __pyx_v_stop); /* proto */
2852
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_18_series_parallel(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, int __pyx_v_verb, int __pyx_v_force_mulmod, PyObject *__pyx_v_ncpus); /* proto */
2853
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20_prec_bounds(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_ser_prec); /* proto */
2854
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_22series(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, int __pyx_v_check, int __pyx_v_verb, PyObject *__pyx_v_parallel); /* proto */
2855
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_24series_modp(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_ser_prec, int __pyx_v_check); /* proto */
2856
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_26series_to_enough_prec(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_verb); /* proto */
2857
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_28sha_modp(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_verb); /* proto */
2858
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2859
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2860
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_4__del__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2861
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2862
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2863
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2864
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2865
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2866
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2867
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2868
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2869
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2870
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2871
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2872
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2873
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_4__del__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self); /* proto */
2874
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_f(PyObject *__pyx_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop); /* proto */
2875
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_series_parallel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_L, PyObject *__pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, PyObject *__pyx_v_verb, PyObject *__pyx_v_force_mulmod, PyObject *__pyx_v_ncpus); /* proto */
2876
static PyObject *__pyx_pf_4sage_9structure_7element_parent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x); /* proto */
2877
static PyObject *__pyx_pf_4sage_9structure_7element_2have_same_parent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_left, PyObject *__pyx_v_right); /* proto */
2878
static PyObject *__pyx_pf_4sage_9structure_11sage_object_richcmp_not_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op); /* proto */
2879
static PyObject *__pyx_pf_4sage_9structure_11sage_object_2rich_to_bool(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_op, int __pyx_v_c); /* proto */
2880
static PyObject *__pyx_pf_4sage_9structure_11sage_object_4rich_to_bool_sgn(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_op, int __pyx_v_c); /* proto */
2881
static PyObject *__pyx_pf_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_arg0, PyObject *__pyx_v_arg1, int __pyx_v_arg2); /* proto */
2882
static PyObject *__pyx_tp_new_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2883
static PyObject *__pyx_tp_new_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2884
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2885
static PyObject *__pyx_int_0;
2886
static PyObject *__pyx_int_1;
2887
static PyObject *__pyx_int_2;
2888
static PyObject *__pyx_int_4;
2889
static PyObject *__pyx_int_5;
2890
static PyObject *__pyx_int_10;
2891
static PyObject *__pyx_int_20002;
2892
static PyObject *__pyx_int_9223372036854775808;
2893
static PyObject *__pyx_tuple_;
2894
static PyObject *__pyx_tuple__2;
2895
static PyObject *__pyx_tuple__3;
2896
static PyObject *__pyx_tuple__4;
2897
static PyObject *__pyx_tuple__5;
2898
static PyObject *__pyx_tuple__7;
2899
static PyObject *__pyx_tuple__9;
2900
static PyObject *__pyx_tuple__10;
2901
static PyObject *__pyx_tuple__11;
2902
static PyObject *__pyx_tuple__12;
2903
static PyObject *__pyx_tuple__13;
2904
static PyObject *__pyx_codeobj__6;
2905
static PyObject *__pyx_codeobj__8;
2906
static PyObject *__pyx_codeobj__14;
2907
2908
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":36
2909
* # Necessary gmp imports for the mulmod function
2910
* from sage.libs.gmp.mpz cimport mpz_fdiv_ui, mpz_set_si, mpz_mul
2911
* cdef long mulmod(long a, long b, long n): # <<<<<<<<<<<<<<
2912
* """
2913
* Return (a*b)%n, which is >= 0.
2914
*/
2915
2916
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_mulmod(long __pyx_v_a, long __pyx_v_b, long __pyx_v_n) {
2917
long __pyx_r;
2918
__Pyx_RefNannyDeclarations
2919
__Pyx_RefNannySetupContext("mulmod", 0);
2920
2921
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":44
2922
* """
2923
* global aa, bb
2924
* mpz_set_si(aa.value, a) # <<<<<<<<<<<<<<
2925
* mpz_set_si(bb.value, b)
2926
* mpz_mul(cc.value, aa.value, bb.value)
2927
*/
2928
mpz_set_si(__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_aa->value, __pyx_v_a);
2929
2930
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":45
2931
* global aa, bb
2932
* mpz_set_si(aa.value, a)
2933
* mpz_set_si(bb.value, b) # <<<<<<<<<<<<<<
2934
* mpz_mul(cc.value, aa.value, bb.value)
2935
* return mpz_fdiv_ui(cc.value, n)
2936
*/
2937
mpz_set_si(__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_bb->value, __pyx_v_b);
2938
2939
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":46
2940
* mpz_set_si(aa.value, a)
2941
* mpz_set_si(bb.value, b)
2942
* mpz_mul(cc.value, aa.value, bb.value) # <<<<<<<<<<<<<<
2943
* return mpz_fdiv_ui(cc.value, n)
2944
*
2945
*/
2946
mpz_mul(__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_cc->value, __pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_aa->value, __pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_bb->value);
2947
2948
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":47
2949
* mpz_set_si(bb.value, b)
2950
* mpz_mul(cc.value, aa.value, bb.value)
2951
* return mpz_fdiv_ui(cc.value, n) # <<<<<<<<<<<<<<
2952
*
2953
* cdef class pAdicLseries:
2954
*/
2955
__pyx_r = mpz_fdiv_ui(__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_cc->value, __pyx_v_n);
2956
goto __pyx_L0;
2957
2958
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":36
2959
* # Necessary gmp imports for the mulmod function
2960
* from sage.libs.gmp.mpz cimport mpz_fdiv_ui, mpz_set_si, mpz_mul
2961
* cdef long mulmod(long a, long b, long n): # <<<<<<<<<<<<<<
2962
* """
2963
* Return (a*b)%n, which is >= 0.
2964
*/
2965
2966
/* function exit code */
2967
__pyx_L0:;
2968
__Pyx_RefNannyFinishContext();
2969
return __pyx_r;
2970
}
2971
2972
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":61
2973
* cdef public ModularSymbolMap modsym
2974
*
2975
* def __cinit__(self): # <<<<<<<<<<<<<<
2976
* self.teich = NULL
2977
* self.teich_mulmod = NULL
2978
*/
2979
2980
/* Python wrapper */
2981
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2982
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1__cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2983
int __pyx_r;
2984
__Pyx_RefNannyDeclarations
2985
__Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
2986
if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
2987
__Pyx_RaiseArgtupleInvalid("__cinit__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
2988
if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__cinit__", 0))) return -1;
2989
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries___cinit__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
2990
2991
/* function exit code */
2992
__Pyx_RefNannyFinishContext();
2993
return __pyx_r;
2994
}
2995
2996
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries___cinit__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
2997
int __pyx_r;
2998
__Pyx_RefNannyDeclarations
2999
__Pyx_RefNannySetupContext("__cinit__", 0);
3000
3001
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":62
3002
*
3003
* def __cinit__(self):
3004
* self.teich = NULL # <<<<<<<<<<<<<<
3005
* self.teich_mulmod = NULL
3006
*
3007
*/
3008
__pyx_v_self->teich = NULL;
3009
3010
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":63
3011
* def __cinit__(self):
3012
* self.teich = NULL
3013
* self.teich_mulmod = NULL # <<<<<<<<<<<<<<
3014
*
3015
* def __dealloc__(self):
3016
*/
3017
__pyx_v_self->teich_mulmod = NULL;
3018
3019
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":61
3020
* cdef public ModularSymbolMap modsym
3021
*
3022
* def __cinit__(self): # <<<<<<<<<<<<<<
3023
* self.teich = NULL
3024
* self.teich_mulmod = NULL
3025
*/
3026
3027
/* function exit code */
3028
__pyx_r = 0;
3029
__Pyx_RefNannyFinishContext();
3030
return __pyx_r;
3031
}
3032
3033
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":65
3034
* self.teich_mulmod = NULL
3035
*
3036
* def __dealloc__(self): # <<<<<<<<<<<<<<
3037
* if self.teich:
3038
* sage_free(self.teich)
3039
*/
3040
3041
/* Python wrapper */
3042
static void __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_3__dealloc__(PyObject *__pyx_v_self); /*proto*/
3043
static void __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_3__dealloc__(PyObject *__pyx_v_self) {
3044
__Pyx_RefNannyDeclarations
3045
__Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
3046
__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_2__dealloc__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
3047
3048
/* function exit code */
3049
__Pyx_RefNannyFinishContext();
3050
}
3051
3052
static void __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_2__dealloc__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
3053
__Pyx_RefNannyDeclarations
3054
int __pyx_t_1;
3055
__Pyx_RefNannySetupContext("__dealloc__", 0);
3056
3057
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":66
3058
*
3059
* def __dealloc__(self):
3060
* if self.teich: # <<<<<<<<<<<<<<
3061
* sage_free(self.teich)
3062
* if self.teich_mulmod:
3063
*/
3064
__pyx_t_1 = (__pyx_v_self->teich != 0);
3065
if (__pyx_t_1) {
3066
3067
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":67
3068
* def __dealloc__(self):
3069
* if self.teich:
3070
* sage_free(self.teich) # <<<<<<<<<<<<<<
3071
* if self.teich_mulmod:
3072
* sage_free(self.teich_mulmod)
3073
*/
3074
sig_free(__pyx_v_self->teich);
3075
3076
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":66
3077
*
3078
* def __dealloc__(self):
3079
* if self.teich: # <<<<<<<<<<<<<<
3080
* sage_free(self.teich)
3081
* if self.teich_mulmod:
3082
*/
3083
}
3084
3085
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":68
3086
* if self.teich:
3087
* sage_free(self.teich)
3088
* if self.teich_mulmod: # <<<<<<<<<<<<<<
3089
* sage_free(self.teich_mulmod)
3090
*
3091
*/
3092
__pyx_t_1 = (__pyx_v_self->teich_mulmod != 0);
3093
if (__pyx_t_1) {
3094
3095
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":69
3096
* sage_free(self.teich)
3097
* if self.teich_mulmod:
3098
* sage_free(self.teich_mulmod) # <<<<<<<<<<<<<<
3099
*
3100
*
3101
*/
3102
sig_free(__pyx_v_self->teich_mulmod);
3103
3104
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":68
3105
* if self.teich:
3106
* sage_free(self.teich)
3107
* if self.teich_mulmod: # <<<<<<<<<<<<<<
3108
* sage_free(self.teich_mulmod)
3109
*
3110
*/
3111
}
3112
3113
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":65
3114
* self.teich_mulmod = NULL
3115
*
3116
* def __dealloc__(self): # <<<<<<<<<<<<<<
3117
* if self.teich:
3118
* sage_free(self.teich)
3119
*/
3120
3121
/* function exit code */
3122
__Pyx_RefNannyFinishContext();
3123
}
3124
3125
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":72
3126
*
3127
*
3128
* def __init__(self, E, p, algorithm='eclib', parallel=False): # <<<<<<<<<<<<<<
3129
* """
3130
* INPUT:
3131
*/
3132
3133
/* Python wrapper */
3134
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3135
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 72)\n\n INPUT:\n - E -- an elliptic curve over QQ\n - p -- a prime of good ordinary reduction with E[p] surjective\n - algorithm -- str (default: 'eclib')\n - 'eclib' -- use elliptic curve modular symbol computed using eclib\n - 'sage' -- use elliptic curve modular symbol computed using sage\n - 'modsym' -- use sage modular symbols directly (!! not correctly normalized !!)\n - parallel -- bool (default: False); if True default to using parallel techniques.\n\n EXAMPLES::\n\n sage: from psage.modform.rational.padic_elliptic_lseries_fast import pAdicLseries\n sage: E = EllipticCurve('389a'); L = pAdicLseries(E, 7)\n sage: L.series()\n O(7) + O(7)*T + (5 + O(7))*T^2 + (3 + O(7))*T^3 + (6 + O(7))*T^4 + O(T^5)\n sage: L.series(n=3)\n O(7^2) + O(7^2)*T + (5 + 4*7 + O(7^2))*T^2 + (3 + 6*7 + O(7^2))*T^3 + (6 + 3*7 + O(7^2))*T^4 + O(T^5)\n sage: L.series(n=4)\n O(7^3) + O(7^3)*T + (5 + 4*7 + 5*7^2 + O(7^3))*T^2 + (3 + 6*7 + 4*7^2 + O(7^3))*T^3 + (6 + 3*7 + 3*7^2 + O(7^3))*T^4 + O(T^5)\n\n We can also get the series just mod 7::\n\n sage: L.series_modp()\n 5*T^2 + 3*T^3 + 6*T^4 + O(T^5)\n sage: L.series_modp().list()\n [0, 0, 5, 3, 6]\n\n We use Sage modular symbols instead of eclib's::\n\n sage: L = pAdicLseries(E, 7, algorithm='sage')\n sage: L.series(n=3)\n O(7^2) + O(7^2)*T + (5 + 4*7 + O(7^2))*T^2 + (3 + 6*7 + O(7^2))*T^3 + (6 + 3*7 + O(7^2))*T^4 + O(T^5)\n\n When we use algorithm='modsym', we see that the normalization\n is not correct (as is documented above -- no attempt is made\n to normalize!)::\n\n sage: L = pAdicLseries(E, 7, algorithm='modsym')\n sage: L.series(n=3)\n O(7^2) + O(7^""2)*T + (6 + 5*7 + O(7^2))*T^2 + (5 + 6*7 + O(7^2))*T^3 + (3 + 5*7 + O(7^2))*T^4 + O(T^5)\n sage: 2*L.series(n=3)\n O(7^2) + O(7^2)*T + (5 + 4*7 + O(7^2))*T^2 + (3 + 6*7 + O(7^2))*T^3 + (6 + 3*7 + O(7^2))*T^4 + O(T^5)\n\n These agree with the L-series computed directly using separate code in Sage::\n\n sage: L = E.padic_lseries(7)\n sage: L.series(3)\n O(7^5) + O(7^2)*T + (5 + 4*7 + O(7^2))*T^2 + (3 + 6*7 + O(7^2))*T^3 + (6 + 3*7 + O(7^2))*T^4 + O(T^5)\n\n Comparing the parallel and serial version::\n\n sage: from psage.modform.rational.padic_elliptic_lseries_fast import pAdicLseries\n sage: L = pAdicLseries(EllipticCurve('389a'),997)\n sage: L2 = pAdicLseries(EllipticCurve('389a'),997,parallel=True)\n sage: L.series_modp() == L2.series_modp()\n True\n\n If you time the left and right above separately, and have a\n multicore machine, you should see that the right is much\n faster than the left.\n ";
3136
#if CYTHON_COMPILING_IN_CPYTHON
3137
struct wrapperbase __pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__;
3138
#endif
3139
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_5__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3140
PyObject *__pyx_v_E = 0;
3141
PyObject *__pyx_v_p = 0;
3142
PyObject *__pyx_v_algorithm = 0;
3143
PyObject *__pyx_v_parallel = 0;
3144
int __pyx_r;
3145
__Pyx_RefNannyDeclarations
3146
__Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
3147
{
3148
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_E,&__pyx_n_s_p,&__pyx_n_s_algorithm,&__pyx_n_s_parallel,0};
3149
PyObject* values[4] = {0,0,0,0};
3150
values[2] = ((PyObject *)__pyx_n_s_eclib);
3151
values[3] = ((PyObject *)Py_False);
3152
if (unlikely(__pyx_kwds)) {
3153
Py_ssize_t kw_args;
3154
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3155
switch (pos_args) {
3156
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3157
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3158
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3159
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3160
case 0: break;
3161
default: goto __pyx_L5_argtuple_error;
3162
}
3163
kw_args = PyDict_Size(__pyx_kwds);
3164
switch (pos_args) {
3165
case 0:
3166
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_E)) != 0)) kw_args--;
3167
else goto __pyx_L5_argtuple_error;
3168
case 1:
3169
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_p)) != 0)) kw_args--;
3170
else {
3171
__Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, 1); __PYX_ERR(0, 72, __pyx_L3_error)
3172
}
3173
case 2:
3174
if (kw_args > 0) {
3175
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_algorithm);
3176
if (value) { values[2] = value; kw_args--; }
3177
}
3178
case 3:
3179
if (kw_args > 0) {
3180
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parallel);
3181
if (value) { values[3] = value; kw_args--; }
3182
}
3183
}
3184
if (unlikely(kw_args > 0)) {
3185
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 72, __pyx_L3_error)
3186
}
3187
} else {
3188
switch (PyTuple_GET_SIZE(__pyx_args)) {
3189
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
3190
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
3191
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
3192
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3193
break;
3194
default: goto __pyx_L5_argtuple_error;
3195
}
3196
}
3197
__pyx_v_E = values[0];
3198
__pyx_v_p = values[1];
3199
__pyx_v_algorithm = values[2];
3200
__pyx_v_parallel = values[3];
3201
}
3202
goto __pyx_L4_argument_unpacking_done;
3203
__pyx_L5_argtuple_error:;
3204
__Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 4, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 72, __pyx_L3_error)
3205
__pyx_L3_error:;
3206
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3207
__Pyx_RefNannyFinishContext();
3208
return -1;
3209
__pyx_L4_argument_unpacking_done:;
3210
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_E, __pyx_v_p, __pyx_v_algorithm, __pyx_v_parallel);
3211
3212
/* function exit code */
3213
__Pyx_RefNannyFinishContext();
3214
return __pyx_r;
3215
}
3216
3217
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_E, PyObject *__pyx_v_p, PyObject *__pyx_v_algorithm, PyObject *__pyx_v_parallel) {
3218
PyObject *__pyx_v_f = NULL;
3219
PyObject *__pyx_v_A = NULL;
3220
PyObject *__pyx_v_G = NULL;
3221
PyObject *__pyx_v_Zp = NULL;
3222
PyObject *__pyx_v_pr = NULL;
3223
CYTHON_UNUSED PyObject *__pyx_v_e = NULL;
3224
PyObject *__pyx_v_alpha = NULL;
3225
int __pyx_v_n;
3226
PyObject *__pyx_v_K = NULL;
3227
PyObject *__pyx_v_u = NULL;
3228
PyObject *__pyx_v_K_mulmod = NULL;
3229
PyObject *__pyx_v_ppow = NULL;
3230
int __pyx_r;
3231
__Pyx_RefNannyDeclarations
3232
int __pyx_t_1;
3233
long __pyx_t_2;
3234
PyObject *__pyx_t_3 = NULL;
3235
PyObject *__pyx_t_4 = NULL;
3236
PyObject *__pyx_t_5 = NULL;
3237
PyObject *__pyx_t_6 = NULL;
3238
PyObject *__pyx_t_7 = NULL;
3239
PyObject *__pyx_t_8 = NULL;
3240
int __pyx_t_9;
3241
Py_ssize_t __pyx_t_10;
3242
PyObject *(*__pyx_t_11)(PyObject *);
3243
PyObject *(*__pyx_t_12)(PyObject *);
3244
long __pyx_t_13;
3245
__Pyx_RefNannySetupContext("__init__", 0);
3246
3247
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":135
3248
* faster than the left.
3249
* """
3250
* self.parallel = parallel # <<<<<<<<<<<<<<
3251
* self.E = E
3252
* self.p = p
3253
*/
3254
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_parallel); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 135, __pyx_L1_error)
3255
__pyx_v_self->parallel = __pyx_t_1;
3256
3257
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":136
3258
* """
3259
* self.parallel = parallel
3260
* self.E = E # <<<<<<<<<<<<<<
3261
* self.p = p
3262
*
3263
*/
3264
__Pyx_INCREF(__pyx_v_E);
3265
__Pyx_GIVEREF(__pyx_v_E);
3266
__Pyx_GOTREF(__pyx_v_self->E);
3267
__Pyx_DECREF(__pyx_v_self->E);
3268
__pyx_v_self->E = __pyx_v_E;
3269
3270
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":137
3271
* self.parallel = parallel
3272
* self.E = E
3273
* self.p = p # <<<<<<<<<<<<<<
3274
*
3275
* # prec = biggest n such that p^n <= 2^63, so n = floor(log_p(2^63))
3276
*/
3277
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_p); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 137, __pyx_L1_error)
3278
__pyx_v_self->p = __pyx_t_2;
3279
3280
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":140
3281
*
3282
* # prec = biggest n such that p^n <= 2^63, so n = floor(log_p(2^63))
3283
* self.prec = ZZ(2**63).exact_log(p) # <<<<<<<<<<<<<<
3284
*
3285
* assert Integer(p).is_pseudoprime(), "p (=%s) must be prime"%p
3286
*/
3287
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZZ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
3288
__Pyx_GOTREF(__pyx_t_4);
3289
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 140, __pyx_L1_error)
3290
__Pyx_GOTREF(__pyx_t_5);
3291
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3292
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_exact_log); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 140, __pyx_L1_error)
3293
__Pyx_GOTREF(__pyx_t_4);
3294
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3295
__pyx_t_5 = NULL;
3296
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3297
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3298
if (likely(__pyx_t_5)) {
3299
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3300
__Pyx_INCREF(__pyx_t_5);
3301
__Pyx_INCREF(function);
3302
__Pyx_DECREF_SET(__pyx_t_4, function);
3303
}
3304
}
3305
if (!__pyx_t_5) {
3306
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
3307
__Pyx_GOTREF(__pyx_t_3);
3308
} else {
3309
#if CYTHON_FAST_PYCALL
3310
if (PyFunction_Check(__pyx_t_4)) {
3311
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
3312
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
3313
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3314
__Pyx_GOTREF(__pyx_t_3);
3315
} else
3316
#endif
3317
#if CYTHON_FAST_PYCCALL
3318
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3319
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
3320
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
3321
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3322
__Pyx_GOTREF(__pyx_t_3);
3323
} else
3324
#endif
3325
{
3326
__pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 140, __pyx_L1_error)
3327
__Pyx_GOTREF(__pyx_t_6);
3328
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
3329
__Pyx_INCREF(__pyx_v_p);
3330
__Pyx_GIVEREF(__pyx_v_p);
3331
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_p);
3332
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 140, __pyx_L1_error)
3333
__Pyx_GOTREF(__pyx_t_3);
3334
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3335
}
3336
}
3337
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3338
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
3339
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3340
__pyx_v_self->prec = __pyx_t_2;
3341
3342
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":142
3343
* self.prec = ZZ(2**63).exact_log(p)
3344
*
3345
* assert Integer(p).is_pseudoprime(), "p (=%s) must be prime"%p # <<<<<<<<<<<<<<
3346
* assert E.is_ordinary(p), "p (=%s) must be ordinary for E"%p
3347
* assert E.is_good(p), "p (=%s) must be good for E"%p
3348
*/
3349
#ifndef CYTHON_WITHOUT_ASSERTIONS
3350
if (unlikely(!Py_OptimizeFlag)) {
3351
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3352
__Pyx_GOTREF(__pyx_t_4);
3353
__Pyx_INCREF(__pyx_v_p);
3354
__Pyx_GIVEREF(__pyx_v_p);
3355
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_p);
3356
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4sage_5rings_7integer_Integer), __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 142, __pyx_L1_error)
3357
__Pyx_GOTREF(__pyx_t_6);
3358
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3359
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_is_pseudoprime); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 142, __pyx_L1_error)
3360
__Pyx_GOTREF(__pyx_t_4);
3361
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3362
__pyx_t_6 = NULL;
3363
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3364
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
3365
if (likely(__pyx_t_6)) {
3366
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3367
__Pyx_INCREF(__pyx_t_6);
3368
__Pyx_INCREF(function);
3369
__Pyx_DECREF_SET(__pyx_t_4, function);
3370
}
3371
}
3372
if (__pyx_t_6) {
3373
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
3374
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3375
} else {
3376
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
3377
}
3378
__Pyx_GOTREF(__pyx_t_3);
3379
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3380
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 142, __pyx_L1_error)
3381
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3382
if (unlikely(!__pyx_t_1)) {
3383
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_p_s_must_be_prime, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 142, __pyx_L1_error)
3384
__Pyx_GOTREF(__pyx_t_3);
3385
PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
3386
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3387
__PYX_ERR(0, 142, __pyx_L1_error)
3388
}
3389
}
3390
#endif
3391
3392
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":143
3393
*
3394
* assert Integer(p).is_pseudoprime(), "p (=%s) must be prime"%p
3395
* assert E.is_ordinary(p), "p (=%s) must be ordinary for E"%p # <<<<<<<<<<<<<<
3396
* assert E.is_good(p), "p (=%s) must be good for E"%p
3397
*
3398
*/
3399
#ifndef CYTHON_WITHOUT_ASSERTIONS
3400
if (unlikely(!Py_OptimizeFlag)) {
3401
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_E, __pyx_n_s_is_ordinary); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 143, __pyx_L1_error)
3402
__Pyx_GOTREF(__pyx_t_4);
3403
__pyx_t_6 = NULL;
3404
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3405
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
3406
if (likely(__pyx_t_6)) {
3407
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3408
__Pyx_INCREF(__pyx_t_6);
3409
__Pyx_INCREF(function);
3410
__Pyx_DECREF_SET(__pyx_t_4, function);
3411
}
3412
}
3413
if (!__pyx_t_6) {
3414
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
3415
__Pyx_GOTREF(__pyx_t_3);
3416
} else {
3417
#if CYTHON_FAST_PYCALL
3418
if (PyFunction_Check(__pyx_t_4)) {
3419
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_p};
3420
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
3421
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3422
__Pyx_GOTREF(__pyx_t_3);
3423
} else
3424
#endif
3425
#if CYTHON_FAST_PYCCALL
3426
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3427
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_p};
3428
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
3429
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3430
__Pyx_GOTREF(__pyx_t_3);
3431
} else
3432
#endif
3433
{
3434
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 143, __pyx_L1_error)
3435
__Pyx_GOTREF(__pyx_t_5);
3436
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_6); __pyx_t_6 = NULL;
3437
__Pyx_INCREF(__pyx_v_p);
3438
__Pyx_GIVEREF(__pyx_v_p);
3439
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_v_p);
3440
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
3441
__Pyx_GOTREF(__pyx_t_3);
3442
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
3443
}
3444
}
3445
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3446
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 143, __pyx_L1_error)
3447
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3448
if (unlikely(!__pyx_t_1)) {
3449
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_p_s_must_be_ordinary_for_E, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 143, __pyx_L1_error)
3450
__Pyx_GOTREF(__pyx_t_3);
3451
PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
3452
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3453
__PYX_ERR(0, 143, __pyx_L1_error)
3454
}
3455
}
3456
#endif
3457
3458
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":144
3459
* assert Integer(p).is_pseudoprime(), "p (=%s) must be prime"%p
3460
* assert E.is_ordinary(p), "p (=%s) must be ordinary for E"%p
3461
* assert E.is_good(p), "p (=%s) must be good for E"%p # <<<<<<<<<<<<<<
3462
*
3463
* if algorithm == 'eclib':
3464
*/
3465
#ifndef CYTHON_WITHOUT_ASSERTIONS
3466
if (unlikely(!Py_OptimizeFlag)) {
3467
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_E, __pyx_n_s_is_good); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 144, __pyx_L1_error)
3468
__Pyx_GOTREF(__pyx_t_4);
3469
__pyx_t_5 = NULL;
3470
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3471
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3472
if (likely(__pyx_t_5)) {
3473
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3474
__Pyx_INCREF(__pyx_t_5);
3475
__Pyx_INCREF(function);
3476
__Pyx_DECREF_SET(__pyx_t_4, function);
3477
}
3478
}
3479
if (!__pyx_t_5) {
3480
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3481
__Pyx_GOTREF(__pyx_t_3);
3482
} else {
3483
#if CYTHON_FAST_PYCALL
3484
if (PyFunction_Check(__pyx_t_4)) {
3485
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
3486
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3487
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3488
__Pyx_GOTREF(__pyx_t_3);
3489
} else
3490
#endif
3491
#if CYTHON_FAST_PYCCALL
3492
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3493
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
3494
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3495
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3496
__Pyx_GOTREF(__pyx_t_3);
3497
} else
3498
#endif
3499
{
3500
__pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 144, __pyx_L1_error)
3501
__Pyx_GOTREF(__pyx_t_6);
3502
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
3503
__Pyx_INCREF(__pyx_v_p);
3504
__Pyx_GIVEREF(__pyx_v_p);
3505
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_p);
3506
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3507
__Pyx_GOTREF(__pyx_t_3);
3508
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3509
}
3510
}
3511
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3512
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 144, __pyx_L1_error)
3513
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3514
if (unlikely(!__pyx_t_1)) {
3515
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_p_s_must_be_good_for_E, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 144, __pyx_L1_error)
3516
__Pyx_GOTREF(__pyx_t_3);
3517
PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
3518
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3519
__PYX_ERR(0, 144, __pyx_L1_error)
3520
}
3521
}
3522
#endif
3523
3524
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":146
3525
* assert E.is_good(p), "p (=%s) must be good for E"%p
3526
*
3527
* if algorithm == 'eclib': # <<<<<<<<<<<<<<
3528
* f = E.modular_symbol(sign=1, use_eclib=True)
3529
* self.modsym = ModularSymbolMap(f)
3530
*/
3531
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_algorithm, __pyx_n_s_eclib, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 146, __pyx_L1_error)
3532
if (__pyx_t_1) {
3533
3534
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":147
3535
*
3536
* if algorithm == 'eclib':
3537
* f = E.modular_symbol(sign=1, use_eclib=True) # <<<<<<<<<<<<<<
3538
* self.modsym = ModularSymbolMap(f)
3539
* elif algorithm == 'sage':
3540
*/
3541
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_E, __pyx_n_s_modular_symbol); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 147, __pyx_L1_error)
3542
__Pyx_GOTREF(__pyx_t_3);
3543
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 147, __pyx_L1_error)
3544
__Pyx_GOTREF(__pyx_t_4);
3545
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_sign, __pyx_int_1) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
3546
if (PyDict_SetItem(__pyx_t_4, __pyx_n_s_use_eclib, Py_True) < 0) __PYX_ERR(0, 147, __pyx_L1_error)
3547
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_empty_tuple, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 147, __pyx_L1_error)
3548
__Pyx_GOTREF(__pyx_t_6);
3549
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3550
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3551
__pyx_v_f = __pyx_t_6;
3552
__pyx_t_6 = 0;
3553
3554
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":148
3555
* if algorithm == 'eclib':
3556
* f = E.modular_symbol(sign=1, use_eclib=True)
3557
* self.modsym = ModularSymbolMap(f) # <<<<<<<<<<<<<<
3558
* elif algorithm == 'sage':
3559
* f = E.modular_symbol(sign=1, use_eclib=False)
3560
*/
3561
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 148, __pyx_L1_error)
3562
__Pyx_GOTREF(__pyx_t_6);
3563
__Pyx_INCREF(__pyx_v_f);
3564
__Pyx_GIVEREF(__pyx_v_f);
3565
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_f);
3566
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap), __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 148, __pyx_L1_error)
3567
__Pyx_GOTREF(__pyx_t_4);
3568
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3569
__Pyx_GIVEREF(__pyx_t_4);
3570
__Pyx_GOTREF(__pyx_v_self->modsym);
3571
__Pyx_DECREF(((PyObject *)__pyx_v_self->modsym));
3572
__pyx_v_self->modsym = ((struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)__pyx_t_4);
3573
__pyx_t_4 = 0;
3574
3575
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":146
3576
* assert E.is_good(p), "p (=%s) must be good for E"%p
3577
*
3578
* if algorithm == 'eclib': # <<<<<<<<<<<<<<
3579
* f = E.modular_symbol(sign=1, use_eclib=True)
3580
* self.modsym = ModularSymbolMap(f)
3581
*/
3582
goto __pyx_L3;
3583
}
3584
3585
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":149
3586
* f = E.modular_symbol(sign=1, use_eclib=True)
3587
* self.modsym = ModularSymbolMap(f)
3588
* elif algorithm == 'sage': # <<<<<<<<<<<<<<
3589
* f = E.modular_symbol(sign=1, use_eclib=False)
3590
* self.modsym = ModularSymbolMap(f)
3591
*/
3592
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_algorithm, __pyx_n_s_sage, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 149, __pyx_L1_error)
3593
if (__pyx_t_1) {
3594
3595
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":150
3596
* self.modsym = ModularSymbolMap(f)
3597
* elif algorithm == 'sage':
3598
* f = E.modular_symbol(sign=1, use_eclib=False) # <<<<<<<<<<<<<<
3599
* self.modsym = ModularSymbolMap(f)
3600
* elif algorithm == "modsym":
3601
*/
3602
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_E, __pyx_n_s_modular_symbol); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
3603
__Pyx_GOTREF(__pyx_t_4);
3604
__pyx_t_6 = PyDict_New(); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
3605
__Pyx_GOTREF(__pyx_t_6);
3606
if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_sign, __pyx_int_1) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
3607
if (PyDict_SetItem(__pyx_t_6, __pyx_n_s_use_eclib, Py_False) < 0) __PYX_ERR(0, 150, __pyx_L1_error)
3608
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_empty_tuple, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
3609
__Pyx_GOTREF(__pyx_t_3);
3610
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3611
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3612
__pyx_v_f = __pyx_t_3;
3613
__pyx_t_3 = 0;
3614
3615
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":151
3616
* elif algorithm == 'sage':
3617
* f = E.modular_symbol(sign=1, use_eclib=False)
3618
* self.modsym = ModularSymbolMap(f) # <<<<<<<<<<<<<<
3619
* elif algorithm == "modsym":
3620
* A = E.modular_symbol_space(sign=1)
3621
*/
3622
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
3623
__Pyx_GOTREF(__pyx_t_3);
3624
__Pyx_INCREF(__pyx_v_f);
3625
__Pyx_GIVEREF(__pyx_v_f);
3626
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_f);
3627
__pyx_t_6 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap), __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 151, __pyx_L1_error)
3628
__Pyx_GOTREF(__pyx_t_6);
3629
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3630
__Pyx_GIVEREF(__pyx_t_6);
3631
__Pyx_GOTREF(__pyx_v_self->modsym);
3632
__Pyx_DECREF(((PyObject *)__pyx_v_self->modsym));
3633
__pyx_v_self->modsym = ((struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)__pyx_t_6);
3634
__pyx_t_6 = 0;
3635
3636
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":149
3637
* f = E.modular_symbol(sign=1, use_eclib=True)
3638
* self.modsym = ModularSymbolMap(f)
3639
* elif algorithm == 'sage': # <<<<<<<<<<<<<<
3640
* f = E.modular_symbol(sign=1, use_eclib=False)
3641
* self.modsym = ModularSymbolMap(f)
3642
*/
3643
goto __pyx_L3;
3644
}
3645
3646
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":152
3647
* f = E.modular_symbol(sign=1, use_eclib=False)
3648
* self.modsym = ModularSymbolMap(f)
3649
* elif algorithm == "modsym": # <<<<<<<<<<<<<<
3650
* A = E.modular_symbol_space(sign=1)
3651
* self.modsym = ModularSymbolMap(A)
3652
*/
3653
__pyx_t_1 = (__Pyx_PyString_Equals(__pyx_v_algorithm, __pyx_n_s_modsym, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 152, __pyx_L1_error)
3654
if (__pyx_t_1) {
3655
3656
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":153
3657
* self.modsym = ModularSymbolMap(f)
3658
* elif algorithm == "modsym":
3659
* A = E.modular_symbol_space(sign=1) # <<<<<<<<<<<<<<
3660
* self.modsym = ModularSymbolMap(A)
3661
* else:
3662
*/
3663
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_E, __pyx_n_s_modular_symbol_space); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 153, __pyx_L1_error)
3664
__Pyx_GOTREF(__pyx_t_6);
3665
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
3666
__Pyx_GOTREF(__pyx_t_3);
3667
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_sign, __pyx_int_1) < 0) __PYX_ERR(0, 153, __pyx_L1_error)
3668
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 153, __pyx_L1_error)
3669
__Pyx_GOTREF(__pyx_t_4);
3670
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3671
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3672
__pyx_v_A = __pyx_t_4;
3673
__pyx_t_4 = 0;
3674
3675
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":154
3676
* elif algorithm == "modsym":
3677
* A = E.modular_symbol_space(sign=1)
3678
* self.modsym = ModularSymbolMap(A) # <<<<<<<<<<<<<<
3679
* else:
3680
* raise ValueError, "unknown algorithm '%s'"%algorithm
3681
*/
3682
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 154, __pyx_L1_error)
3683
__Pyx_GOTREF(__pyx_t_4);
3684
__Pyx_INCREF(__pyx_v_A);
3685
__Pyx_GIVEREF(__pyx_v_A);
3686
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_A);
3687
__pyx_t_3 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap), __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
3688
__Pyx_GOTREF(__pyx_t_3);
3689
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3690
__Pyx_GIVEREF(__pyx_t_3);
3691
__Pyx_GOTREF(__pyx_v_self->modsym);
3692
__Pyx_DECREF(((PyObject *)__pyx_v_self->modsym));
3693
__pyx_v_self->modsym = ((struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)__pyx_t_3);
3694
__pyx_t_3 = 0;
3695
3696
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":152
3697
* f = E.modular_symbol(sign=1, use_eclib=False)
3698
* self.modsym = ModularSymbolMap(f)
3699
* elif algorithm == "modsym": # <<<<<<<<<<<<<<
3700
* A = E.modular_symbol_space(sign=1)
3701
* self.modsym = ModularSymbolMap(A)
3702
*/
3703
goto __pyx_L3;
3704
}
3705
3706
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":156
3707
* self.modsym = ModularSymbolMap(A)
3708
* else:
3709
* raise ValueError, "unknown algorithm '%s'"%algorithm # <<<<<<<<<<<<<<
3710
*
3711
* # the denom must be a unit, given our hypotheses (and assumptions in code!)
3712
*/
3713
/*else*/ {
3714
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_unknown_algorithm_s, __pyx_v_algorithm); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
3715
__Pyx_GOTREF(__pyx_t_3);
3716
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_t_3, 0, 0);
3717
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3718
__PYX_ERR(0, 156, __pyx_L1_error)
3719
}
3720
__pyx_L3:;
3721
3722
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":159
3723
*
3724
* # the denom must be a unit, given our hypotheses (and assumptions in code!)
3725
* assert ZZ(self.modsym.denom)%self.p != 0, "internal modsym denominator must be a p(=%s)-unit, but it is %s"%(self.p, self.modsym.denom) # <<<<<<<<<<<<<<
3726
*
3727
* # Compute alpha:
3728
*/
3729
#ifndef CYTHON_WITHOUT_ASSERTIONS
3730
if (unlikely(!Py_OptimizeFlag)) {
3731
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZZ); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3732
__Pyx_GOTREF(__pyx_t_4);
3733
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->modsym->denom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 159, __pyx_L1_error)
3734
__Pyx_GOTREF(__pyx_t_6);
3735
__pyx_t_5 = NULL;
3736
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3737
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
3738
if (likely(__pyx_t_5)) {
3739
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3740
__Pyx_INCREF(__pyx_t_5);
3741
__Pyx_INCREF(function);
3742
__Pyx_DECREF_SET(__pyx_t_4, function);
3743
}
3744
}
3745
if (!__pyx_t_5) {
3746
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
3747
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3748
__Pyx_GOTREF(__pyx_t_3);
3749
} else {
3750
#if CYTHON_FAST_PYCALL
3751
if (PyFunction_Check(__pyx_t_4)) {
3752
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
3753
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
3754
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3755
__Pyx_GOTREF(__pyx_t_3);
3756
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3757
} else
3758
#endif
3759
#if CYTHON_FAST_PYCCALL
3760
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3761
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
3762
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
3763
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3764
__Pyx_GOTREF(__pyx_t_3);
3765
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3766
} else
3767
#endif
3768
{
3769
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
3770
__Pyx_GOTREF(__pyx_t_7);
3771
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
3772
__Pyx_GIVEREF(__pyx_t_6);
3773
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
3774
__pyx_t_6 = 0;
3775
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
3776
__Pyx_GOTREF(__pyx_t_3);
3777
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3778
}
3779
}
3780
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3781
__pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3782
__Pyx_GOTREF(__pyx_t_4);
3783
__pyx_t_7 = PyNumber_Remainder(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
3784
__Pyx_GOTREF(__pyx_t_7);
3785
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3786
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3787
__pyx_t_4 = PyObject_RichCompare(__pyx_t_7, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3788
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3789
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
3790
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3791
if (unlikely(!__pyx_t_1)) {
3792
__pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 159, __pyx_L1_error)
3793
__Pyx_GOTREF(__pyx_t_4);
3794
__pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_self->modsym->denom); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
3795
__Pyx_GOTREF(__pyx_t_7);
3796
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
3797
__Pyx_GOTREF(__pyx_t_3);
3798
__Pyx_GIVEREF(__pyx_t_4);
3799
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_4);
3800
__Pyx_GIVEREF(__pyx_t_7);
3801
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_7);
3802
__pyx_t_4 = 0;
3803
__pyx_t_7 = 0;
3804
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_internal_modsym_denominator_must, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 159, __pyx_L1_error)
3805
__Pyx_GOTREF(__pyx_t_7);
3806
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3807
PyErr_SetObject(PyExc_AssertionError, __pyx_t_7);
3808
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
3809
__PYX_ERR(0, 159, __pyx_L1_error)
3810
}
3811
}
3812
#endif
3813
3814
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":162
3815
*
3816
* # Compute alpha:
3817
* f = ZZ['x']([p, -E.ap(p), 1]) # <<<<<<<<<<<<<<
3818
* G = f.factor_padic(p, self.prec)
3819
* Zp = None
3820
*/
3821
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZZ); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3822
__Pyx_GOTREF(__pyx_t_3);
3823
__pyx_t_4 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_x); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 162, __pyx_L1_error)
3824
__Pyx_GOTREF(__pyx_t_4);
3825
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3826
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_E, __pyx_n_s_ap); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
3827
__Pyx_GOTREF(__pyx_t_6);
3828
__pyx_t_5 = NULL;
3829
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
3830
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
3831
if (likely(__pyx_t_5)) {
3832
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
3833
__Pyx_INCREF(__pyx_t_5);
3834
__Pyx_INCREF(function);
3835
__Pyx_DECREF_SET(__pyx_t_6, function);
3836
}
3837
}
3838
if (!__pyx_t_5) {
3839
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3840
__Pyx_GOTREF(__pyx_t_3);
3841
} else {
3842
#if CYTHON_FAST_PYCALL
3843
if (PyFunction_Check(__pyx_t_6)) {
3844
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
3845
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3846
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3847
__Pyx_GOTREF(__pyx_t_3);
3848
} else
3849
#endif
3850
#if CYTHON_FAST_PYCCALL
3851
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
3852
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
3853
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3854
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
3855
__Pyx_GOTREF(__pyx_t_3);
3856
} else
3857
#endif
3858
{
3859
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 162, __pyx_L1_error)
3860
__Pyx_GOTREF(__pyx_t_8);
3861
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
3862
__Pyx_INCREF(__pyx_v_p);
3863
__Pyx_GIVEREF(__pyx_v_p);
3864
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_v_p);
3865
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3866
__Pyx_GOTREF(__pyx_t_3);
3867
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3868
}
3869
}
3870
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3871
__pyx_t_6 = PyNumber_Negative(__pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 162, __pyx_L1_error)
3872
__Pyx_GOTREF(__pyx_t_6);
3873
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3874
__pyx_t_3 = PyList_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 162, __pyx_L1_error)
3875
__Pyx_GOTREF(__pyx_t_3);
3876
__Pyx_INCREF(__pyx_v_p);
3877
__Pyx_GIVEREF(__pyx_v_p);
3878
PyList_SET_ITEM(__pyx_t_3, 0, __pyx_v_p);
3879
__Pyx_GIVEREF(__pyx_t_6);
3880
PyList_SET_ITEM(__pyx_t_3, 1, __pyx_t_6);
3881
__Pyx_INCREF(__pyx_int_1);
3882
__Pyx_GIVEREF(__pyx_int_1);
3883
PyList_SET_ITEM(__pyx_t_3, 2, __pyx_int_1);
3884
__pyx_t_6 = 0;
3885
__pyx_t_6 = NULL;
3886
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
3887
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
3888
if (likely(__pyx_t_6)) {
3889
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3890
__Pyx_INCREF(__pyx_t_6);
3891
__Pyx_INCREF(function);
3892
__Pyx_DECREF_SET(__pyx_t_4, function);
3893
}
3894
}
3895
if (!__pyx_t_6) {
3896
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 162, __pyx_L1_error)
3897
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3898
__Pyx_GOTREF(__pyx_t_7);
3899
} else {
3900
#if CYTHON_FAST_PYCALL
3901
if (PyFunction_Check(__pyx_t_4)) {
3902
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
3903
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 162, __pyx_L1_error)
3904
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3905
__Pyx_GOTREF(__pyx_t_7);
3906
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3907
} else
3908
#endif
3909
#if CYTHON_FAST_PYCCALL
3910
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3911
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_3};
3912
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 162, __pyx_L1_error)
3913
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
3914
__Pyx_GOTREF(__pyx_t_7);
3915
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3916
} else
3917
#endif
3918
{
3919
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 162, __pyx_L1_error)
3920
__Pyx_GOTREF(__pyx_t_8);
3921
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
3922
__Pyx_GIVEREF(__pyx_t_3);
3923
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_3);
3924
__pyx_t_3 = 0;
3925
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 162, __pyx_L1_error)
3926
__Pyx_GOTREF(__pyx_t_7);
3927
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3928
}
3929
}
3930
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3931
__Pyx_XDECREF_SET(__pyx_v_f, __pyx_t_7);
3932
__pyx_t_7 = 0;
3933
3934
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":163
3935
* # Compute alpha:
3936
* f = ZZ['x']([p, -E.ap(p), 1])
3937
* G = f.factor_padic(p, self.prec) # <<<<<<<<<<<<<<
3938
* Zp = None
3939
* for pr, e in G:
3940
*/
3941
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_factor_padic); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 163, __pyx_L1_error)
3942
__Pyx_GOTREF(__pyx_t_4);
3943
__pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_self->prec); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 163, __pyx_L1_error)
3944
__Pyx_GOTREF(__pyx_t_8);
3945
__pyx_t_3 = NULL;
3946
__pyx_t_9 = 0;
3947
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
3948
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
3949
if (likely(__pyx_t_3)) {
3950
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
3951
__Pyx_INCREF(__pyx_t_3);
3952
__Pyx_INCREF(function);
3953
__Pyx_DECREF_SET(__pyx_t_4, function);
3954
__pyx_t_9 = 1;
3955
}
3956
}
3957
#if CYTHON_FAST_PYCALL
3958
if (PyFunction_Check(__pyx_t_4)) {
3959
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_p, __pyx_t_8};
3960
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
3961
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3962
__Pyx_GOTREF(__pyx_t_7);
3963
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3964
} else
3965
#endif
3966
#if CYTHON_FAST_PYCCALL
3967
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
3968
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_p, __pyx_t_8};
3969
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
3970
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
3971
__Pyx_GOTREF(__pyx_t_7);
3972
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
3973
} else
3974
#endif
3975
{
3976
__pyx_t_6 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 163, __pyx_L1_error)
3977
__Pyx_GOTREF(__pyx_t_6);
3978
if (__pyx_t_3) {
3979
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_3); __pyx_t_3 = NULL;
3980
}
3981
__Pyx_INCREF(__pyx_v_p);
3982
__Pyx_GIVEREF(__pyx_v_p);
3983
PyTuple_SET_ITEM(__pyx_t_6, 0+__pyx_t_9, __pyx_v_p);
3984
__Pyx_GIVEREF(__pyx_t_8);
3985
PyTuple_SET_ITEM(__pyx_t_6, 1+__pyx_t_9, __pyx_t_8);
3986
__pyx_t_8 = 0;
3987
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 163, __pyx_L1_error)
3988
__Pyx_GOTREF(__pyx_t_7);
3989
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
3990
}
3991
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3992
__pyx_v_G = __pyx_t_7;
3993
__pyx_t_7 = 0;
3994
3995
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":164
3996
* f = ZZ['x']([p, -E.ap(p), 1])
3997
* G = f.factor_padic(p, self.prec)
3998
* Zp = None # <<<<<<<<<<<<<<
3999
* for pr, e in G:
4000
* alpha = -pr[0]
4001
*/
4002
__Pyx_INCREF(Py_None);
4003
__pyx_v_Zp = Py_None;
4004
4005
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":165
4006
* G = f.factor_padic(p, self.prec)
4007
* Zp = None
4008
* for pr, e in G: # <<<<<<<<<<<<<<
4009
* alpha = -pr[0]
4010
* if alpha.valuation() < 1:
4011
*/
4012
if (likely(PyList_CheckExact(__pyx_v_G)) || PyTuple_CheckExact(__pyx_v_G)) {
4013
__pyx_t_7 = __pyx_v_G; __Pyx_INCREF(__pyx_t_7); __pyx_t_10 = 0;
4014
__pyx_t_11 = NULL;
4015
} else {
4016
__pyx_t_10 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_G); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 165, __pyx_L1_error)
4017
__Pyx_GOTREF(__pyx_t_7);
4018
__pyx_t_11 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 165, __pyx_L1_error)
4019
}
4020
for (;;) {
4021
if (likely(!__pyx_t_11)) {
4022
if (likely(PyList_CheckExact(__pyx_t_7))) {
4023
if (__pyx_t_10 >= PyList_GET_SIZE(__pyx_t_7)) break;
4024
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4025
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
4026
#else
4027
__pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
4028
__Pyx_GOTREF(__pyx_t_4);
4029
#endif
4030
} else {
4031
if (__pyx_t_10 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
4032
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4033
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_10); __Pyx_INCREF(__pyx_t_4); __pyx_t_10++; if (unlikely(0 < 0)) __PYX_ERR(0, 165, __pyx_L1_error)
4034
#else
4035
__pyx_t_4 = PySequence_ITEM(__pyx_t_7, __pyx_t_10); __pyx_t_10++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 165, __pyx_L1_error)
4036
__Pyx_GOTREF(__pyx_t_4);
4037
#endif
4038
}
4039
} else {
4040
__pyx_t_4 = __pyx_t_11(__pyx_t_7);
4041
if (unlikely(!__pyx_t_4)) {
4042
PyObject* exc_type = PyErr_Occurred();
4043
if (exc_type) {
4044
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
4045
else __PYX_ERR(0, 165, __pyx_L1_error)
4046
}
4047
break;
4048
}
4049
__Pyx_GOTREF(__pyx_t_4);
4050
}
4051
if ((likely(PyTuple_CheckExact(__pyx_t_4))) || (PyList_CheckExact(__pyx_t_4))) {
4052
PyObject* sequence = __pyx_t_4;
4053
#if !CYTHON_COMPILING_IN_PYPY
4054
Py_ssize_t size = Py_SIZE(sequence);
4055
#else
4056
Py_ssize_t size = PySequence_Size(sequence);
4057
#endif
4058
if (unlikely(size != 2)) {
4059
if (size > 2) __Pyx_RaiseTooManyValuesError(2);
4060
else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
4061
__PYX_ERR(0, 165, __pyx_L1_error)
4062
}
4063
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
4064
if (likely(PyTuple_CheckExact(sequence))) {
4065
__pyx_t_6 = PyTuple_GET_ITEM(sequence, 0);
4066
__pyx_t_8 = PyTuple_GET_ITEM(sequence, 1);
4067
} else {
4068
__pyx_t_6 = PyList_GET_ITEM(sequence, 0);
4069
__pyx_t_8 = PyList_GET_ITEM(sequence, 1);
4070
}
4071
__Pyx_INCREF(__pyx_t_6);
4072
__Pyx_INCREF(__pyx_t_8);
4073
#else
4074
__pyx_t_6 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 165, __pyx_L1_error)
4075
__Pyx_GOTREF(__pyx_t_6);
4076
__pyx_t_8 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 165, __pyx_L1_error)
4077
__Pyx_GOTREF(__pyx_t_8);
4078
#endif
4079
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4080
} else {
4081
Py_ssize_t index = -1;
4082
__pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 165, __pyx_L1_error)
4083
__Pyx_GOTREF(__pyx_t_3);
4084
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4085
__pyx_t_12 = Py_TYPE(__pyx_t_3)->tp_iternext;
4086
index = 0; __pyx_t_6 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_6)) goto __pyx_L6_unpacking_failed;
4087
__Pyx_GOTREF(__pyx_t_6);
4088
index = 1; __pyx_t_8 = __pyx_t_12(__pyx_t_3); if (unlikely(!__pyx_t_8)) goto __pyx_L6_unpacking_failed;
4089
__Pyx_GOTREF(__pyx_t_8);
4090
if (__Pyx_IternextUnpackEndCheck(__pyx_t_12(__pyx_t_3), 2) < 0) __PYX_ERR(0, 165, __pyx_L1_error)
4091
__pyx_t_12 = NULL;
4092
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4093
goto __pyx_L7_unpacking_done;
4094
__pyx_L6_unpacking_failed:;
4095
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4096
__pyx_t_12 = NULL;
4097
if (__Pyx_IterFinish() == 0) __Pyx_RaiseNeedMoreValuesError(index);
4098
__PYX_ERR(0, 165, __pyx_L1_error)
4099
__pyx_L7_unpacking_done:;
4100
}
4101
__Pyx_XDECREF_SET(__pyx_v_pr, __pyx_t_6);
4102
__pyx_t_6 = 0;
4103
__Pyx_XDECREF_SET(__pyx_v_e, __pyx_t_8);
4104
__pyx_t_8 = 0;
4105
4106
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":166
4107
* Zp = None
4108
* for pr, e in G:
4109
* alpha = -pr[0] # <<<<<<<<<<<<<<
4110
* if alpha.valuation() < 1:
4111
* Zp = alpha.parent()
4112
*/
4113
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_pr, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 166, __pyx_L1_error)
4114
__Pyx_GOTREF(__pyx_t_4);
4115
__pyx_t_8 = PyNumber_Negative(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 166, __pyx_L1_error)
4116
__Pyx_GOTREF(__pyx_t_8);
4117
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4118
__Pyx_XDECREF_SET(__pyx_v_alpha, __pyx_t_8);
4119
__pyx_t_8 = 0;
4120
4121
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":167
4122
* for pr, e in G:
4123
* alpha = -pr[0]
4124
* if alpha.valuation() < 1: # <<<<<<<<<<<<<<
4125
* Zp = alpha.parent()
4126
* self._alpha = alpha.lift()
4127
*/
4128
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_alpha, __pyx_n_s_valuation); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
4129
__Pyx_GOTREF(__pyx_t_4);
4130
__pyx_t_6 = NULL;
4131
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4132
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
4133
if (likely(__pyx_t_6)) {
4134
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4135
__Pyx_INCREF(__pyx_t_6);
4136
__Pyx_INCREF(function);
4137
__Pyx_DECREF_SET(__pyx_t_4, function);
4138
}
4139
}
4140
if (__pyx_t_6) {
4141
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error)
4142
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4143
} else {
4144
__pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 167, __pyx_L1_error)
4145
}
4146
__Pyx_GOTREF(__pyx_t_8);
4147
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4148
__pyx_t_4 = PyObject_RichCompare(__pyx_t_8, __pyx_int_1, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 167, __pyx_L1_error)
4149
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4150
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 167, __pyx_L1_error)
4151
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4152
if (__pyx_t_1) {
4153
4154
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":168
4155
* alpha = -pr[0]
4156
* if alpha.valuation() < 1:
4157
* Zp = alpha.parent() # <<<<<<<<<<<<<<
4158
* self._alpha = alpha.lift()
4159
* break
4160
*/
4161
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_alpha, __pyx_n_s_parent); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 168, __pyx_L1_error)
4162
__Pyx_GOTREF(__pyx_t_8);
4163
__pyx_t_6 = NULL;
4164
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
4165
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
4166
if (likely(__pyx_t_6)) {
4167
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4168
__Pyx_INCREF(__pyx_t_6);
4169
__Pyx_INCREF(function);
4170
__Pyx_DECREF_SET(__pyx_t_8, function);
4171
}
4172
}
4173
if (__pyx_t_6) {
4174
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
4175
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4176
} else {
4177
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 168, __pyx_L1_error)
4178
}
4179
__Pyx_GOTREF(__pyx_t_4);
4180
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4181
__Pyx_DECREF_SET(__pyx_v_Zp, __pyx_t_4);
4182
__pyx_t_4 = 0;
4183
4184
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":169
4185
* if alpha.valuation() < 1:
4186
* Zp = alpha.parent()
4187
* self._alpha = alpha.lift() # <<<<<<<<<<<<<<
4188
* break
4189
* assert Zp is not None, "bug -- must have unit root (p=%s)"%p
4190
*/
4191
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_v_alpha, __pyx_n_s_lift); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 169, __pyx_L1_error)
4192
__Pyx_GOTREF(__pyx_t_8);
4193
__pyx_t_6 = NULL;
4194
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
4195
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_8);
4196
if (likely(__pyx_t_6)) {
4197
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
4198
__Pyx_INCREF(__pyx_t_6);
4199
__Pyx_INCREF(function);
4200
__Pyx_DECREF_SET(__pyx_t_8, function);
4201
}
4202
}
4203
if (__pyx_t_6) {
4204
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
4205
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4206
} else {
4207
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_8); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 169, __pyx_L1_error)
4208
}
4209
__Pyx_GOTREF(__pyx_t_4);
4210
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4211
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_4); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error)
4212
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4213
__pyx_v_self->_alpha = __pyx_t_2;
4214
4215
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":170
4216
* Zp = alpha.parent()
4217
* self._alpha = alpha.lift()
4218
* break # <<<<<<<<<<<<<<
4219
* assert Zp is not None, "bug -- must have unit root (p=%s)"%p
4220
*
4221
*/
4222
goto __pyx_L5_break;
4223
4224
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":167
4225
* for pr, e in G:
4226
* alpha = -pr[0]
4227
* if alpha.valuation() < 1: # <<<<<<<<<<<<<<
4228
* Zp = alpha.parent()
4229
* self._alpha = alpha.lift()
4230
*/
4231
}
4232
4233
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":165
4234
* G = f.factor_padic(p, self.prec)
4235
* Zp = None
4236
* for pr, e in G: # <<<<<<<<<<<<<<
4237
* alpha = -pr[0]
4238
* if alpha.valuation() < 1:
4239
*/
4240
}
4241
__pyx_L5_break:;
4242
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4243
4244
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":171
4245
* self._alpha = alpha.lift()
4246
* break
4247
* assert Zp is not None, "bug -- must have unit root (p=%s)"%p # <<<<<<<<<<<<<<
4248
*
4249
* cdef int n
4250
*/
4251
#ifndef CYTHON_WITHOUT_ASSERTIONS
4252
if (unlikely(!Py_OptimizeFlag)) {
4253
__pyx_t_1 = (__pyx_v_Zp != Py_None);
4254
if (unlikely(!(__pyx_t_1 != 0))) {
4255
__pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_bug_must_have_unit_root_p_s, __pyx_v_p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 171, __pyx_L1_error)
4256
__Pyx_GOTREF(__pyx_t_7);
4257
PyErr_SetObject(PyExc_AssertionError, __pyx_t_7);
4258
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4259
__PYX_ERR(0, 171, __pyx_L1_error)
4260
}
4261
}
4262
#endif
4263
4264
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":174
4265
*
4266
* cdef int n
4267
* K = Qp(self.p, self.prec//2) # <<<<<<<<<<<<<<
4268
* # Compute array of powers of inverse of alpha, modulo p^prec
4269
* # for each power up to prec. This is only used for the
4270
*/
4271
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Qp); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 174, __pyx_L1_error)
4272
__Pyx_GOTREF(__pyx_t_4);
4273
__pyx_t_8 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 174, __pyx_L1_error)
4274
__Pyx_GOTREF(__pyx_t_8);
4275
__pyx_t_6 = __Pyx_PyInt_From_long(__Pyx_div_long(__pyx_v_self->prec, 2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 174, __pyx_L1_error)
4276
__Pyx_GOTREF(__pyx_t_6);
4277
__pyx_t_3 = NULL;
4278
__pyx_t_9 = 0;
4279
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
4280
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
4281
if (likely(__pyx_t_3)) {
4282
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4283
__Pyx_INCREF(__pyx_t_3);
4284
__Pyx_INCREF(function);
4285
__Pyx_DECREF_SET(__pyx_t_4, function);
4286
__pyx_t_9 = 1;
4287
}
4288
}
4289
#if CYTHON_FAST_PYCALL
4290
if (PyFunction_Check(__pyx_t_4)) {
4291
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_8, __pyx_t_6};
4292
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
4293
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4294
__Pyx_GOTREF(__pyx_t_7);
4295
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4296
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4297
} else
4298
#endif
4299
#if CYTHON_FAST_PYCCALL
4300
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
4301
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_t_8, __pyx_t_6};
4302
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
4303
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
4304
__Pyx_GOTREF(__pyx_t_7);
4305
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4306
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4307
} else
4308
#endif
4309
{
4310
__pyx_t_5 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 174, __pyx_L1_error)
4311
__Pyx_GOTREF(__pyx_t_5);
4312
if (__pyx_t_3) {
4313
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
4314
}
4315
__Pyx_GIVEREF(__pyx_t_8);
4316
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_9, __pyx_t_8);
4317
__Pyx_GIVEREF(__pyx_t_6);
4318
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_9, __pyx_t_6);
4319
__pyx_t_8 = 0;
4320
__pyx_t_6 = 0;
4321
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 174, __pyx_L1_error)
4322
__Pyx_GOTREF(__pyx_t_7);
4323
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4324
}
4325
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4326
__pyx_v_K = __pyx_t_7;
4327
__pyx_t_7 = 0;
4328
4329
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":178
4330
* # for each power up to prec. This is only used for the
4331
* # non-mulmod version.
4332
* u = 1 # <<<<<<<<<<<<<<
4333
* self.alpha_inv[0] = u
4334
* for n in range(self.prec):
4335
*/
4336
__Pyx_INCREF(__pyx_int_1);
4337
__pyx_v_u = __pyx_int_1;
4338
4339
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":179
4340
* # non-mulmod version.
4341
* u = 1
4342
* self.alpha_inv[0] = u # <<<<<<<<<<<<<<
4343
* for n in range(self.prec):
4344
* u *= alpha
4345
*/
4346
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_u); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
4347
(__pyx_v_self->alpha_inv[0]) = __pyx_t_2;
4348
4349
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":180
4350
* u = 1
4351
* self.alpha_inv[0] = u
4352
* for n in range(self.prec): # <<<<<<<<<<<<<<
4353
* u *= alpha
4354
* self.alpha_inv[n+1] = K(1/u).lift() # coerce to K to lower precision
4355
*/
4356
__pyx_t_2 = __pyx_v_self->prec;
4357
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) {
4358
__pyx_v_n = __pyx_t_9;
4359
4360
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":181
4361
* self.alpha_inv[0] = u
4362
* for n in range(self.prec):
4363
* u *= alpha # <<<<<<<<<<<<<<
4364
* self.alpha_inv[n+1] = K(1/u).lift() # coerce to K to lower precision
4365
*
4366
*/
4367
if (unlikely(!__pyx_v_alpha)) { __Pyx_RaiseUnboundLocalError("alpha"); __PYX_ERR(0, 181, __pyx_L1_error) }
4368
__pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_u, __pyx_v_alpha); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 181, __pyx_L1_error)
4369
__Pyx_GOTREF(__pyx_t_7);
4370
__Pyx_DECREF_SET(__pyx_v_u, __pyx_t_7);
4371
__pyx_t_7 = 0;
4372
4373
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":182
4374
* for n in range(self.prec):
4375
* u *= alpha
4376
* self.alpha_inv[n+1] = K(1/u).lift() # coerce to K to lower precision # <<<<<<<<<<<<<<
4377
*
4378
* # Now do the same, but modulo p^(prec). This is used for the
4379
*/
4380
__pyx_t_5 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_v_u); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 182, __pyx_L1_error)
4381
__Pyx_GOTREF(__pyx_t_5);
4382
__Pyx_INCREF(__pyx_v_K);
4383
__pyx_t_6 = __pyx_v_K; __pyx_t_8 = NULL;
4384
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
4385
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
4386
if (likely(__pyx_t_8)) {
4387
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4388
__Pyx_INCREF(__pyx_t_8);
4389
__Pyx_INCREF(function);
4390
__Pyx_DECREF_SET(__pyx_t_6, function);
4391
}
4392
}
4393
if (!__pyx_t_8) {
4394
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
4395
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4396
__Pyx_GOTREF(__pyx_t_4);
4397
} else {
4398
#if CYTHON_FAST_PYCALL
4399
if (PyFunction_Check(__pyx_t_6)) {
4400
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
4401
__pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
4402
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4403
__Pyx_GOTREF(__pyx_t_4);
4404
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4405
} else
4406
#endif
4407
#if CYTHON_FAST_PYCCALL
4408
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
4409
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
4410
__pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
4411
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4412
__Pyx_GOTREF(__pyx_t_4);
4413
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4414
} else
4415
#endif
4416
{
4417
__pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 182, __pyx_L1_error)
4418
__Pyx_GOTREF(__pyx_t_3);
4419
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_8); __pyx_t_8 = NULL;
4420
__Pyx_GIVEREF(__pyx_t_5);
4421
PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_t_5);
4422
__pyx_t_5 = 0;
4423
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 182, __pyx_L1_error)
4424
__Pyx_GOTREF(__pyx_t_4);
4425
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4426
}
4427
}
4428
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4429
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_lift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 182, __pyx_L1_error)
4430
__Pyx_GOTREF(__pyx_t_6);
4431
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4432
__pyx_t_4 = NULL;
4433
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
4434
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
4435
if (likely(__pyx_t_4)) {
4436
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4437
__Pyx_INCREF(__pyx_t_4);
4438
__Pyx_INCREF(function);
4439
__Pyx_DECREF_SET(__pyx_t_6, function);
4440
}
4441
}
4442
if (__pyx_t_4) {
4443
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error)
4444
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4445
} else {
4446
__pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 182, __pyx_L1_error)
4447
}
4448
__Pyx_GOTREF(__pyx_t_7);
4449
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4450
__pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_7); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
4451
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4452
(__pyx_v_self->alpha_inv[(__pyx_v_n + 1)]) = __pyx_t_13;
4453
}
4454
4455
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":186
4456
* # Now do the same, but modulo p^(prec). This is used for the
4457
* # mulmod larger precision version of computations.
4458
* K_mulmod = Qp(self.p, self.prec) # <<<<<<<<<<<<<<
4459
* u = 1
4460
* self.alpha_inv_mulmod[0] = u
4461
*/
4462
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_Qp); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 186, __pyx_L1_error)
4463
__Pyx_GOTREF(__pyx_t_6);
4464
__pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 186, __pyx_L1_error)
4465
__Pyx_GOTREF(__pyx_t_4);
4466
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_self->prec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 186, __pyx_L1_error)
4467
__Pyx_GOTREF(__pyx_t_3);
4468
__pyx_t_5 = NULL;
4469
__pyx_t_9 = 0;
4470
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
4471
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
4472
if (likely(__pyx_t_5)) {
4473
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4474
__Pyx_INCREF(__pyx_t_5);
4475
__Pyx_INCREF(function);
4476
__Pyx_DECREF_SET(__pyx_t_6, function);
4477
__pyx_t_9 = 1;
4478
}
4479
}
4480
#if CYTHON_FAST_PYCALL
4481
if (PyFunction_Check(__pyx_t_6)) {
4482
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_3};
4483
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
4484
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4485
__Pyx_GOTREF(__pyx_t_7);
4486
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4487
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4488
} else
4489
#endif
4490
#if CYTHON_FAST_PYCCALL
4491
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
4492
PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_4, __pyx_t_3};
4493
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_9, 2+__pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
4494
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4495
__Pyx_GOTREF(__pyx_t_7);
4496
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4497
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4498
} else
4499
#endif
4500
{
4501
__pyx_t_8 = PyTuple_New(2+__pyx_t_9); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 186, __pyx_L1_error)
4502
__Pyx_GOTREF(__pyx_t_8);
4503
if (__pyx_t_5) {
4504
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
4505
}
4506
__Pyx_GIVEREF(__pyx_t_4);
4507
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_9, __pyx_t_4);
4508
__Pyx_GIVEREF(__pyx_t_3);
4509
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_9, __pyx_t_3);
4510
__pyx_t_4 = 0;
4511
__pyx_t_3 = 0;
4512
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 186, __pyx_L1_error)
4513
__Pyx_GOTREF(__pyx_t_7);
4514
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4515
}
4516
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4517
__pyx_v_K_mulmod = __pyx_t_7;
4518
__pyx_t_7 = 0;
4519
4520
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":187
4521
* # mulmod larger precision version of computations.
4522
* K_mulmod = Qp(self.p, self.prec)
4523
* u = 1 # <<<<<<<<<<<<<<
4524
* self.alpha_inv_mulmod[0] = u
4525
* for n in range(self.prec):
4526
*/
4527
__Pyx_INCREF(__pyx_int_1);
4528
__Pyx_DECREF_SET(__pyx_v_u, __pyx_int_1);
4529
4530
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":188
4531
* K_mulmod = Qp(self.p, self.prec)
4532
* u = 1
4533
* self.alpha_inv_mulmod[0] = u # <<<<<<<<<<<<<<
4534
* for n in range(self.prec):
4535
* u *= alpha
4536
*/
4537
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_u); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 188, __pyx_L1_error)
4538
(__pyx_v_self->alpha_inv_mulmod[0]) = __pyx_t_2;
4539
4540
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":189
4541
* u = 1
4542
* self.alpha_inv_mulmod[0] = u
4543
* for n in range(self.prec): # <<<<<<<<<<<<<<
4544
* u *= alpha
4545
* self.alpha_inv_mulmod[n+1] = K_mulmod(1/u).lift()
4546
*/
4547
__pyx_t_2 = __pyx_v_self->prec;
4548
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) {
4549
__pyx_v_n = __pyx_t_9;
4550
4551
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":190
4552
* self.alpha_inv_mulmod[0] = u
4553
* for n in range(self.prec):
4554
* u *= alpha # <<<<<<<<<<<<<<
4555
* self.alpha_inv_mulmod[n+1] = K_mulmod(1/u).lift()
4556
*
4557
*/
4558
if (unlikely(!__pyx_v_alpha)) { __Pyx_RaiseUnboundLocalError("alpha"); __PYX_ERR(0, 190, __pyx_L1_error) }
4559
__pyx_t_7 = PyNumber_InPlaceMultiply(__pyx_v_u, __pyx_v_alpha); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 190, __pyx_L1_error)
4560
__Pyx_GOTREF(__pyx_t_7);
4561
__Pyx_DECREF_SET(__pyx_v_u, __pyx_t_7);
4562
__pyx_t_7 = 0;
4563
4564
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":191
4565
* for n in range(self.prec):
4566
* u *= alpha
4567
* self.alpha_inv_mulmod[n+1] = K_mulmod(1/u).lift() # <<<<<<<<<<<<<<
4568
*
4569
* # Make a table of powers of p up to prec
4570
*/
4571
__pyx_t_8 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_v_u); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 191, __pyx_L1_error)
4572
__Pyx_GOTREF(__pyx_t_8);
4573
__Pyx_INCREF(__pyx_v_K_mulmod);
4574
__pyx_t_3 = __pyx_v_K_mulmod; __pyx_t_4 = NULL;
4575
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4576
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4577
if (likely(__pyx_t_4)) {
4578
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4579
__Pyx_INCREF(__pyx_t_4);
4580
__Pyx_INCREF(function);
4581
__Pyx_DECREF_SET(__pyx_t_3, function);
4582
}
4583
}
4584
if (!__pyx_t_4) {
4585
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
4586
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4587
__Pyx_GOTREF(__pyx_t_6);
4588
} else {
4589
#if CYTHON_FAST_PYCALL
4590
if (PyFunction_Check(__pyx_t_3)) {
4591
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8};
4592
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
4593
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4594
__Pyx_GOTREF(__pyx_t_6);
4595
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4596
} else
4597
#endif
4598
#if CYTHON_FAST_PYCCALL
4599
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
4600
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8};
4601
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
4602
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4603
__Pyx_GOTREF(__pyx_t_6);
4604
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4605
} else
4606
#endif
4607
{
4608
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error)
4609
__Pyx_GOTREF(__pyx_t_5);
4610
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
4611
__Pyx_GIVEREF(__pyx_t_8);
4612
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8);
4613
__pyx_t_8 = 0;
4614
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 191, __pyx_L1_error)
4615
__Pyx_GOTREF(__pyx_t_6);
4616
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4617
}
4618
}
4619
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4620
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lift); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
4621
__Pyx_GOTREF(__pyx_t_3);
4622
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4623
__pyx_t_6 = NULL;
4624
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
4625
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
4626
if (likely(__pyx_t_6)) {
4627
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4628
__Pyx_INCREF(__pyx_t_6);
4629
__Pyx_INCREF(function);
4630
__Pyx_DECREF_SET(__pyx_t_3, function);
4631
}
4632
}
4633
if (__pyx_t_6) {
4634
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error)
4635
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4636
} else {
4637
__pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 191, __pyx_L1_error)
4638
}
4639
__Pyx_GOTREF(__pyx_t_7);
4640
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4641
__pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_7); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 191, __pyx_L1_error)
4642
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4643
(__pyx_v_self->alpha_inv_mulmod[(__pyx_v_n + 1)]) = __pyx_t_13;
4644
}
4645
4646
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":194
4647
*
4648
* # Make a table of powers of p up to prec
4649
* ppow = 1 # <<<<<<<<<<<<<<
4650
* self.p_pow[0] = ppow
4651
* for n in range(self.prec):
4652
*/
4653
__Pyx_INCREF(__pyx_int_1);
4654
__pyx_v_ppow = __pyx_int_1;
4655
4656
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":195
4657
* # Make a table of powers of p up to prec
4658
* ppow = 1
4659
* self.p_pow[0] = ppow # <<<<<<<<<<<<<<
4660
* for n in range(self.prec):
4661
* ppow *= self.p
4662
*/
4663
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_ppow); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L1_error)
4664
(__pyx_v_self->p_pow[0]) = __pyx_t_2;
4665
4666
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":196
4667
* ppow = 1
4668
* self.p_pow[0] = ppow
4669
* for n in range(self.prec): # <<<<<<<<<<<<<<
4670
* ppow *= self.p
4671
* self.p_pow[n+1] = ppow
4672
*/
4673
__pyx_t_2 = __pyx_v_self->prec;
4674
for (__pyx_t_9 = 0; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) {
4675
__pyx_v_n = __pyx_t_9;
4676
4677
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":197
4678
* self.p_pow[0] = ppow
4679
* for n in range(self.prec):
4680
* ppow *= self.p # <<<<<<<<<<<<<<
4681
* self.p_pow[n+1] = ppow
4682
*
4683
*/
4684
__pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 197, __pyx_L1_error)
4685
__Pyx_GOTREF(__pyx_t_7);
4686
__pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_ppow, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 197, __pyx_L1_error)
4687
__Pyx_GOTREF(__pyx_t_3);
4688
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4689
__Pyx_DECREF_SET(__pyx_v_ppow, __pyx_t_3);
4690
__pyx_t_3 = 0;
4691
4692
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":198
4693
* for n in range(self.prec):
4694
* ppow *= self.p
4695
* self.p_pow[n+1] = ppow # <<<<<<<<<<<<<<
4696
*
4697
* # Make a table of Teichmuller lifts to precision p^(prec//2)
4698
*/
4699
__pyx_t_13 = __Pyx_PyInt_As_long(__pyx_v_ppow); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L1_error)
4700
(__pyx_v_self->p_pow[(__pyx_v_n + 1)]) = __pyx_t_13;
4701
}
4702
4703
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":201
4704
*
4705
* # Make a table of Teichmuller lifts to precision p^(prec//2)
4706
* self.teich = <long*> sage_malloc(sizeof(long)*self.p) # <<<<<<<<<<<<<<
4707
* self.teich[0] = 0
4708
* for n in range(1,p):
4709
*/
4710
__pyx_v_self->teich = ((long *)sig_malloc(((sizeof(long)) * __pyx_v_self->p)));
4711
4712
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":202
4713
* # Make a table of Teichmuller lifts to precision p^(prec//2)
4714
* self.teich = <long*> sage_malloc(sizeof(long)*self.p)
4715
* self.teich[0] = 0 # <<<<<<<<<<<<<<
4716
* for n in range(1,p):
4717
* self.teich[n] = K.teichmuller(n).lift()
4718
*/
4719
(__pyx_v_self->teich[0]) = 0;
4720
4721
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":203
4722
* self.teich = <long*> sage_malloc(sizeof(long)*self.p)
4723
* self.teich[0] = 0
4724
* for n in range(1,p): # <<<<<<<<<<<<<<
4725
* self.teich[n] = K.teichmuller(n).lift()
4726
*
4727
*/
4728
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_p); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 203, __pyx_L1_error)
4729
for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) {
4730
__pyx_v_n = __pyx_t_9;
4731
4732
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":204
4733
* self.teich[0] = 0
4734
* for n in range(1,p):
4735
* self.teich[n] = K.teichmuller(n).lift() # <<<<<<<<<<<<<<
4736
*
4737
* # Make a table of Teichmuller lifts to precision p^prec
4738
*/
4739
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_K, __pyx_n_s_teichmuller); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
4740
__Pyx_GOTREF(__pyx_t_6);
4741
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
4742
__Pyx_GOTREF(__pyx_t_5);
4743
__pyx_t_8 = NULL;
4744
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
4745
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
4746
if (likely(__pyx_t_8)) {
4747
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4748
__Pyx_INCREF(__pyx_t_8);
4749
__Pyx_INCREF(function);
4750
__Pyx_DECREF_SET(__pyx_t_6, function);
4751
}
4752
}
4753
if (!__pyx_t_8) {
4754
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error)
4755
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4756
__Pyx_GOTREF(__pyx_t_7);
4757
} else {
4758
#if CYTHON_FAST_PYCALL
4759
if (PyFunction_Check(__pyx_t_6)) {
4760
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
4761
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error)
4762
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4763
__Pyx_GOTREF(__pyx_t_7);
4764
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4765
} else
4766
#endif
4767
#if CYTHON_FAST_PYCCALL
4768
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
4769
PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_5};
4770
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error)
4771
__Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
4772
__Pyx_GOTREF(__pyx_t_7);
4773
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4774
} else
4775
#endif
4776
{
4777
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
4778
__Pyx_GOTREF(__pyx_t_4);
4779
__Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_8); __pyx_t_8 = NULL;
4780
__Pyx_GIVEREF(__pyx_t_5);
4781
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_5);
4782
__pyx_t_5 = 0;
4783
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_4, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 204, __pyx_L1_error)
4784
__Pyx_GOTREF(__pyx_t_7);
4785
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4786
}
4787
}
4788
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4789
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_lift); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 204, __pyx_L1_error)
4790
__Pyx_GOTREF(__pyx_t_6);
4791
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4792
__pyx_t_7 = NULL;
4793
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
4794
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
4795
if (likely(__pyx_t_7)) {
4796
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4797
__Pyx_INCREF(__pyx_t_7);
4798
__Pyx_INCREF(function);
4799
__Pyx_DECREF_SET(__pyx_t_6, function);
4800
}
4801
}
4802
if (__pyx_t_7) {
4803
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
4804
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4805
} else {
4806
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
4807
}
4808
__Pyx_GOTREF(__pyx_t_3);
4809
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4810
__pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 204, __pyx_L1_error)
4811
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4812
(__pyx_v_self->teich[__pyx_v_n]) = __pyx_t_13;
4813
}
4814
4815
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":207
4816
*
4817
* # Make a table of Teichmuller lifts to precision p^prec
4818
* self.teich_mulmod = <long*> sage_malloc(sizeof(long)*self.p) # <<<<<<<<<<<<<<
4819
* self.teich_mulmod[0] = 0
4820
* for n in range(1,p):
4821
*/
4822
__pyx_v_self->teich_mulmod = ((long *)sig_malloc(((sizeof(long)) * __pyx_v_self->p)));
4823
4824
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":208
4825
* # Make a table of Teichmuller lifts to precision p^prec
4826
* self.teich_mulmod = <long*> sage_malloc(sizeof(long)*self.p)
4827
* self.teich_mulmod[0] = 0 # <<<<<<<<<<<<<<
4828
* for n in range(1,p):
4829
* self.teich_mulmod[n] = K_mulmod.teichmuller(n).lift()
4830
*/
4831
(__pyx_v_self->teich_mulmod[0]) = 0;
4832
4833
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":209
4834
* self.teich_mulmod = <long*> sage_malloc(sizeof(long)*self.p)
4835
* self.teich_mulmod[0] = 0
4836
* for n in range(1,p): # <<<<<<<<<<<<<<
4837
* self.teich_mulmod[n] = K_mulmod.teichmuller(n).lift()
4838
*
4839
*/
4840
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_v_p); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 209, __pyx_L1_error)
4841
for (__pyx_t_9 = 1; __pyx_t_9 < __pyx_t_2; __pyx_t_9+=1) {
4842
__pyx_v_n = __pyx_t_9;
4843
4844
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":210
4845
* self.teich_mulmod[0] = 0
4846
* for n in range(1,p):
4847
* self.teich_mulmod[n] = K_mulmod.teichmuller(n).lift() # <<<<<<<<<<<<<<
4848
*
4849
* # Compute normalization
4850
*/
4851
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_v_K_mulmod, __pyx_n_s_teichmuller); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error)
4852
__Pyx_GOTREF(__pyx_t_7);
4853
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
4854
__Pyx_GOTREF(__pyx_t_4);
4855
__pyx_t_5 = NULL;
4856
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
4857
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
4858
if (likely(__pyx_t_5)) {
4859
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4860
__Pyx_INCREF(__pyx_t_5);
4861
__Pyx_INCREF(function);
4862
__Pyx_DECREF_SET(__pyx_t_7, function);
4863
}
4864
}
4865
if (!__pyx_t_5) {
4866
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
4867
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4868
__Pyx_GOTREF(__pyx_t_6);
4869
} else {
4870
#if CYTHON_FAST_PYCALL
4871
if (PyFunction_Check(__pyx_t_7)) {
4872
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
4873
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
4874
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4875
__Pyx_GOTREF(__pyx_t_6);
4876
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4877
} else
4878
#endif
4879
#if CYTHON_FAST_PYCCALL
4880
if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
4881
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
4882
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
4883
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
4884
__Pyx_GOTREF(__pyx_t_6);
4885
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4886
} else
4887
#endif
4888
{
4889
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 210, __pyx_L1_error)
4890
__Pyx_GOTREF(__pyx_t_8);
4891
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
4892
__Pyx_GIVEREF(__pyx_t_4);
4893
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_4);
4894
__pyx_t_4 = 0;
4895
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_8, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 210, __pyx_L1_error)
4896
__Pyx_GOTREF(__pyx_t_6);
4897
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4898
}
4899
}
4900
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4901
__pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_lift); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 210, __pyx_L1_error)
4902
__Pyx_GOTREF(__pyx_t_7);
4903
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4904
__pyx_t_6 = NULL;
4905
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
4906
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
4907
if (likely(__pyx_t_6)) {
4908
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
4909
__Pyx_INCREF(__pyx_t_6);
4910
__Pyx_INCREF(function);
4911
__Pyx_DECREF_SET(__pyx_t_7, function);
4912
}
4913
}
4914
if (__pyx_t_6) {
4915
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
4916
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
4917
} else {
4918
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 210, __pyx_L1_error)
4919
}
4920
__Pyx_GOTREF(__pyx_t_3);
4921
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
4922
__pyx_t_13 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_13 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 210, __pyx_L1_error)
4923
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4924
(__pyx_v_self->teich_mulmod[__pyx_v_n]) = __pyx_t_13;
4925
}
4926
4927
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":213
4928
*
4929
* # Compute normalization
4930
* self.normalization = ZZ(self.E.real_components()).inverse_mod(self.p_pow[self.prec//2]) # <<<<<<<<<<<<<<
4931
* self.normalization_mulmod = ZZ(self.E.real_components()).inverse_mod(self.p_pow[self.prec])
4932
*
4933
*/
4934
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZZ); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
4935
__Pyx_GOTREF(__pyx_t_6);
4936
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_real_components); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 213, __pyx_L1_error)
4937
__Pyx_GOTREF(__pyx_t_4);
4938
__pyx_t_5 = NULL;
4939
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
4940
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
4941
if (likely(__pyx_t_5)) {
4942
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
4943
__Pyx_INCREF(__pyx_t_5);
4944
__Pyx_INCREF(function);
4945
__Pyx_DECREF_SET(__pyx_t_4, function);
4946
}
4947
}
4948
if (__pyx_t_5) {
4949
__pyx_t_8 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error)
4950
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4951
} else {
4952
__pyx_t_8 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error)
4953
}
4954
__Pyx_GOTREF(__pyx_t_8);
4955
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4956
__pyx_t_4 = NULL;
4957
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
4958
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
4959
if (likely(__pyx_t_4)) {
4960
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
4961
__Pyx_INCREF(__pyx_t_4);
4962
__Pyx_INCREF(function);
4963
__Pyx_DECREF_SET(__pyx_t_6, function);
4964
}
4965
}
4966
if (!__pyx_t_4) {
4967
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
4968
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4969
__Pyx_GOTREF(__pyx_t_7);
4970
} else {
4971
#if CYTHON_FAST_PYCALL
4972
if (PyFunction_Check(__pyx_t_6)) {
4973
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8};
4974
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
4975
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4976
__Pyx_GOTREF(__pyx_t_7);
4977
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4978
} else
4979
#endif
4980
#if CYTHON_FAST_PYCCALL
4981
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
4982
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_8};
4983
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
4984
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
4985
__Pyx_GOTREF(__pyx_t_7);
4986
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
4987
} else
4988
#endif
4989
{
4990
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 213, __pyx_L1_error)
4991
__Pyx_GOTREF(__pyx_t_5);
4992
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
4993
__Pyx_GIVEREF(__pyx_t_8);
4994
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_8);
4995
__pyx_t_8 = 0;
4996
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_5, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
4997
__Pyx_GOTREF(__pyx_t_7);
4998
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
4999
}
5000
}
5001
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5002
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_inverse_mod); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 213, __pyx_L1_error)
5003
__Pyx_GOTREF(__pyx_t_6);
5004
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5005
__pyx_t_7 = __Pyx_PyInt_From_long((__pyx_v_self->p_pow[__Pyx_div_long(__pyx_v_self->prec, 2)])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 213, __pyx_L1_error)
5006
__Pyx_GOTREF(__pyx_t_7);
5007
__pyx_t_5 = NULL;
5008
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
5009
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
5010
if (likely(__pyx_t_5)) {
5011
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5012
__Pyx_INCREF(__pyx_t_5);
5013
__Pyx_INCREF(function);
5014
__Pyx_DECREF_SET(__pyx_t_6, function);
5015
}
5016
}
5017
if (!__pyx_t_5) {
5018
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
5019
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5020
__Pyx_GOTREF(__pyx_t_3);
5021
} else {
5022
#if CYTHON_FAST_PYCALL
5023
if (PyFunction_Check(__pyx_t_6)) {
5024
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
5025
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
5026
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5027
__Pyx_GOTREF(__pyx_t_3);
5028
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5029
} else
5030
#endif
5031
#if CYTHON_FAST_PYCCALL
5032
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
5033
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
5034
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
5035
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5036
__Pyx_GOTREF(__pyx_t_3);
5037
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5038
} else
5039
#endif
5040
{
5041
__pyx_t_8 = PyTuple_New(1+1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 213, __pyx_L1_error)
5042
__Pyx_GOTREF(__pyx_t_8);
5043
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
5044
__Pyx_GIVEREF(__pyx_t_7);
5045
PyTuple_SET_ITEM(__pyx_t_8, 0+1, __pyx_t_7);
5046
__pyx_t_7 = 0;
5047
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 213, __pyx_L1_error)
5048
__Pyx_GOTREF(__pyx_t_3);
5049
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5050
}
5051
}
5052
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5053
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 213, __pyx_L1_error)
5054
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5055
__pyx_v_self->normalization = __pyx_t_2;
5056
5057
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":214
5058
* # Compute normalization
5059
* self.normalization = ZZ(self.E.real_components()).inverse_mod(self.p_pow[self.prec//2])
5060
* self.normalization_mulmod = ZZ(self.E.real_components()).inverse_mod(self.p_pow[self.prec]) # <<<<<<<<<<<<<<
5061
*
5062
* def __repr__(self):
5063
*/
5064
__pyx_t_8 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZZ); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error)
5065
__Pyx_GOTREF(__pyx_t_8);
5066
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_real_components); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 214, __pyx_L1_error)
5067
__Pyx_GOTREF(__pyx_t_5);
5068
__pyx_t_4 = NULL;
5069
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
5070
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
5071
if (likely(__pyx_t_4)) {
5072
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5073
__Pyx_INCREF(__pyx_t_4);
5074
__Pyx_INCREF(function);
5075
__Pyx_DECREF_SET(__pyx_t_5, function);
5076
}
5077
}
5078
if (__pyx_t_4) {
5079
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error)
5080
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5081
} else {
5082
__pyx_t_7 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error)
5083
}
5084
__Pyx_GOTREF(__pyx_t_7);
5085
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5086
__pyx_t_5 = NULL;
5087
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_8))) {
5088
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_8);
5089
if (likely(__pyx_t_5)) {
5090
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5091
__Pyx_INCREF(__pyx_t_5);
5092
__Pyx_INCREF(function);
5093
__Pyx_DECREF_SET(__pyx_t_8, function);
5094
}
5095
}
5096
if (!__pyx_t_5) {
5097
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
5098
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5099
__Pyx_GOTREF(__pyx_t_6);
5100
} else {
5101
#if CYTHON_FAST_PYCALL
5102
if (PyFunction_Check(__pyx_t_8)) {
5103
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
5104
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
5105
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5106
__Pyx_GOTREF(__pyx_t_6);
5107
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5108
} else
5109
#endif
5110
#if CYTHON_FAST_PYCCALL
5111
if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
5112
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_7};
5113
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
5114
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5115
__Pyx_GOTREF(__pyx_t_6);
5116
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5117
} else
5118
#endif
5119
{
5120
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 214, __pyx_L1_error)
5121
__Pyx_GOTREF(__pyx_t_4);
5122
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5); __pyx_t_5 = NULL;
5123
__Pyx_GIVEREF(__pyx_t_7);
5124
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_7);
5125
__pyx_t_7 = 0;
5126
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
5127
__Pyx_GOTREF(__pyx_t_6);
5128
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5129
}
5130
}
5131
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5132
__pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_inverse_mod); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 214, __pyx_L1_error)
5133
__Pyx_GOTREF(__pyx_t_8);
5134
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5135
__pyx_t_6 = __Pyx_PyInt_From_long((__pyx_v_self->p_pow[__pyx_v_self->prec])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 214, __pyx_L1_error)
5136
__Pyx_GOTREF(__pyx_t_6);
5137
__pyx_t_4 = NULL;
5138
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
5139
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_8);
5140
if (likely(__pyx_t_4)) {
5141
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
5142
__Pyx_INCREF(__pyx_t_4);
5143
__Pyx_INCREF(function);
5144
__Pyx_DECREF_SET(__pyx_t_8, function);
5145
}
5146
}
5147
if (!__pyx_t_4) {
5148
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_8, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
5149
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5150
__Pyx_GOTREF(__pyx_t_3);
5151
} else {
5152
#if CYTHON_FAST_PYCALL
5153
if (PyFunction_Check(__pyx_t_8)) {
5154
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
5155
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
5156
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5157
__Pyx_GOTREF(__pyx_t_3);
5158
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5159
} else
5160
#endif
5161
#if CYTHON_FAST_PYCCALL
5162
if (__Pyx_PyFastCFunction_Check(__pyx_t_8)) {
5163
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_6};
5164
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_8, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
5165
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
5166
__Pyx_GOTREF(__pyx_t_3);
5167
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5168
} else
5169
#endif
5170
{
5171
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 214, __pyx_L1_error)
5172
__Pyx_GOTREF(__pyx_t_7);
5173
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
5174
__Pyx_GIVEREF(__pyx_t_6);
5175
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
5176
__pyx_t_6 = 0;
5177
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_8, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 214, __pyx_L1_error)
5178
__Pyx_GOTREF(__pyx_t_3);
5179
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
5180
}
5181
}
5182
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5183
__pyx_t_2 = __Pyx_PyInt_As_long(__pyx_t_3); if (unlikely((__pyx_t_2 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 214, __pyx_L1_error)
5184
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5185
__pyx_v_self->normalization_mulmod = __pyx_t_2;
5186
5187
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":72
5188
*
5189
*
5190
* def __init__(self, E, p, algorithm='eclib', parallel=False): # <<<<<<<<<<<<<<
5191
* """
5192
* INPUT:
5193
*/
5194
5195
/* function exit code */
5196
__pyx_r = 0;
5197
goto __pyx_L0;
5198
__pyx_L1_error:;
5199
__Pyx_XDECREF(__pyx_t_3);
5200
__Pyx_XDECREF(__pyx_t_4);
5201
__Pyx_XDECREF(__pyx_t_5);
5202
__Pyx_XDECREF(__pyx_t_6);
5203
__Pyx_XDECREF(__pyx_t_7);
5204
__Pyx_XDECREF(__pyx_t_8);
5205
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5206
__pyx_r = -1;
5207
__pyx_L0:;
5208
__Pyx_XDECREF(__pyx_v_f);
5209
__Pyx_XDECREF(__pyx_v_A);
5210
__Pyx_XDECREF(__pyx_v_G);
5211
__Pyx_XDECREF(__pyx_v_Zp);
5212
__Pyx_XDECREF(__pyx_v_pr);
5213
__Pyx_XDECREF(__pyx_v_e);
5214
__Pyx_XDECREF(__pyx_v_alpha);
5215
__Pyx_XDECREF(__pyx_v_K);
5216
__Pyx_XDECREF(__pyx_v_u);
5217
__Pyx_XDECREF(__pyx_v_K_mulmod);
5218
__Pyx_XDECREF(__pyx_v_ppow);
5219
__Pyx_RefNannyFinishContext();
5220
return __pyx_r;
5221
}
5222
5223
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":216
5224
* self.normalization_mulmod = ZZ(self.E.real_components()).inverse_mod(self.p_pow[self.prec])
5225
*
5226
* def __repr__(self): # <<<<<<<<<<<<<<
5227
* return "%s-adic L-series of %s"%(self.p, self.E)
5228
*
5229
*/
5230
5231
/* Python wrapper */
5232
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_7__repr__(PyObject *__pyx_v_self); /*proto*/
5233
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 216)";
5234
#if CYTHON_COMPILING_IN_CPYTHON
5235
struct wrapperbase __pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__;
5236
#endif
5237
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_7__repr__(PyObject *__pyx_v_self) {
5238
PyObject *__pyx_r = 0;
5239
__Pyx_RefNannyDeclarations
5240
__Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
5241
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
5242
5243
/* function exit code */
5244
__Pyx_RefNannyFinishContext();
5245
return __pyx_r;
5246
}
5247
5248
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
5249
PyObject *__pyx_r = NULL;
5250
__Pyx_RefNannyDeclarations
5251
PyObject *__pyx_t_1 = NULL;
5252
PyObject *__pyx_t_2 = NULL;
5253
__Pyx_RefNannySetupContext("__repr__", 0);
5254
5255
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":217
5256
*
5257
* def __repr__(self):
5258
* return "%s-adic L-series of %s"%(self.p, self.E) # <<<<<<<<<<<<<<
5259
*
5260
* def alpha(self):
5261
*/
5262
__Pyx_XDECREF(__pyx_r);
5263
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
5264
__Pyx_GOTREF(__pyx_t_1);
5265
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 217, __pyx_L1_error)
5266
__Pyx_GOTREF(__pyx_t_2);
5267
__Pyx_GIVEREF(__pyx_t_1);
5268
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
5269
__Pyx_INCREF(__pyx_v_self->E);
5270
__Pyx_GIVEREF(__pyx_v_self->E);
5271
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_v_self->E);
5272
__pyx_t_1 = 0;
5273
__pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_s_adic_L_series_of_s, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 217, __pyx_L1_error)
5274
__Pyx_GOTREF(__pyx_t_1);
5275
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5276
__pyx_r = __pyx_t_1;
5277
__pyx_t_1 = 0;
5278
goto __pyx_L0;
5279
5280
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":216
5281
* self.normalization_mulmod = ZZ(self.E.real_components()).inverse_mod(self.p_pow[self.prec])
5282
*
5283
* def __repr__(self): # <<<<<<<<<<<<<<
5284
* return "%s-adic L-series of %s"%(self.p, self.E)
5285
*
5286
*/
5287
5288
/* function exit code */
5289
__pyx_L1_error:;
5290
__Pyx_XDECREF(__pyx_t_1);
5291
__Pyx_XDECREF(__pyx_t_2);
5292
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
5293
__pyx_r = NULL;
5294
__pyx_L0:;
5295
__Pyx_XGIVEREF(__pyx_r);
5296
__Pyx_RefNannyFinishContext();
5297
return __pyx_r;
5298
}
5299
5300
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":219
5301
* return "%s-adic L-series of %s"%(self.p, self.E)
5302
*
5303
* def alpha(self): # <<<<<<<<<<<<<<
5304
* return self._alpha
5305
*
5306
*/
5307
5308
/* Python wrapper */
5309
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_9alpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
5310
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_8alpha[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 219)";
5311
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_9alpha(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
5312
PyObject *__pyx_r = 0;
5313
__Pyx_RefNannyDeclarations
5314
__Pyx_RefNannySetupContext("alpha (wrapper)", 0);
5315
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_8alpha(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
5316
5317
/* function exit code */
5318
__Pyx_RefNannyFinishContext();
5319
return __pyx_r;
5320
}
5321
5322
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_8alpha(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
5323
PyObject *__pyx_r = NULL;
5324
__Pyx_RefNannyDeclarations
5325
PyObject *__pyx_t_1 = NULL;
5326
__Pyx_RefNannySetupContext("alpha", 0);
5327
5328
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":220
5329
*
5330
* def alpha(self):
5331
* return self._alpha # <<<<<<<<<<<<<<
5332
*
5333
* cpdef long modular_symbol(self, long a, long b):
5334
*/
5335
__Pyx_XDECREF(__pyx_r);
5336
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_alpha); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 220, __pyx_L1_error)
5337
__Pyx_GOTREF(__pyx_t_1);
5338
__pyx_r = __pyx_t_1;
5339
__pyx_t_1 = 0;
5340
goto __pyx_L0;
5341
5342
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":219
5343
* return "%s-adic L-series of %s"%(self.p, self.E)
5344
*
5345
* def alpha(self): # <<<<<<<<<<<<<<
5346
* return self._alpha
5347
*
5348
*/
5349
5350
/* function exit code */
5351
__pyx_L1_error:;
5352
__Pyx_XDECREF(__pyx_t_1);
5353
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.alpha", __pyx_clineno, __pyx_lineno, __pyx_filename);
5354
__pyx_r = NULL;
5355
__pyx_L0:;
5356
__Pyx_XGIVEREF(__pyx_r);
5357
__Pyx_RefNannyFinishContext();
5358
return __pyx_r;
5359
}
5360
5361
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":222
5362
* return self._alpha
5363
*
5364
* cpdef long modular_symbol(self, long a, long b): # <<<<<<<<<<<<<<
5365
* cdef long v[1]
5366
* self.modsym.evaluate(v, a, b)
5367
*/
5368
5369
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_11modular_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5370
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modular_symbol(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, long __pyx_v_b, int __pyx_skip_dispatch) {
5371
long __pyx_v_v[1];
5372
long __pyx_r;
5373
__Pyx_RefNannyDeclarations
5374
PyObject *__pyx_t_1 = NULL;
5375
PyObject *__pyx_t_2 = NULL;
5376
PyObject *__pyx_t_3 = NULL;
5377
PyObject *__pyx_t_4 = NULL;
5378
PyObject *__pyx_t_5 = NULL;
5379
PyObject *__pyx_t_6 = NULL;
5380
int __pyx_t_7;
5381
PyObject *__pyx_t_8 = NULL;
5382
long __pyx_t_9;
5383
__Pyx_RefNannySetupContext("modular_symbol", 0);
5384
/* Check if called by wrapper */
5385
if (unlikely(__pyx_skip_dispatch)) ;
5386
/* Check if overridden in Python */
5387
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
5388
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_modular_symbol); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
5389
__Pyx_GOTREF(__pyx_t_1);
5390
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_11modular_symbol)) {
5391
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 222, __pyx_L1_error)
5392
__Pyx_GOTREF(__pyx_t_3);
5393
__pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_b); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 222, __pyx_L1_error)
5394
__Pyx_GOTREF(__pyx_t_4);
5395
__Pyx_INCREF(__pyx_t_1);
5396
__pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
5397
__pyx_t_7 = 0;
5398
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5399
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5400
if (likely(__pyx_t_6)) {
5401
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5402
__Pyx_INCREF(__pyx_t_6);
5403
__Pyx_INCREF(function);
5404
__Pyx_DECREF_SET(__pyx_t_5, function);
5405
__pyx_t_7 = 1;
5406
}
5407
}
5408
#if CYTHON_FAST_PYCALL
5409
if (PyFunction_Check(__pyx_t_5)) {
5410
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
5411
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
5412
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5413
__Pyx_GOTREF(__pyx_t_2);
5414
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5415
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5416
} else
5417
#endif
5418
#if CYTHON_FAST_PYCCALL
5419
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
5420
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
5421
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
5422
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5423
__Pyx_GOTREF(__pyx_t_2);
5424
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5425
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5426
} else
5427
#endif
5428
{
5429
__pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 222, __pyx_L1_error)
5430
__Pyx_GOTREF(__pyx_t_8);
5431
if (__pyx_t_6) {
5432
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
5433
}
5434
__Pyx_GIVEREF(__pyx_t_3);
5435
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
5436
__Pyx_GIVEREF(__pyx_t_4);
5437
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
5438
__pyx_t_3 = 0;
5439
__pyx_t_4 = 0;
5440
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 222, __pyx_L1_error)
5441
__Pyx_GOTREF(__pyx_t_2);
5442
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5443
}
5444
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5445
__pyx_t_9 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L1_error)
5446
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5447
__pyx_r = __pyx_t_9;
5448
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5449
goto __pyx_L0;
5450
}
5451
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5452
}
5453
5454
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":224
5455
* cpdef long modular_symbol(self, long a, long b):
5456
* cdef long v[1]
5457
* self.modsym.evaluate(v, a, b) # <<<<<<<<<<<<<<
5458
* return v[0]
5459
*
5460
*/
5461
__pyx_t_7 = ((struct __pyx_vtabstruct_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)__pyx_v_self->modsym->__pyx_vtab)->evaluate(__pyx_v_self->modsym, __pyx_v_v, __pyx_v_a, __pyx_v_b); if (unlikely(__pyx_t_7 == -1)) __PYX_ERR(0, 224, __pyx_L1_error)
5462
5463
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":225
5464
* cdef long v[1]
5465
* self.modsym.evaluate(v, a, b)
5466
* return v[0] # <<<<<<<<<<<<<<
5467
*
5468
* cpdef long measure(self, long a, int n) except 9223372036854775807: # 64-bit maxint
5469
*/
5470
__pyx_r = (__pyx_v_v[0]);
5471
goto __pyx_L0;
5472
5473
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":222
5474
* return self._alpha
5475
*
5476
* cpdef long modular_symbol(self, long a, long b): # <<<<<<<<<<<<<<
5477
* cdef long v[1]
5478
* self.modsym.evaluate(v, a, b)
5479
*/
5480
5481
/* function exit code */
5482
__pyx_L1_error:;
5483
__Pyx_XDECREF(__pyx_t_1);
5484
__Pyx_XDECREF(__pyx_t_2);
5485
__Pyx_XDECREF(__pyx_t_3);
5486
__Pyx_XDECREF(__pyx_t_4);
5487
__Pyx_XDECREF(__pyx_t_5);
5488
__Pyx_XDECREF(__pyx_t_6);
5489
__Pyx_XDECREF(__pyx_t_8);
5490
__Pyx_WriteUnraisable("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.modular_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename, 0, 0);
5491
__pyx_r = 0;
5492
__pyx_L0:;
5493
__Pyx_RefNannyFinishContext();
5494
return __pyx_r;
5495
}
5496
5497
/* Python wrapper */
5498
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_11modular_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5499
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_10modular_symbol[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 222)";
5500
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_11modular_symbol(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5501
long __pyx_v_a;
5502
long __pyx_v_b;
5503
PyObject *__pyx_r = 0;
5504
__Pyx_RefNannyDeclarations
5505
__Pyx_RefNannySetupContext("modular_symbol (wrapper)", 0);
5506
{
5507
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_b,0};
5508
PyObject* values[2] = {0,0};
5509
if (unlikely(__pyx_kwds)) {
5510
Py_ssize_t kw_args;
5511
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5512
switch (pos_args) {
5513
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5514
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5515
case 0: break;
5516
default: goto __pyx_L5_argtuple_error;
5517
}
5518
kw_args = PyDict_Size(__pyx_kwds);
5519
switch (pos_args) {
5520
case 0:
5521
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5522
else goto __pyx_L5_argtuple_error;
5523
case 1:
5524
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_b)) != 0)) kw_args--;
5525
else {
5526
__Pyx_RaiseArgtupleInvalid("modular_symbol", 1, 2, 2, 1); __PYX_ERR(0, 222, __pyx_L3_error)
5527
}
5528
}
5529
if (unlikely(kw_args > 0)) {
5530
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "modular_symbol") < 0)) __PYX_ERR(0, 222, __pyx_L3_error)
5531
}
5532
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5533
goto __pyx_L5_argtuple_error;
5534
} else {
5535
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5536
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5537
}
5538
__pyx_v_a = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_a == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L3_error)
5539
__pyx_v_b = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v_b == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 222, __pyx_L3_error)
5540
}
5541
goto __pyx_L4_argument_unpacking_done;
5542
__pyx_L5_argtuple_error:;
5543
__Pyx_RaiseArgtupleInvalid("modular_symbol", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 222, __pyx_L3_error)
5544
__pyx_L3_error:;
5545
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.modular_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
5546
__Pyx_RefNannyFinishContext();
5547
return NULL;
5548
__pyx_L4_argument_unpacking_done:;
5549
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_10modular_symbol(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_a, __pyx_v_b);
5550
5551
/* function exit code */
5552
__Pyx_RefNannyFinishContext();
5553
return __pyx_r;
5554
}
5555
5556
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_10modular_symbol(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, long __pyx_v_b) {
5557
PyObject *__pyx_r = NULL;
5558
__Pyx_RefNannyDeclarations
5559
PyObject *__pyx_t_1 = NULL;
5560
__Pyx_RefNannySetupContext("modular_symbol", 0);
5561
__Pyx_XDECREF(__pyx_r);
5562
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modular_symbol(__pyx_v_self, __pyx_v_a, __pyx_v_b, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
5563
__Pyx_GOTREF(__pyx_t_1);
5564
__pyx_r = __pyx_t_1;
5565
__pyx_t_1 = 0;
5566
goto __pyx_L0;
5567
5568
/* function exit code */
5569
__pyx_L1_error:;
5570
__Pyx_XDECREF(__pyx_t_1);
5571
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.modular_symbol", __pyx_clineno, __pyx_lineno, __pyx_filename);
5572
__pyx_r = NULL;
5573
__pyx_L0:;
5574
__Pyx_XGIVEREF(__pyx_r);
5575
__Pyx_RefNannyFinishContext();
5576
return __pyx_r;
5577
}
5578
5579
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":227
5580
* return v[0]
5581
*
5582
* cpdef long measure(self, long a, int n) except 9223372036854775807: # 64-bit maxint # <<<<<<<<<<<<<<
5583
* """
5584
* Compute mu(a/p^n). Note that the second input is the exponent of p.
5585
*/
5586
5587
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13measure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5588
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n, int __pyx_skip_dispatch) {
5589
long __pyx_r;
5590
__Pyx_RefNannyDeclarations
5591
PyObject *__pyx_t_1 = NULL;
5592
PyObject *__pyx_t_2 = NULL;
5593
PyObject *__pyx_t_3 = NULL;
5594
PyObject *__pyx_t_4 = NULL;
5595
PyObject *__pyx_t_5 = NULL;
5596
PyObject *__pyx_t_6 = NULL;
5597
int __pyx_t_7;
5598
PyObject *__pyx_t_8 = NULL;
5599
long __pyx_t_9;
5600
int __pyx_t_10;
5601
__Pyx_RefNannySetupContext("measure", 0);
5602
/* Check if called by wrapper */
5603
if (unlikely(__pyx_skip_dispatch)) ;
5604
/* Check if overridden in Python */
5605
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
5606
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_measure); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
5607
__Pyx_GOTREF(__pyx_t_1);
5608
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13measure)) {
5609
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
5610
__Pyx_GOTREF(__pyx_t_3);
5611
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 227, __pyx_L1_error)
5612
__Pyx_GOTREF(__pyx_t_4);
5613
__Pyx_INCREF(__pyx_t_1);
5614
__pyx_t_5 = __pyx_t_1; __pyx_t_6 = NULL;
5615
__pyx_t_7 = 0;
5616
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
5617
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
5618
if (likely(__pyx_t_6)) {
5619
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
5620
__Pyx_INCREF(__pyx_t_6);
5621
__Pyx_INCREF(function);
5622
__Pyx_DECREF_SET(__pyx_t_5, function);
5623
__pyx_t_7 = 1;
5624
}
5625
}
5626
#if CYTHON_FAST_PYCALL
5627
if (PyFunction_Check(__pyx_t_5)) {
5628
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
5629
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
5630
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5631
__Pyx_GOTREF(__pyx_t_2);
5632
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5633
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5634
} else
5635
#endif
5636
#if CYTHON_FAST_PYCCALL
5637
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
5638
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_3, __pyx_t_4};
5639
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
5640
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5641
__Pyx_GOTREF(__pyx_t_2);
5642
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5643
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5644
} else
5645
#endif
5646
{
5647
__pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 227, __pyx_L1_error)
5648
__Pyx_GOTREF(__pyx_t_8);
5649
if (__pyx_t_6) {
5650
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
5651
}
5652
__Pyx_GIVEREF(__pyx_t_3);
5653
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_3);
5654
__Pyx_GIVEREF(__pyx_t_4);
5655
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_4);
5656
__pyx_t_3 = 0;
5657
__pyx_t_4 = 0;
5658
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_8, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
5659
__Pyx_GOTREF(__pyx_t_2);
5660
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5661
}
5662
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5663
__pyx_t_9 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_9 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L1_error)
5664
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5665
__pyx_r = __pyx_t_9;
5666
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5667
goto __pyx_L0;
5668
}
5669
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5670
}
5671
5672
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":235
5673
* - n -- int (very small)
5674
* """
5675
* if n+1 > self.prec: # for safety # <<<<<<<<<<<<<<
5676
* raise ValueError, "n too large to compute measure"
5677
*
5678
*/
5679
__pyx_t_10 = (((__pyx_v_n + 1) > __pyx_v_self->prec) != 0);
5680
if (__pyx_t_10) {
5681
5682
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":236
5683
* """
5684
* if n+1 > self.prec: # for safety
5685
* raise ValueError, "n too large to compute measure" # <<<<<<<<<<<<<<
5686
*
5687
* # TODO/WARNING: The case when p divides level is different -- but we check in __init__ that p is good.
5688
*/
5689
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_n_too_large_to_compute_measure, 0, 0);
5690
__PYX_ERR(0, 236, __pyx_L1_error)
5691
5692
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":235
5693
* - n -- int (very small)
5694
* """
5695
* if n+1 > self.prec: # for safety # <<<<<<<<<<<<<<
5696
* raise ValueError, "n too large to compute measure"
5697
*
5698
*/
5699
}
5700
5701
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":240
5702
* # TODO/WARNING: The case when p divides level is different -- but we check in __init__ that p is good.
5703
* return (self.alpha_inv[n] * self.modular_symbol(a, self.p_pow[n])
5704
* - self.alpha_inv[n+1] * self.modular_symbol(a, self.p_pow[n-1])) # <<<<<<<<<<<<<<
5705
*
5706
* cpdef long measure_mulmod(self, long a, int n, long pp) except 9223372036854775807: # 64-bit maxint
5707
*/
5708
__pyx_r = (((__pyx_v_self->alpha_inv[__pyx_v_n]) * ((struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self->__pyx_vtab)->modular_symbol(__pyx_v_self, __pyx_v_a, (__pyx_v_self->p_pow[__pyx_v_n]), 0)) - ((__pyx_v_self->alpha_inv[(__pyx_v_n + 1)]) * ((struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self->__pyx_vtab)->modular_symbol(__pyx_v_self, __pyx_v_a, (__pyx_v_self->p_pow[(__pyx_v_n - 1)]), 0)));
5709
goto __pyx_L0;
5710
5711
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":227
5712
* return v[0]
5713
*
5714
* cpdef long measure(self, long a, int n) except 9223372036854775807: # 64-bit maxint # <<<<<<<<<<<<<<
5715
* """
5716
* Compute mu(a/p^n). Note that the second input is the exponent of p.
5717
*/
5718
5719
/* function exit code */
5720
__pyx_L1_error:;
5721
__Pyx_XDECREF(__pyx_t_1);
5722
__Pyx_XDECREF(__pyx_t_2);
5723
__Pyx_XDECREF(__pyx_t_3);
5724
__Pyx_XDECREF(__pyx_t_4);
5725
__Pyx_XDECREF(__pyx_t_5);
5726
__Pyx_XDECREF(__pyx_t_6);
5727
__Pyx_XDECREF(__pyx_t_8);
5728
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.measure", __pyx_clineno, __pyx_lineno, __pyx_filename);
5729
__pyx_r = 0x7FFFFFFFFFFFFFFF;
5730
__pyx_L0:;
5731
__Pyx_RefNannyFinishContext();
5732
return __pyx_r;
5733
}
5734
5735
/* Python wrapper */
5736
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13measure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5737
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_12measure[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 227)\n\n Compute mu(a/p^n). Note that the second input is the exponent of p.\n\n INPUT:\n - a -- long\n - n -- int (very small)\n ";
5738
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13measure(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
5739
long __pyx_v_a;
5740
int __pyx_v_n;
5741
PyObject *__pyx_r = 0;
5742
__Pyx_RefNannyDeclarations
5743
__Pyx_RefNannySetupContext("measure (wrapper)", 0);
5744
{
5745
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_n,0};
5746
PyObject* values[2] = {0,0};
5747
if (unlikely(__pyx_kwds)) {
5748
Py_ssize_t kw_args;
5749
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
5750
switch (pos_args) {
5751
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5752
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5753
case 0: break;
5754
default: goto __pyx_L5_argtuple_error;
5755
}
5756
kw_args = PyDict_Size(__pyx_kwds);
5757
switch (pos_args) {
5758
case 0:
5759
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
5760
else goto __pyx_L5_argtuple_error;
5761
case 1:
5762
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
5763
else {
5764
__Pyx_RaiseArgtupleInvalid("measure", 1, 2, 2, 1); __PYX_ERR(0, 227, __pyx_L3_error)
5765
}
5766
}
5767
if (unlikely(kw_args > 0)) {
5768
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "measure") < 0)) __PYX_ERR(0, 227, __pyx_L3_error)
5769
}
5770
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
5771
goto __pyx_L5_argtuple_error;
5772
} else {
5773
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
5774
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
5775
}
5776
__pyx_v_a = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_a == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error)
5777
__pyx_v_n = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 227, __pyx_L3_error)
5778
}
5779
goto __pyx_L4_argument_unpacking_done;
5780
__pyx_L5_argtuple_error:;
5781
__Pyx_RaiseArgtupleInvalid("measure", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 227, __pyx_L3_error)
5782
__pyx_L3_error:;
5783
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.measure", __pyx_clineno, __pyx_lineno, __pyx_filename);
5784
__Pyx_RefNannyFinishContext();
5785
return NULL;
5786
__pyx_L4_argument_unpacking_done:;
5787
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_12measure(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_a, __pyx_v_n);
5788
5789
/* function exit code */
5790
__Pyx_RefNannyFinishContext();
5791
return __pyx_r;
5792
}
5793
5794
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_12measure(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n) {
5795
PyObject *__pyx_r = NULL;
5796
__Pyx_RefNannyDeclarations
5797
long __pyx_t_1;
5798
PyObject *__pyx_t_2 = NULL;
5799
__Pyx_RefNannySetupContext("measure", 0);
5800
__Pyx_XDECREF(__pyx_r);
5801
__pyx_t_1 = __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure(__pyx_v_self, __pyx_v_a, __pyx_v_n, 1); if (unlikely(__pyx_t_1 == 0x7FFFFFFFFFFFFFFF)) __PYX_ERR(0, 227, __pyx_L1_error)
5802
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
5803
__Pyx_GOTREF(__pyx_t_2);
5804
__pyx_r = __pyx_t_2;
5805
__pyx_t_2 = 0;
5806
goto __pyx_L0;
5807
5808
/* function exit code */
5809
__pyx_L1_error:;
5810
__Pyx_XDECREF(__pyx_t_2);
5811
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.measure", __pyx_clineno, __pyx_lineno, __pyx_filename);
5812
__pyx_r = NULL;
5813
__pyx_L0:;
5814
__Pyx_XGIVEREF(__pyx_r);
5815
__Pyx_RefNannyFinishContext();
5816
return __pyx_r;
5817
}
5818
5819
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":242
5820
* - self.alpha_inv[n+1] * self.modular_symbol(a, self.p_pow[n-1]))
5821
*
5822
* cpdef long measure_mulmod(self, long a, int n, long pp) except 9223372036854775807: # 64-bit maxint # <<<<<<<<<<<<<<
5823
* """
5824
* Compute mu(a/p^n). Note that the second input is the exponent of p.
5825
*/
5826
5827
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_15measure_mulmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
5828
static long __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure_mulmod(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n, long __pyx_v_pp, int __pyx_skip_dispatch) {
5829
long __pyx_v_ans;
5830
long __pyx_r;
5831
__Pyx_RefNannyDeclarations
5832
PyObject *__pyx_t_1 = NULL;
5833
PyObject *__pyx_t_2 = NULL;
5834
PyObject *__pyx_t_3 = NULL;
5835
PyObject *__pyx_t_4 = NULL;
5836
PyObject *__pyx_t_5 = NULL;
5837
PyObject *__pyx_t_6 = NULL;
5838
PyObject *__pyx_t_7 = NULL;
5839
int __pyx_t_8;
5840
PyObject *__pyx_t_9 = NULL;
5841
long __pyx_t_10;
5842
int __pyx_t_11;
5843
__Pyx_RefNannySetupContext("measure_mulmod", 0);
5844
/* Check if called by wrapper */
5845
if (unlikely(__pyx_skip_dispatch)) ;
5846
/* Check if overridden in Python */
5847
else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
5848
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_measure_mulmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 242, __pyx_L1_error)
5849
__Pyx_GOTREF(__pyx_t_1);
5850
if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_15measure_mulmod)) {
5851
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_a); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 242, __pyx_L1_error)
5852
__Pyx_GOTREF(__pyx_t_3);
5853
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 242, __pyx_L1_error)
5854
__Pyx_GOTREF(__pyx_t_4);
5855
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 242, __pyx_L1_error)
5856
__Pyx_GOTREF(__pyx_t_5);
5857
__Pyx_INCREF(__pyx_t_1);
5858
__pyx_t_6 = __pyx_t_1; __pyx_t_7 = NULL;
5859
__pyx_t_8 = 0;
5860
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
5861
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
5862
if (likely(__pyx_t_7)) {
5863
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
5864
__Pyx_INCREF(__pyx_t_7);
5865
__Pyx_INCREF(function);
5866
__Pyx_DECREF_SET(__pyx_t_6, function);
5867
__pyx_t_8 = 1;
5868
}
5869
}
5870
#if CYTHON_FAST_PYCALL
5871
if (PyFunction_Check(__pyx_t_6)) {
5872
PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
5873
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
5874
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5875
__Pyx_GOTREF(__pyx_t_2);
5876
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5877
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5878
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5879
} else
5880
#endif
5881
#if CYTHON_FAST_PYCCALL
5882
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
5883
PyObject *__pyx_temp[4] = {__pyx_t_7, __pyx_t_3, __pyx_t_4, __pyx_t_5};
5884
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 3+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
5885
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
5886
__Pyx_GOTREF(__pyx_t_2);
5887
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5888
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5889
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
5890
} else
5891
#endif
5892
{
5893
__pyx_t_9 = PyTuple_New(3+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 242, __pyx_L1_error)
5894
__Pyx_GOTREF(__pyx_t_9);
5895
if (__pyx_t_7) {
5896
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
5897
}
5898
__Pyx_GIVEREF(__pyx_t_3);
5899
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_3);
5900
__Pyx_GIVEREF(__pyx_t_4);
5901
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_4);
5902
__Pyx_GIVEREF(__pyx_t_5);
5903
PyTuple_SET_ITEM(__pyx_t_9, 2+__pyx_t_8, __pyx_t_5);
5904
__pyx_t_3 = 0;
5905
__pyx_t_4 = 0;
5906
__pyx_t_5 = 0;
5907
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
5908
__Pyx_GOTREF(__pyx_t_2);
5909
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5910
}
5911
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5912
__pyx_t_10 = __Pyx_PyInt_As_long(__pyx_t_2); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error)
5913
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5914
__pyx_r = __pyx_t_10;
5915
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5916
goto __pyx_L0;
5917
}
5918
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5919
}
5920
5921
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":253
5922
* - pp -- long (modulus, a power of p).
5923
* """
5924
* if n+1 > self.prec: # for safety # <<<<<<<<<<<<<<
5925
* raise ValueError, "n too large to compute measure"
5926
*
5927
*/
5928
__pyx_t_11 = (((__pyx_v_n + 1) > __pyx_v_self->prec) != 0);
5929
if (__pyx_t_11) {
5930
5931
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":254
5932
* """
5933
* if n+1 > self.prec: # for safety
5934
* raise ValueError, "n too large to compute measure" # <<<<<<<<<<<<<<
5935
*
5936
* # TODO/WARNING: The case when p divides level is different -- but we check in __init__ that p is good.
5937
*/
5938
__Pyx_Raise(__pyx_builtin_ValueError, __pyx_kp_s_n_too_large_to_compute_measure, 0, 0);
5939
__PYX_ERR(0, 254, __pyx_L1_error)
5940
5941
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":253
5942
* - pp -- long (modulus, a power of p).
5943
* """
5944
* if n+1 > self.prec: # for safety # <<<<<<<<<<<<<<
5945
* raise ValueError, "n too large to compute measure"
5946
*
5947
*/
5948
}
5949
5950
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":259
5951
*
5952
* cdef long ans = (mulmod(self.alpha_inv_mulmod[n], self.modular_symbol(a, self.p_pow[n]), pp)
5953
* - mulmod(self.alpha_inv_mulmod[n+1], self.modular_symbol(a, self.p_pow[n-1]), pp)) # <<<<<<<<<<<<<<
5954
*
5955
* # mulmod returns a number between 0 and pp-1, inclusive, and so does this function. Since
5956
*/
5957
__pyx_v_ans = (__pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_mulmod((__pyx_v_self->alpha_inv_mulmod[__pyx_v_n]), ((struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self->__pyx_vtab)->modular_symbol(__pyx_v_self, __pyx_v_a, (__pyx_v_self->p_pow[__pyx_v_n]), 0), __pyx_v_pp) - __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_mulmod((__pyx_v_self->alpha_inv_mulmod[(__pyx_v_n + 1)]), ((struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self->__pyx_vtab)->modular_symbol(__pyx_v_self, __pyx_v_a, (__pyx_v_self->p_pow[(__pyx_v_n - 1)]), 0), __pyx_v_pp));
5958
5959
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":264
5960
* # we compute ans as a difference of two such numbers, it is already in the interval [0..pp-1],
5961
* # or it is in the interval [-(pp-1)..-1], in which case we add pp.
5962
* if ans < 0: # <<<<<<<<<<<<<<
5963
* ans += pp
5964
* return ans
5965
*/
5966
__pyx_t_11 = ((__pyx_v_ans < 0) != 0);
5967
if (__pyx_t_11) {
5968
5969
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":265
5970
* # or it is in the interval [-(pp-1)..-1], in which case we add pp.
5971
* if ans < 0:
5972
* ans += pp # <<<<<<<<<<<<<<
5973
* return ans
5974
*
5975
*/
5976
__pyx_v_ans = (__pyx_v_ans + __pyx_v_pp);
5977
5978
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":264
5979
* # we compute ans as a difference of two such numbers, it is already in the interval [0..pp-1],
5980
* # or it is in the interval [-(pp-1)..-1], in which case we add pp.
5981
* if ans < 0: # <<<<<<<<<<<<<<
5982
* ans += pp
5983
* return ans
5984
*/
5985
}
5986
5987
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":266
5988
* if ans < 0:
5989
* ans += pp
5990
* return ans # <<<<<<<<<<<<<<
5991
*
5992
* def _series(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False,
5993
*/
5994
__pyx_r = __pyx_v_ans;
5995
goto __pyx_L0;
5996
5997
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":242
5998
* - self.alpha_inv[n+1] * self.modular_symbol(a, self.p_pow[n-1]))
5999
*
6000
* cpdef long measure_mulmod(self, long a, int n, long pp) except 9223372036854775807: # 64-bit maxint # <<<<<<<<<<<<<<
6001
* """
6002
* Compute mu(a/p^n). Note that the second input is the exponent of p.
6003
*/
6004
6005
/* function exit code */
6006
__pyx_L1_error:;
6007
__Pyx_XDECREF(__pyx_t_1);
6008
__Pyx_XDECREF(__pyx_t_2);
6009
__Pyx_XDECREF(__pyx_t_3);
6010
__Pyx_XDECREF(__pyx_t_4);
6011
__Pyx_XDECREF(__pyx_t_5);
6012
__Pyx_XDECREF(__pyx_t_6);
6013
__Pyx_XDECREF(__pyx_t_7);
6014
__Pyx_XDECREF(__pyx_t_9);
6015
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.measure_mulmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
6016
__pyx_r = 0x7FFFFFFFFFFFFFFF;
6017
__pyx_L0:;
6018
__Pyx_RefNannyFinishContext();
6019
return __pyx_r;
6020
}
6021
6022
/* Python wrapper */
6023
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_15measure_mulmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6024
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_14measure_mulmod[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 242)\n\n Compute mu(a/p^n). Note that the second input is the exponent of p.\n\n Uses GMP to do the multiplies modulo pp, to avoid overflow. Slower, but safe.\n\n INPUT:\n - a -- long\n - n -- int (very small)\n - pp -- long (modulus, a power of p).\n ";
6025
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_15measure_mulmod(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6026
long __pyx_v_a;
6027
int __pyx_v_n;
6028
long __pyx_v_pp;
6029
PyObject *__pyx_r = 0;
6030
__Pyx_RefNannyDeclarations
6031
__Pyx_RefNannySetupContext("measure_mulmod (wrapper)", 0);
6032
{
6033
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a,&__pyx_n_s_n,&__pyx_n_s_pp,0};
6034
PyObject* values[3] = {0,0,0};
6035
if (unlikely(__pyx_kwds)) {
6036
Py_ssize_t kw_args;
6037
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6038
switch (pos_args) {
6039
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6040
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6041
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6042
case 0: break;
6043
default: goto __pyx_L5_argtuple_error;
6044
}
6045
kw_args = PyDict_Size(__pyx_kwds);
6046
switch (pos_args) {
6047
case 0:
6048
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_a)) != 0)) kw_args--;
6049
else goto __pyx_L5_argtuple_error;
6050
case 1:
6051
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
6052
else {
6053
__Pyx_RaiseArgtupleInvalid("measure_mulmod", 1, 3, 3, 1); __PYX_ERR(0, 242, __pyx_L3_error)
6054
}
6055
case 2:
6056
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_pp)) != 0)) kw_args--;
6057
else {
6058
__Pyx_RaiseArgtupleInvalid("measure_mulmod", 1, 3, 3, 2); __PYX_ERR(0, 242, __pyx_L3_error)
6059
}
6060
}
6061
if (unlikely(kw_args > 0)) {
6062
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "measure_mulmod") < 0)) __PYX_ERR(0, 242, __pyx_L3_error)
6063
}
6064
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
6065
goto __pyx_L5_argtuple_error;
6066
} else {
6067
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6068
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6069
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6070
}
6071
__pyx_v_a = __Pyx_PyInt_As_long(values[0]); if (unlikely((__pyx_v_a == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
6072
__pyx_v_n = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
6073
__pyx_v_pp = __Pyx_PyInt_As_long(values[2]); if (unlikely((__pyx_v_pp == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L3_error)
6074
}
6075
goto __pyx_L4_argument_unpacking_done;
6076
__pyx_L5_argtuple_error:;
6077
__Pyx_RaiseArgtupleInvalid("measure_mulmod", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 242, __pyx_L3_error)
6078
__pyx_L3_error:;
6079
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.measure_mulmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
6080
__Pyx_RefNannyFinishContext();
6081
return NULL;
6082
__pyx_L4_argument_unpacking_done:;
6083
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_14measure_mulmod(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_a, __pyx_v_n, __pyx_v_pp);
6084
6085
/* function exit code */
6086
__Pyx_RefNannyFinishContext();
6087
return __pyx_r;
6088
}
6089
6090
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_14measure_mulmod(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, long __pyx_v_a, int __pyx_v_n, long __pyx_v_pp) {
6091
PyObject *__pyx_r = NULL;
6092
__Pyx_RefNannyDeclarations
6093
long __pyx_t_1;
6094
PyObject *__pyx_t_2 = NULL;
6095
__Pyx_RefNannySetupContext("measure_mulmod", 0);
6096
__Pyx_XDECREF(__pyx_r);
6097
__pyx_t_1 = __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure_mulmod(__pyx_v_self, __pyx_v_a, __pyx_v_n, __pyx_v_pp, 1); if (unlikely(__pyx_t_1 == 0x7FFFFFFFFFFFFFFF)) __PYX_ERR(0, 242, __pyx_L1_error)
6098
__pyx_t_2 = __Pyx_PyInt_From_long(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 242, __pyx_L1_error)
6099
__Pyx_GOTREF(__pyx_t_2);
6100
__pyx_r = __pyx_t_2;
6101
__pyx_t_2 = 0;
6102
goto __pyx_L0;
6103
6104
/* function exit code */
6105
__pyx_L1_error:;
6106
__Pyx_XDECREF(__pyx_t_2);
6107
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.measure_mulmod", __pyx_clineno, __pyx_lineno, __pyx_filename);
6108
__pyx_r = NULL;
6109
__pyx_L0:;
6110
__Pyx_XGIVEREF(__pyx_r);
6111
__Pyx_RefNannyFinishContext();
6112
return __pyx_r;
6113
}
6114
6115
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":268
6116
* return ans
6117
*
6118
* def _series(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False, # <<<<<<<<<<<<<<
6119
* long start=-1, long stop=-1):
6120
* """
6121
*/
6122
6123
/* Python wrapper */
6124
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_17_series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
6125
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_16_series[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 268)\n\n EXAMPLES::\n\n sage: import psage.modform.rational.padic_elliptic_lseries_fast as p; L = p.pAdicLseries(EllipticCurve('389a'),5)\n sage: f = L._series(2, 3, ser_prec=6); f.change_ring(Integers(5^3))\n 73*T^4 + 42*T^3 + 89*T^2 + 120*T\n sage: f = L._series(3, 4, ser_prec=6); f.change_ring(Integers(5^3))\n 36*T^5 + 53*T^4 + 47*T^3 + 99*T^2\n sage: f = L._series(4, 5, ser_prec=6); f.change_ring(Integers(5^3))\n 61*T^5 + 53*T^4 + 22*T^3 + 49*T^2\n sage: f = L._series(5, 6, ser_prec=6); f.change_ring(Integers(5^3))\n 111*T^5 + 53*T^4 + 22*T^3 + 49*T^2\n ";
6126
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_17_series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
6127
int __pyx_v_n;
6128
PyObject *__pyx_v_prec = 0;
6129
PyObject *__pyx_v_ser_prec = 0;
6130
int __pyx_v_verb;
6131
int __pyx_v_force_mulmod;
6132
long __pyx_v_start;
6133
long __pyx_v_stop;
6134
PyObject *__pyx_r = 0;
6135
__Pyx_RefNannyDeclarations
6136
__Pyx_RefNannySetupContext("_series (wrapper)", 0);
6137
{
6138
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_prec,&__pyx_n_s_ser_prec,&__pyx_n_s_verb,&__pyx_n_s_force_mulmod,&__pyx_n_s_start,&__pyx_n_s_stop,0};
6139
PyObject* values[7] = {0,0,0,0,0,0,0};
6140
values[2] = ((PyObject *)__pyx_int_5);
6141
if (unlikely(__pyx_kwds)) {
6142
Py_ssize_t kw_args;
6143
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
6144
switch (pos_args) {
6145
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6146
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6147
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6148
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6149
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6150
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6151
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6152
case 0: break;
6153
default: goto __pyx_L5_argtuple_error;
6154
}
6155
kw_args = PyDict_Size(__pyx_kwds);
6156
switch (pos_args) {
6157
case 0:
6158
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
6159
else goto __pyx_L5_argtuple_error;
6160
case 1:
6161
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prec)) != 0)) kw_args--;
6162
else {
6163
__Pyx_RaiseArgtupleInvalid("_series", 0, 2, 7, 1); __PYX_ERR(0, 268, __pyx_L3_error)
6164
}
6165
case 2:
6166
if (kw_args > 0) {
6167
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ser_prec);
6168
if (value) { values[2] = value; kw_args--; }
6169
}
6170
case 3:
6171
if (kw_args > 0) {
6172
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verb);
6173
if (value) { values[3] = value; kw_args--; }
6174
}
6175
case 4:
6176
if (kw_args > 0) {
6177
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force_mulmod);
6178
if (value) { values[4] = value; kw_args--; }
6179
}
6180
case 5:
6181
if (kw_args > 0) {
6182
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start);
6183
if (value) { values[5] = value; kw_args--; }
6184
}
6185
case 6:
6186
if (kw_args > 0) {
6187
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop);
6188
if (value) { values[6] = value; kw_args--; }
6189
}
6190
}
6191
if (unlikely(kw_args > 0)) {
6192
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_series") < 0)) __PYX_ERR(0, 268, __pyx_L3_error)
6193
}
6194
} else {
6195
switch (PyTuple_GET_SIZE(__pyx_args)) {
6196
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
6197
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
6198
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
6199
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
6200
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
6201
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
6202
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
6203
break;
6204
default: goto __pyx_L5_argtuple_error;
6205
}
6206
}
6207
__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
6208
__pyx_v_prec = values[1];
6209
__pyx_v_ser_prec = values[2];
6210
if (values[3]) {
6211
__pyx_v_verb = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_verb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
6212
} else {
6213
__pyx_v_verb = ((int)0);
6214
}
6215
if (values[4]) {
6216
__pyx_v_force_mulmod = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_force_mulmod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L3_error)
6217
} else {
6218
__pyx_v_force_mulmod = ((int)0);
6219
}
6220
if (values[5]) {
6221
__pyx_v_start = __Pyx_PyInt_As_long(values[5]); if (unlikely((__pyx_v_start == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error)
6222
} else {
6223
__pyx_v_start = ((long)-1L);
6224
}
6225
if (values[6]) {
6226
__pyx_v_stop = __Pyx_PyInt_As_long(values[6]); if (unlikely((__pyx_v_stop == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 269, __pyx_L3_error)
6227
} else {
6228
__pyx_v_stop = ((long)-1L);
6229
}
6230
}
6231
goto __pyx_L4_argument_unpacking_done;
6232
__pyx_L5_argtuple_error:;
6233
__Pyx_RaiseArgtupleInvalid("_series", 0, 2, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 268, __pyx_L3_error)
6234
__pyx_L3_error:;
6235
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._series", __pyx_clineno, __pyx_lineno, __pyx_filename);
6236
__Pyx_RefNannyFinishContext();
6237
return NULL;
6238
__pyx_L4_argument_unpacking_done:;
6239
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_16_series(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_n, __pyx_v_prec, __pyx_v_ser_prec, __pyx_v_verb, __pyx_v_force_mulmod, __pyx_v_start, __pyx_v_stop);
6240
6241
/* function exit code */
6242
__Pyx_RefNannyFinishContext();
6243
return __pyx_r;
6244
}
6245
6246
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_16_series(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, int __pyx_v_verb, int __pyx_v_force_mulmod, long __pyx_v_start, long __pyx_v_stop) {
6247
long __pyx_v_a;
6248
long __pyx_v_b;
6249
CYTHON_UNUSED long __pyx_v_j;
6250
long __pyx_v_s;
6251
long __pyx_v_gamma_pow;
6252
long __pyx_v_gamma;
6253
long __pyx_v_pp;
6254
PyObject *__pyx_v_R = NULL;
6255
PyObject *__pyx_v_T = NULL;
6256
PyObject *__pyx_v_one_plus_T_factor = NULL;
6257
PyObject *__pyx_v_L = NULL;
6258
PyObject *__pyx_v_one_plus_T = NULL;
6259
PyObject *__pyx_r = NULL;
6260
__Pyx_RefNannyDeclarations
6261
int __pyx_t_1;
6262
PyObject *__pyx_t_2 = NULL;
6263
PyObject *__pyx_t_3 = NULL;
6264
Py_ssize_t __pyx_t_4;
6265
PyObject *__pyx_t_5 = NULL;
6266
PyObject *__pyx_t_6 = NULL;
6267
PyObject *__pyx_t_7 = NULL;
6268
int __pyx_t_8;
6269
PyObject *__pyx_t_9 = NULL;
6270
long __pyx_t_10;
6271
int __pyx_t_11;
6272
long __pyx_t_12;
6273
long __pyx_t_13;
6274
long __pyx_t_14;
6275
long __pyx_t_15;
6276
__Pyx_RefNannySetupContext("_series", 0);
6277
6278
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":283
6279
* 111*T^5 + 53*T^4 + 22*T^3 + 49*T^2
6280
* """
6281
* if verb: # <<<<<<<<<<<<<<
6282
* print "_series %s computing mod p^%s"%(n, prec)
6283
*
6284
*/
6285
__pyx_t_1 = (__pyx_v_verb != 0);
6286
if (__pyx_t_1) {
6287
6288
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":284
6289
* """
6290
* if verb:
6291
* print "_series %s computing mod p^%s"%(n, prec) # <<<<<<<<<<<<<<
6292
*
6293
* cdef long a, b, j, s, gamma_pow, gamma, pp
6294
*/
6295
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
6296
__Pyx_GOTREF(__pyx_t_2);
6297
__pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 284, __pyx_L1_error)
6298
__Pyx_GOTREF(__pyx_t_3);
6299
__Pyx_GIVEREF(__pyx_t_2);
6300
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2);
6301
__Pyx_INCREF(__pyx_v_prec);
6302
__Pyx_GIVEREF(__pyx_v_prec);
6303
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_prec);
6304
__pyx_t_2 = 0;
6305
__pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_series_s_computing_mod_p_s, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 284, __pyx_L1_error)
6306
__Pyx_GOTREF(__pyx_t_2);
6307
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6308
if (__Pyx_PrintOne(0, __pyx_t_2) < 0) __PYX_ERR(0, 284, __pyx_L1_error)
6309
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6310
6311
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":283
6312
* 111*T^5 + 53*T^4 + 22*T^3 + 49*T^2
6313
* """
6314
* if verb: # <<<<<<<<<<<<<<
6315
* print "_series %s computing mod p^%s"%(n, prec)
6316
*
6317
*/
6318
}
6319
6320
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":288
6321
* cdef long a, b, j, s, gamma_pow, gamma, pp
6322
*
6323
* assert prec >= n, "prec (=%s) must be as large as approximation n (=%s)"%(prec, n) # <<<<<<<<<<<<<<
6324
*
6325
* pp = self.p_pow[prec]
6326
*/
6327
#ifndef CYTHON_WITHOUT_ASSERTIONS
6328
if (unlikely(!Py_OptimizeFlag)) {
6329
__pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
6330
__Pyx_GOTREF(__pyx_t_2);
6331
__pyx_t_3 = PyObject_RichCompare(__pyx_v_prec, __pyx_t_2, Py_GE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
6332
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6333
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 288, __pyx_L1_error)
6334
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6335
if (unlikely(!__pyx_t_1)) {
6336
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
6337
__Pyx_GOTREF(__pyx_t_3);
6338
__pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 288, __pyx_L1_error)
6339
__Pyx_GOTREF(__pyx_t_2);
6340
__Pyx_INCREF(__pyx_v_prec);
6341
__Pyx_GIVEREF(__pyx_v_prec);
6342
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_prec);
6343
__Pyx_GIVEREF(__pyx_t_3);
6344
PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
6345
__pyx_t_3 = 0;
6346
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_prec_s_must_be_as_large_as_appro, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 288, __pyx_L1_error)
6347
__Pyx_GOTREF(__pyx_t_3);
6348
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6349
PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
6350
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6351
__PYX_ERR(0, 288, __pyx_L1_error)
6352
}
6353
}
6354
#endif
6355
6356
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":290
6357
* assert prec >= n, "prec (=%s) must be as large as approximation n (=%s)"%(prec, n)
6358
*
6359
* pp = self.p_pow[prec] # <<<<<<<<<<<<<<
6360
*
6361
* gamma = 1 + self.p
6362
*/
6363
__pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_prec); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 290, __pyx_L1_error)
6364
__pyx_v_pp = (__pyx_v_self->p_pow[__pyx_t_4]);
6365
6366
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":292
6367
* pp = self.p_pow[prec]
6368
*
6369
* gamma = 1 + self.p # <<<<<<<<<<<<<<
6370
* gamma_pow = 1
6371
*
6372
*/
6373
__pyx_v_gamma = (1 + __pyx_v_self->p);
6374
6375
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":293
6376
*
6377
* gamma = 1 + self.p
6378
* gamma_pow = 1 # <<<<<<<<<<<<<<
6379
*
6380
* R = Integers(pp)['T']
6381
*/
6382
__pyx_v_gamma_pow = 1;
6383
6384
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":295
6385
* gamma_pow = 1
6386
*
6387
* R = Integers(pp)['T'] # <<<<<<<<<<<<<<
6388
* T = R.gen()
6389
* one_plus_T_factor = R(1)
6390
*/
6391
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_Integers); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
6392
__Pyx_GOTREF(__pyx_t_2);
6393
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 295, __pyx_L1_error)
6394
__Pyx_GOTREF(__pyx_t_5);
6395
__pyx_t_6 = NULL;
6396
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6397
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
6398
if (likely(__pyx_t_6)) {
6399
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6400
__Pyx_INCREF(__pyx_t_6);
6401
__Pyx_INCREF(function);
6402
__Pyx_DECREF_SET(__pyx_t_2, function);
6403
}
6404
}
6405
if (!__pyx_t_6) {
6406
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
6407
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6408
__Pyx_GOTREF(__pyx_t_3);
6409
} else {
6410
#if CYTHON_FAST_PYCALL
6411
if (PyFunction_Check(__pyx_t_2)) {
6412
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
6413
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
6414
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6415
__Pyx_GOTREF(__pyx_t_3);
6416
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6417
} else
6418
#endif
6419
#if CYTHON_FAST_PYCCALL
6420
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
6421
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
6422
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
6423
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6424
__Pyx_GOTREF(__pyx_t_3);
6425
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6426
} else
6427
#endif
6428
{
6429
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 295, __pyx_L1_error)
6430
__Pyx_GOTREF(__pyx_t_7);
6431
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
6432
__Pyx_GIVEREF(__pyx_t_5);
6433
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
6434
__pyx_t_5 = 0;
6435
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 295, __pyx_L1_error)
6436
__Pyx_GOTREF(__pyx_t_3);
6437
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6438
}
6439
}
6440
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6441
__pyx_t_2 = PyObject_GetItem(__pyx_t_3, __pyx_n_s_T); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 295, __pyx_L1_error)
6442
__Pyx_GOTREF(__pyx_t_2);
6443
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6444
__pyx_v_R = __pyx_t_2;
6445
__pyx_t_2 = 0;
6446
6447
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":296
6448
*
6449
* R = Integers(pp)['T']
6450
* T = R.gen() # <<<<<<<<<<<<<<
6451
* one_plus_T_factor = R(1)
6452
* L = R(0)
6453
*/
6454
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_R, __pyx_n_s_gen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 296, __pyx_L1_error)
6455
__Pyx_GOTREF(__pyx_t_3);
6456
__pyx_t_7 = NULL;
6457
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6458
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_3);
6459
if (likely(__pyx_t_7)) {
6460
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6461
__Pyx_INCREF(__pyx_t_7);
6462
__Pyx_INCREF(function);
6463
__Pyx_DECREF_SET(__pyx_t_3, function);
6464
}
6465
}
6466
if (__pyx_t_7) {
6467
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
6468
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6469
} else {
6470
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 296, __pyx_L1_error)
6471
}
6472
__Pyx_GOTREF(__pyx_t_2);
6473
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6474
__pyx_v_T = __pyx_t_2;
6475
__pyx_t_2 = 0;
6476
6477
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":297
6478
* R = Integers(pp)['T']
6479
* T = R.gen()
6480
* one_plus_T_factor = R(1) # <<<<<<<<<<<<<<
6481
* L = R(0)
6482
* one_plus_T = 1+T
6483
*/
6484
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_R, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 297, __pyx_L1_error)
6485
__Pyx_GOTREF(__pyx_t_2);
6486
__pyx_v_one_plus_T_factor = __pyx_t_2;
6487
__pyx_t_2 = 0;
6488
6489
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":298
6490
* T = R.gen()
6491
* one_plus_T_factor = R(1)
6492
* L = R(0) # <<<<<<<<<<<<<<
6493
* one_plus_T = 1+T
6494
*
6495
*/
6496
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_v_R, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 298, __pyx_L1_error)
6497
__Pyx_GOTREF(__pyx_t_2);
6498
__pyx_v_L = __pyx_t_2;
6499
__pyx_t_2 = 0;
6500
6501
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":299
6502
* one_plus_T_factor = R(1)
6503
* L = R(0)
6504
* one_plus_T = 1+T # <<<<<<<<<<<<<<
6505
*
6506
* if start == -1:
6507
*/
6508
__pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_v_T, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 299, __pyx_L1_error)
6509
__Pyx_GOTREF(__pyx_t_2);
6510
__pyx_v_one_plus_T = __pyx_t_2;
6511
__pyx_t_2 = 0;
6512
6513
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":301
6514
* one_plus_T = 1+T
6515
*
6516
* if start == -1: # <<<<<<<<<<<<<<
6517
* start = 0
6518
* stop = self.p_pow[n-1]
6519
*/
6520
__pyx_t_1 = ((__pyx_v_start == -1L) != 0);
6521
if (__pyx_t_1) {
6522
6523
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":302
6524
*
6525
* if start == -1:
6526
* start = 0 # <<<<<<<<<<<<<<
6527
* stop = self.p_pow[n-1]
6528
*
6529
*/
6530
__pyx_v_start = 0;
6531
6532
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":303
6533
* if start == -1:
6534
* start = 0
6535
* stop = self.p_pow[n-1] # <<<<<<<<<<<<<<
6536
*
6537
* if start != 0:
6538
*/
6539
__pyx_v_stop = (__pyx_v_self->p_pow[(__pyx_v_n - 1)]);
6540
6541
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":301
6542
* one_plus_T = 1+T
6543
*
6544
* if start == -1: # <<<<<<<<<<<<<<
6545
* start = 0
6546
* stop = self.p_pow[n-1]
6547
*/
6548
}
6549
6550
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":305
6551
* stop = self.p_pow[n-1]
6552
*
6553
* if start != 0: # <<<<<<<<<<<<<<
6554
* # initialize gamma_pow and one_plus_T_factor to be
6555
* # gamma_pow = gamma^start
6556
*/
6557
__pyx_t_1 = ((__pyx_v_start != 0) != 0);
6558
if (__pyx_t_1) {
6559
6560
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":309
6561
* # gamma_pow = gamma^start
6562
* # one_plus_T_factor = one_plus_T^start
6563
* gamma_pow = Mod(gamma, pp)**start # <<<<<<<<<<<<<<
6564
* one_plus_T_factor = ((one_plus_T + O(T**ser_prec))**start).truncate(ser_prec)
6565
*
6566
*/
6567
__pyx_t_3 = __Pyx_GetModuleGlobalName(__pyx_n_s_Mod); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
6568
__Pyx_GOTREF(__pyx_t_3);
6569
__pyx_t_7 = __Pyx_PyInt_From_long(__pyx_v_gamma); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 309, __pyx_L1_error)
6570
__Pyx_GOTREF(__pyx_t_7);
6571
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_pp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 309, __pyx_L1_error)
6572
__Pyx_GOTREF(__pyx_t_5);
6573
__pyx_t_6 = NULL;
6574
__pyx_t_8 = 0;
6575
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
6576
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6577
if (likely(__pyx_t_6)) {
6578
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6579
__Pyx_INCREF(__pyx_t_6);
6580
__Pyx_INCREF(function);
6581
__Pyx_DECREF_SET(__pyx_t_3, function);
6582
__pyx_t_8 = 1;
6583
}
6584
}
6585
#if CYTHON_FAST_PYCALL
6586
if (PyFunction_Check(__pyx_t_3)) {
6587
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_5};
6588
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
6589
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6590
__Pyx_GOTREF(__pyx_t_2);
6591
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6592
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6593
} else
6594
#endif
6595
#if CYTHON_FAST_PYCCALL
6596
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
6597
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_7, __pyx_t_5};
6598
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
6599
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6600
__Pyx_GOTREF(__pyx_t_2);
6601
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6602
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6603
} else
6604
#endif
6605
{
6606
__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
6607
__Pyx_GOTREF(__pyx_t_9);
6608
if (__pyx_t_6) {
6609
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
6610
}
6611
__Pyx_GIVEREF(__pyx_t_7);
6612
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_7);
6613
__Pyx_GIVEREF(__pyx_t_5);
6614
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_t_5);
6615
__pyx_t_7 = 0;
6616
__pyx_t_5 = 0;
6617
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_9, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 309, __pyx_L1_error)
6618
__Pyx_GOTREF(__pyx_t_2);
6619
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6620
}
6621
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6622
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 309, __pyx_L1_error)
6623
__Pyx_GOTREF(__pyx_t_3);
6624
__pyx_t_9 = PyNumber_Power(__pyx_t_2, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 309, __pyx_L1_error)
6625
__Pyx_GOTREF(__pyx_t_9);
6626
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6627
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6628
__pyx_t_10 = __Pyx_PyInt_As_long(__pyx_t_9); if (unlikely((__pyx_t_10 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 309, __pyx_L1_error)
6629
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6630
__pyx_v_gamma_pow = __pyx_t_10;
6631
6632
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":310
6633
* # one_plus_T_factor = one_plus_T^start
6634
* gamma_pow = Mod(gamma, pp)**start
6635
* one_plus_T_factor = ((one_plus_T + O(T**ser_prec))**start).truncate(ser_prec) # <<<<<<<<<<<<<<
6636
*
6637
* if not force_mulmod and prec <= self.prec // 2:
6638
*/
6639
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_O); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
6640
__Pyx_GOTREF(__pyx_t_2);
6641
__pyx_t_5 = PyNumber_Power(__pyx_v_T, __pyx_v_ser_prec, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 310, __pyx_L1_error)
6642
__Pyx_GOTREF(__pyx_t_5);
6643
__pyx_t_7 = NULL;
6644
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
6645
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_2);
6646
if (likely(__pyx_t_7)) {
6647
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
6648
__Pyx_INCREF(__pyx_t_7);
6649
__Pyx_INCREF(function);
6650
__Pyx_DECREF_SET(__pyx_t_2, function);
6651
}
6652
}
6653
if (!__pyx_t_7) {
6654
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
6655
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6656
__Pyx_GOTREF(__pyx_t_3);
6657
} else {
6658
#if CYTHON_FAST_PYCALL
6659
if (PyFunction_Check(__pyx_t_2)) {
6660
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
6661
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
6662
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6663
__Pyx_GOTREF(__pyx_t_3);
6664
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6665
} else
6666
#endif
6667
#if CYTHON_FAST_PYCCALL
6668
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
6669
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
6670
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
6671
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
6672
__Pyx_GOTREF(__pyx_t_3);
6673
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
6674
} else
6675
#endif
6676
{
6677
__pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
6678
__Pyx_GOTREF(__pyx_t_6);
6679
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
6680
__Pyx_GIVEREF(__pyx_t_5);
6681
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
6682
__pyx_t_5 = 0;
6683
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
6684
__Pyx_GOTREF(__pyx_t_3);
6685
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6686
}
6687
}
6688
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6689
__pyx_t_2 = PyNumber_Add(__pyx_v_one_plus_T, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
6690
__Pyx_GOTREF(__pyx_t_2);
6691
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6692
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
6693
__Pyx_GOTREF(__pyx_t_3);
6694
__pyx_t_6 = PyNumber_Power(__pyx_t_2, __pyx_t_3, Py_None); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 310, __pyx_L1_error)
6695
__Pyx_GOTREF(__pyx_t_6);
6696
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6697
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6698
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_truncate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 310, __pyx_L1_error)
6699
__Pyx_GOTREF(__pyx_t_3);
6700
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6701
__pyx_t_6 = NULL;
6702
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
6703
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
6704
if (likely(__pyx_t_6)) {
6705
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
6706
__Pyx_INCREF(__pyx_t_6);
6707
__Pyx_INCREF(function);
6708
__Pyx_DECREF_SET(__pyx_t_3, function);
6709
}
6710
}
6711
if (!__pyx_t_6) {
6712
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_ser_prec); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
6713
__Pyx_GOTREF(__pyx_t_9);
6714
} else {
6715
#if CYTHON_FAST_PYCALL
6716
if (PyFunction_Check(__pyx_t_3)) {
6717
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_ser_prec};
6718
__pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
6719
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6720
__Pyx_GOTREF(__pyx_t_9);
6721
} else
6722
#endif
6723
#if CYTHON_FAST_PYCCALL
6724
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
6725
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_ser_prec};
6726
__pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
6727
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
6728
__Pyx_GOTREF(__pyx_t_9);
6729
} else
6730
#endif
6731
{
6732
__pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 310, __pyx_L1_error)
6733
__Pyx_GOTREF(__pyx_t_2);
6734
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_6); __pyx_t_6 = NULL;
6735
__Pyx_INCREF(__pyx_v_ser_prec);
6736
__Pyx_GIVEREF(__pyx_v_ser_prec);
6737
PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_ser_prec);
6738
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 310, __pyx_L1_error)
6739
__Pyx_GOTREF(__pyx_t_9);
6740
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6741
}
6742
}
6743
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6744
__Pyx_DECREF_SET(__pyx_v_one_plus_T_factor, __pyx_t_9);
6745
__pyx_t_9 = 0;
6746
6747
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":305
6748
* stop = self.p_pow[n-1]
6749
*
6750
* if start != 0: # <<<<<<<<<<<<<<
6751
* # initialize gamma_pow and one_plus_T_factor to be
6752
* # gamma_pow = gamma^start
6753
*/
6754
}
6755
6756
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":312
6757
* one_plus_T_factor = ((one_plus_T + O(T**ser_prec))**start).truncate(ser_prec)
6758
*
6759
* if not force_mulmod and prec <= self.prec // 2: # <<<<<<<<<<<<<<
6760
* # no concerns about overflow when multiplying together two longs, then reducing modulo pp
6761
* for j in range(start, stop):
6762
*/
6763
__pyx_t_11 = ((!(__pyx_v_force_mulmod != 0)) != 0);
6764
if (__pyx_t_11) {
6765
} else {
6766
__pyx_t_1 = __pyx_t_11;
6767
goto __pyx_L7_bool_binop_done;
6768
}
6769
__pyx_t_9 = __Pyx_PyInt_From_long(__Pyx_div_long(__pyx_v_self->prec, 2)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 312, __pyx_L1_error)
6770
__Pyx_GOTREF(__pyx_t_9);
6771
__pyx_t_3 = PyObject_RichCompare(__pyx_v_prec, __pyx_t_9, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 312, __pyx_L1_error)
6772
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6773
__pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_11 < 0)) __PYX_ERR(0, 312, __pyx_L1_error)
6774
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6775
__pyx_t_1 = __pyx_t_11;
6776
__pyx_L7_bool_binop_done:;
6777
if (__pyx_t_1) {
6778
6779
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":314
6780
* if not force_mulmod and prec <= self.prec // 2:
6781
* # no concerns about overflow when multiplying together two longs, then reducing modulo pp
6782
* for j in range(start, stop): # <<<<<<<<<<<<<<
6783
* sig_on()
6784
* s = 0
6785
*/
6786
__pyx_t_10 = __pyx_v_stop;
6787
for (__pyx_t_12 = __pyx_v_start; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
6788
__pyx_v_j = __pyx_t_12;
6789
6790
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":315
6791
* # no concerns about overflow when multiplying together two longs, then reducing modulo pp
6792
* for j in range(start, stop):
6793
* sig_on() # <<<<<<<<<<<<<<
6794
* s = 0
6795
* for a in range(1, self.p):
6796
*/
6797
__pyx_t_8 = sig_on(); if (unlikely(__pyx_t_8 == 0)) __PYX_ERR(0, 315, __pyx_L1_error)
6798
6799
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":316
6800
* for j in range(start, stop):
6801
* sig_on()
6802
* s = 0 # <<<<<<<<<<<<<<
6803
* for a in range(1, self.p):
6804
* b = self.teich[a] * gamma_pow
6805
*/
6806
__pyx_v_s = 0;
6807
6808
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":317
6809
* sig_on()
6810
* s = 0
6811
* for a in range(1, self.p): # <<<<<<<<<<<<<<
6812
* b = self.teich[a] * gamma_pow
6813
* s += self.measure(b, n)
6814
*/
6815
__pyx_t_13 = __pyx_v_self->p;
6816
for (__pyx_t_14 = 1; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
6817
__pyx_v_a = __pyx_t_14;
6818
6819
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":318
6820
* s = 0
6821
* for a in range(1, self.p):
6822
* b = self.teich[a] * gamma_pow # <<<<<<<<<<<<<<
6823
* s += self.measure(b, n)
6824
* sig_off()
6825
*/
6826
__pyx_v_b = ((__pyx_v_self->teich[__pyx_v_a]) * __pyx_v_gamma_pow);
6827
6828
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":319
6829
* for a in range(1, self.p):
6830
* b = self.teich[a] * gamma_pow
6831
* s += self.measure(b, n) # <<<<<<<<<<<<<<
6832
* sig_off()
6833
* L += (s * one_plus_T_factor).truncate(ser_prec)
6834
*/
6835
__pyx_t_15 = ((struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self->__pyx_vtab)->measure(__pyx_v_self, __pyx_v_b, __pyx_v_n, 0); if (unlikely(__pyx_t_15 == 0x7FFFFFFFFFFFFFFF)) __PYX_ERR(0, 319, __pyx_L1_error)
6836
__pyx_v_s = (__pyx_v_s + __pyx_t_15);
6837
}
6838
6839
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":320
6840
* b = self.teich[a] * gamma_pow
6841
* s += self.measure(b, n)
6842
* sig_off() # <<<<<<<<<<<<<<
6843
* L += (s * one_plus_T_factor).truncate(ser_prec)
6844
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec)
6845
*/
6846
sig_off();
6847
6848
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":321
6849
* s += self.measure(b, n)
6850
* sig_off()
6851
* L += (s * one_plus_T_factor).truncate(ser_prec) # <<<<<<<<<<<<<<
6852
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec)
6853
* gamma_pow = (gamma_pow * gamma)%pp
6854
*/
6855
__pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_s); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L1_error)
6856
__Pyx_GOTREF(__pyx_t_9);
6857
__pyx_t_2 = PyNumber_Multiply(__pyx_t_9, __pyx_v_one_plus_T_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 321, __pyx_L1_error)
6858
__Pyx_GOTREF(__pyx_t_2);
6859
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6860
__pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_truncate); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L1_error)
6861
__Pyx_GOTREF(__pyx_t_9);
6862
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6863
__pyx_t_2 = NULL;
6864
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
6865
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_9);
6866
if (likely(__pyx_t_2)) {
6867
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
6868
__Pyx_INCREF(__pyx_t_2);
6869
__Pyx_INCREF(function);
6870
__Pyx_DECREF_SET(__pyx_t_9, function);
6871
}
6872
}
6873
if (!__pyx_t_2) {
6874
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_v_ser_prec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
6875
__Pyx_GOTREF(__pyx_t_3);
6876
} else {
6877
#if CYTHON_FAST_PYCALL
6878
if (PyFunction_Check(__pyx_t_9)) {
6879
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_ser_prec};
6880
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
6881
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6882
__Pyx_GOTREF(__pyx_t_3);
6883
} else
6884
#endif
6885
#if CYTHON_FAST_PYCCALL
6886
if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
6887
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_ser_prec};
6888
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
6889
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
6890
__Pyx_GOTREF(__pyx_t_3);
6891
} else
6892
#endif
6893
{
6894
__pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 321, __pyx_L1_error)
6895
__Pyx_GOTREF(__pyx_t_6);
6896
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_2); __pyx_t_2 = NULL;
6897
__Pyx_INCREF(__pyx_v_ser_prec);
6898
__Pyx_GIVEREF(__pyx_v_ser_prec);
6899
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_ser_prec);
6900
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 321, __pyx_L1_error)
6901
__Pyx_GOTREF(__pyx_t_3);
6902
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6903
}
6904
}
6905
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6906
__pyx_t_9 = PyNumber_InPlaceAdd(__pyx_v_L, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 321, __pyx_L1_error)
6907
__Pyx_GOTREF(__pyx_t_9);
6908
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6909
__Pyx_DECREF_SET(__pyx_v_L, __pyx_t_9);
6910
__pyx_t_9 = 0;
6911
6912
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":322
6913
* sig_off()
6914
* L += (s * one_plus_T_factor).truncate(ser_prec)
6915
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec) # <<<<<<<<<<<<<<
6916
* gamma_pow = (gamma_pow * gamma)%pp
6917
* #if verb: print j, s, one_plus_T_factor, gamma_pow
6918
*/
6919
__pyx_t_3 = PyNumber_Multiply(__pyx_v_one_plus_T, __pyx_v_one_plus_T_factor); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 322, __pyx_L1_error)
6920
__Pyx_GOTREF(__pyx_t_3);
6921
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_truncate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 322, __pyx_L1_error)
6922
__Pyx_GOTREF(__pyx_t_6);
6923
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6924
__pyx_t_3 = NULL;
6925
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
6926
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_6);
6927
if (likely(__pyx_t_3)) {
6928
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
6929
__Pyx_INCREF(__pyx_t_3);
6930
__Pyx_INCREF(function);
6931
__Pyx_DECREF_SET(__pyx_t_6, function);
6932
}
6933
}
6934
if (!__pyx_t_3) {
6935
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_ser_prec); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error)
6936
__Pyx_GOTREF(__pyx_t_9);
6937
} else {
6938
#if CYTHON_FAST_PYCALL
6939
if (PyFunction_Check(__pyx_t_6)) {
6940
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_ser_prec};
6941
__pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error)
6942
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6943
__Pyx_GOTREF(__pyx_t_9);
6944
} else
6945
#endif
6946
#if CYTHON_FAST_PYCCALL
6947
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
6948
PyObject *__pyx_temp[2] = {__pyx_t_3, __pyx_v_ser_prec};
6949
__pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error)
6950
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
6951
__Pyx_GOTREF(__pyx_t_9);
6952
} else
6953
#endif
6954
{
6955
__pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 322, __pyx_L1_error)
6956
__Pyx_GOTREF(__pyx_t_2);
6957
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3); __pyx_t_3 = NULL;
6958
__Pyx_INCREF(__pyx_v_ser_prec);
6959
__Pyx_GIVEREF(__pyx_v_ser_prec);
6960
PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_ser_prec);
6961
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_2, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 322, __pyx_L1_error)
6962
__Pyx_GOTREF(__pyx_t_9);
6963
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
6964
}
6965
}
6966
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
6967
__Pyx_DECREF_SET(__pyx_v_one_plus_T_factor, __pyx_t_9);
6968
__pyx_t_9 = 0;
6969
6970
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":323
6971
* L += (s * one_plus_T_factor).truncate(ser_prec)
6972
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec)
6973
* gamma_pow = (gamma_pow * gamma)%pp # <<<<<<<<<<<<<<
6974
* #if verb: print j, s, one_plus_T_factor, gamma_pow
6975
* return L * self.normalization
6976
*/
6977
__pyx_t_13 = (__pyx_v_gamma_pow * __pyx_v_gamma);
6978
if (unlikely(__pyx_v_pp == 0)) {
6979
PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
6980
__PYX_ERR(0, 323, __pyx_L1_error)
6981
}
6982
__pyx_v_gamma_pow = __Pyx_mod_long(__pyx_t_13, __pyx_v_pp);
6983
}
6984
6985
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":325
6986
* gamma_pow = (gamma_pow * gamma)%pp
6987
* #if verb: print j, s, one_plus_T_factor, gamma_pow
6988
* return L * self.normalization # <<<<<<<<<<<<<<
6989
* else:
6990
* if verb: print "Using mulmod"
6991
*/
6992
__Pyx_XDECREF(__pyx_r);
6993
__pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_self->normalization); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 325, __pyx_L1_error)
6994
__Pyx_GOTREF(__pyx_t_9);
6995
__pyx_t_6 = PyNumber_Multiply(__pyx_v_L, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 325, __pyx_L1_error)
6996
__Pyx_GOTREF(__pyx_t_6);
6997
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
6998
__pyx_r = __pyx_t_6;
6999
__pyx_t_6 = 0;
7000
goto __pyx_L0;
7001
7002
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":312
7003
* one_plus_T_factor = ((one_plus_T + O(T**ser_prec))**start).truncate(ser_prec)
7004
*
7005
* if not force_mulmod and prec <= self.prec // 2: # <<<<<<<<<<<<<<
7006
* # no concerns about overflow when multiplying together two longs, then reducing modulo pp
7007
* for j in range(start, stop):
7008
*/
7009
}
7010
7011
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":327
7012
* return L * self.normalization
7013
* else:
7014
* if verb: print "Using mulmod" # <<<<<<<<<<<<<<
7015
* # Since prec > self.prec//2, where self.prec =
7016
* # ZZ(2**63).exact_log(p) = floor(log_p(2^63)),
7017
*/
7018
/*else*/ {
7019
__pyx_t_1 = (__pyx_v_verb != 0);
7020
if (__pyx_t_1) {
7021
if (__Pyx_PrintOne(0, __pyx_kp_s_Using_mulmod) < 0) __PYX_ERR(0, 327, __pyx_L1_error)
7022
}
7023
7024
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":334
7025
* # is necessary to ensure no overflow.
7026
*
7027
* assert prec <= self.prec, "requested precision (%s) too large (max: %s)"%(prec, self.prec) # <<<<<<<<<<<<<<
7028
* for j in range(start, stop):
7029
* sig_on()
7030
*/
7031
#ifndef CYTHON_WITHOUT_ASSERTIONS
7032
if (unlikely(!Py_OptimizeFlag)) {
7033
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->prec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
7034
__Pyx_GOTREF(__pyx_t_6);
7035
__pyx_t_9 = PyObject_RichCompare(__pyx_v_prec, __pyx_t_6, Py_LE); __Pyx_XGOTREF(__pyx_t_9); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 334, __pyx_L1_error)
7036
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7037
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 334, __pyx_L1_error)
7038
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7039
if (unlikely(!__pyx_t_1)) {
7040
__pyx_t_9 = __Pyx_PyInt_From_long(__pyx_v_self->prec); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 334, __pyx_L1_error)
7041
__Pyx_GOTREF(__pyx_t_9);
7042
__pyx_t_6 = PyTuple_New(2); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 334, __pyx_L1_error)
7043
__Pyx_GOTREF(__pyx_t_6);
7044
__Pyx_INCREF(__pyx_v_prec);
7045
__Pyx_GIVEREF(__pyx_v_prec);
7046
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_v_prec);
7047
__Pyx_GIVEREF(__pyx_t_9);
7048
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_t_9);
7049
__pyx_t_9 = 0;
7050
__pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_requested_precision_s_too_large, __pyx_t_6); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 334, __pyx_L1_error)
7051
__Pyx_GOTREF(__pyx_t_9);
7052
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7053
PyErr_SetObject(PyExc_AssertionError, __pyx_t_9);
7054
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7055
__PYX_ERR(0, 334, __pyx_L1_error)
7056
}
7057
}
7058
#endif
7059
7060
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":335
7061
*
7062
* assert prec <= self.prec, "requested precision (%s) too large (max: %s)"%(prec, self.prec)
7063
* for j in range(start, stop): # <<<<<<<<<<<<<<
7064
* sig_on()
7065
* s = 0
7066
*/
7067
__pyx_t_10 = __pyx_v_stop;
7068
for (__pyx_t_12 = __pyx_v_start; __pyx_t_12 < __pyx_t_10; __pyx_t_12+=1) {
7069
__pyx_v_j = __pyx_t_12;
7070
7071
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":336
7072
* assert prec <= self.prec, "requested precision (%s) too large (max: %s)"%(prec, self.prec)
7073
* for j in range(start, stop):
7074
* sig_on() # <<<<<<<<<<<<<<
7075
* s = 0
7076
* for a in range(1, self.p):
7077
*/
7078
__pyx_t_8 = sig_on(); if (unlikely(__pyx_t_8 == 0)) __PYX_ERR(0, 336, __pyx_L1_error)
7079
7080
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":337
7081
* for j in range(start, stop):
7082
* sig_on()
7083
* s = 0 # <<<<<<<<<<<<<<
7084
* for a in range(1, self.p):
7085
* b = mulmod(self.teich_mulmod[a], gamma_pow, pp)
7086
*/
7087
__pyx_v_s = 0;
7088
7089
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":338
7090
* sig_on()
7091
* s = 0
7092
* for a in range(1, self.p): # <<<<<<<<<<<<<<
7093
* b = mulmod(self.teich_mulmod[a], gamma_pow, pp)
7094
* s += self.measure_mulmod(b, n, pp)
7095
*/
7096
__pyx_t_13 = __pyx_v_self->p;
7097
for (__pyx_t_14 = 1; __pyx_t_14 < __pyx_t_13; __pyx_t_14+=1) {
7098
__pyx_v_a = __pyx_t_14;
7099
7100
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":339
7101
* s = 0
7102
* for a in range(1, self.p):
7103
* b = mulmod(self.teich_mulmod[a], gamma_pow, pp) # <<<<<<<<<<<<<<
7104
* s += self.measure_mulmod(b, n, pp)
7105
* if s >= pp: s -= pp # normalize
7106
*/
7107
__pyx_v_b = __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_mulmod((__pyx_v_self->teich_mulmod[__pyx_v_a]), __pyx_v_gamma_pow, __pyx_v_pp);
7108
7109
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":340
7110
* for a in range(1, self.p):
7111
* b = mulmod(self.teich_mulmod[a], gamma_pow, pp)
7112
* s += self.measure_mulmod(b, n, pp) # <<<<<<<<<<<<<<
7113
* if s >= pp: s -= pp # normalize
7114
* sig_off()
7115
*/
7116
__pyx_t_15 = ((struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self->__pyx_vtab)->measure_mulmod(__pyx_v_self, __pyx_v_b, __pyx_v_n, __pyx_v_pp, 0); if (unlikely(__pyx_t_15 == 0x7FFFFFFFFFFFFFFF)) __PYX_ERR(0, 340, __pyx_L1_error)
7117
__pyx_v_s = (__pyx_v_s + __pyx_t_15);
7118
7119
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":341
7120
* b = mulmod(self.teich_mulmod[a], gamma_pow, pp)
7121
* s += self.measure_mulmod(b, n, pp)
7122
* if s >= pp: s -= pp # normalize # <<<<<<<<<<<<<<
7123
* sig_off()
7124
* L += (s * one_plus_T_factor).truncate(ser_prec)
7125
*/
7126
__pyx_t_1 = ((__pyx_v_s >= __pyx_v_pp) != 0);
7127
if (__pyx_t_1) {
7128
__pyx_v_s = (__pyx_v_s - __pyx_v_pp);
7129
}
7130
}
7131
7132
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":342
7133
* s += self.measure_mulmod(b, n, pp)
7134
* if s >= pp: s -= pp # normalize
7135
* sig_off() # <<<<<<<<<<<<<<
7136
* L += (s * one_plus_T_factor).truncate(ser_prec)
7137
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec)
7138
*/
7139
sig_off();
7140
7141
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":343
7142
* if s >= pp: s -= pp # normalize
7143
* sig_off()
7144
* L += (s * one_plus_T_factor).truncate(ser_prec) # <<<<<<<<<<<<<<
7145
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec)
7146
* gamma_pow = mulmod(gamma_pow, gamma, pp)
7147
*/
7148
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_s); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
7149
__Pyx_GOTREF(__pyx_t_6);
7150
__pyx_t_2 = PyNumber_Multiply(__pyx_t_6, __pyx_v_one_plus_T_factor); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 343, __pyx_L1_error)
7151
__Pyx_GOTREF(__pyx_t_2);
7152
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7153
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_truncate); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
7154
__Pyx_GOTREF(__pyx_t_6);
7155
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7156
__pyx_t_2 = NULL;
7157
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
7158
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_6);
7159
if (likely(__pyx_t_2)) {
7160
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7161
__Pyx_INCREF(__pyx_t_2);
7162
__Pyx_INCREF(function);
7163
__Pyx_DECREF_SET(__pyx_t_6, function);
7164
}
7165
}
7166
if (!__pyx_t_2) {
7167
__pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_v_ser_prec); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
7168
__Pyx_GOTREF(__pyx_t_9);
7169
} else {
7170
#if CYTHON_FAST_PYCALL
7171
if (PyFunction_Check(__pyx_t_6)) {
7172
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_ser_prec};
7173
__pyx_t_9 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
7174
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7175
__Pyx_GOTREF(__pyx_t_9);
7176
} else
7177
#endif
7178
#if CYTHON_FAST_PYCCALL
7179
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
7180
PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_v_ser_prec};
7181
__pyx_t_9 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
7182
__Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7183
__Pyx_GOTREF(__pyx_t_9);
7184
} else
7185
#endif
7186
{
7187
__pyx_t_3 = PyTuple_New(1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 343, __pyx_L1_error)
7188
__Pyx_GOTREF(__pyx_t_3);
7189
__Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_2); __pyx_t_2 = NULL;
7190
__Pyx_INCREF(__pyx_v_ser_prec);
7191
__Pyx_GIVEREF(__pyx_v_ser_prec);
7192
PyTuple_SET_ITEM(__pyx_t_3, 0+1, __pyx_v_ser_prec);
7193
__pyx_t_9 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_3, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 343, __pyx_L1_error)
7194
__Pyx_GOTREF(__pyx_t_9);
7195
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7196
}
7197
}
7198
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7199
__pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_L, __pyx_t_9); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 343, __pyx_L1_error)
7200
__Pyx_GOTREF(__pyx_t_6);
7201
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7202
__Pyx_DECREF_SET(__pyx_v_L, __pyx_t_6);
7203
__pyx_t_6 = 0;
7204
7205
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":344
7206
* sig_off()
7207
* L += (s * one_plus_T_factor).truncate(ser_prec)
7208
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec) # <<<<<<<<<<<<<<
7209
* gamma_pow = mulmod(gamma_pow, gamma, pp)
7210
* return L * self.normalization_mulmod
7211
*/
7212
__pyx_t_9 = PyNumber_Multiply(__pyx_v_one_plus_T, __pyx_v_one_plus_T_factor); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 344, __pyx_L1_error)
7213
__Pyx_GOTREF(__pyx_t_9);
7214
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_9, __pyx_n_s_truncate); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 344, __pyx_L1_error)
7215
__Pyx_GOTREF(__pyx_t_3);
7216
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7217
__pyx_t_9 = NULL;
7218
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
7219
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_3);
7220
if (likely(__pyx_t_9)) {
7221
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
7222
__Pyx_INCREF(__pyx_t_9);
7223
__Pyx_INCREF(function);
7224
__Pyx_DECREF_SET(__pyx_t_3, function);
7225
}
7226
}
7227
if (!__pyx_t_9) {
7228
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_v_ser_prec); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
7229
__Pyx_GOTREF(__pyx_t_6);
7230
} else {
7231
#if CYTHON_FAST_PYCALL
7232
if (PyFunction_Check(__pyx_t_3)) {
7233
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_ser_prec};
7234
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
7235
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7236
__Pyx_GOTREF(__pyx_t_6);
7237
} else
7238
#endif
7239
#if CYTHON_FAST_PYCCALL
7240
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
7241
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_v_ser_prec};
7242
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
7243
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7244
__Pyx_GOTREF(__pyx_t_6);
7245
} else
7246
#endif
7247
{
7248
__pyx_t_2 = PyTuple_New(1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 344, __pyx_L1_error)
7249
__Pyx_GOTREF(__pyx_t_2);
7250
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_9); __pyx_t_9 = NULL;
7251
__Pyx_INCREF(__pyx_v_ser_prec);
7252
__Pyx_GIVEREF(__pyx_v_ser_prec);
7253
PyTuple_SET_ITEM(__pyx_t_2, 0+1, __pyx_v_ser_prec);
7254
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 344, __pyx_L1_error)
7255
__Pyx_GOTREF(__pyx_t_6);
7256
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7257
}
7258
}
7259
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7260
__Pyx_DECREF_SET(__pyx_v_one_plus_T_factor, __pyx_t_6);
7261
__pyx_t_6 = 0;
7262
7263
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":345
7264
* L += (s * one_plus_T_factor).truncate(ser_prec)
7265
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec)
7266
* gamma_pow = mulmod(gamma_pow, gamma, pp) # <<<<<<<<<<<<<<
7267
* return L * self.normalization_mulmod
7268
*
7269
*/
7270
__pyx_v_gamma_pow = __pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_mulmod(__pyx_v_gamma_pow, __pyx_v_gamma, __pyx_v_pp);
7271
}
7272
7273
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":346
7274
* one_plus_T_factor = (one_plus_T*one_plus_T_factor).truncate(ser_prec)
7275
* gamma_pow = mulmod(gamma_pow, gamma, pp)
7276
* return L * self.normalization_mulmod # <<<<<<<<<<<<<<
7277
*
7278
* def _series_parallel(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False,
7279
*/
7280
__Pyx_XDECREF(__pyx_r);
7281
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->normalization_mulmod); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 346, __pyx_L1_error)
7282
__Pyx_GOTREF(__pyx_t_6);
7283
__pyx_t_3 = PyNumber_Multiply(__pyx_v_L, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 346, __pyx_L1_error)
7284
__Pyx_GOTREF(__pyx_t_3);
7285
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7286
__pyx_r = __pyx_t_3;
7287
__pyx_t_3 = 0;
7288
goto __pyx_L0;
7289
}
7290
7291
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":268
7292
* return ans
7293
*
7294
* def _series(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False, # <<<<<<<<<<<<<<
7295
* long start=-1, long stop=-1):
7296
* """
7297
*/
7298
7299
/* function exit code */
7300
__pyx_L1_error:;
7301
__Pyx_XDECREF(__pyx_t_2);
7302
__Pyx_XDECREF(__pyx_t_3);
7303
__Pyx_XDECREF(__pyx_t_5);
7304
__Pyx_XDECREF(__pyx_t_6);
7305
__Pyx_XDECREF(__pyx_t_7);
7306
__Pyx_XDECREF(__pyx_t_9);
7307
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._series", __pyx_clineno, __pyx_lineno, __pyx_filename);
7308
__pyx_r = NULL;
7309
__pyx_L0:;
7310
__Pyx_XDECREF(__pyx_v_R);
7311
__Pyx_XDECREF(__pyx_v_T);
7312
__Pyx_XDECREF(__pyx_v_one_plus_T_factor);
7313
__Pyx_XDECREF(__pyx_v_L);
7314
__Pyx_XDECREF(__pyx_v_one_plus_T);
7315
__Pyx_XGIVEREF(__pyx_r);
7316
__Pyx_RefNannyFinishContext();
7317
return __pyx_r;
7318
}
7319
7320
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":348
7321
* return L * self.normalization_mulmod
7322
*
7323
* def _series_parallel(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False, # <<<<<<<<<<<<<<
7324
* ncpus=None):
7325
* return series_parallel(self, n, prec, ser_prec, verb, force_mulmod, ncpus)
7326
*/
7327
7328
/* Python wrapper */
7329
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_19_series_parallel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7330
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_18_series_parallel[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 348)";
7331
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_19_series_parallel(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7332
int __pyx_v_n;
7333
PyObject *__pyx_v_prec = 0;
7334
PyObject *__pyx_v_ser_prec = 0;
7335
int __pyx_v_verb;
7336
int __pyx_v_force_mulmod;
7337
PyObject *__pyx_v_ncpus = 0;
7338
PyObject *__pyx_r = 0;
7339
__Pyx_RefNannyDeclarations
7340
__Pyx_RefNannySetupContext("_series_parallel (wrapper)", 0);
7341
{
7342
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_prec,&__pyx_n_s_ser_prec,&__pyx_n_s_verb,&__pyx_n_s_force_mulmod,&__pyx_n_s_ncpus,0};
7343
PyObject* values[6] = {0,0,0,0,0,0};
7344
values[2] = ((PyObject *)__pyx_int_5);
7345
7346
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":349
7347
*
7348
* def _series_parallel(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False,
7349
* ncpus=None): # <<<<<<<<<<<<<<
7350
* return series_parallel(self, n, prec, ser_prec, verb, force_mulmod, ncpus)
7351
*
7352
*/
7353
values[5] = ((PyObject *)Py_None);
7354
if (unlikely(__pyx_kwds)) {
7355
Py_ssize_t kw_args;
7356
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7357
switch (pos_args) {
7358
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7359
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7360
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7361
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7362
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7363
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7364
case 0: break;
7365
default: goto __pyx_L5_argtuple_error;
7366
}
7367
kw_args = PyDict_Size(__pyx_kwds);
7368
switch (pos_args) {
7369
case 0:
7370
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
7371
else goto __pyx_L5_argtuple_error;
7372
case 1:
7373
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prec)) != 0)) kw_args--;
7374
else {
7375
__Pyx_RaiseArgtupleInvalid("_series_parallel", 0, 2, 6, 1); __PYX_ERR(0, 348, __pyx_L3_error)
7376
}
7377
case 2:
7378
if (kw_args > 0) {
7379
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ser_prec);
7380
if (value) { values[2] = value; kw_args--; }
7381
}
7382
case 3:
7383
if (kw_args > 0) {
7384
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verb);
7385
if (value) { values[3] = value; kw_args--; }
7386
}
7387
case 4:
7388
if (kw_args > 0) {
7389
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force_mulmod);
7390
if (value) { values[4] = value; kw_args--; }
7391
}
7392
case 5:
7393
if (kw_args > 0) {
7394
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ncpus);
7395
if (value) { values[5] = value; kw_args--; }
7396
}
7397
}
7398
if (unlikely(kw_args > 0)) {
7399
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_series_parallel") < 0)) __PYX_ERR(0, 348, __pyx_L3_error)
7400
}
7401
} else {
7402
switch (PyTuple_GET_SIZE(__pyx_args)) {
7403
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
7404
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7405
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7406
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7407
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7408
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7409
break;
7410
default: goto __pyx_L5_argtuple_error;
7411
}
7412
}
7413
__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L3_error)
7414
__pyx_v_prec = values[1];
7415
__pyx_v_ser_prec = values[2];
7416
if (values[3]) {
7417
__pyx_v_verb = __Pyx_PyObject_IsTrue(values[3]); if (unlikely((__pyx_v_verb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L3_error)
7418
} else {
7419
__pyx_v_verb = ((int)0);
7420
}
7421
if (values[4]) {
7422
__pyx_v_force_mulmod = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_force_mulmod == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 348, __pyx_L3_error)
7423
} else {
7424
7425
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":348
7426
* return L * self.normalization_mulmod
7427
*
7428
* def _series_parallel(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False, # <<<<<<<<<<<<<<
7429
* ncpus=None):
7430
* return series_parallel(self, n, prec, ser_prec, verb, force_mulmod, ncpus)
7431
*/
7432
__pyx_v_force_mulmod = ((int)0);
7433
}
7434
__pyx_v_ncpus = values[5];
7435
}
7436
goto __pyx_L4_argument_unpacking_done;
7437
__pyx_L5_argtuple_error:;
7438
__Pyx_RaiseArgtupleInvalid("_series_parallel", 0, 2, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 348, __pyx_L3_error)
7439
__pyx_L3_error:;
7440
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._series_parallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
7441
__Pyx_RefNannyFinishContext();
7442
return NULL;
7443
__pyx_L4_argument_unpacking_done:;
7444
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_18_series_parallel(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_n, __pyx_v_prec, __pyx_v_ser_prec, __pyx_v_verb, __pyx_v_force_mulmod, __pyx_v_ncpus);
7445
7446
/* function exit code */
7447
__Pyx_RefNannyFinishContext();
7448
return __pyx_r;
7449
}
7450
7451
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_18_series_parallel(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, int __pyx_v_verb, int __pyx_v_force_mulmod, PyObject *__pyx_v_ncpus) {
7452
PyObject *__pyx_r = NULL;
7453
__Pyx_RefNannyDeclarations
7454
PyObject *__pyx_t_1 = NULL;
7455
PyObject *__pyx_t_2 = NULL;
7456
PyObject *__pyx_t_3 = NULL;
7457
PyObject *__pyx_t_4 = NULL;
7458
PyObject *__pyx_t_5 = NULL;
7459
PyObject *__pyx_t_6 = NULL;
7460
int __pyx_t_7;
7461
PyObject *__pyx_t_8 = NULL;
7462
__Pyx_RefNannySetupContext("_series_parallel", 0);
7463
7464
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":350
7465
* def _series_parallel(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False,
7466
* ncpus=None):
7467
* return series_parallel(self, n, prec, ser_prec, verb, force_mulmod, ncpus) # <<<<<<<<<<<<<<
7468
*
7469
* def _prec_bounds(self, n, ser_prec):
7470
*/
7471
__Pyx_XDECREF(__pyx_r);
7472
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_series_parallel); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 350, __pyx_L1_error)
7473
__Pyx_GOTREF(__pyx_t_2);
7474
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 350, __pyx_L1_error)
7475
__Pyx_GOTREF(__pyx_t_3);
7476
__pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_verb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 350, __pyx_L1_error)
7477
__Pyx_GOTREF(__pyx_t_4);
7478
__pyx_t_5 = __Pyx_PyBool_FromLong(__pyx_v_force_mulmod); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 350, __pyx_L1_error)
7479
__Pyx_GOTREF(__pyx_t_5);
7480
__pyx_t_6 = NULL;
7481
__pyx_t_7 = 0;
7482
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
7483
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
7484
if (likely(__pyx_t_6)) {
7485
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
7486
__Pyx_INCREF(__pyx_t_6);
7487
__Pyx_INCREF(function);
7488
__Pyx_DECREF_SET(__pyx_t_2, function);
7489
__pyx_t_7 = 1;
7490
}
7491
}
7492
#if CYTHON_FAST_PYCALL
7493
if (PyFunction_Check(__pyx_t_2)) {
7494
PyObject *__pyx_temp[8] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_v_prec, __pyx_v_ser_prec, __pyx_t_4, __pyx_t_5, __pyx_v_ncpus};
7495
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 7+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
7496
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7497
__Pyx_GOTREF(__pyx_t_1);
7498
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7499
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7500
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7501
} else
7502
#endif
7503
#if CYTHON_FAST_PYCCALL
7504
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
7505
PyObject *__pyx_temp[8] = {__pyx_t_6, ((PyObject *)__pyx_v_self), __pyx_t_3, __pyx_v_prec, __pyx_v_ser_prec, __pyx_t_4, __pyx_t_5, __pyx_v_ncpus};
7506
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_7, 7+__pyx_t_7); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
7507
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
7508
__Pyx_GOTREF(__pyx_t_1);
7509
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7510
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7511
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7512
} else
7513
#endif
7514
{
7515
__pyx_t_8 = PyTuple_New(7+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 350, __pyx_L1_error)
7516
__Pyx_GOTREF(__pyx_t_8);
7517
if (__pyx_t_6) {
7518
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_6); __pyx_t_6 = NULL;
7519
}
7520
__Pyx_INCREF(((PyObject *)__pyx_v_self));
7521
__Pyx_GIVEREF(((PyObject *)__pyx_v_self));
7522
PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, ((PyObject *)__pyx_v_self));
7523
__Pyx_GIVEREF(__pyx_t_3);
7524
PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_t_3);
7525
__Pyx_INCREF(__pyx_v_prec);
7526
__Pyx_GIVEREF(__pyx_v_prec);
7527
PyTuple_SET_ITEM(__pyx_t_8, 2+__pyx_t_7, __pyx_v_prec);
7528
__Pyx_INCREF(__pyx_v_ser_prec);
7529
__Pyx_GIVEREF(__pyx_v_ser_prec);
7530
PyTuple_SET_ITEM(__pyx_t_8, 3+__pyx_t_7, __pyx_v_ser_prec);
7531
__Pyx_GIVEREF(__pyx_t_4);
7532
PyTuple_SET_ITEM(__pyx_t_8, 4+__pyx_t_7, __pyx_t_4);
7533
__Pyx_GIVEREF(__pyx_t_5);
7534
PyTuple_SET_ITEM(__pyx_t_8, 5+__pyx_t_7, __pyx_t_5);
7535
__Pyx_INCREF(__pyx_v_ncpus);
7536
__Pyx_GIVEREF(__pyx_v_ncpus);
7537
PyTuple_SET_ITEM(__pyx_t_8, 6+__pyx_t_7, __pyx_v_ncpus);
7538
__pyx_t_3 = 0;
7539
__pyx_t_4 = 0;
7540
__pyx_t_5 = 0;
7541
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_8, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 350, __pyx_L1_error)
7542
__Pyx_GOTREF(__pyx_t_1);
7543
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7544
}
7545
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
7546
__pyx_r = __pyx_t_1;
7547
__pyx_t_1 = 0;
7548
goto __pyx_L0;
7549
7550
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":348
7551
* return L * self.normalization_mulmod
7552
*
7553
* def _series_parallel(self, int n, prec, ser_prec=5, bint verb=0, bint force_mulmod=False, # <<<<<<<<<<<<<<
7554
* ncpus=None):
7555
* return series_parallel(self, n, prec, ser_prec, verb, force_mulmod, ncpus)
7556
*/
7557
7558
/* function exit code */
7559
__pyx_L1_error:;
7560
__Pyx_XDECREF(__pyx_t_1);
7561
__Pyx_XDECREF(__pyx_t_2);
7562
__Pyx_XDECREF(__pyx_t_3);
7563
__Pyx_XDECREF(__pyx_t_4);
7564
__Pyx_XDECREF(__pyx_t_5);
7565
__Pyx_XDECREF(__pyx_t_6);
7566
__Pyx_XDECREF(__pyx_t_8);
7567
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._series_parallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
7568
__pyx_r = NULL;
7569
__pyx_L0:;
7570
__Pyx_XGIVEREF(__pyx_r);
7571
__Pyx_RefNannyFinishContext();
7572
return __pyx_r;
7573
}
7574
7575
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":352
7576
* return series_parallel(self, n, prec, ser_prec, verb, force_mulmod, ncpus)
7577
*
7578
* def _prec_bounds(self, n, ser_prec): # <<<<<<<<<<<<<<
7579
* pn = Integer(self.p_pow[n-1])
7580
* enj = infinity
7581
*/
7582
7583
/* Python wrapper */
7584
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_21_prec_bounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7585
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20_prec_bounds[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 352)";
7586
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_21_prec_bounds(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7587
PyObject *__pyx_v_n = 0;
7588
PyObject *__pyx_v_ser_prec = 0;
7589
PyObject *__pyx_r = 0;
7590
__Pyx_RefNannyDeclarations
7591
__Pyx_RefNannySetupContext("_prec_bounds (wrapper)", 0);
7592
{
7593
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_ser_prec,0};
7594
PyObject* values[2] = {0,0};
7595
if (unlikely(__pyx_kwds)) {
7596
Py_ssize_t kw_args;
7597
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7598
switch (pos_args) {
7599
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7600
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7601
case 0: break;
7602
default: goto __pyx_L5_argtuple_error;
7603
}
7604
kw_args = PyDict_Size(__pyx_kwds);
7605
switch (pos_args) {
7606
case 0:
7607
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
7608
else goto __pyx_L5_argtuple_error;
7609
case 1:
7610
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ser_prec)) != 0)) kw_args--;
7611
else {
7612
__Pyx_RaiseArgtupleInvalid("_prec_bounds", 1, 2, 2, 1); __PYX_ERR(0, 352, __pyx_L3_error)
7613
}
7614
}
7615
if (unlikely(kw_args > 0)) {
7616
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "_prec_bounds") < 0)) __PYX_ERR(0, 352, __pyx_L3_error)
7617
}
7618
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
7619
goto __pyx_L5_argtuple_error;
7620
} else {
7621
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7622
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7623
}
7624
__pyx_v_n = values[0];
7625
__pyx_v_ser_prec = values[1];
7626
}
7627
goto __pyx_L4_argument_unpacking_done;
7628
__pyx_L5_argtuple_error:;
7629
__Pyx_RaiseArgtupleInvalid("_prec_bounds", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 352, __pyx_L3_error)
7630
__pyx_L3_error:;
7631
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._prec_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
7632
__Pyx_RefNannyFinishContext();
7633
return NULL;
7634
__pyx_L4_argument_unpacking_done:;
7635
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20_prec_bounds(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_n, __pyx_v_ser_prec);
7636
7637
/* function exit code */
7638
__Pyx_RefNannyFinishContext();
7639
return __pyx_r;
7640
}
7641
7642
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20_prec_bounds(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_n, PyObject *__pyx_v_ser_prec) {
7643
struct __pyx_obj_4sage_5rings_7integer_Integer *__pyx_v_pn = NULL;
7644
PyObject *__pyx_v_enj = NULL;
7645
PyObject *__pyx_v_res = NULL;
7646
PyObject *__pyx_v_j = NULL;
7647
PyObject *__pyx_v_bino = NULL;
7648
PyObject *__pyx_r = NULL;
7649
__Pyx_RefNannyDeclarations
7650
PyObject *__pyx_t_1 = NULL;
7651
Py_ssize_t __pyx_t_2;
7652
PyObject *__pyx_t_3 = NULL;
7653
PyObject *(*__pyx_t_4)(PyObject *);
7654
PyObject *__pyx_t_5 = NULL;
7655
PyObject *__pyx_t_6 = NULL;
7656
PyObject *__pyx_t_7 = NULL;
7657
int __pyx_t_8;
7658
PyObject *__pyx_t_9 = NULL;
7659
int __pyx_t_10;
7660
int __pyx_t_11;
7661
__Pyx_RefNannySetupContext("_prec_bounds", 0);
7662
7663
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":353
7664
*
7665
* def _prec_bounds(self, n, ser_prec):
7666
* pn = Integer(self.p_pow[n-1]) # <<<<<<<<<<<<<<
7667
* enj = infinity
7668
* res = [enj]
7669
*/
7670
__pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
7671
__Pyx_GOTREF(__pyx_t_1);
7672
__pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_t_1); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 353, __pyx_L1_error)
7673
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7674
__pyx_t_1 = __Pyx_PyInt_From_long((__pyx_v_self->p_pow[__pyx_t_2])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
7675
__Pyx_GOTREF(__pyx_t_1);
7676
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 353, __pyx_L1_error)
7677
__Pyx_GOTREF(__pyx_t_3);
7678
__Pyx_GIVEREF(__pyx_t_1);
7679
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
7680
__pyx_t_1 = 0;
7681
__pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4sage_5rings_7integer_Integer), __pyx_t_3, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
7682
__Pyx_GOTREF(__pyx_t_1);
7683
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7684
__pyx_v_pn = ((struct __pyx_obj_4sage_5rings_7integer_Integer *)__pyx_t_1);
7685
__pyx_t_1 = 0;
7686
7687
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":354
7688
* def _prec_bounds(self, n, ser_prec):
7689
* pn = Integer(self.p_pow[n-1])
7690
* enj = infinity # <<<<<<<<<<<<<<
7691
* res = [enj]
7692
* for j in range(1, ser_prec):
7693
*/
7694
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_infinity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 354, __pyx_L1_error)
7695
__Pyx_GOTREF(__pyx_t_1);
7696
__pyx_v_enj = __pyx_t_1;
7697
__pyx_t_1 = 0;
7698
7699
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":355
7700
* pn = Integer(self.p_pow[n-1])
7701
* enj = infinity
7702
* res = [enj] # <<<<<<<<<<<<<<
7703
* for j in range(1, ser_prec):
7704
* bino = binomial(pn,j).valuation(self.p)
7705
*/
7706
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 355, __pyx_L1_error)
7707
__Pyx_GOTREF(__pyx_t_1);
7708
__Pyx_INCREF(__pyx_v_enj);
7709
__Pyx_GIVEREF(__pyx_v_enj);
7710
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_v_enj);
7711
__pyx_v_res = ((PyObject*)__pyx_t_1);
7712
__pyx_t_1 = 0;
7713
7714
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":356
7715
* enj = infinity
7716
* res = [enj]
7717
* for j in range(1, ser_prec): # <<<<<<<<<<<<<<
7718
* bino = binomial(pn,j).valuation(self.p)
7719
* if bino < enj:
7720
*/
7721
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
7722
__Pyx_GOTREF(__pyx_t_1);
7723
__Pyx_INCREF(__pyx_int_1);
7724
__Pyx_GIVEREF(__pyx_int_1);
7725
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_int_1);
7726
__Pyx_INCREF(__pyx_v_ser_prec);
7727
__Pyx_GIVEREF(__pyx_v_ser_prec);
7728
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_ser_prec);
7729
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error)
7730
__Pyx_GOTREF(__pyx_t_3);
7731
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7732
if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
7733
__pyx_t_1 = __pyx_t_3; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
7734
__pyx_t_4 = NULL;
7735
} else {
7736
__pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 356, __pyx_L1_error)
7737
__Pyx_GOTREF(__pyx_t_1);
7738
__pyx_t_4 = Py_TYPE(__pyx_t_1)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 356, __pyx_L1_error)
7739
}
7740
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7741
for (;;) {
7742
if (likely(!__pyx_t_4)) {
7743
if (likely(PyList_CheckExact(__pyx_t_1))) {
7744
if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
7745
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7746
__pyx_t_3 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(0, 356, __pyx_L1_error)
7747
#else
7748
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error)
7749
__Pyx_GOTREF(__pyx_t_3);
7750
#endif
7751
} else {
7752
if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
7753
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
7754
__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_ERR(0, 356, __pyx_L1_error)
7755
#else
7756
__pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 356, __pyx_L1_error)
7757
__Pyx_GOTREF(__pyx_t_3);
7758
#endif
7759
}
7760
} else {
7761
__pyx_t_3 = __pyx_t_4(__pyx_t_1);
7762
if (unlikely(!__pyx_t_3)) {
7763
PyObject* exc_type = PyErr_Occurred();
7764
if (exc_type) {
7765
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
7766
else __PYX_ERR(0, 356, __pyx_L1_error)
7767
}
7768
break;
7769
}
7770
__Pyx_GOTREF(__pyx_t_3);
7771
}
7772
__Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
7773
__pyx_t_3 = 0;
7774
7775
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":357
7776
* res = [enj]
7777
* for j in range(1, ser_prec):
7778
* bino = binomial(pn,j).valuation(self.p) # <<<<<<<<<<<<<<
7779
* if bino < enj:
7780
* enj = bino
7781
*/
7782
__pyx_t_6 = __Pyx_GetModuleGlobalName(__pyx_n_s_binomial); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
7783
__Pyx_GOTREF(__pyx_t_6);
7784
__pyx_t_7 = NULL;
7785
__pyx_t_8 = 0;
7786
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
7787
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_6);
7788
if (likely(__pyx_t_7)) {
7789
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7790
__Pyx_INCREF(__pyx_t_7);
7791
__Pyx_INCREF(function);
7792
__Pyx_DECREF_SET(__pyx_t_6, function);
7793
__pyx_t_8 = 1;
7794
}
7795
}
7796
#if CYTHON_FAST_PYCALL
7797
if (PyFunction_Check(__pyx_t_6)) {
7798
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_pn), __pyx_v_j};
7799
__pyx_t_5 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
7800
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7801
__Pyx_GOTREF(__pyx_t_5);
7802
} else
7803
#endif
7804
#if CYTHON_FAST_PYCCALL
7805
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
7806
PyObject *__pyx_temp[3] = {__pyx_t_7, ((PyObject *)__pyx_v_pn), __pyx_v_j};
7807
__pyx_t_5 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
7808
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
7809
__Pyx_GOTREF(__pyx_t_5);
7810
} else
7811
#endif
7812
{
7813
__pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 357, __pyx_L1_error)
7814
__Pyx_GOTREF(__pyx_t_9);
7815
if (__pyx_t_7) {
7816
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
7817
}
7818
__Pyx_INCREF(((PyObject *)__pyx_v_pn));
7819
__Pyx_GIVEREF(((PyObject *)__pyx_v_pn));
7820
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, ((PyObject *)__pyx_v_pn));
7821
__Pyx_INCREF(__pyx_v_j);
7822
__Pyx_GIVEREF(__pyx_v_j);
7823
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_j);
7824
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
7825
__Pyx_GOTREF(__pyx_t_5);
7826
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
7827
}
7828
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7829
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_valuation); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 357, __pyx_L1_error)
7830
__Pyx_GOTREF(__pyx_t_6);
7831
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7832
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 357, __pyx_L1_error)
7833
__Pyx_GOTREF(__pyx_t_5);
7834
__pyx_t_9 = NULL;
7835
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
7836
__pyx_t_9 = PyMethod_GET_SELF(__pyx_t_6);
7837
if (likely(__pyx_t_9)) {
7838
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
7839
__Pyx_INCREF(__pyx_t_9);
7840
__Pyx_INCREF(function);
7841
__Pyx_DECREF_SET(__pyx_t_6, function);
7842
}
7843
}
7844
if (!__pyx_t_9) {
7845
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
7846
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7847
__Pyx_GOTREF(__pyx_t_3);
7848
} else {
7849
#if CYTHON_FAST_PYCALL
7850
if (PyFunction_Check(__pyx_t_6)) {
7851
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_5};
7852
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
7853
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7854
__Pyx_GOTREF(__pyx_t_3);
7855
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7856
} else
7857
#endif
7858
#if CYTHON_FAST_PYCCALL
7859
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
7860
PyObject *__pyx_temp[2] = {__pyx_t_9, __pyx_t_5};
7861
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
7862
__Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
7863
__Pyx_GOTREF(__pyx_t_3);
7864
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
7865
} else
7866
#endif
7867
{
7868
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 357, __pyx_L1_error)
7869
__Pyx_GOTREF(__pyx_t_7);
7870
__Pyx_GIVEREF(__pyx_t_9); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_9); __pyx_t_9 = NULL;
7871
__Pyx_GIVEREF(__pyx_t_5);
7872
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
7873
__pyx_t_5 = 0;
7874
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 357, __pyx_L1_error)
7875
__Pyx_GOTREF(__pyx_t_3);
7876
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
7877
}
7878
}
7879
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
7880
__Pyx_XDECREF_SET(__pyx_v_bino, __pyx_t_3);
7881
__pyx_t_3 = 0;
7882
7883
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":358
7884
* for j in range(1, ser_prec):
7885
* bino = binomial(pn,j).valuation(self.p)
7886
* if bino < enj: # <<<<<<<<<<<<<<
7887
* enj = bino
7888
* res.append(enj)
7889
*/
7890
__pyx_t_3 = PyObject_RichCompare(__pyx_v_bino, __pyx_v_enj, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 358, __pyx_L1_error)
7891
__pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_10 < 0)) __PYX_ERR(0, 358, __pyx_L1_error)
7892
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7893
if (__pyx_t_10) {
7894
7895
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":359
7896
* bino = binomial(pn,j).valuation(self.p)
7897
* if bino < enj:
7898
* enj = bino # <<<<<<<<<<<<<<
7899
* res.append(enj)
7900
* return res
7901
*/
7902
__Pyx_INCREF(__pyx_v_bino);
7903
__Pyx_DECREF_SET(__pyx_v_enj, __pyx_v_bino);
7904
7905
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":358
7906
* for j in range(1, ser_prec):
7907
* bino = binomial(pn,j).valuation(self.p)
7908
* if bino < enj: # <<<<<<<<<<<<<<
7909
* enj = bino
7910
* res.append(enj)
7911
*/
7912
}
7913
7914
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":360
7915
* if bino < enj:
7916
* enj = bino
7917
* res.append(enj) # <<<<<<<<<<<<<<
7918
* return res
7919
*
7920
*/
7921
__pyx_t_11 = __Pyx_PyList_Append(__pyx_v_res, __pyx_v_enj); if (unlikely(__pyx_t_11 == -1)) __PYX_ERR(0, 360, __pyx_L1_error)
7922
7923
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":356
7924
* enj = infinity
7925
* res = [enj]
7926
* for j in range(1, ser_prec): # <<<<<<<<<<<<<<
7927
* bino = binomial(pn,j).valuation(self.p)
7928
* if bino < enj:
7929
*/
7930
}
7931
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7932
7933
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":361
7934
* enj = bino
7935
* res.append(enj)
7936
* return res # <<<<<<<<<<<<<<
7937
*
7938
* def series(self, int n=2, prec=None, ser_prec=5, int check=True, bint verb=False,
7939
*/
7940
__Pyx_XDECREF(__pyx_r);
7941
__Pyx_INCREF(__pyx_v_res);
7942
__pyx_r = __pyx_v_res;
7943
goto __pyx_L0;
7944
7945
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":352
7946
* return series_parallel(self, n, prec, ser_prec, verb, force_mulmod, ncpus)
7947
*
7948
* def _prec_bounds(self, n, ser_prec): # <<<<<<<<<<<<<<
7949
* pn = Integer(self.p_pow[n-1])
7950
* enj = infinity
7951
*/
7952
7953
/* function exit code */
7954
__pyx_L1_error:;
7955
__Pyx_XDECREF(__pyx_t_1);
7956
__Pyx_XDECREF(__pyx_t_3);
7957
__Pyx_XDECREF(__pyx_t_5);
7958
__Pyx_XDECREF(__pyx_t_6);
7959
__Pyx_XDECREF(__pyx_t_7);
7960
__Pyx_XDECREF(__pyx_t_9);
7961
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._prec_bounds", __pyx_clineno, __pyx_lineno, __pyx_filename);
7962
__pyx_r = NULL;
7963
__pyx_L0:;
7964
__Pyx_XDECREF((PyObject *)__pyx_v_pn);
7965
__Pyx_XDECREF(__pyx_v_enj);
7966
__Pyx_XDECREF(__pyx_v_res);
7967
__Pyx_XDECREF(__pyx_v_j);
7968
__Pyx_XDECREF(__pyx_v_bino);
7969
__Pyx_XGIVEREF(__pyx_r);
7970
__Pyx_RefNannyFinishContext();
7971
return __pyx_r;
7972
}
7973
7974
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":363
7975
* return res
7976
*
7977
* def series(self, int n=2, prec=None, ser_prec=5, int check=True, bint verb=False, # <<<<<<<<<<<<<<
7978
* parallel=None):
7979
* """
7980
*/
7981
7982
/* Python wrapper */
7983
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_23series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7984
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_22series[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 363)\n\n EXAMPLES::\n\n sage: from psage.modform.rational.padic_elliptic_lseries_fast import pAdicLseries\n sage: E = EllipticCurve('389a'); L = pAdicLseries(E,5)\n sage: L.series()\n O(5) + O(5)*T + (4 + O(5))*T^2 + (2 + O(5))*T^3 + (3 + O(5))*T^4 + O(T^5)\n sage: L.series(1)\n O(T^0)\n sage: L.series(3)\n O(5^2) + O(5^2)*T + (4 + 4*5 + O(5^2))*T^2 + (2 + 4*5 + O(5^2))*T^3 + (3 + O(5^2))*T^4 + O(T^5)\n sage: L.series(2, 8)\n O(5^6) + O(5)*T + (4 + O(5))*T^2 + (2 + O(5))*T^3 + (3 + O(5))*T^4 + O(T^5)\n sage: L.series(3, 8)\n O(5^6) + O(5^2)*T + (4 + 4*5 + O(5^2))*T^2 + (2 + 4*5 + O(5^2))*T^3 + (3 + O(5^2))*T^4 + O(T^5)\n sage: L.series(3, ser_prec=8)\n O(5^2) + O(5^2)*T + (4 + 4*5 + O(5^2))*T^2 + (2 + 4*5 + O(5^2))*T^3 + (3 + O(5^2))*T^4 + (1 + O(5))*T^5 + O(5)*T^6 + (4 + O(5))*T^7 + O(T^8)\n ";
7985
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_23series(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7986
int __pyx_v_n;
7987
PyObject *__pyx_v_prec = 0;
7988
PyObject *__pyx_v_ser_prec = 0;
7989
int __pyx_v_check;
7990
int __pyx_v_verb;
7991
PyObject *__pyx_v_parallel = 0;
7992
PyObject *__pyx_r = 0;
7993
__Pyx_RefNannyDeclarations
7994
__Pyx_RefNannySetupContext("series (wrapper)", 0);
7995
{
7996
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_prec,&__pyx_n_s_ser_prec,&__pyx_n_s_check,&__pyx_n_s_verb,&__pyx_n_s_parallel,0};
7997
PyObject* values[6] = {0,0,0,0,0,0};
7998
values[1] = ((PyObject *)Py_None);
7999
values[2] = ((PyObject *)__pyx_int_5);
8000
8001
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":364
8002
*
8003
* def series(self, int n=2, prec=None, ser_prec=5, int check=True, bint verb=False,
8004
* parallel=None): # <<<<<<<<<<<<<<
8005
* """
8006
* EXAMPLES::
8007
*/
8008
values[5] = ((PyObject *)Py_None);
8009
if (unlikely(__pyx_kwds)) {
8010
Py_ssize_t kw_args;
8011
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
8012
switch (pos_args) {
8013
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8014
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8015
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8016
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8017
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8018
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8019
case 0: break;
8020
default: goto __pyx_L5_argtuple_error;
8021
}
8022
kw_args = PyDict_Size(__pyx_kwds);
8023
switch (pos_args) {
8024
case 0:
8025
if (kw_args > 0) {
8026
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n);
8027
if (value) { values[0] = value; kw_args--; }
8028
}
8029
case 1:
8030
if (kw_args > 0) {
8031
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prec);
8032
if (value) { values[1] = value; kw_args--; }
8033
}
8034
case 2:
8035
if (kw_args > 0) {
8036
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ser_prec);
8037
if (value) { values[2] = value; kw_args--; }
8038
}
8039
case 3:
8040
if (kw_args > 0) {
8041
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check);
8042
if (value) { values[3] = value; kw_args--; }
8043
}
8044
case 4:
8045
if (kw_args > 0) {
8046
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verb);
8047
if (value) { values[4] = value; kw_args--; }
8048
}
8049
case 5:
8050
if (kw_args > 0) {
8051
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_parallel);
8052
if (value) { values[5] = value; kw_args--; }
8053
}
8054
}
8055
if (unlikely(kw_args > 0)) {
8056
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "series") < 0)) __PYX_ERR(0, 363, __pyx_L3_error)
8057
}
8058
} else {
8059
switch (PyTuple_GET_SIZE(__pyx_args)) {
8060
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
8061
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
8062
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
8063
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
8064
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
8065
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
8066
case 0: break;
8067
default: goto __pyx_L5_argtuple_error;
8068
}
8069
}
8070
if (values[0]) {
8071
__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
8072
} else {
8073
__pyx_v_n = ((int)2);
8074
}
8075
__pyx_v_prec = values[1];
8076
__pyx_v_ser_prec = values[2];
8077
if (values[3]) {
8078
__pyx_v_check = __Pyx_PyInt_As_int(values[3]); if (unlikely((__pyx_v_check == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
8079
} else {
8080
8081
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":363
8082
* return res
8083
*
8084
* def series(self, int n=2, prec=None, ser_prec=5, int check=True, bint verb=False, # <<<<<<<<<<<<<<
8085
* parallel=None):
8086
* """
8087
*/
8088
__pyx_v_check = ((int)1);
8089
}
8090
if (values[4]) {
8091
__pyx_v_verb = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_verb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 363, __pyx_L3_error)
8092
} else {
8093
__pyx_v_verb = ((int)0);
8094
}
8095
__pyx_v_parallel = values[5];
8096
}
8097
goto __pyx_L4_argument_unpacking_done;
8098
__pyx_L5_argtuple_error:;
8099
__Pyx_RaiseArgtupleInvalid("series", 0, 0, 6, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 363, __pyx_L3_error)
8100
__pyx_L3_error:;
8101
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.series", __pyx_clineno, __pyx_lineno, __pyx_filename);
8102
__Pyx_RefNannyFinishContext();
8103
return NULL;
8104
__pyx_L4_argument_unpacking_done:;
8105
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_22series(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_n, __pyx_v_prec, __pyx_v_ser_prec, __pyx_v_check, __pyx_v_verb, __pyx_v_parallel);
8106
8107
/* function exit code */
8108
__Pyx_RefNannyFinishContext();
8109
return __pyx_r;
8110
}
8111
8112
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_22series(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, int __pyx_v_check, int __pyx_v_verb, PyObject *__pyx_v_parallel) {
8113
PyObject *__pyx_v_p = NULL;
8114
PyObject *__pyx_v_f = NULL;
8115
PyObject *__pyx_v_aj = NULL;
8116
PyObject *__pyx_v_R = NULL;
8117
PyObject *__pyx_v_bounds = NULL;
8118
PyObject *__pyx_v_L = NULL;
8119
Py_ssize_t __pyx_v_j;
8120
CYTHON_UNUSED PyObject *__pyx_v__ = NULL;
8121
Py_ssize_t __pyx_v_i;
8122
PyObject *__pyx_r = NULL;
8123
__Pyx_RefNannyDeclarations
8124
int __pyx_t_1;
8125
int __pyx_t_2;
8126
PyObject *__pyx_t_3 = NULL;
8127
PyObject *__pyx_t_4 = NULL;
8128
PyObject *__pyx_t_5 = NULL;
8129
PyObject *__pyx_t_6 = NULL;
8130
int __pyx_t_7;
8131
Py_ssize_t __pyx_t_8;
8132
PyObject *__pyx_t_9 = NULL;
8133
PyObject *__pyx_t_10 = NULL;
8134
Py_ssize_t __pyx_t_11;
8135
PyObject *__pyx_t_12 = NULL;
8136
PyObject *__pyx_t_13 = NULL;
8137
PyObject *(*__pyx_t_14)(PyObject *);
8138
__Pyx_RefNannySetupContext("series", 0);
8139
__Pyx_INCREF(__pyx_v_prec);
8140
__Pyx_INCREF(__pyx_v_ser_prec);
8141
__Pyx_INCREF(__pyx_v_parallel);
8142
8143
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":383
8144
* O(5^2) + O(5^2)*T + (4 + 4*5 + O(5^2))*T^2 + (2 + 4*5 + O(5^2))*T^3 + (3 + O(5^2))*T^4 + (1 + O(5))*T^5 + O(5)*T^6 + (4 + O(5))*T^7 + O(T^8)
8145
* """
8146
* if prec is None: prec = n+1 # <<<<<<<<<<<<<<
8147
* p = self.p
8148
* if check:
8149
*/
8150
__pyx_t_1 = (__pyx_v_prec == Py_None);
8151
__pyx_t_2 = (__pyx_t_1 != 0);
8152
if (__pyx_t_2) {
8153
__pyx_t_3 = __Pyx_PyInt_From_long((__pyx_v_n + 1)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 383, __pyx_L1_error)
8154
__Pyx_GOTREF(__pyx_t_3);
8155
__Pyx_DECREF_SET(__pyx_v_prec, __pyx_t_3);
8156
__pyx_t_3 = 0;
8157
}
8158
8159
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":384
8160
* """
8161
* if prec is None: prec = n+1
8162
* p = self.p # <<<<<<<<<<<<<<
8163
* if check:
8164
* assert self.E.galois_representation().is_surjective(p), "p (=%s) must be surjective for E"%p
8165
*/
8166
__pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 384, __pyx_L1_error)
8167
__Pyx_GOTREF(__pyx_t_3);
8168
__pyx_v_p = __pyx_t_3;
8169
__pyx_t_3 = 0;
8170
8171
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":385
8172
* if prec is None: prec = n+1
8173
* p = self.p
8174
* if check: # <<<<<<<<<<<<<<
8175
* assert self.E.galois_representation().is_surjective(p), "p (=%s) must be surjective for E"%p
8176
* if parallel is None:
8177
*/
8178
__pyx_t_2 = (__pyx_v_check != 0);
8179
if (__pyx_t_2) {
8180
8181
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":386
8182
* p = self.p
8183
* if check:
8184
* assert self.E.galois_representation().is_surjective(p), "p (=%s) must be surjective for E"%p # <<<<<<<<<<<<<<
8185
* if parallel is None:
8186
* parallel = self.parallel
8187
*/
8188
#ifndef CYTHON_WITHOUT_ASSERTIONS
8189
if (unlikely(!Py_OptimizeFlag)) {
8190
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_galois_representation); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
8191
__Pyx_GOTREF(__pyx_t_5);
8192
__pyx_t_6 = NULL;
8193
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8194
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8195
if (likely(__pyx_t_6)) {
8196
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8197
__Pyx_INCREF(__pyx_t_6);
8198
__Pyx_INCREF(function);
8199
__Pyx_DECREF_SET(__pyx_t_5, function);
8200
}
8201
}
8202
if (__pyx_t_6) {
8203
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
8204
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8205
} else {
8206
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 386, __pyx_L1_error)
8207
}
8208
__Pyx_GOTREF(__pyx_t_4);
8209
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8210
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_is_surjective); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 386, __pyx_L1_error)
8211
__Pyx_GOTREF(__pyx_t_5);
8212
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8213
__pyx_t_4 = NULL;
8214
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8215
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_5);
8216
if (likely(__pyx_t_4)) {
8217
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8218
__Pyx_INCREF(__pyx_t_4);
8219
__Pyx_INCREF(function);
8220
__Pyx_DECREF_SET(__pyx_t_5, function);
8221
}
8222
}
8223
if (!__pyx_t_4) {
8224
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
8225
__Pyx_GOTREF(__pyx_t_3);
8226
} else {
8227
#if CYTHON_FAST_PYCALL
8228
if (PyFunction_Check(__pyx_t_5)) {
8229
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_p};
8230
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
8231
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8232
__Pyx_GOTREF(__pyx_t_3);
8233
} else
8234
#endif
8235
#if CYTHON_FAST_PYCCALL
8236
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8237
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_v_p};
8238
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
8239
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
8240
__Pyx_GOTREF(__pyx_t_3);
8241
} else
8242
#endif
8243
{
8244
__pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 386, __pyx_L1_error)
8245
__Pyx_GOTREF(__pyx_t_6);
8246
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_4); __pyx_t_4 = NULL;
8247
__Pyx_INCREF(__pyx_v_p);
8248
__Pyx_GIVEREF(__pyx_v_p);
8249
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_p);
8250
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
8251
__Pyx_GOTREF(__pyx_t_3);
8252
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8253
}
8254
}
8255
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8256
__pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 386, __pyx_L1_error)
8257
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8258
if (unlikely(!__pyx_t_2)) {
8259
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_p_s_must_be_surjective_for_E, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 386, __pyx_L1_error)
8260
__Pyx_GOTREF(__pyx_t_3);
8261
PyErr_SetObject(PyExc_AssertionError, __pyx_t_3);
8262
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8263
__PYX_ERR(0, 386, __pyx_L1_error)
8264
}
8265
}
8266
#endif
8267
8268
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":385
8269
* if prec is None: prec = n+1
8270
* p = self.p
8271
* if check: # <<<<<<<<<<<<<<
8272
* assert self.E.galois_representation().is_surjective(p), "p (=%s) must be surjective for E"%p
8273
* if parallel is None:
8274
*/
8275
}
8276
8277
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":387
8278
* if check:
8279
* assert self.E.galois_representation().is_surjective(p), "p (=%s) must be surjective for E"%p
8280
* if parallel is None: # <<<<<<<<<<<<<<
8281
* parallel = self.parallel
8282
*
8283
*/
8284
__pyx_t_2 = (__pyx_v_parallel == Py_None);
8285
__pyx_t_1 = (__pyx_t_2 != 0);
8286
if (__pyx_t_1) {
8287
8288
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":388
8289
* assert self.E.galois_representation().is_surjective(p), "p (=%s) must be surjective for E"%p
8290
* if parallel is None:
8291
* parallel = self.parallel # <<<<<<<<<<<<<<
8292
*
8293
* if parallel:
8294
*/
8295
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_self->parallel); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 388, __pyx_L1_error)
8296
__Pyx_GOTREF(__pyx_t_3);
8297
__Pyx_DECREF_SET(__pyx_v_parallel, __pyx_t_3);
8298
__pyx_t_3 = 0;
8299
8300
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":387
8301
* if check:
8302
* assert self.E.galois_representation().is_surjective(p), "p (=%s) must be surjective for E"%p
8303
* if parallel is None: # <<<<<<<<<<<<<<
8304
* parallel = self.parallel
8305
*
8306
*/
8307
}
8308
8309
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":390
8310
* parallel = self.parallel
8311
*
8312
* if parallel: # <<<<<<<<<<<<<<
8313
* f = self._series_parallel(n, prec, ser_prec, verb=verb)
8314
* else:
8315
*/
8316
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_parallel); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 390, __pyx_L1_error)
8317
if (__pyx_t_1) {
8318
8319
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":391
8320
*
8321
* if parallel:
8322
* f = self._series_parallel(n, prec, ser_prec, verb=verb) # <<<<<<<<<<<<<<
8323
* else:
8324
* f = self._series(n, prec, ser_prec, verb=verb)
8325
*/
8326
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_series_parallel_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 391, __pyx_L1_error)
8327
__Pyx_GOTREF(__pyx_t_3);
8328
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
8329
__Pyx_GOTREF(__pyx_t_5);
8330
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 391, __pyx_L1_error)
8331
__Pyx_GOTREF(__pyx_t_6);
8332
__Pyx_GIVEREF(__pyx_t_5);
8333
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
8334
__Pyx_INCREF(__pyx_v_prec);
8335
__Pyx_GIVEREF(__pyx_v_prec);
8336
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_prec);
8337
__Pyx_INCREF(__pyx_v_ser_prec);
8338
__Pyx_GIVEREF(__pyx_v_ser_prec);
8339
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ser_prec);
8340
__pyx_t_5 = 0;
8341
__pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 391, __pyx_L1_error)
8342
__Pyx_GOTREF(__pyx_t_5);
8343
__pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_verb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
8344
__Pyx_GOTREF(__pyx_t_4);
8345
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_verb, __pyx_t_4) < 0) __PYX_ERR(0, 391, __pyx_L1_error)
8346
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8347
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 391, __pyx_L1_error)
8348
__Pyx_GOTREF(__pyx_t_4);
8349
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8350
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8351
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8352
__pyx_v_f = __pyx_t_4;
8353
__pyx_t_4 = 0;
8354
8355
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":390
8356
* parallel = self.parallel
8357
*
8358
* if parallel: # <<<<<<<<<<<<<<
8359
* f = self._series_parallel(n, prec, ser_prec, verb=verb)
8360
* else:
8361
*/
8362
goto __pyx_L6;
8363
}
8364
8365
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":393
8366
* f = self._series_parallel(n, prec, ser_prec, verb=verb)
8367
* else:
8368
* f = self._series(n, prec, ser_prec, verb=verb) # <<<<<<<<<<<<<<
8369
* aj = f.list()
8370
* R = Zp(p, prec)
8371
*/
8372
/*else*/ {
8373
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_series); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 393, __pyx_L1_error)
8374
__Pyx_GOTREF(__pyx_t_4);
8375
__pyx_t_5 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
8376
__Pyx_GOTREF(__pyx_t_5);
8377
__pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 393, __pyx_L1_error)
8378
__Pyx_GOTREF(__pyx_t_6);
8379
__Pyx_GIVEREF(__pyx_t_5);
8380
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5);
8381
__Pyx_INCREF(__pyx_v_prec);
8382
__Pyx_GIVEREF(__pyx_v_prec);
8383
PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_v_prec);
8384
__Pyx_INCREF(__pyx_v_ser_prec);
8385
__Pyx_GIVEREF(__pyx_v_ser_prec);
8386
PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_v_ser_prec);
8387
__pyx_t_5 = 0;
8388
__pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 393, __pyx_L1_error)
8389
__Pyx_GOTREF(__pyx_t_5);
8390
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_verb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
8391
__Pyx_GOTREF(__pyx_t_3);
8392
if (PyDict_SetItem(__pyx_t_5, __pyx_n_s_verb, __pyx_t_3) < 0) __PYX_ERR(0, 393, __pyx_L1_error)
8393
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8394
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 393, __pyx_L1_error)
8395
__Pyx_GOTREF(__pyx_t_3);
8396
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8397
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8398
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8399
__pyx_v_f = __pyx_t_3;
8400
__pyx_t_3 = 0;
8401
}
8402
__pyx_L6:;
8403
8404
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":394
8405
* else:
8406
* f = self._series(n, prec, ser_prec, verb=verb)
8407
* aj = f.list() # <<<<<<<<<<<<<<
8408
* R = Zp(p, prec)
8409
* if len(aj) > 0:
8410
*/
8411
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_f, __pyx_n_s_list); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 394, __pyx_L1_error)
8412
__Pyx_GOTREF(__pyx_t_5);
8413
__pyx_t_6 = NULL;
8414
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8415
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8416
if (likely(__pyx_t_6)) {
8417
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8418
__Pyx_INCREF(__pyx_t_6);
8419
__Pyx_INCREF(function);
8420
__Pyx_DECREF_SET(__pyx_t_5, function);
8421
}
8422
}
8423
if (__pyx_t_6) {
8424
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
8425
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8426
} else {
8427
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 394, __pyx_L1_error)
8428
}
8429
__Pyx_GOTREF(__pyx_t_3);
8430
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8431
__pyx_v_aj = __pyx_t_3;
8432
__pyx_t_3 = 0;
8433
8434
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":395
8435
* f = self._series(n, prec, ser_prec, verb=verb)
8436
* aj = f.list()
8437
* R = Zp(p, prec) # <<<<<<<<<<<<<<
8438
* if len(aj) > 0:
8439
* bounds = self._prec_bounds(n, ser_prec)
8440
*/
8441
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_Zp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 395, __pyx_L1_error)
8442
__Pyx_GOTREF(__pyx_t_5);
8443
__pyx_t_6 = NULL;
8444
__pyx_t_7 = 0;
8445
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
8446
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8447
if (likely(__pyx_t_6)) {
8448
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8449
__Pyx_INCREF(__pyx_t_6);
8450
__Pyx_INCREF(function);
8451
__Pyx_DECREF_SET(__pyx_t_5, function);
8452
__pyx_t_7 = 1;
8453
}
8454
}
8455
#if CYTHON_FAST_PYCALL
8456
if (PyFunction_Check(__pyx_t_5)) {
8457
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_p, __pyx_v_prec};
8458
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
8459
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8460
__Pyx_GOTREF(__pyx_t_3);
8461
} else
8462
#endif
8463
#if CYTHON_FAST_PYCCALL
8464
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8465
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_v_p, __pyx_v_prec};
8466
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
8467
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8468
__Pyx_GOTREF(__pyx_t_3);
8469
} else
8470
#endif
8471
{
8472
__pyx_t_4 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 395, __pyx_L1_error)
8473
__Pyx_GOTREF(__pyx_t_4);
8474
if (__pyx_t_6) {
8475
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
8476
}
8477
__Pyx_INCREF(__pyx_v_p);
8478
__Pyx_GIVEREF(__pyx_v_p);
8479
PyTuple_SET_ITEM(__pyx_t_4, 0+__pyx_t_7, __pyx_v_p);
8480
__Pyx_INCREF(__pyx_v_prec);
8481
__Pyx_GIVEREF(__pyx_v_prec);
8482
PyTuple_SET_ITEM(__pyx_t_4, 1+__pyx_t_7, __pyx_v_prec);
8483
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 395, __pyx_L1_error)
8484
__Pyx_GOTREF(__pyx_t_3);
8485
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8486
}
8487
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8488
__pyx_v_R = __pyx_t_3;
8489
__pyx_t_3 = 0;
8490
8491
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":396
8492
* aj = f.list()
8493
* R = Zp(p, prec)
8494
* if len(aj) > 0: # <<<<<<<<<<<<<<
8495
* bounds = self._prec_bounds(n, ser_prec)
8496
* aj = [R(aj[0], prec-2)] + [R(aj[j], bounds[j]) for j in range(1,len(aj))]
8497
*/
8498
__pyx_t_8 = PyObject_Length(__pyx_v_aj); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 396, __pyx_L1_error)
8499
__pyx_t_1 = ((__pyx_t_8 > 0) != 0);
8500
if (__pyx_t_1) {
8501
8502
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":397
8503
* R = Zp(p, prec)
8504
* if len(aj) > 0:
8505
* bounds = self._prec_bounds(n, ser_prec) # <<<<<<<<<<<<<<
8506
* aj = [R(aj[0], prec-2)] + [R(aj[j], bounds[j]) for j in range(1,len(aj))]
8507
* # make unknown coefficients show as 0 precision.
8508
*/
8509
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_prec_bounds); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 397, __pyx_L1_error)
8510
__Pyx_GOTREF(__pyx_t_5);
8511
__pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 397, __pyx_L1_error)
8512
__Pyx_GOTREF(__pyx_t_4);
8513
__pyx_t_6 = NULL;
8514
__pyx_t_7 = 0;
8515
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
8516
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
8517
if (likely(__pyx_t_6)) {
8518
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
8519
__Pyx_INCREF(__pyx_t_6);
8520
__Pyx_INCREF(function);
8521
__Pyx_DECREF_SET(__pyx_t_5, function);
8522
__pyx_t_7 = 1;
8523
}
8524
}
8525
#if CYTHON_FAST_PYCALL
8526
if (PyFunction_Check(__pyx_t_5)) {
8527
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_ser_prec};
8528
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
8529
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8530
__Pyx_GOTREF(__pyx_t_3);
8531
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8532
} else
8533
#endif
8534
#if CYTHON_FAST_PYCCALL
8535
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
8536
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_4, __pyx_v_ser_prec};
8537
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
8538
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8539
__Pyx_GOTREF(__pyx_t_3);
8540
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8541
} else
8542
#endif
8543
{
8544
__pyx_t_9 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 397, __pyx_L1_error)
8545
__Pyx_GOTREF(__pyx_t_9);
8546
if (__pyx_t_6) {
8547
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_6); __pyx_t_6 = NULL;
8548
}
8549
__Pyx_GIVEREF(__pyx_t_4);
8550
PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_7, __pyx_t_4);
8551
__Pyx_INCREF(__pyx_v_ser_prec);
8552
__Pyx_GIVEREF(__pyx_v_ser_prec);
8553
PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_7, __pyx_v_ser_prec);
8554
__pyx_t_4 = 0;
8555
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 397, __pyx_L1_error)
8556
__Pyx_GOTREF(__pyx_t_3);
8557
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8558
}
8559
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8560
__pyx_v_bounds = __pyx_t_3;
8561
__pyx_t_3 = 0;
8562
8563
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":398
8564
* if len(aj) > 0:
8565
* bounds = self._prec_bounds(n, ser_prec)
8566
* aj = [R(aj[0], prec-2)] + [R(aj[j], bounds[j]) for j in range(1,len(aj))] # <<<<<<<<<<<<<<
8567
* # make unknown coefficients show as 0 precision.
8568
* aj.extend([R(0,0) for _ in range(ser_prec-len(aj))])
8569
*/
8570
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_aj, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
8571
__Pyx_GOTREF(__pyx_t_5);
8572
__pyx_t_9 = __Pyx_PyInt_SubtractObjC(__pyx_v_prec, __pyx_int_2, 2, 0); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L1_error)
8573
__Pyx_GOTREF(__pyx_t_9);
8574
__Pyx_INCREF(__pyx_v_R);
8575
__pyx_t_4 = __pyx_v_R; __pyx_t_6 = NULL;
8576
__pyx_t_7 = 0;
8577
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
8578
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
8579
if (likely(__pyx_t_6)) {
8580
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
8581
__Pyx_INCREF(__pyx_t_6);
8582
__Pyx_INCREF(function);
8583
__Pyx_DECREF_SET(__pyx_t_4, function);
8584
__pyx_t_7 = 1;
8585
}
8586
}
8587
#if CYTHON_FAST_PYCALL
8588
if (PyFunction_Check(__pyx_t_4)) {
8589
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_9};
8590
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
8591
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8592
__Pyx_GOTREF(__pyx_t_3);
8593
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8594
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8595
} else
8596
#endif
8597
#if CYTHON_FAST_PYCCALL
8598
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
8599
PyObject *__pyx_temp[3] = {__pyx_t_6, __pyx_t_5, __pyx_t_9};
8600
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
8601
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8602
__Pyx_GOTREF(__pyx_t_3);
8603
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8604
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8605
} else
8606
#endif
8607
{
8608
__pyx_t_10 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 398, __pyx_L1_error)
8609
__Pyx_GOTREF(__pyx_t_10);
8610
if (__pyx_t_6) {
8611
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_6); __pyx_t_6 = NULL;
8612
}
8613
__Pyx_GIVEREF(__pyx_t_5);
8614
PyTuple_SET_ITEM(__pyx_t_10, 0+__pyx_t_7, __pyx_t_5);
8615
__Pyx_GIVEREF(__pyx_t_9);
8616
PyTuple_SET_ITEM(__pyx_t_10, 1+__pyx_t_7, __pyx_t_9);
8617
__pyx_t_5 = 0;
8618
__pyx_t_9 = 0;
8619
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_10, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
8620
__Pyx_GOTREF(__pyx_t_3);
8621
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8622
}
8623
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8624
__pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 398, __pyx_L1_error)
8625
__Pyx_GOTREF(__pyx_t_4);
8626
__Pyx_GIVEREF(__pyx_t_3);
8627
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
8628
__pyx_t_3 = 0;
8629
__pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 398, __pyx_L1_error)
8630
__Pyx_GOTREF(__pyx_t_3);
8631
__pyx_t_8 = PyObject_Length(__pyx_v_aj); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 398, __pyx_L1_error)
8632
for (__pyx_t_11 = 1; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
8633
__pyx_v_j = __pyx_t_11;
8634
__pyx_t_9 = __Pyx_GetItemInt(__pyx_v_aj, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 398, __pyx_L1_error)
8635
__Pyx_GOTREF(__pyx_t_9);
8636
__pyx_t_5 = __Pyx_GetItemInt(__pyx_v_bounds, __pyx_v_j, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
8637
__Pyx_GOTREF(__pyx_t_5);
8638
__Pyx_INCREF(__pyx_v_R);
8639
__pyx_t_6 = __pyx_v_R; __pyx_t_12 = NULL;
8640
__pyx_t_7 = 0;
8641
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
8642
__pyx_t_12 = PyMethod_GET_SELF(__pyx_t_6);
8643
if (likely(__pyx_t_12)) {
8644
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8645
__Pyx_INCREF(__pyx_t_12);
8646
__Pyx_INCREF(function);
8647
__Pyx_DECREF_SET(__pyx_t_6, function);
8648
__pyx_t_7 = 1;
8649
}
8650
}
8651
#if CYTHON_FAST_PYCALL
8652
if (PyFunction_Check(__pyx_t_6)) {
8653
PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_9, __pyx_t_5};
8654
__pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 398, __pyx_L1_error)
8655
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
8656
__Pyx_GOTREF(__pyx_t_10);
8657
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8658
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8659
} else
8660
#endif
8661
#if CYTHON_FAST_PYCCALL
8662
if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
8663
PyObject *__pyx_temp[3] = {__pyx_t_12, __pyx_t_9, __pyx_t_5};
8664
__pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 398, __pyx_L1_error)
8665
__Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
8666
__Pyx_GOTREF(__pyx_t_10);
8667
__Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8668
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8669
} else
8670
#endif
8671
{
8672
__pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 398, __pyx_L1_error)
8673
__Pyx_GOTREF(__pyx_t_13);
8674
if (__pyx_t_12) {
8675
__Pyx_GIVEREF(__pyx_t_12); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_12); __pyx_t_12 = NULL;
8676
}
8677
__Pyx_GIVEREF(__pyx_t_9);
8678
PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_t_9);
8679
__Pyx_GIVEREF(__pyx_t_5);
8680
PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_t_5);
8681
__pyx_t_9 = 0;
8682
__pyx_t_5 = 0;
8683
__pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 398, __pyx_L1_error)
8684
__Pyx_GOTREF(__pyx_t_10);
8685
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8686
}
8687
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8688
if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_10))) __PYX_ERR(0, 398, __pyx_L1_error)
8689
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8690
}
8691
__pyx_t_10 = PyNumber_Add(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 398, __pyx_L1_error)
8692
__Pyx_GOTREF(__pyx_t_10);
8693
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8694
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8695
__Pyx_DECREF_SET(__pyx_v_aj, __pyx_t_10);
8696
__pyx_t_10 = 0;
8697
8698
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":396
8699
* aj = f.list()
8700
* R = Zp(p, prec)
8701
* if len(aj) > 0: # <<<<<<<<<<<<<<
8702
* bounds = self._prec_bounds(n, ser_prec)
8703
* aj = [R(aj[0], prec-2)] + [R(aj[j], bounds[j]) for j in range(1,len(aj))]
8704
*/
8705
}
8706
8707
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":400
8708
* aj = [R(aj[0], prec-2)] + [R(aj[j], bounds[j]) for j in range(1,len(aj))]
8709
* # make unknown coefficients show as 0 precision.
8710
* aj.extend([R(0,0) for _ in range(ser_prec-len(aj))]) # <<<<<<<<<<<<<<
8711
* ser_prec = min([ser_prec] + [i for i in range(len(aj)) if aj[i].precision_absolute() == 0])
8712
* L = R[['T']](aj, ser_prec)
8713
*/
8714
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_aj, __pyx_n_s_extend); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 400, __pyx_L1_error)
8715
__Pyx_GOTREF(__pyx_t_3);
8716
__pyx_t_4 = PyList_New(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 400, __pyx_L1_error)
8717
__Pyx_GOTREF(__pyx_t_4);
8718
__pyx_t_8 = PyObject_Length(__pyx_v_aj); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 400, __pyx_L1_error)
8719
__pyx_t_6 = PyInt_FromSsize_t(__pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
8720
__Pyx_GOTREF(__pyx_t_6);
8721
__pyx_t_13 = PyNumber_Subtract(__pyx_v_ser_prec, __pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 400, __pyx_L1_error)
8722
__Pyx_GOTREF(__pyx_t_13);
8723
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8724
__pyx_t_6 = PyTuple_New(1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
8725
__Pyx_GOTREF(__pyx_t_6);
8726
__Pyx_GIVEREF(__pyx_t_13);
8727
PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_13);
8728
__pyx_t_13 = 0;
8729
__pyx_t_13 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_6, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 400, __pyx_L1_error)
8730
__Pyx_GOTREF(__pyx_t_13);
8731
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8732
if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
8733
__pyx_t_6 = __pyx_t_13; __Pyx_INCREF(__pyx_t_6); __pyx_t_8 = 0;
8734
__pyx_t_14 = NULL;
8735
} else {
8736
__pyx_t_8 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 400, __pyx_L1_error)
8737
__Pyx_GOTREF(__pyx_t_6);
8738
__pyx_t_14 = Py_TYPE(__pyx_t_6)->tp_iternext; if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 400, __pyx_L1_error)
8739
}
8740
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8741
for (;;) {
8742
if (likely(!__pyx_t_14)) {
8743
if (likely(PyList_CheckExact(__pyx_t_6))) {
8744
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_6)) break;
8745
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8746
__pyx_t_13 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
8747
#else
8748
__pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 400, __pyx_L1_error)
8749
__Pyx_GOTREF(__pyx_t_13);
8750
#endif
8751
} else {
8752
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
8753
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8754
__pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_8); __Pyx_INCREF(__pyx_t_13); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 400, __pyx_L1_error)
8755
#else
8756
__pyx_t_13 = PySequence_ITEM(__pyx_t_6, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 400, __pyx_L1_error)
8757
__Pyx_GOTREF(__pyx_t_13);
8758
#endif
8759
}
8760
} else {
8761
__pyx_t_13 = __pyx_t_14(__pyx_t_6);
8762
if (unlikely(!__pyx_t_13)) {
8763
PyObject* exc_type = PyErr_Occurred();
8764
if (exc_type) {
8765
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
8766
else __PYX_ERR(0, 400, __pyx_L1_error)
8767
}
8768
break;
8769
}
8770
__Pyx_GOTREF(__pyx_t_13);
8771
}
8772
__Pyx_XDECREF_SET(__pyx_v__, __pyx_t_13);
8773
__pyx_t_13 = 0;
8774
__pyx_t_13 = __Pyx_PyObject_Call(__pyx_v_R, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 400, __pyx_L1_error)
8775
__Pyx_GOTREF(__pyx_t_13);
8776
if (unlikely(__Pyx_ListComp_Append(__pyx_t_4, (PyObject*)__pyx_t_13))) __PYX_ERR(0, 400, __pyx_L1_error)
8777
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8778
}
8779
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8780
__pyx_t_6 = NULL;
8781
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
8782
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_3);
8783
if (likely(__pyx_t_6)) {
8784
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
8785
__Pyx_INCREF(__pyx_t_6);
8786
__Pyx_INCREF(function);
8787
__Pyx_DECREF_SET(__pyx_t_3, function);
8788
}
8789
}
8790
if (!__pyx_t_6) {
8791
__pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 400, __pyx_L1_error)
8792
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8793
__Pyx_GOTREF(__pyx_t_10);
8794
} else {
8795
#if CYTHON_FAST_PYCALL
8796
if (PyFunction_Check(__pyx_t_3)) {
8797
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
8798
__pyx_t_10 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 400, __pyx_L1_error)
8799
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8800
__Pyx_GOTREF(__pyx_t_10);
8801
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8802
} else
8803
#endif
8804
#if CYTHON_FAST_PYCCALL
8805
if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
8806
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
8807
__pyx_t_10 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 400, __pyx_L1_error)
8808
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
8809
__Pyx_GOTREF(__pyx_t_10);
8810
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8811
} else
8812
#endif
8813
{
8814
__pyx_t_13 = PyTuple_New(1+1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 400, __pyx_L1_error)
8815
__Pyx_GOTREF(__pyx_t_13);
8816
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_6); __pyx_t_6 = NULL;
8817
__Pyx_GIVEREF(__pyx_t_4);
8818
PyTuple_SET_ITEM(__pyx_t_13, 0+1, __pyx_t_4);
8819
__pyx_t_4 = 0;
8820
__pyx_t_10 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_13, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 400, __pyx_L1_error)
8821
__Pyx_GOTREF(__pyx_t_10);
8822
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8823
}
8824
}
8825
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8826
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8827
8828
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":401
8829
* # make unknown coefficients show as 0 precision.
8830
* aj.extend([R(0,0) for _ in range(ser_prec-len(aj))])
8831
* ser_prec = min([ser_prec] + [i for i in range(len(aj)) if aj[i].precision_absolute() == 0]) # <<<<<<<<<<<<<<
8832
* L = R[['T']](aj, ser_prec)
8833
* return L / self.modsym.denom
8834
*/
8835
__pyx_t_10 = PyList_New(1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 401, __pyx_L1_error)
8836
__Pyx_GOTREF(__pyx_t_10);
8837
__Pyx_INCREF(__pyx_v_ser_prec);
8838
__Pyx_GIVEREF(__pyx_v_ser_prec);
8839
PyList_SET_ITEM(__pyx_t_10, 0, __pyx_v_ser_prec);
8840
__pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
8841
__Pyx_GOTREF(__pyx_t_3);
8842
__pyx_t_8 = PyObject_Length(__pyx_v_aj); if (unlikely(__pyx_t_8 == -1)) __PYX_ERR(0, 401, __pyx_L1_error)
8843
for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
8844
__pyx_v_i = __pyx_t_11;
8845
__pyx_t_4 = __Pyx_GetItemInt(__pyx_v_aj, __pyx_v_i, Py_ssize_t, 1, PyInt_FromSsize_t, 0, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 401, __pyx_L1_error)
8846
__Pyx_GOTREF(__pyx_t_4);
8847
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_precision_absolute); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
8848
__Pyx_GOTREF(__pyx_t_6);
8849
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8850
__pyx_t_4 = NULL;
8851
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
8852
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_6);
8853
if (likely(__pyx_t_4)) {
8854
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
8855
__Pyx_INCREF(__pyx_t_4);
8856
__Pyx_INCREF(function);
8857
__Pyx_DECREF_SET(__pyx_t_6, function);
8858
}
8859
}
8860
if (__pyx_t_4) {
8861
__pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_t_6, __pyx_t_4); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 401, __pyx_L1_error)
8862
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
8863
} else {
8864
__pyx_t_13 = __Pyx_PyObject_CallNoArg(__pyx_t_6); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 401, __pyx_L1_error)
8865
}
8866
__Pyx_GOTREF(__pyx_t_13);
8867
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8868
__pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_t_13, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
8869
__Pyx_GOTREF(__pyx_t_6);
8870
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8871
__pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 401, __pyx_L1_error)
8872
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8873
if (__pyx_t_1) {
8874
__pyx_t_6 = PyInt_FromSsize_t(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
8875
__Pyx_GOTREF(__pyx_t_6);
8876
if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 401, __pyx_L1_error)
8877
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8878
}
8879
}
8880
__pyx_t_6 = PyNumber_Add(__pyx_t_10, __pyx_t_3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
8881
__Pyx_GOTREF(__pyx_t_6);
8882
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8883
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8884
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 401, __pyx_L1_error)
8885
__Pyx_GOTREF(__pyx_t_3);
8886
__Pyx_GIVEREF(__pyx_t_6);
8887
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_6);
8888
__pyx_t_6 = 0;
8889
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_min, __pyx_t_3, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 401, __pyx_L1_error)
8890
__Pyx_GOTREF(__pyx_t_6);
8891
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8892
__Pyx_DECREF_SET(__pyx_v_ser_prec, __pyx_t_6);
8893
__pyx_t_6 = 0;
8894
8895
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":402
8896
* aj.extend([R(0,0) for _ in range(ser_prec-len(aj))])
8897
* ser_prec = min([ser_prec] + [i for i in range(len(aj)) if aj[i].precision_absolute() == 0])
8898
* L = R[['T']](aj, ser_prec) # <<<<<<<<<<<<<<
8899
* return L / self.modsym.denom
8900
*
8901
*/
8902
__pyx_t_3 = PyList_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
8903
__Pyx_GOTREF(__pyx_t_3);
8904
__Pyx_INCREF(__pyx_n_s_T);
8905
__Pyx_GIVEREF(__pyx_n_s_T);
8906
PyList_SET_ITEM(__pyx_t_3, 0, __pyx_n_s_T);
8907
__pyx_t_10 = PyObject_GetItem(__pyx_v_R, __pyx_t_3); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 402, __pyx_L1_error)
8908
__Pyx_GOTREF(__pyx_t_10);
8909
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8910
__pyx_t_3 = NULL;
8911
__pyx_t_7 = 0;
8912
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
8913
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_10);
8914
if (likely(__pyx_t_3)) {
8915
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
8916
__Pyx_INCREF(__pyx_t_3);
8917
__Pyx_INCREF(function);
8918
__Pyx_DECREF_SET(__pyx_t_10, function);
8919
__pyx_t_7 = 1;
8920
}
8921
}
8922
#if CYTHON_FAST_PYCALL
8923
if (PyFunction_Check(__pyx_t_10)) {
8924
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_aj, __pyx_v_ser_prec};
8925
__pyx_t_6 = __Pyx_PyFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
8926
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8927
__Pyx_GOTREF(__pyx_t_6);
8928
} else
8929
#endif
8930
#if CYTHON_FAST_PYCCALL
8931
if (__Pyx_PyFastCFunction_Check(__pyx_t_10)) {
8932
PyObject *__pyx_temp[3] = {__pyx_t_3, __pyx_v_aj, __pyx_v_ser_prec};
8933
__pyx_t_6 = __Pyx_PyCFunction_FastCall(__pyx_t_10, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
8934
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
8935
__Pyx_GOTREF(__pyx_t_6);
8936
} else
8937
#endif
8938
{
8939
__pyx_t_13 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 402, __pyx_L1_error)
8940
__Pyx_GOTREF(__pyx_t_13);
8941
if (__pyx_t_3) {
8942
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_13, 0, __pyx_t_3); __pyx_t_3 = NULL;
8943
}
8944
__Pyx_INCREF(__pyx_v_aj);
8945
__Pyx_GIVEREF(__pyx_v_aj);
8946
PyTuple_SET_ITEM(__pyx_t_13, 0+__pyx_t_7, __pyx_v_aj);
8947
__Pyx_INCREF(__pyx_v_ser_prec);
8948
__Pyx_GIVEREF(__pyx_v_ser_prec);
8949
PyTuple_SET_ITEM(__pyx_t_13, 1+__pyx_t_7, __pyx_v_ser_prec);
8950
__pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_10, __pyx_t_13, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 402, __pyx_L1_error)
8951
__Pyx_GOTREF(__pyx_t_6);
8952
__Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
8953
}
8954
__Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8955
__pyx_v_L = __pyx_t_6;
8956
__pyx_t_6 = 0;
8957
8958
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":403
8959
* ser_prec = min([ser_prec] + [i for i in range(len(aj)) if aj[i].precision_absolute() == 0])
8960
* L = R[['T']](aj, ser_prec)
8961
* return L / self.modsym.denom # <<<<<<<<<<<<<<
8962
*
8963
* def series_modp(self, int n=2, ser_prec=5, int check=True):
8964
*/
8965
__Pyx_XDECREF(__pyx_r);
8966
__pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_self->modsym->denom); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 403, __pyx_L1_error)
8967
__Pyx_GOTREF(__pyx_t_6);
8968
__pyx_t_10 = __Pyx_PyNumber_Divide(__pyx_v_L, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 403, __pyx_L1_error)
8969
__Pyx_GOTREF(__pyx_t_10);
8970
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
8971
__pyx_r = __pyx_t_10;
8972
__pyx_t_10 = 0;
8973
goto __pyx_L0;
8974
8975
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":363
8976
* return res
8977
*
8978
* def series(self, int n=2, prec=None, ser_prec=5, int check=True, bint verb=False, # <<<<<<<<<<<<<<
8979
* parallel=None):
8980
* """
8981
*/
8982
8983
/* function exit code */
8984
__pyx_L1_error:;
8985
__Pyx_XDECREF(__pyx_t_3);
8986
__Pyx_XDECREF(__pyx_t_4);
8987
__Pyx_XDECREF(__pyx_t_5);
8988
__Pyx_XDECREF(__pyx_t_6);
8989
__Pyx_XDECREF(__pyx_t_9);
8990
__Pyx_XDECREF(__pyx_t_10);
8991
__Pyx_XDECREF(__pyx_t_12);
8992
__Pyx_XDECREF(__pyx_t_13);
8993
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.series", __pyx_clineno, __pyx_lineno, __pyx_filename);
8994
__pyx_r = NULL;
8995
__pyx_L0:;
8996
__Pyx_XDECREF(__pyx_v_p);
8997
__Pyx_XDECREF(__pyx_v_f);
8998
__Pyx_XDECREF(__pyx_v_aj);
8999
__Pyx_XDECREF(__pyx_v_R);
9000
__Pyx_XDECREF(__pyx_v_bounds);
9001
__Pyx_XDECREF(__pyx_v_L);
9002
__Pyx_XDECREF(__pyx_v__);
9003
__Pyx_XDECREF(__pyx_v_prec);
9004
__Pyx_XDECREF(__pyx_v_ser_prec);
9005
__Pyx_XDECREF(__pyx_v_parallel);
9006
__Pyx_XGIVEREF(__pyx_r);
9007
__Pyx_RefNannyFinishContext();
9008
return __pyx_r;
9009
}
9010
9011
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":405
9012
* return L / self.modsym.denom
9013
*
9014
* def series_modp(self, int n=2, ser_prec=5, int check=True): # <<<<<<<<<<<<<<
9015
* """
9016
* EXAMPLES::
9017
*/
9018
9019
/* Python wrapper */
9020
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_25series_modp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9021
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_24series_modp[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 405)\n\n EXAMPLES::\n\n sage: from psage.modform.rational.padic_elliptic_lseries_fast import pAdicLseries\n sage: E = EllipticCurve('389a')\n sage: L = pAdicLseries(E,5)\n sage: L.series_modp()\n 4*T^2 + 2*T^3 + 3*T^4 + O(T^5)\n sage: L.series_modp(3, 8)\n 4*T^2 + 2*T^3 + 3*T^4 + T^5 + 4*T^7 + O(T^8)\n sage: L.series_modp(2, 20)\n 4*T^2 + 2*T^3 + 3*T^4 + O(T^5)\n ";
9022
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_25series_modp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9023
int __pyx_v_n;
9024
PyObject *__pyx_v_ser_prec = 0;
9025
int __pyx_v_check;
9026
PyObject *__pyx_r = 0;
9027
__Pyx_RefNannyDeclarations
9028
__Pyx_RefNannySetupContext("series_modp (wrapper)", 0);
9029
{
9030
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_n,&__pyx_n_s_ser_prec,&__pyx_n_s_check,0};
9031
PyObject* values[3] = {0,0,0};
9032
values[1] = ((PyObject *)__pyx_int_5);
9033
if (unlikely(__pyx_kwds)) {
9034
Py_ssize_t kw_args;
9035
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9036
switch (pos_args) {
9037
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9038
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9039
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9040
case 0: break;
9041
default: goto __pyx_L5_argtuple_error;
9042
}
9043
kw_args = PyDict_Size(__pyx_kwds);
9044
switch (pos_args) {
9045
case 0:
9046
if (kw_args > 0) {
9047
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n);
9048
if (value) { values[0] = value; kw_args--; }
9049
}
9050
case 1:
9051
if (kw_args > 0) {
9052
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ser_prec);
9053
if (value) { values[1] = value; kw_args--; }
9054
}
9055
case 2:
9056
if (kw_args > 0) {
9057
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_check);
9058
if (value) { values[2] = value; kw_args--; }
9059
}
9060
}
9061
if (unlikely(kw_args > 0)) {
9062
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "series_modp") < 0)) __PYX_ERR(0, 405, __pyx_L3_error)
9063
}
9064
} else {
9065
switch (PyTuple_GET_SIZE(__pyx_args)) {
9066
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
9067
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
9068
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9069
case 0: break;
9070
default: goto __pyx_L5_argtuple_error;
9071
}
9072
}
9073
if (values[0]) {
9074
__pyx_v_n = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_n == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L3_error)
9075
} else {
9076
__pyx_v_n = ((int)2);
9077
}
9078
__pyx_v_ser_prec = values[1];
9079
if (values[2]) {
9080
__pyx_v_check = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_check == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 405, __pyx_L3_error)
9081
} else {
9082
__pyx_v_check = ((int)1);
9083
}
9084
}
9085
goto __pyx_L4_argument_unpacking_done;
9086
__pyx_L5_argtuple_error:;
9087
__Pyx_RaiseArgtupleInvalid("series_modp", 0, 0, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 405, __pyx_L3_error)
9088
__pyx_L3_error:;
9089
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.series_modp", __pyx_clineno, __pyx_lineno, __pyx_filename);
9090
__Pyx_RefNannyFinishContext();
9091
return NULL;
9092
__pyx_L4_argument_unpacking_done:;
9093
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_24series_modp(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_n, __pyx_v_ser_prec, __pyx_v_check);
9094
9095
/* function exit code */
9096
__Pyx_RefNannyFinishContext();
9097
return __pyx_r;
9098
}
9099
9100
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_24series_modp(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_n, PyObject *__pyx_v_ser_prec, int __pyx_v_check) {
9101
PyObject *__pyx_v_L = NULL;
9102
PyObject *__pyx_r = NULL;
9103
__Pyx_RefNannyDeclarations
9104
PyObject *__pyx_t_1 = NULL;
9105
PyObject *__pyx_t_2 = NULL;
9106
PyObject *__pyx_t_3 = NULL;
9107
PyObject *__pyx_t_4 = NULL;
9108
PyObject *__pyx_t_5 = NULL;
9109
PyObject *__pyx_t_6 = NULL;
9110
PyObject *__pyx_t_7 = NULL;
9111
__Pyx_RefNannySetupContext("series_modp", 0);
9112
9113
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":419
9114
* 4*T^2 + 2*T^3 + 3*T^4 + O(T^5)
9115
* """
9116
* L = self.series(n=n, ser_prec=ser_prec, check=check) # <<<<<<<<<<<<<<
9117
* return L.change_ring(Integers(self.p))
9118
*
9119
*/
9120
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_series_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 419, __pyx_L1_error)
9121
__Pyx_GOTREF(__pyx_t_1);
9122
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 419, __pyx_L1_error)
9123
__Pyx_GOTREF(__pyx_t_2);
9124
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_n); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
9125
__Pyx_GOTREF(__pyx_t_3);
9126
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_n, __pyx_t_3) < 0) __PYX_ERR(0, 419, __pyx_L1_error)
9127
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9128
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_ser_prec, __pyx_v_ser_prec) < 0) __PYX_ERR(0, 419, __pyx_L1_error)
9129
__pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_check); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
9130
__Pyx_GOTREF(__pyx_t_3);
9131
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_check, __pyx_t_3) < 0) __PYX_ERR(0, 419, __pyx_L1_error)
9132
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9133
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 419, __pyx_L1_error)
9134
__Pyx_GOTREF(__pyx_t_3);
9135
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9136
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9137
__pyx_v_L = __pyx_t_3;
9138
__pyx_t_3 = 0;
9139
9140
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":420
9141
* """
9142
* L = self.series(n=n, ser_prec=ser_prec, check=check)
9143
* return L.change_ring(Integers(self.p)) # <<<<<<<<<<<<<<
9144
*
9145
* def series_to_enough_prec(self, bint verb=0):
9146
*/
9147
__Pyx_XDECREF(__pyx_r);
9148
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_change_ring); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
9149
__Pyx_GOTREF(__pyx_t_2);
9150
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_Integers); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
9151
__Pyx_GOTREF(__pyx_t_4);
9152
__pyx_t_5 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 420, __pyx_L1_error)
9153
__Pyx_GOTREF(__pyx_t_5);
9154
__pyx_t_6 = NULL;
9155
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
9156
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_4);
9157
if (likely(__pyx_t_6)) {
9158
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9159
__Pyx_INCREF(__pyx_t_6);
9160
__Pyx_INCREF(function);
9161
__Pyx_DECREF_SET(__pyx_t_4, function);
9162
}
9163
}
9164
if (!__pyx_t_6) {
9165
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
9166
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9167
__Pyx_GOTREF(__pyx_t_1);
9168
} else {
9169
#if CYTHON_FAST_PYCALL
9170
if (PyFunction_Check(__pyx_t_4)) {
9171
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
9172
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
9173
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9174
__Pyx_GOTREF(__pyx_t_1);
9175
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9176
} else
9177
#endif
9178
#if CYTHON_FAST_PYCCALL
9179
if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
9180
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_5};
9181
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
9182
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9183
__Pyx_GOTREF(__pyx_t_1);
9184
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9185
} else
9186
#endif
9187
{
9188
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
9189
__Pyx_GOTREF(__pyx_t_7);
9190
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
9191
__Pyx_GIVEREF(__pyx_t_5);
9192
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_5);
9193
__pyx_t_5 = 0;
9194
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
9195
__Pyx_GOTREF(__pyx_t_1);
9196
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9197
}
9198
}
9199
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9200
__pyx_t_4 = NULL;
9201
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9202
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
9203
if (likely(__pyx_t_4)) {
9204
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9205
__Pyx_INCREF(__pyx_t_4);
9206
__Pyx_INCREF(function);
9207
__Pyx_DECREF_SET(__pyx_t_2, function);
9208
}
9209
}
9210
if (!__pyx_t_4) {
9211
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
9212
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9213
__Pyx_GOTREF(__pyx_t_3);
9214
} else {
9215
#if CYTHON_FAST_PYCALL
9216
if (PyFunction_Check(__pyx_t_2)) {
9217
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
9218
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
9219
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9220
__Pyx_GOTREF(__pyx_t_3);
9221
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9222
} else
9223
#endif
9224
#if CYTHON_FAST_PYCCALL
9225
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
9226
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
9227
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
9228
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9229
__Pyx_GOTREF(__pyx_t_3);
9230
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9231
} else
9232
#endif
9233
{
9234
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 420, __pyx_L1_error)
9235
__Pyx_GOTREF(__pyx_t_7);
9236
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_4); __pyx_t_4 = NULL;
9237
__Pyx_GIVEREF(__pyx_t_1);
9238
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_1);
9239
__pyx_t_1 = 0;
9240
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 420, __pyx_L1_error)
9241
__Pyx_GOTREF(__pyx_t_3);
9242
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
9243
}
9244
}
9245
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9246
__pyx_r = __pyx_t_3;
9247
__pyx_t_3 = 0;
9248
goto __pyx_L0;
9249
9250
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":405
9251
* return L / self.modsym.denom
9252
*
9253
* def series_modp(self, int n=2, ser_prec=5, int check=True): # <<<<<<<<<<<<<<
9254
* """
9255
* EXAMPLES::
9256
*/
9257
9258
/* function exit code */
9259
__pyx_L1_error:;
9260
__Pyx_XDECREF(__pyx_t_1);
9261
__Pyx_XDECREF(__pyx_t_2);
9262
__Pyx_XDECREF(__pyx_t_3);
9263
__Pyx_XDECREF(__pyx_t_4);
9264
__Pyx_XDECREF(__pyx_t_5);
9265
__Pyx_XDECREF(__pyx_t_6);
9266
__Pyx_XDECREF(__pyx_t_7);
9267
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.series_modp", __pyx_clineno, __pyx_lineno, __pyx_filename);
9268
__pyx_r = NULL;
9269
__pyx_L0:;
9270
__Pyx_XDECREF(__pyx_v_L);
9271
__Pyx_XGIVEREF(__pyx_r);
9272
__Pyx_RefNannyFinishContext();
9273
return __pyx_r;
9274
}
9275
9276
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":422
9277
* return L.change_ring(Integers(self.p))
9278
*
9279
* def series_to_enough_prec(self, bint verb=0): # <<<<<<<<<<<<<<
9280
* r = self.E.rank()
9281
* n = 2
9282
*/
9283
9284
/* Python wrapper */
9285
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_27series_to_enough_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9286
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_26series_to_enough_prec[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 422)";
9287
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_27series_to_enough_prec(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9288
int __pyx_v_verb;
9289
PyObject *__pyx_r = 0;
9290
__Pyx_RefNannyDeclarations
9291
__Pyx_RefNannySetupContext("series_to_enough_prec (wrapper)", 0);
9292
{
9293
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_verb,0};
9294
PyObject* values[1] = {0};
9295
if (unlikely(__pyx_kwds)) {
9296
Py_ssize_t kw_args;
9297
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9298
switch (pos_args) {
9299
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9300
case 0: break;
9301
default: goto __pyx_L5_argtuple_error;
9302
}
9303
kw_args = PyDict_Size(__pyx_kwds);
9304
switch (pos_args) {
9305
case 0:
9306
if (kw_args > 0) {
9307
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verb);
9308
if (value) { values[0] = value; kw_args--; }
9309
}
9310
}
9311
if (unlikely(kw_args > 0)) {
9312
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "series_to_enough_prec") < 0)) __PYX_ERR(0, 422, __pyx_L3_error)
9313
}
9314
} else {
9315
switch (PyTuple_GET_SIZE(__pyx_args)) {
9316
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9317
case 0: break;
9318
default: goto __pyx_L5_argtuple_error;
9319
}
9320
}
9321
if (values[0]) {
9322
__pyx_v_verb = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_verb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 422, __pyx_L3_error)
9323
} else {
9324
__pyx_v_verb = ((int)0);
9325
}
9326
}
9327
goto __pyx_L4_argument_unpacking_done;
9328
__pyx_L5_argtuple_error:;
9329
__Pyx_RaiseArgtupleInvalid("series_to_enough_prec", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 422, __pyx_L3_error)
9330
__pyx_L3_error:;
9331
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.series_to_enough_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
9332
__Pyx_RefNannyFinishContext();
9333
return NULL;
9334
__pyx_L4_argument_unpacking_done:;
9335
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_26series_to_enough_prec(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_verb);
9336
9337
/* function exit code */
9338
__Pyx_RefNannyFinishContext();
9339
return __pyx_r;
9340
}
9341
9342
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_26series_to_enough_prec(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_verb) {
9343
PyObject *__pyx_v_r = NULL;
9344
PyObject *__pyx_v_n = NULL;
9345
PyObject *__pyx_v_L = NULL;
9346
PyObject *__pyx_v_i = NULL;
9347
PyObject *__pyx_r = NULL;
9348
__Pyx_RefNannyDeclarations
9349
PyObject *__pyx_t_1 = NULL;
9350
PyObject *__pyx_t_2 = NULL;
9351
PyObject *__pyx_t_3 = NULL;
9352
PyObject *__pyx_t_4 = NULL;
9353
int __pyx_t_5;
9354
Py_ssize_t __pyx_t_6;
9355
PyObject *(*__pyx_t_7)(PyObject *);
9356
__Pyx_RefNannySetupContext("series_to_enough_prec", 0);
9357
9358
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":423
9359
*
9360
* def series_to_enough_prec(self, bint verb=0):
9361
* r = self.E.rank() # <<<<<<<<<<<<<<
9362
* n = 2
9363
* while True:
9364
*/
9365
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_rank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 423, __pyx_L1_error)
9366
__Pyx_GOTREF(__pyx_t_2);
9367
__pyx_t_3 = NULL;
9368
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9369
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
9370
if (likely(__pyx_t_3)) {
9371
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9372
__Pyx_INCREF(__pyx_t_3);
9373
__Pyx_INCREF(function);
9374
__Pyx_DECREF_SET(__pyx_t_2, function);
9375
}
9376
}
9377
if (__pyx_t_3) {
9378
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
9379
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9380
} else {
9381
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 423, __pyx_L1_error)
9382
}
9383
__Pyx_GOTREF(__pyx_t_1);
9384
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9385
__pyx_v_r = __pyx_t_1;
9386
__pyx_t_1 = 0;
9387
9388
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":424
9389
* def series_to_enough_prec(self, bint verb=0):
9390
* r = self.E.rank()
9391
* n = 2 # <<<<<<<<<<<<<<
9392
* while True:
9393
* L = self.series(n, ser_prec=4+r, check=True, verb=verb)
9394
*/
9395
__Pyx_INCREF(__pyx_int_2);
9396
__pyx_v_n = __pyx_int_2;
9397
9398
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":425
9399
* r = self.E.rank()
9400
* n = 2
9401
* while True: # <<<<<<<<<<<<<<
9402
* L = self.series(n, ser_prec=4+r, check=True, verb=verb)
9403
* if verb: print "L = ", L
9404
*/
9405
while (1) {
9406
9407
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":426
9408
* n = 2
9409
* while True:
9410
* L = self.series(n, ser_prec=4+r, check=True, verb=verb) # <<<<<<<<<<<<<<
9411
* if verb: print "L = ", L
9412
* if L.prec() > r:
9413
*/
9414
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_series_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 426, __pyx_L1_error)
9415
__Pyx_GOTREF(__pyx_t_1);
9416
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 426, __pyx_L1_error)
9417
__Pyx_GOTREF(__pyx_t_2);
9418
__Pyx_INCREF(__pyx_v_n);
9419
__Pyx_GIVEREF(__pyx_v_n);
9420
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_n);
9421
__pyx_t_3 = PyDict_New(); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 426, __pyx_L1_error)
9422
__Pyx_GOTREF(__pyx_t_3);
9423
__pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_4, __pyx_v_r, 4, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
9424
__Pyx_GOTREF(__pyx_t_4);
9425
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_ser_prec, __pyx_t_4) < 0) __PYX_ERR(0, 426, __pyx_L1_error)
9426
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9427
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_check, Py_True) < 0) __PYX_ERR(0, 426, __pyx_L1_error)
9428
__pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_verb); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
9429
__Pyx_GOTREF(__pyx_t_4);
9430
if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_verb, __pyx_t_4) < 0) __PYX_ERR(0, 426, __pyx_L1_error)
9431
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9432
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 426, __pyx_L1_error)
9433
__Pyx_GOTREF(__pyx_t_4);
9434
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9435
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9436
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9437
__Pyx_XDECREF_SET(__pyx_v_L, __pyx_t_4);
9438
__pyx_t_4 = 0;
9439
9440
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":427
9441
* while True:
9442
* L = self.series(n, ser_prec=4+r, check=True, verb=verb)
9443
* if verb: print "L = ", L # <<<<<<<<<<<<<<
9444
* if L.prec() > r:
9445
* for i in range(r):
9446
*/
9447
__pyx_t_5 = (__pyx_v_verb != 0);
9448
if (__pyx_t_5) {
9449
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 427, __pyx_L1_error)
9450
__Pyx_GOTREF(__pyx_t_4);
9451
__Pyx_INCREF(__pyx_kp_s_L);
9452
__Pyx_GIVEREF(__pyx_kp_s_L);
9453
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_kp_s_L);
9454
__Pyx_INCREF(__pyx_v_L);
9455
__Pyx_GIVEREF(__pyx_v_L);
9456
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_L);
9457
if (__Pyx_Print(0, __pyx_t_4, 1) < 0) __PYX_ERR(0, 427, __pyx_L1_error)
9458
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9459
}
9460
9461
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":428
9462
* L = self.series(n, ser_prec=4+r, check=True, verb=verb)
9463
* if verb: print "L = ", L
9464
* if L.prec() > r: # <<<<<<<<<<<<<<
9465
* for i in range(r):
9466
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p)
9467
*/
9468
__pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_L, __pyx_n_s_prec); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
9469
__Pyx_GOTREF(__pyx_t_3);
9470
__pyx_t_2 = NULL;
9471
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
9472
__pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
9473
if (likely(__pyx_t_2)) {
9474
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
9475
__Pyx_INCREF(__pyx_t_2);
9476
__Pyx_INCREF(function);
9477
__Pyx_DECREF_SET(__pyx_t_3, function);
9478
}
9479
}
9480
if (__pyx_t_2) {
9481
__pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
9482
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9483
} else {
9484
__pyx_t_4 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 428, __pyx_L1_error)
9485
}
9486
__Pyx_GOTREF(__pyx_t_4);
9487
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9488
__pyx_t_3 = PyObject_RichCompare(__pyx_t_4, __pyx_v_r, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 428, __pyx_L1_error)
9489
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9490
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 428, __pyx_L1_error)
9491
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9492
if (__pyx_t_5) {
9493
9494
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":429
9495
* if verb: print "L = ", L
9496
* if L.prec() > r:
9497
* for i in range(r): # <<<<<<<<<<<<<<
9498
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p)
9499
* if L[r] != 0:
9500
*/
9501
__pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
9502
__Pyx_GOTREF(__pyx_t_3);
9503
__Pyx_INCREF(__pyx_v_r);
9504
__Pyx_GIVEREF(__pyx_v_r);
9505
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_r);
9506
__pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
9507
__Pyx_GOTREF(__pyx_t_4);
9508
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9509
if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
9510
__pyx_t_3 = __pyx_t_4; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
9511
__pyx_t_7 = NULL;
9512
} else {
9513
__pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 429, __pyx_L1_error)
9514
__Pyx_GOTREF(__pyx_t_3);
9515
__pyx_t_7 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L1_error)
9516
}
9517
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9518
for (;;) {
9519
if (likely(!__pyx_t_7)) {
9520
if (likely(PyList_CheckExact(__pyx_t_3))) {
9521
if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
9522
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9523
__pyx_t_4 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
9524
#else
9525
__pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
9526
__Pyx_GOTREF(__pyx_t_4);
9527
#endif
9528
} else {
9529
if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
9530
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
9531
__pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_4); __pyx_t_6++; if (unlikely(0 < 0)) __PYX_ERR(0, 429, __pyx_L1_error)
9532
#else
9533
__pyx_t_4 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 429, __pyx_L1_error)
9534
__Pyx_GOTREF(__pyx_t_4);
9535
#endif
9536
}
9537
} else {
9538
__pyx_t_4 = __pyx_t_7(__pyx_t_3);
9539
if (unlikely(!__pyx_t_4)) {
9540
PyObject* exc_type = PyErr_Occurred();
9541
if (exc_type) {
9542
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
9543
else __PYX_ERR(0, 429, __pyx_L1_error)
9544
}
9545
break;
9546
}
9547
__Pyx_GOTREF(__pyx_t_4);
9548
}
9549
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
9550
__pyx_t_4 = 0;
9551
9552
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":430
9553
* if L.prec() > r:
9554
* for i in range(r):
9555
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p) # <<<<<<<<<<<<<<
9556
* if L[r] != 0:
9557
* return L
9558
*/
9559
#ifndef CYTHON_WITHOUT_ASSERTIONS
9560
if (unlikely(!Py_OptimizeFlag)) {
9561
__pyx_t_4 = PyObject_GetItem(__pyx_v_L, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
9562
__Pyx_GOTREF(__pyx_t_4);
9563
__pyx_t_2 = __Pyx_PyInt_EqObjC(__pyx_t_4, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
9564
__Pyx_GOTREF(__pyx_t_2);
9565
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9566
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 430, __pyx_L1_error)
9567
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9568
if (unlikely(!__pyx_t_5)) {
9569
__pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_a_invariants); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
9570
__Pyx_GOTREF(__pyx_t_4);
9571
__pyx_t_1 = NULL;
9572
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_4))) {
9573
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
9574
if (likely(__pyx_t_1)) {
9575
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
9576
__Pyx_INCREF(__pyx_t_1);
9577
__Pyx_INCREF(function);
9578
__Pyx_DECREF_SET(__pyx_t_4, function);
9579
}
9580
}
9581
if (__pyx_t_1) {
9582
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
9583
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9584
} else {
9585
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 430, __pyx_L1_error)
9586
}
9587
__Pyx_GOTREF(__pyx_t_2);
9588
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9589
__pyx_t_4 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
9590
__Pyx_GOTREF(__pyx_t_4);
9591
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 430, __pyx_L1_error)
9592
__Pyx_GOTREF(__pyx_t_1);
9593
__Pyx_GIVEREF(__pyx_t_2);
9594
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
9595
__Pyx_GIVEREF(__pyx_t_4);
9596
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_4);
9597
__pyx_t_2 = 0;
9598
__pyx_t_4 = 0;
9599
__pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_bug_in_computing_p_adic_L_series, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 430, __pyx_L1_error)
9600
__Pyx_GOTREF(__pyx_t_4);
9601
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9602
PyErr_SetObject(PyExc_AssertionError, __pyx_t_4);
9603
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9604
__PYX_ERR(0, 430, __pyx_L1_error)
9605
}
9606
}
9607
#endif
9608
9609
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":429
9610
* if verb: print "L = ", L
9611
* if L.prec() > r:
9612
* for i in range(r): # <<<<<<<<<<<<<<
9613
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p)
9614
* if L[r] != 0:
9615
*/
9616
}
9617
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9618
9619
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":431
9620
* for i in range(r):
9621
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p)
9622
* if L[r] != 0: # <<<<<<<<<<<<<<
9623
* return L
9624
* n += 1
9625
*/
9626
__pyx_t_3 = PyObject_GetItem(__pyx_v_L, __pyx_v_r); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 431, __pyx_L1_error)
9627
__Pyx_GOTREF(__pyx_t_3);
9628
__pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_int_0, Py_NE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 431, __pyx_L1_error)
9629
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9630
__pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_5 < 0)) __PYX_ERR(0, 431, __pyx_L1_error)
9631
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9632
if (__pyx_t_5) {
9633
9634
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":432
9635
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p)
9636
* if L[r] != 0:
9637
* return L # <<<<<<<<<<<<<<
9638
* n += 1
9639
*
9640
*/
9641
__Pyx_XDECREF(__pyx_r);
9642
__Pyx_INCREF(__pyx_v_L);
9643
__pyx_r = __pyx_v_L;
9644
goto __pyx_L0;
9645
9646
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":431
9647
* for i in range(r):
9648
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p)
9649
* if L[r] != 0: # <<<<<<<<<<<<<<
9650
* return L
9651
* n += 1
9652
*/
9653
}
9654
9655
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":428
9656
* L = self.series(n, ser_prec=4+r, check=True, verb=verb)
9657
* if verb: print "L = ", L
9658
* if L.prec() > r: # <<<<<<<<<<<<<<
9659
* for i in range(r):
9660
* assert L[i] == 0, "bug in computing p-adic L-series for %s and p=%s"%(self.E.a_invariants(), self.p)
9661
*/
9662
}
9663
9664
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":433
9665
* if L[r] != 0:
9666
* return L
9667
* n += 1 # <<<<<<<<<<<<<<
9668
*
9669
* def sha_modp(self, bint verb=0):
9670
*/
9671
__pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_n, __pyx_int_1, 1, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 433, __pyx_L1_error)
9672
__Pyx_GOTREF(__pyx_t_4);
9673
__Pyx_DECREF_SET(__pyx_v_n, __pyx_t_4);
9674
__pyx_t_4 = 0;
9675
}
9676
9677
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":422
9678
* return L.change_ring(Integers(self.p))
9679
*
9680
* def series_to_enough_prec(self, bint verb=0): # <<<<<<<<<<<<<<
9681
* r = self.E.rank()
9682
* n = 2
9683
*/
9684
9685
/* function exit code */
9686
__pyx_r = Py_None; __Pyx_INCREF(Py_None);
9687
goto __pyx_L0;
9688
__pyx_L1_error:;
9689
__Pyx_XDECREF(__pyx_t_1);
9690
__Pyx_XDECREF(__pyx_t_2);
9691
__Pyx_XDECREF(__pyx_t_3);
9692
__Pyx_XDECREF(__pyx_t_4);
9693
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.series_to_enough_prec", __pyx_clineno, __pyx_lineno, __pyx_filename);
9694
__pyx_r = NULL;
9695
__pyx_L0:;
9696
__Pyx_XDECREF(__pyx_v_r);
9697
__Pyx_XDECREF(__pyx_v_n);
9698
__Pyx_XDECREF(__pyx_v_L);
9699
__Pyx_XDECREF(__pyx_v_i);
9700
__Pyx_XGIVEREF(__pyx_r);
9701
__Pyx_RefNannyFinishContext();
9702
return __pyx_r;
9703
}
9704
9705
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":435
9706
* n += 1
9707
*
9708
* def sha_modp(self, bint verb=0): # <<<<<<<<<<<<<<
9709
* """
9710
* Return the p-adic conjectural order of Sha mod p using p-adic
9711
*/
9712
9713
/* Python wrapper */
9714
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_29sha_modp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9715
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_28sha_modp[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 435)\n\n Return the p-adic conjectural order of Sha mod p using p-adic\n BSD, along with the p-adic L-series and p-adic regulator.\n\n EXAMPLES::\n\n sage: E = EllipticCurve('10050s1')\n sage: from psage.modform.rational.padic_elliptic_lseries_fast import pAdicLseries\n sage: L = pAdicLseries(E, 13)\n sage: sha, L, reg = L.sha_modp()\n sage: sha\n 1 + O(13)\n sage: L\n O(13^2) + O(13^2)*T + (10*13 + O(13^2))*T^2 + (12*13 + O(13^2))*T^3 + (9 + 10*13 + O(13^2))*T^4 + (7 + 9*13 + O(13^2))*T^5 + O(T^6)\n sage: reg\n 12*13^3 + 4*13^4 + 9*13^5 + 11*13^6 + 5*13^7 + 7*13^9 + 6*13^10 + 5*13^12 + 4*13^13 + 4*13^14 + 5*13^15 + 5*13^16 + 4*13^17 + 10*13^18 + 2*13^19 + 6*13^20 + O(13^21)\n ";
9716
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_29sha_modp(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9717
int __pyx_v_verb;
9718
PyObject *__pyx_r = 0;
9719
__Pyx_RefNannyDeclarations
9720
__Pyx_RefNannySetupContext("sha_modp (wrapper)", 0);
9721
{
9722
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_verb,0};
9723
PyObject* values[1] = {0};
9724
if (unlikely(__pyx_kwds)) {
9725
Py_ssize_t kw_args;
9726
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9727
switch (pos_args) {
9728
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9729
case 0: break;
9730
default: goto __pyx_L5_argtuple_error;
9731
}
9732
kw_args = PyDict_Size(__pyx_kwds);
9733
switch (pos_args) {
9734
case 0:
9735
if (kw_args > 0) {
9736
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verb);
9737
if (value) { values[0] = value; kw_args--; }
9738
}
9739
}
9740
if (unlikely(kw_args > 0)) {
9741
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "sha_modp") < 0)) __PYX_ERR(0, 435, __pyx_L3_error)
9742
}
9743
} else {
9744
switch (PyTuple_GET_SIZE(__pyx_args)) {
9745
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9746
case 0: break;
9747
default: goto __pyx_L5_argtuple_error;
9748
}
9749
}
9750
if (values[0]) {
9751
__pyx_v_verb = __Pyx_PyObject_IsTrue(values[0]); if (unlikely((__pyx_v_verb == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 435, __pyx_L3_error)
9752
} else {
9753
__pyx_v_verb = ((int)0);
9754
}
9755
}
9756
goto __pyx_L4_argument_unpacking_done;
9757
__pyx_L5_argtuple_error:;
9758
__Pyx_RaiseArgtupleInvalid("sha_modp", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 435, __pyx_L3_error)
9759
__pyx_L3_error:;
9760
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.sha_modp", __pyx_clineno, __pyx_lineno, __pyx_filename);
9761
__Pyx_RefNannyFinishContext();
9762
return NULL;
9763
__pyx_L4_argument_unpacking_done:;
9764
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_28sha_modp(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), __pyx_v_verb);
9765
9766
/* function exit code */
9767
__Pyx_RefNannyFinishContext();
9768
return __pyx_r;
9769
}
9770
9771
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_28sha_modp(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, int __pyx_v_verb) {
9772
PyObject *__pyx_v_L = NULL;
9773
PyObject *__pyx_v_p = NULL;
9774
PyObject *__pyx_v_reg = NULL;
9775
PyObject *__pyx_v_r = NULL;
9776
PyObject *__pyx_v_lg = NULL;
9777
PyObject *__pyx_v_tam = NULL;
9778
PyObject *__pyx_v_eps = NULL;
9779
PyObject *__pyx_v_tor = NULL;
9780
PyObject *__pyx_v_sha = NULL;
9781
PyObject *__pyx_r = NULL;
9782
__Pyx_RefNannyDeclarations
9783
PyObject *__pyx_t_1 = NULL;
9784
PyObject *__pyx_t_2 = NULL;
9785
PyObject *__pyx_t_3 = NULL;
9786
PyObject *__pyx_t_4 = NULL;
9787
PyObject *__pyx_t_5 = NULL;
9788
PyObject *__pyx_t_6 = NULL;
9789
PyObject *__pyx_t_7 = NULL;
9790
__Pyx_RefNannySetupContext("sha_modp", 0);
9791
9792
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":453
9793
* 12*13^3 + 4*13^4 + 9*13^5 + 11*13^6 + 5*13^7 + 7*13^9 + 6*13^10 + 5*13^12 + 4*13^13 + 4*13^14 + 5*13^15 + 5*13^16 + 4*13^17 + 10*13^18 + 2*13^19 + 6*13^20 + O(13^21)
9794
* """
9795
* L = self.series_to_enough_prec(verb=verb) # <<<<<<<<<<<<<<
9796
* p = ZZ(self.p)
9797
* reg = self.E.padic_regulator(p)
9798
*/
9799
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_series_to_enough_prec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 453, __pyx_L1_error)
9800
__Pyx_GOTREF(__pyx_t_1);
9801
__pyx_t_2 = PyDict_New(); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 453, __pyx_L1_error)
9802
__Pyx_GOTREF(__pyx_t_2);
9803
__pyx_t_3 = __Pyx_PyBool_FromLong(__pyx_v_verb); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
9804
__Pyx_GOTREF(__pyx_t_3);
9805
if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_verb, __pyx_t_3) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
9806
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9807
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 453, __pyx_L1_error)
9808
__Pyx_GOTREF(__pyx_t_3);
9809
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9810
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9811
__pyx_v_L = __pyx_t_3;
9812
__pyx_t_3 = 0;
9813
9814
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":454
9815
* """
9816
* L = self.series_to_enough_prec(verb=verb)
9817
* p = ZZ(self.p) # <<<<<<<<<<<<<<
9818
* reg = self.E.padic_regulator(p)
9819
* r = self.E.rank()
9820
*/
9821
__pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZZ); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 454, __pyx_L1_error)
9822
__Pyx_GOTREF(__pyx_t_2);
9823
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 454, __pyx_L1_error)
9824
__Pyx_GOTREF(__pyx_t_1);
9825
__pyx_t_4 = NULL;
9826
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
9827
__pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
9828
if (likely(__pyx_t_4)) {
9829
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9830
__Pyx_INCREF(__pyx_t_4);
9831
__Pyx_INCREF(function);
9832
__Pyx_DECREF_SET(__pyx_t_2, function);
9833
}
9834
}
9835
if (!__pyx_t_4) {
9836
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
9837
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9838
__Pyx_GOTREF(__pyx_t_3);
9839
} else {
9840
#if CYTHON_FAST_PYCALL
9841
if (PyFunction_Check(__pyx_t_2)) {
9842
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
9843
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
9844
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9845
__Pyx_GOTREF(__pyx_t_3);
9846
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9847
} else
9848
#endif
9849
#if CYTHON_FAST_PYCCALL
9850
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
9851
PyObject *__pyx_temp[2] = {__pyx_t_4, __pyx_t_1};
9852
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
9853
__Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
9854
__Pyx_GOTREF(__pyx_t_3);
9855
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9856
} else
9857
#endif
9858
{
9859
__pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 454, __pyx_L1_error)
9860
__Pyx_GOTREF(__pyx_t_5);
9861
__Pyx_GIVEREF(__pyx_t_4); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4); __pyx_t_4 = NULL;
9862
__Pyx_GIVEREF(__pyx_t_1);
9863
PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_1);
9864
__pyx_t_1 = 0;
9865
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 454, __pyx_L1_error)
9866
__Pyx_GOTREF(__pyx_t_3);
9867
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9868
}
9869
}
9870
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9871
__pyx_v_p = __pyx_t_3;
9872
__pyx_t_3 = 0;
9873
9874
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":455
9875
* L = self.series_to_enough_prec(verb=verb)
9876
* p = ZZ(self.p)
9877
* reg = self.E.padic_regulator(p) # <<<<<<<<<<<<<<
9878
* r = self.E.rank()
9879
* lg = (1 + p + O(p**10)).log()
9880
*/
9881
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_padic_regulator); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 455, __pyx_L1_error)
9882
__Pyx_GOTREF(__pyx_t_2);
9883
__pyx_t_5 = NULL;
9884
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9885
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
9886
if (likely(__pyx_t_5)) {
9887
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9888
__Pyx_INCREF(__pyx_t_5);
9889
__Pyx_INCREF(function);
9890
__Pyx_DECREF_SET(__pyx_t_2, function);
9891
}
9892
}
9893
if (!__pyx_t_5) {
9894
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_p); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
9895
__Pyx_GOTREF(__pyx_t_3);
9896
} else {
9897
#if CYTHON_FAST_PYCALL
9898
if (PyFunction_Check(__pyx_t_2)) {
9899
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
9900
__pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
9901
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9902
__Pyx_GOTREF(__pyx_t_3);
9903
} else
9904
#endif
9905
#if CYTHON_FAST_PYCCALL
9906
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
9907
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_v_p};
9908
__pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
9909
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
9910
__Pyx_GOTREF(__pyx_t_3);
9911
} else
9912
#endif
9913
{
9914
__pyx_t_1 = PyTuple_New(1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 455, __pyx_L1_error)
9915
__Pyx_GOTREF(__pyx_t_1);
9916
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5); __pyx_t_5 = NULL;
9917
__Pyx_INCREF(__pyx_v_p);
9918
__Pyx_GIVEREF(__pyx_v_p);
9919
PyTuple_SET_ITEM(__pyx_t_1, 0+1, __pyx_v_p);
9920
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_1, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 455, __pyx_L1_error)
9921
__Pyx_GOTREF(__pyx_t_3);
9922
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9923
}
9924
}
9925
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9926
__pyx_v_reg = __pyx_t_3;
9927
__pyx_t_3 = 0;
9928
9929
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":456
9930
* p = ZZ(self.p)
9931
* reg = self.E.padic_regulator(p)
9932
* r = self.E.rank() # <<<<<<<<<<<<<<
9933
* lg = (1 + p + O(p**10)).log()
9934
* tam = self.E.tamagawa_product()
9935
*/
9936
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_rank); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 456, __pyx_L1_error)
9937
__Pyx_GOTREF(__pyx_t_2);
9938
__pyx_t_1 = NULL;
9939
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
9940
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
9941
if (likely(__pyx_t_1)) {
9942
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
9943
__Pyx_INCREF(__pyx_t_1);
9944
__Pyx_INCREF(function);
9945
__Pyx_DECREF_SET(__pyx_t_2, function);
9946
}
9947
}
9948
if (__pyx_t_1) {
9949
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
9950
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9951
} else {
9952
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 456, __pyx_L1_error)
9953
}
9954
__Pyx_GOTREF(__pyx_t_3);
9955
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9956
__pyx_v_r = __pyx_t_3;
9957
__pyx_t_3 = 0;
9958
9959
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":457
9960
* reg = self.E.padic_regulator(p)
9961
* r = self.E.rank()
9962
* lg = (1 + p + O(p**10)).log() # <<<<<<<<<<<<<<
9963
* tam = self.E.tamagawa_product()
9964
* eps = (1 - 1/(self.alpha()+O(p**10)))**2 # assumes good ordinary
9965
*/
9966
__pyx_t_2 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_v_p, 1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
9967
__Pyx_GOTREF(__pyx_t_2);
9968
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_O); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
9969
__Pyx_GOTREF(__pyx_t_5);
9970
__pyx_t_4 = PyNumber_Power(__pyx_v_p, __pyx_int_10, Py_None); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 457, __pyx_L1_error)
9971
__Pyx_GOTREF(__pyx_t_4);
9972
__pyx_t_6 = NULL;
9973
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
9974
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
9975
if (likely(__pyx_t_6)) {
9976
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
9977
__Pyx_INCREF(__pyx_t_6);
9978
__Pyx_INCREF(function);
9979
__Pyx_DECREF_SET(__pyx_t_5, function);
9980
}
9981
}
9982
if (!__pyx_t_6) {
9983
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
9984
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9985
__Pyx_GOTREF(__pyx_t_1);
9986
} else {
9987
#if CYTHON_FAST_PYCALL
9988
if (PyFunction_Check(__pyx_t_5)) {
9989
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
9990
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
9991
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
9992
__Pyx_GOTREF(__pyx_t_1);
9993
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
9994
} else
9995
#endif
9996
#if CYTHON_FAST_PYCCALL
9997
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
9998
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_t_4};
9999
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
10000
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
10001
__Pyx_GOTREF(__pyx_t_1);
10002
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10003
} else
10004
#endif
10005
{
10006
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 457, __pyx_L1_error)
10007
__Pyx_GOTREF(__pyx_t_7);
10008
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
10009
__Pyx_GIVEREF(__pyx_t_4);
10010
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_4);
10011
__pyx_t_4 = 0;
10012
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
10013
__Pyx_GOTREF(__pyx_t_1);
10014
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
10015
}
10016
}
10017
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10018
__pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 457, __pyx_L1_error)
10019
__Pyx_GOTREF(__pyx_t_5);
10020
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10021
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10022
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_log); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
10023
__Pyx_GOTREF(__pyx_t_1);
10024
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10025
__pyx_t_5 = NULL;
10026
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10027
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
10028
if (likely(__pyx_t_5)) {
10029
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10030
__Pyx_INCREF(__pyx_t_5);
10031
__Pyx_INCREF(function);
10032
__Pyx_DECREF_SET(__pyx_t_1, function);
10033
}
10034
}
10035
if (__pyx_t_5) {
10036
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
10037
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10038
} else {
10039
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 457, __pyx_L1_error)
10040
}
10041
__Pyx_GOTREF(__pyx_t_3);
10042
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10043
__pyx_v_lg = __pyx_t_3;
10044
__pyx_t_3 = 0;
10045
10046
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":458
10047
* r = self.E.rank()
10048
* lg = (1 + p + O(p**10)).log()
10049
* tam = self.E.tamagawa_product() # <<<<<<<<<<<<<<
10050
* eps = (1 - 1/(self.alpha()+O(p**10)))**2 # assumes good ordinary
10051
* tor = self.E.torsion_order()**2
10052
*/
10053
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_tamagawa_product); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 458, __pyx_L1_error)
10054
__Pyx_GOTREF(__pyx_t_1);
10055
__pyx_t_5 = NULL;
10056
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10057
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
10058
if (likely(__pyx_t_5)) {
10059
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10060
__Pyx_INCREF(__pyx_t_5);
10061
__Pyx_INCREF(function);
10062
__Pyx_DECREF_SET(__pyx_t_1, function);
10063
}
10064
}
10065
if (__pyx_t_5) {
10066
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
10067
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10068
} else {
10069
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 458, __pyx_L1_error)
10070
}
10071
__Pyx_GOTREF(__pyx_t_3);
10072
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10073
__pyx_v_tam = __pyx_t_3;
10074
__pyx_t_3 = 0;
10075
10076
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":459
10077
* lg = (1 + p + O(p**10)).log()
10078
* tam = self.E.tamagawa_product()
10079
* eps = (1 - 1/(self.alpha()+O(p**10)))**2 # assumes good ordinary # <<<<<<<<<<<<<<
10080
* tor = self.E.torsion_order()**2
10081
*
10082
*/
10083
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_alpha); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
10084
__Pyx_GOTREF(__pyx_t_1);
10085
__pyx_t_5 = NULL;
10086
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
10087
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
10088
if (likely(__pyx_t_5)) {
10089
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
10090
__Pyx_INCREF(__pyx_t_5);
10091
__Pyx_INCREF(function);
10092
__Pyx_DECREF_SET(__pyx_t_1, function);
10093
}
10094
}
10095
if (__pyx_t_5) {
10096
__pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error)
10097
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10098
} else {
10099
__pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 459, __pyx_L1_error)
10100
}
10101
__Pyx_GOTREF(__pyx_t_3);
10102
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10103
__pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_O); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
10104
__Pyx_GOTREF(__pyx_t_5);
10105
__pyx_t_2 = PyNumber_Power(__pyx_v_p, __pyx_int_10, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 459, __pyx_L1_error)
10106
__Pyx_GOTREF(__pyx_t_2);
10107
__pyx_t_7 = NULL;
10108
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
10109
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
10110
if (likely(__pyx_t_7)) {
10111
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10112
__Pyx_INCREF(__pyx_t_7);
10113
__Pyx_INCREF(function);
10114
__Pyx_DECREF_SET(__pyx_t_5, function);
10115
}
10116
}
10117
if (!__pyx_t_7) {
10118
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
10119
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10120
__Pyx_GOTREF(__pyx_t_1);
10121
} else {
10122
#if CYTHON_FAST_PYCALL
10123
if (PyFunction_Check(__pyx_t_5)) {
10124
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_2};
10125
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
10126
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10127
__Pyx_GOTREF(__pyx_t_1);
10128
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10129
} else
10130
#endif
10131
#if CYTHON_FAST_PYCCALL
10132
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
10133
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_2};
10134
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
10135
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
10136
__Pyx_GOTREF(__pyx_t_1);
10137
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10138
} else
10139
#endif
10140
{
10141
__pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 459, __pyx_L1_error)
10142
__Pyx_GOTREF(__pyx_t_4);
10143
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_7); __pyx_t_7 = NULL;
10144
__Pyx_GIVEREF(__pyx_t_2);
10145
PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_t_2);
10146
__pyx_t_2 = 0;
10147
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_4, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
10148
__Pyx_GOTREF(__pyx_t_1);
10149
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
10150
}
10151
}
10152
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10153
__pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
10154
__Pyx_GOTREF(__pyx_t_5);
10155
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10156
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10157
__pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_int_1, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
10158
__Pyx_GOTREF(__pyx_t_1);
10159
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10160
__pyx_t_5 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_1, 1, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 459, __pyx_L1_error)
10161
__Pyx_GOTREF(__pyx_t_5);
10162
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10163
__pyx_t_1 = PyNumber_Power(__pyx_t_5, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 459, __pyx_L1_error)
10164
__Pyx_GOTREF(__pyx_t_1);
10165
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10166
__pyx_v_eps = __pyx_t_1;
10167
__pyx_t_1 = 0;
10168
10169
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":460
10170
* tam = self.E.tamagawa_product()
10171
* eps = (1 - 1/(self.alpha()+O(p**10)))**2 # assumes good ordinary
10172
* tor = self.E.torsion_order()**2 # <<<<<<<<<<<<<<
10173
*
10174
* #sha = Mod(tam * (reg / lg**r) * eps / tor, p)
10175
*/
10176
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->E, __pyx_n_s_torsion_order); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error)
10177
__Pyx_GOTREF(__pyx_t_5);
10178
__pyx_t_3 = NULL;
10179
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
10180
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_5);
10181
if (likely(__pyx_t_3)) {
10182
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
10183
__Pyx_INCREF(__pyx_t_3);
10184
__Pyx_INCREF(function);
10185
__Pyx_DECREF_SET(__pyx_t_5, function);
10186
}
10187
}
10188
if (__pyx_t_3) {
10189
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
10190
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10191
} else {
10192
__pyx_t_1 = __Pyx_PyObject_CallNoArg(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
10193
}
10194
__Pyx_GOTREF(__pyx_t_1);
10195
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10196
__pyx_t_5 = PyNumber_Power(__pyx_t_1, __pyx_int_2, Py_None); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 460, __pyx_L1_error)
10197
__Pyx_GOTREF(__pyx_t_5);
10198
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10199
__pyx_v_tor = __pyx_t_5;
10200
__pyx_t_5 = 0;
10201
10202
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":463
10203
*
10204
* #sha = Mod(tam * (reg / lg**r) * eps / tor, p)
10205
* sha = L[r] / (tam * (reg / lg**r) * eps / tor) # <<<<<<<<<<<<<<
10206
*
10207
* return sha, L, reg
10208
*/
10209
__pyx_t_5 = PyObject_GetItem(__pyx_v_L, __pyx_v_r); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 463, __pyx_L1_error)
10210
__Pyx_GOTREF(__pyx_t_5);
10211
__pyx_t_1 = PyNumber_Power(__pyx_v_lg, __pyx_v_r, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
10212
__Pyx_GOTREF(__pyx_t_1);
10213
__pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_v_reg, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
10214
__Pyx_GOTREF(__pyx_t_3);
10215
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10216
__pyx_t_1 = PyNumber_Multiply(__pyx_v_tam, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
10217
__Pyx_GOTREF(__pyx_t_1);
10218
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10219
__pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_v_eps); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
10220
__Pyx_GOTREF(__pyx_t_3);
10221
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10222
__pyx_t_1 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_tor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 463, __pyx_L1_error)
10223
__Pyx_GOTREF(__pyx_t_1);
10224
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10225
__pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 463, __pyx_L1_error)
10226
__Pyx_GOTREF(__pyx_t_3);
10227
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
10228
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10229
__pyx_v_sha = __pyx_t_3;
10230
__pyx_t_3 = 0;
10231
10232
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":465
10233
* sha = L[r] / (tam * (reg / lg**r) * eps / tor)
10234
*
10235
* return sha, L, reg # <<<<<<<<<<<<<<
10236
*
10237
* def series_parallel(L, n, prec, ser_prec=5, verb=False, force_mulmod=False, ncpus=None):
10238
*/
10239
__Pyx_XDECREF(__pyx_r);
10240
__pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 465, __pyx_L1_error)
10241
__Pyx_GOTREF(__pyx_t_3);
10242
__Pyx_INCREF(__pyx_v_sha);
10243
__Pyx_GIVEREF(__pyx_v_sha);
10244
PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_sha);
10245
__Pyx_INCREF(__pyx_v_L);
10246
__Pyx_GIVEREF(__pyx_v_L);
10247
PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_L);
10248
__Pyx_INCREF(__pyx_v_reg);
10249
__Pyx_GIVEREF(__pyx_v_reg);
10250
PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_reg);
10251
__pyx_r = __pyx_t_3;
10252
__pyx_t_3 = 0;
10253
goto __pyx_L0;
10254
10255
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":435
10256
* n += 1
10257
*
10258
* def sha_modp(self, bint verb=0): # <<<<<<<<<<<<<<
10259
* """
10260
* Return the p-adic conjectural order of Sha mod p using p-adic
10261
*/
10262
10263
/* function exit code */
10264
__pyx_L1_error:;
10265
__Pyx_XDECREF(__pyx_t_1);
10266
__Pyx_XDECREF(__pyx_t_2);
10267
__Pyx_XDECREF(__pyx_t_3);
10268
__Pyx_XDECREF(__pyx_t_4);
10269
__Pyx_XDECREF(__pyx_t_5);
10270
__Pyx_XDECREF(__pyx_t_6);
10271
__Pyx_XDECREF(__pyx_t_7);
10272
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.sha_modp", __pyx_clineno, __pyx_lineno, __pyx_filename);
10273
__pyx_r = NULL;
10274
__pyx_L0:;
10275
__Pyx_XDECREF(__pyx_v_L);
10276
__Pyx_XDECREF(__pyx_v_p);
10277
__Pyx_XDECREF(__pyx_v_reg);
10278
__Pyx_XDECREF(__pyx_v_r);
10279
__Pyx_XDECREF(__pyx_v_lg);
10280
__Pyx_XDECREF(__pyx_v_tam);
10281
__Pyx_XDECREF(__pyx_v_eps);
10282
__Pyx_XDECREF(__pyx_v_tor);
10283
__Pyx_XDECREF(__pyx_v_sha);
10284
__Pyx_XGIVEREF(__pyx_r);
10285
__Pyx_RefNannyFinishContext();
10286
return __pyx_r;
10287
}
10288
10289
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":51
10290
* cdef class pAdicLseries:
10291
* cdef bint parallel
10292
* cdef public object E # <<<<<<<<<<<<<<
10293
* cdef public long p, prec
10294
* cdef public long normalization, normalization_mulmod
10295
*/
10296
10297
/* Python wrapper */
10298
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_1__get__(PyObject *__pyx_v_self); /*proto*/
10299
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_1__get__(PyObject *__pyx_v_self) {
10300
PyObject *__pyx_r = 0;
10301
__Pyx_RefNannyDeclarations
10302
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10303
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E___get__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10304
10305
/* function exit code */
10306
__Pyx_RefNannyFinishContext();
10307
return __pyx_r;
10308
}
10309
10310
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10311
PyObject *__pyx_r = NULL;
10312
__Pyx_RefNannyDeclarations
10313
__Pyx_RefNannySetupContext("__get__", 0);
10314
__Pyx_XDECREF(__pyx_r);
10315
__Pyx_INCREF(__pyx_v_self->E);
10316
__pyx_r = __pyx_v_self->E;
10317
goto __pyx_L0;
10318
10319
/* function exit code */
10320
__pyx_L0:;
10321
__Pyx_XGIVEREF(__pyx_r);
10322
__Pyx_RefNannyFinishContext();
10323
return __pyx_r;
10324
}
10325
10326
/* Python wrapper */
10327
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
10328
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10329
int __pyx_r;
10330
__Pyx_RefNannyDeclarations
10331
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10332
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_2__set__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10333
10334
/* function exit code */
10335
__Pyx_RefNannyFinishContext();
10336
return __pyx_r;
10337
}
10338
10339
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value) {
10340
int __pyx_r;
10341
__Pyx_RefNannyDeclarations
10342
__Pyx_RefNannySetupContext("__set__", 0);
10343
__Pyx_INCREF(__pyx_v_value);
10344
__Pyx_GIVEREF(__pyx_v_value);
10345
__Pyx_GOTREF(__pyx_v_self->E);
10346
__Pyx_DECREF(__pyx_v_self->E);
10347
__pyx_v_self->E = __pyx_v_value;
10348
10349
/* function exit code */
10350
__pyx_r = 0;
10351
__Pyx_RefNannyFinishContext();
10352
return __pyx_r;
10353
}
10354
10355
/* Python wrapper */
10356
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_5__del__(PyObject *__pyx_v_self); /*proto*/
10357
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_5__del__(PyObject *__pyx_v_self) {
10358
int __pyx_r;
10359
__Pyx_RefNannyDeclarations
10360
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
10361
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_4__del__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10362
10363
/* function exit code */
10364
__Pyx_RefNannyFinishContext();
10365
return __pyx_r;
10366
}
10367
10368
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_4__del__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10369
int __pyx_r;
10370
__Pyx_RefNannyDeclarations
10371
__Pyx_RefNannySetupContext("__del__", 0);
10372
__Pyx_INCREF(Py_None);
10373
__Pyx_GIVEREF(Py_None);
10374
__Pyx_GOTREF(__pyx_v_self->E);
10375
__Pyx_DECREF(__pyx_v_self->E);
10376
__pyx_v_self->E = Py_None;
10377
10378
/* function exit code */
10379
__pyx_r = 0;
10380
__Pyx_RefNannyFinishContext();
10381
return __pyx_r;
10382
}
10383
10384
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":52
10385
* cdef bint parallel
10386
* cdef public object E
10387
* cdef public long p, prec # <<<<<<<<<<<<<<
10388
* cdef public long normalization, normalization_mulmod
10389
* cdef public long _alpha
10390
*/
10391
10392
/* Python wrapper */
10393
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_1__get__(PyObject *__pyx_v_self); /*proto*/
10394
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_1__get__(PyObject *__pyx_v_self) {
10395
PyObject *__pyx_r = 0;
10396
__Pyx_RefNannyDeclarations
10397
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10398
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p___get__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10399
10400
/* function exit code */
10401
__Pyx_RefNannyFinishContext();
10402
return __pyx_r;
10403
}
10404
10405
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10406
PyObject *__pyx_r = NULL;
10407
__Pyx_RefNannyDeclarations
10408
PyObject *__pyx_t_1 = NULL;
10409
__Pyx_RefNannySetupContext("__get__", 0);
10410
__Pyx_XDECREF(__pyx_r);
10411
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->p); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
10412
__Pyx_GOTREF(__pyx_t_1);
10413
__pyx_r = __pyx_t_1;
10414
__pyx_t_1 = 0;
10415
goto __pyx_L0;
10416
10417
/* function exit code */
10418
__pyx_L1_error:;
10419
__Pyx_XDECREF(__pyx_t_1);
10420
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.p.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10421
__pyx_r = NULL;
10422
__pyx_L0:;
10423
__Pyx_XGIVEREF(__pyx_r);
10424
__Pyx_RefNannyFinishContext();
10425
return __pyx_r;
10426
}
10427
10428
/* Python wrapper */
10429
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
10430
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10431
int __pyx_r;
10432
__Pyx_RefNannyDeclarations
10433
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10434
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_2__set__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10435
10436
/* function exit code */
10437
__Pyx_RefNannyFinishContext();
10438
return __pyx_r;
10439
}
10440
10441
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value) {
10442
int __pyx_r;
10443
__Pyx_RefNannyDeclarations
10444
long __pyx_t_1;
10445
__Pyx_RefNannySetupContext("__set__", 0);
10446
__pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
10447
__pyx_v_self->p = __pyx_t_1;
10448
10449
/* function exit code */
10450
__pyx_r = 0;
10451
goto __pyx_L0;
10452
__pyx_L1_error:;
10453
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.p.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10454
__pyx_r = -1;
10455
__pyx_L0:;
10456
__Pyx_RefNannyFinishContext();
10457
return __pyx_r;
10458
}
10459
10460
/* Python wrapper */
10461
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_1__get__(PyObject *__pyx_v_self); /*proto*/
10462
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_1__get__(PyObject *__pyx_v_self) {
10463
PyObject *__pyx_r = 0;
10464
__Pyx_RefNannyDeclarations
10465
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10466
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec___get__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10467
10468
/* function exit code */
10469
__Pyx_RefNannyFinishContext();
10470
return __pyx_r;
10471
}
10472
10473
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10474
PyObject *__pyx_r = NULL;
10475
__Pyx_RefNannyDeclarations
10476
PyObject *__pyx_t_1 = NULL;
10477
__Pyx_RefNannySetupContext("__get__", 0);
10478
__Pyx_XDECREF(__pyx_r);
10479
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->prec); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 52, __pyx_L1_error)
10480
__Pyx_GOTREF(__pyx_t_1);
10481
__pyx_r = __pyx_t_1;
10482
__pyx_t_1 = 0;
10483
goto __pyx_L0;
10484
10485
/* function exit code */
10486
__pyx_L1_error:;
10487
__Pyx_XDECREF(__pyx_t_1);
10488
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.prec.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10489
__pyx_r = NULL;
10490
__pyx_L0:;
10491
__Pyx_XGIVEREF(__pyx_r);
10492
__Pyx_RefNannyFinishContext();
10493
return __pyx_r;
10494
}
10495
10496
/* Python wrapper */
10497
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
10498
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10499
int __pyx_r;
10500
__Pyx_RefNannyDeclarations
10501
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10502
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_2__set__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10503
10504
/* function exit code */
10505
__Pyx_RefNannyFinishContext();
10506
return __pyx_r;
10507
}
10508
10509
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value) {
10510
int __pyx_r;
10511
__Pyx_RefNannyDeclarations
10512
long __pyx_t_1;
10513
__Pyx_RefNannySetupContext("__set__", 0);
10514
__pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 52, __pyx_L1_error)
10515
__pyx_v_self->prec = __pyx_t_1;
10516
10517
/* function exit code */
10518
__pyx_r = 0;
10519
goto __pyx_L0;
10520
__pyx_L1_error:;
10521
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.prec.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10522
__pyx_r = -1;
10523
__pyx_L0:;
10524
__Pyx_RefNannyFinishContext();
10525
return __pyx_r;
10526
}
10527
10528
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":53
10529
* cdef public object E
10530
* cdef public long p, prec
10531
* cdef public long normalization, normalization_mulmod # <<<<<<<<<<<<<<
10532
* cdef public long _alpha
10533
* cdef long alpha_inv[64], alpha_inv_mulmod[64]
10534
*/
10535
10536
/* Python wrapper */
10537
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_1__get__(PyObject *__pyx_v_self); /*proto*/
10538
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_1__get__(PyObject *__pyx_v_self) {
10539
PyObject *__pyx_r = 0;
10540
__Pyx_RefNannyDeclarations
10541
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10542
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization___get__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10543
10544
/* function exit code */
10545
__Pyx_RefNannyFinishContext();
10546
return __pyx_r;
10547
}
10548
10549
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10550
PyObject *__pyx_r = NULL;
10551
__Pyx_RefNannyDeclarations
10552
PyObject *__pyx_t_1 = NULL;
10553
__Pyx_RefNannySetupContext("__get__", 0);
10554
__Pyx_XDECREF(__pyx_r);
10555
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->normalization); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
10556
__Pyx_GOTREF(__pyx_t_1);
10557
__pyx_r = __pyx_t_1;
10558
__pyx_t_1 = 0;
10559
goto __pyx_L0;
10560
10561
/* function exit code */
10562
__pyx_L1_error:;
10563
__Pyx_XDECREF(__pyx_t_1);
10564
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.normalization.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10565
__pyx_r = NULL;
10566
__pyx_L0:;
10567
__Pyx_XGIVEREF(__pyx_r);
10568
__Pyx_RefNannyFinishContext();
10569
return __pyx_r;
10570
}
10571
10572
/* Python wrapper */
10573
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
10574
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10575
int __pyx_r;
10576
__Pyx_RefNannyDeclarations
10577
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10578
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_2__set__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10579
10580
/* function exit code */
10581
__Pyx_RefNannyFinishContext();
10582
return __pyx_r;
10583
}
10584
10585
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value) {
10586
int __pyx_r;
10587
__Pyx_RefNannyDeclarations
10588
long __pyx_t_1;
10589
__Pyx_RefNannySetupContext("__set__", 0);
10590
__pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
10591
__pyx_v_self->normalization = __pyx_t_1;
10592
10593
/* function exit code */
10594
__pyx_r = 0;
10595
goto __pyx_L0;
10596
__pyx_L1_error:;
10597
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.normalization.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10598
__pyx_r = -1;
10599
__pyx_L0:;
10600
__Pyx_RefNannyFinishContext();
10601
return __pyx_r;
10602
}
10603
10604
/* Python wrapper */
10605
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_1__get__(PyObject *__pyx_v_self); /*proto*/
10606
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_1__get__(PyObject *__pyx_v_self) {
10607
PyObject *__pyx_r = 0;
10608
__Pyx_RefNannyDeclarations
10609
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10610
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod___get__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10611
10612
/* function exit code */
10613
__Pyx_RefNannyFinishContext();
10614
return __pyx_r;
10615
}
10616
10617
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10618
PyObject *__pyx_r = NULL;
10619
__Pyx_RefNannyDeclarations
10620
PyObject *__pyx_t_1 = NULL;
10621
__Pyx_RefNannySetupContext("__get__", 0);
10622
__Pyx_XDECREF(__pyx_r);
10623
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->normalization_mulmod); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 53, __pyx_L1_error)
10624
__Pyx_GOTREF(__pyx_t_1);
10625
__pyx_r = __pyx_t_1;
10626
__pyx_t_1 = 0;
10627
goto __pyx_L0;
10628
10629
/* function exit code */
10630
__pyx_L1_error:;
10631
__Pyx_XDECREF(__pyx_t_1);
10632
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.normalization_mulmod.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10633
__pyx_r = NULL;
10634
__pyx_L0:;
10635
__Pyx_XGIVEREF(__pyx_r);
10636
__Pyx_RefNannyFinishContext();
10637
return __pyx_r;
10638
}
10639
10640
/* Python wrapper */
10641
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
10642
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10643
int __pyx_r;
10644
__Pyx_RefNannyDeclarations
10645
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10646
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_2__set__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10647
10648
/* function exit code */
10649
__Pyx_RefNannyFinishContext();
10650
return __pyx_r;
10651
}
10652
10653
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value) {
10654
int __pyx_r;
10655
__Pyx_RefNannyDeclarations
10656
long __pyx_t_1;
10657
__Pyx_RefNannySetupContext("__set__", 0);
10658
__pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 53, __pyx_L1_error)
10659
__pyx_v_self->normalization_mulmod = __pyx_t_1;
10660
10661
/* function exit code */
10662
__pyx_r = 0;
10663
goto __pyx_L0;
10664
__pyx_L1_error:;
10665
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.normalization_mulmod.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10666
__pyx_r = -1;
10667
__pyx_L0:;
10668
__Pyx_RefNannyFinishContext();
10669
return __pyx_r;
10670
}
10671
10672
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":54
10673
* cdef public long p, prec
10674
* cdef public long normalization, normalization_mulmod
10675
* cdef public long _alpha # <<<<<<<<<<<<<<
10676
* cdef long alpha_inv[64], alpha_inv_mulmod[64]
10677
* cdef long p_pow[64]
10678
*/
10679
10680
/* Python wrapper */
10681
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_1__get__(PyObject *__pyx_v_self); /*proto*/
10682
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_1__get__(PyObject *__pyx_v_self) {
10683
PyObject *__pyx_r = 0;
10684
__Pyx_RefNannyDeclarations
10685
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10686
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha___get__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10687
10688
/* function exit code */
10689
__Pyx_RefNannyFinishContext();
10690
return __pyx_r;
10691
}
10692
10693
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10694
PyObject *__pyx_r = NULL;
10695
__Pyx_RefNannyDeclarations
10696
PyObject *__pyx_t_1 = NULL;
10697
__Pyx_RefNannySetupContext("__get__", 0);
10698
__Pyx_XDECREF(__pyx_r);
10699
__pyx_t_1 = __Pyx_PyInt_From_long(__pyx_v_self->_alpha); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 54, __pyx_L1_error)
10700
__Pyx_GOTREF(__pyx_t_1);
10701
__pyx_r = __pyx_t_1;
10702
__pyx_t_1 = 0;
10703
goto __pyx_L0;
10704
10705
/* function exit code */
10706
__pyx_L1_error:;
10707
__Pyx_XDECREF(__pyx_t_1);
10708
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._alpha.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10709
__pyx_r = NULL;
10710
__pyx_L0:;
10711
__Pyx_XGIVEREF(__pyx_r);
10712
__Pyx_RefNannyFinishContext();
10713
return __pyx_r;
10714
}
10715
10716
/* Python wrapper */
10717
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
10718
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10719
int __pyx_r;
10720
__Pyx_RefNannyDeclarations
10721
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10722
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_2__set__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10723
10724
/* function exit code */
10725
__Pyx_RefNannyFinishContext();
10726
return __pyx_r;
10727
}
10728
10729
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value) {
10730
int __pyx_r;
10731
__Pyx_RefNannyDeclarations
10732
long __pyx_t_1;
10733
__Pyx_RefNannySetupContext("__set__", 0);
10734
__pyx_t_1 = __Pyx_PyInt_As_long(__pyx_v_value); if (unlikely((__pyx_t_1 == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 54, __pyx_L1_error)
10735
__pyx_v_self->_alpha = __pyx_t_1;
10736
10737
/* function exit code */
10738
__pyx_r = 0;
10739
goto __pyx_L0;
10740
__pyx_L1_error:;
10741
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries._alpha.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10742
__pyx_r = -1;
10743
__pyx_L0:;
10744
__Pyx_RefNannyFinishContext();
10745
return __pyx_r;
10746
}
10747
10748
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":59
10749
* cdef long *teich
10750
* cdef long *teich_mulmod
10751
* cdef public ModularSymbolMap modsym # <<<<<<<<<<<<<<
10752
*
10753
* def __cinit__(self):
10754
*/
10755
10756
/* Python wrapper */
10757
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_1__get__(PyObject *__pyx_v_self); /*proto*/
10758
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_1__get__(PyObject *__pyx_v_self) {
10759
PyObject *__pyx_r = 0;
10760
__Pyx_RefNannyDeclarations
10761
__Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
10762
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym___get__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10763
10764
/* function exit code */
10765
__Pyx_RefNannyFinishContext();
10766
return __pyx_r;
10767
}
10768
10769
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym___get__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10770
PyObject *__pyx_r = NULL;
10771
__Pyx_RefNannyDeclarations
10772
__Pyx_RefNannySetupContext("__get__", 0);
10773
__Pyx_XDECREF(__pyx_r);
10774
__Pyx_INCREF(((PyObject *)__pyx_v_self->modsym));
10775
__pyx_r = ((PyObject *)__pyx_v_self->modsym);
10776
goto __pyx_L0;
10777
10778
/* function exit code */
10779
__pyx_L0:;
10780
__Pyx_XGIVEREF(__pyx_r);
10781
__Pyx_RefNannyFinishContext();
10782
return __pyx_r;
10783
}
10784
10785
/* Python wrapper */
10786
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
10787
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
10788
int __pyx_r;
10789
__Pyx_RefNannyDeclarations
10790
__Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
10791
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_2__set__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self), ((PyObject *)__pyx_v_value));
10792
10793
/* function exit code */
10794
__Pyx_RefNannyFinishContext();
10795
return __pyx_r;
10796
}
10797
10798
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_2__set__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self, PyObject *__pyx_v_value) {
10799
int __pyx_r;
10800
__Pyx_RefNannyDeclarations
10801
PyObject *__pyx_t_1 = NULL;
10802
__Pyx_RefNannySetupContext("__set__", 0);
10803
if (!(likely(((__pyx_v_value) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_value, __pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap))))) __PYX_ERR(0, 59, __pyx_L1_error)
10804
__pyx_t_1 = __pyx_v_value;
10805
__Pyx_INCREF(__pyx_t_1);
10806
__Pyx_GIVEREF(__pyx_t_1);
10807
__Pyx_GOTREF(__pyx_v_self->modsym);
10808
__Pyx_DECREF(((PyObject *)__pyx_v_self->modsym));
10809
__pyx_v_self->modsym = ((struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)__pyx_t_1);
10810
__pyx_t_1 = 0;
10811
10812
/* function exit code */
10813
__pyx_r = 0;
10814
goto __pyx_L0;
10815
__pyx_L1_error:;
10816
__Pyx_XDECREF(__pyx_t_1);
10817
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries.modsym.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10818
__pyx_r = -1;
10819
__pyx_L0:;
10820
__Pyx_RefNannyFinishContext();
10821
return __pyx_r;
10822
}
10823
10824
/* Python wrapper */
10825
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_5__del__(PyObject *__pyx_v_self); /*proto*/
10826
static int __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_5__del__(PyObject *__pyx_v_self) {
10827
int __pyx_r;
10828
__Pyx_RefNannyDeclarations
10829
__Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
10830
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_4__del__(((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)__pyx_v_self));
10831
10832
/* function exit code */
10833
__Pyx_RefNannyFinishContext();
10834
return __pyx_r;
10835
}
10836
10837
static int __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_4__del__(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *__pyx_v_self) {
10838
int __pyx_r;
10839
__Pyx_RefNannyDeclarations
10840
__Pyx_RefNannySetupContext("__del__", 0);
10841
__Pyx_INCREF(Py_None);
10842
__Pyx_GIVEREF(Py_None);
10843
__Pyx_GOTREF(__pyx_v_self->modsym);
10844
__Pyx_DECREF(((PyObject *)__pyx_v_self->modsym));
10845
__pyx_v_self->modsym = ((struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)Py_None);
10846
10847
/* function exit code */
10848
__pyx_r = 0;
10849
__Pyx_RefNannyFinishContext();
10850
return __pyx_r;
10851
}
10852
10853
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":467
10854
* return sha, L, reg
10855
*
10856
* def series_parallel(L, n, prec, ser_prec=5, verb=False, force_mulmod=False, ncpus=None): # <<<<<<<<<<<<<<
10857
* # Use @parallel to do this computation by dividing it up into
10858
* # p separate tasks, doing those in separate processes,
10859
*/
10860
10861
/* Python wrapper */
10862
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_1series_parallel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10863
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_series_parallel[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 467)";
10864
static PyMethodDef __pyx_mdef_5psage_7modform_8rational_27padic_elliptic_lseries_fast_1series_parallel = {"series_parallel", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_1series_parallel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_series_parallel};
10865
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_1series_parallel(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10866
PyObject *__pyx_v_L = 0;
10867
PyObject *__pyx_v_n = 0;
10868
PyObject *__pyx_v_prec = 0;
10869
PyObject *__pyx_v_ser_prec = 0;
10870
PyObject *__pyx_v_verb = 0;
10871
PyObject *__pyx_v_force_mulmod = 0;
10872
PyObject *__pyx_v_ncpus = 0;
10873
PyObject *__pyx_r = 0;
10874
__Pyx_RefNannyDeclarations
10875
__Pyx_RefNannySetupContext("series_parallel (wrapper)", 0);
10876
{
10877
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_L_2,&__pyx_n_s_n,&__pyx_n_s_prec,&__pyx_n_s_ser_prec,&__pyx_n_s_verb,&__pyx_n_s_force_mulmod,&__pyx_n_s_ncpus,0};
10878
PyObject* values[7] = {0,0,0,0,0,0,0};
10879
values[3] = ((PyObject *)__pyx_int_5);
10880
values[4] = ((PyObject *)Py_False);
10881
values[5] = ((PyObject *)Py_False);
10882
values[6] = ((PyObject *)Py_None);
10883
if (unlikely(__pyx_kwds)) {
10884
Py_ssize_t kw_args;
10885
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10886
switch (pos_args) {
10887
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10888
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10889
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10890
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10891
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10892
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10893
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10894
case 0: break;
10895
default: goto __pyx_L5_argtuple_error;
10896
}
10897
kw_args = PyDict_Size(__pyx_kwds);
10898
switch (pos_args) {
10899
case 0:
10900
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_L_2)) != 0)) kw_args--;
10901
else goto __pyx_L5_argtuple_error;
10902
case 1:
10903
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_n)) != 0)) kw_args--;
10904
else {
10905
__Pyx_RaiseArgtupleInvalid("series_parallel", 0, 3, 7, 1); __PYX_ERR(0, 467, __pyx_L3_error)
10906
}
10907
case 2:
10908
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_prec)) != 0)) kw_args--;
10909
else {
10910
__Pyx_RaiseArgtupleInvalid("series_parallel", 0, 3, 7, 2); __PYX_ERR(0, 467, __pyx_L3_error)
10911
}
10912
case 3:
10913
if (kw_args > 0) {
10914
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ser_prec);
10915
if (value) { values[3] = value; kw_args--; }
10916
}
10917
case 4:
10918
if (kw_args > 0) {
10919
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_verb);
10920
if (value) { values[4] = value; kw_args--; }
10921
}
10922
case 5:
10923
if (kw_args > 0) {
10924
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_force_mulmod);
10925
if (value) { values[5] = value; kw_args--; }
10926
}
10927
case 6:
10928
if (kw_args > 0) {
10929
PyObject* value = PyDict_GetItem(__pyx_kwds, __pyx_n_s_ncpus);
10930
if (value) { values[6] = value; kw_args--; }
10931
}
10932
}
10933
if (unlikely(kw_args > 0)) {
10934
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "series_parallel") < 0)) __PYX_ERR(0, 467, __pyx_L3_error)
10935
}
10936
} else {
10937
switch (PyTuple_GET_SIZE(__pyx_args)) {
10938
case 7: values[6] = PyTuple_GET_ITEM(__pyx_args, 6);
10939
case 6: values[5] = PyTuple_GET_ITEM(__pyx_args, 5);
10940
case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
10941
case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
10942
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10943
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10944
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10945
break;
10946
default: goto __pyx_L5_argtuple_error;
10947
}
10948
}
10949
__pyx_v_L = values[0];
10950
__pyx_v_n = values[1];
10951
__pyx_v_prec = values[2];
10952
__pyx_v_ser_prec = values[3];
10953
__pyx_v_verb = values[4];
10954
__pyx_v_force_mulmod = values[5];
10955
__pyx_v_ncpus = values[6];
10956
}
10957
goto __pyx_L4_argument_unpacking_done;
10958
__pyx_L5_argtuple_error:;
10959
__Pyx_RaiseArgtupleInvalid("series_parallel", 0, 3, 7, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 467, __pyx_L3_error)
10960
__pyx_L3_error:;
10961
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.series_parallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
10962
__Pyx_RefNannyFinishContext();
10963
return NULL;
10964
__pyx_L4_argument_unpacking_done:;
10965
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_series_parallel(__pyx_self, __pyx_v_L, __pyx_v_n, __pyx_v_prec, __pyx_v_ser_prec, __pyx_v_verb, __pyx_v_force_mulmod, __pyx_v_ncpus);
10966
10967
/* function exit code */
10968
__Pyx_RefNannyFinishContext();
10969
return __pyx_r;
10970
}
10971
10972
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":476
10973
* ncpus = sage.parallel.ncpus.ncpus()
10974
* @parallel(ncpus)
10975
* def f(start, stop): # <<<<<<<<<<<<<<
10976
* return L._series(n, prec, ser_prec, verb, force_mulmod, start, stop)
10977
*
10978
*/
10979
10980
/* Python wrapper */
10981
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_1f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10982
static char __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_f[] = "File: padic_elliptic_lseries_fast.pyx (starting at line 476)";
10983
static PyMethodDef __pyx_mdef_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_1f = {"f", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_1f, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_f};
10984
static PyObject *__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_1f(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10985
PyObject *__pyx_v_start = 0;
10986
PyObject *__pyx_v_stop = 0;
10987
PyObject *__pyx_r = 0;
10988
__Pyx_RefNannyDeclarations
10989
__Pyx_RefNannySetupContext("f (wrapper)", 0);
10990
{
10991
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start,&__pyx_n_s_stop,0};
10992
PyObject* values[2] = {0,0};
10993
if (unlikely(__pyx_kwds)) {
10994
Py_ssize_t kw_args;
10995
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10996
switch (pos_args) {
10997
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10998
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10999
case 0: break;
11000
default: goto __pyx_L5_argtuple_error;
11001
}
11002
kw_args = PyDict_Size(__pyx_kwds);
11003
switch (pos_args) {
11004
case 0:
11005
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_start)) != 0)) kw_args--;
11006
else goto __pyx_L5_argtuple_error;
11007
case 1:
11008
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_stop)) != 0)) kw_args--;
11009
else {
11010
__Pyx_RaiseArgtupleInvalid("f", 1, 2, 2, 1); __PYX_ERR(0, 476, __pyx_L3_error)
11011
}
11012
}
11013
if (unlikely(kw_args > 0)) {
11014
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "f") < 0)) __PYX_ERR(0, 476, __pyx_L3_error)
11015
}
11016
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
11017
goto __pyx_L5_argtuple_error;
11018
} else {
11019
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
11020
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
11021
}
11022
__pyx_v_start = values[0];
11023
__pyx_v_stop = values[1];
11024
}
11025
goto __pyx_L4_argument_unpacking_done;
11026
__pyx_L5_argtuple_error:;
11027
__Pyx_RaiseArgtupleInvalid("f", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 476, __pyx_L3_error)
11028
__pyx_L3_error:;
11029
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.series_parallel.f", __pyx_clineno, __pyx_lineno, __pyx_filename);
11030
__Pyx_RefNannyFinishContext();
11031
return NULL;
11032
__pyx_L4_argument_unpacking_done:;
11033
__pyx_r = __pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_f(__pyx_self, __pyx_v_start, __pyx_v_stop);
11034
11035
/* function exit code */
11036
__Pyx_RefNannyFinishContext();
11037
return __pyx_r;
11038
}
11039
11040
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_f(PyObject *__pyx_self, PyObject *__pyx_v_start, PyObject *__pyx_v_stop) {
11041
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *__pyx_cur_scope;
11042
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *__pyx_outer_scope;
11043
PyObject *__pyx_r = NULL;
11044
__Pyx_RefNannyDeclarations
11045
PyObject *__pyx_t_1 = NULL;
11046
PyObject *__pyx_t_2 = NULL;
11047
PyObject *__pyx_t_3 = NULL;
11048
int __pyx_t_4;
11049
PyObject *__pyx_t_5 = NULL;
11050
__Pyx_RefNannySetupContext("f", 0);
11051
__pyx_outer_scope = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *) __Pyx_CyFunction_GetClosure(__pyx_self);
11052
__pyx_cur_scope = __pyx_outer_scope;
11053
11054
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":477
11055
* @parallel(ncpus)
11056
* def f(start, stop):
11057
* return L._series(n, prec, ser_prec, verb, force_mulmod, start, stop) # <<<<<<<<<<<<<<
11058
*
11059
* # intervals is going to be a list of (start, stop) pairs that give
11060
*/
11061
__Pyx_XDECREF(__pyx_r);
11062
if (unlikely(!__pyx_cur_scope->__pyx_v_L)) { __Pyx_RaiseClosureNameError("L"); __PYX_ERR(0, 477, __pyx_L1_error) }
11063
__pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_L, __pyx_n_s_series); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 477, __pyx_L1_error)
11064
__Pyx_GOTREF(__pyx_t_2);
11065
if (unlikely(!__pyx_cur_scope->__pyx_v_n)) { __Pyx_RaiseClosureNameError("n"); __PYX_ERR(0, 477, __pyx_L1_error) }
11066
if (unlikely(!__pyx_cur_scope->__pyx_v_prec)) { __Pyx_RaiseClosureNameError("prec"); __PYX_ERR(0, 477, __pyx_L1_error) }
11067
if (unlikely(!__pyx_cur_scope->__pyx_v_ser_prec)) { __Pyx_RaiseClosureNameError("ser_prec"); __PYX_ERR(0, 477, __pyx_L1_error) }
11068
if (unlikely(!__pyx_cur_scope->__pyx_v_verb)) { __Pyx_RaiseClosureNameError("verb"); __PYX_ERR(0, 477, __pyx_L1_error) }
11069
if (unlikely(!__pyx_cur_scope->__pyx_v_force_mulmod)) { __Pyx_RaiseClosureNameError("force_mulmod"); __PYX_ERR(0, 477, __pyx_L1_error) }
11070
__pyx_t_3 = NULL;
11071
__pyx_t_4 = 0;
11072
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
11073
__pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
11074
if (likely(__pyx_t_3)) {
11075
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11076
__Pyx_INCREF(__pyx_t_3);
11077
__Pyx_INCREF(function);
11078
__Pyx_DECREF_SET(__pyx_t_2, function);
11079
__pyx_t_4 = 1;
11080
}
11081
}
11082
#if CYTHON_FAST_PYCALL
11083
if (PyFunction_Check(__pyx_t_2)) {
11084
PyObject *__pyx_temp[8] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_n, __pyx_cur_scope->__pyx_v_prec, __pyx_cur_scope->__pyx_v_ser_prec, __pyx_cur_scope->__pyx_v_verb, __pyx_cur_scope->__pyx_v_force_mulmod, __pyx_v_start, __pyx_v_stop};
11085
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 7+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11086
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11087
__Pyx_GOTREF(__pyx_t_1);
11088
} else
11089
#endif
11090
#if CYTHON_FAST_PYCCALL
11091
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11092
PyObject *__pyx_temp[8] = {__pyx_t_3, __pyx_cur_scope->__pyx_v_n, __pyx_cur_scope->__pyx_v_prec, __pyx_cur_scope->__pyx_v_ser_prec, __pyx_cur_scope->__pyx_v_verb, __pyx_cur_scope->__pyx_v_force_mulmod, __pyx_v_start, __pyx_v_stop};
11093
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-__pyx_t_4, 7+__pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11094
__Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11095
__Pyx_GOTREF(__pyx_t_1);
11096
} else
11097
#endif
11098
{
11099
__pyx_t_5 = PyTuple_New(7+__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 477, __pyx_L1_error)
11100
__Pyx_GOTREF(__pyx_t_5);
11101
if (__pyx_t_3) {
11102
__Pyx_GIVEREF(__pyx_t_3); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_3); __pyx_t_3 = NULL;
11103
}
11104
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_n);
11105
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_n);
11106
PyTuple_SET_ITEM(__pyx_t_5, 0+__pyx_t_4, __pyx_cur_scope->__pyx_v_n);
11107
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_prec);
11108
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prec);
11109
PyTuple_SET_ITEM(__pyx_t_5, 1+__pyx_t_4, __pyx_cur_scope->__pyx_v_prec);
11110
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_ser_prec);
11111
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ser_prec);
11112
PyTuple_SET_ITEM(__pyx_t_5, 2+__pyx_t_4, __pyx_cur_scope->__pyx_v_ser_prec);
11113
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_verb);
11114
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_verb);
11115
PyTuple_SET_ITEM(__pyx_t_5, 3+__pyx_t_4, __pyx_cur_scope->__pyx_v_verb);
11116
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_force_mulmod);
11117
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_force_mulmod);
11118
PyTuple_SET_ITEM(__pyx_t_5, 4+__pyx_t_4, __pyx_cur_scope->__pyx_v_force_mulmod);
11119
__Pyx_INCREF(__pyx_v_start);
11120
__Pyx_GIVEREF(__pyx_v_start);
11121
PyTuple_SET_ITEM(__pyx_t_5, 5+__pyx_t_4, __pyx_v_start);
11122
__Pyx_INCREF(__pyx_v_stop);
11123
__Pyx_GIVEREF(__pyx_v_stop);
11124
PyTuple_SET_ITEM(__pyx_t_5, 6+__pyx_t_4, __pyx_v_stop);
11125
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 477, __pyx_L1_error)
11126
__Pyx_GOTREF(__pyx_t_1);
11127
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11128
}
11129
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11130
__pyx_r = __pyx_t_1;
11131
__pyx_t_1 = 0;
11132
goto __pyx_L0;
11133
11134
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":476
11135
* ncpus = sage.parallel.ncpus.ncpus()
11136
* @parallel(ncpus)
11137
* def f(start, stop): # <<<<<<<<<<<<<<
11138
* return L._series(n, prec, ser_prec, verb, force_mulmod, start, stop)
11139
*
11140
*/
11141
11142
/* function exit code */
11143
__pyx_L1_error:;
11144
__Pyx_XDECREF(__pyx_t_1);
11145
__Pyx_XDECREF(__pyx_t_2);
11146
__Pyx_XDECREF(__pyx_t_3);
11147
__Pyx_XDECREF(__pyx_t_5);
11148
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.series_parallel.f", __pyx_clineno, __pyx_lineno, __pyx_filename);
11149
__pyx_r = NULL;
11150
__pyx_L0:;
11151
__Pyx_XGIVEREF(__pyx_r);
11152
__Pyx_RefNannyFinishContext();
11153
return __pyx_r;
11154
}
11155
11156
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":467
11157
* return sha, L, reg
11158
*
11159
* def series_parallel(L, n, prec, ser_prec=5, verb=False, force_mulmod=False, ncpus=None): # <<<<<<<<<<<<<<
11160
* # Use @parallel to do this computation by dividing it up into
11161
* # p separate tasks, doing those in separate processes,
11162
*/
11163
11164
static PyObject *__pyx_pf_5psage_7modform_8rational_27padic_elliptic_lseries_fast_series_parallel(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_L, PyObject *__pyx_v_n, PyObject *__pyx_v_prec, PyObject *__pyx_v_ser_prec, PyObject *__pyx_v_verb, PyObject *__pyx_v_force_mulmod, PyObject *__pyx_v_ncpus) {
11165
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *__pyx_cur_scope;
11166
PyObject *__pyx_v_parallel = NULL;
11167
PyObject *__pyx_v_sage = NULL;
11168
PyObject *__pyx_v_f = 0;
11169
PyObject *__pyx_v_last = NULL;
11170
PyObject *__pyx_v_intervals = NULL;
11171
PyObject *__pyx_v_start = NULL;
11172
PyObject *__pyx_v_stop = NULL;
11173
CYTHON_UNUSED PyObject *__pyx_v_i = NULL;
11174
PyObject *__pyx_v_P = NULL;
11175
PyObject *__pyx_v_x = NULL;
11176
PyObject *__pyx_r = NULL;
11177
__Pyx_RefNannyDeclarations
11178
PyObject *__pyx_t_1 = NULL;
11179
PyObject *__pyx_t_2 = NULL;
11180
int __pyx_t_3;
11181
int __pyx_t_4;
11182
PyObject *__pyx_t_5 = NULL;
11183
PyObject *__pyx_t_6 = NULL;
11184
PyObject *__pyx_t_7 = NULL;
11185
Py_ssize_t __pyx_t_8;
11186
PyObject *(*__pyx_t_9)(PyObject *);
11187
int __pyx_t_10;
11188
__Pyx_RefNannySetupContext("series_parallel", 0);
11189
__pyx_cur_scope = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *)__pyx_tp_new_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel(__pyx_ptype_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel, __pyx_empty_tuple, NULL);
11190
if (unlikely(!__pyx_cur_scope)) {
11191
__pyx_cur_scope = ((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *)Py_None);
11192
__Pyx_INCREF(Py_None);
11193
__PYX_ERR(0, 467, __pyx_L1_error)
11194
} else {
11195
__Pyx_GOTREF(__pyx_cur_scope);
11196
}
11197
__pyx_cur_scope->__pyx_v_L = __pyx_v_L;
11198
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_L);
11199
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_L);
11200
__pyx_cur_scope->__pyx_v_n = __pyx_v_n;
11201
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_n);
11202
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_n);
11203
__pyx_cur_scope->__pyx_v_prec = __pyx_v_prec;
11204
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_prec);
11205
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_prec);
11206
__pyx_cur_scope->__pyx_v_ser_prec = __pyx_v_ser_prec;
11207
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_ser_prec);
11208
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_ser_prec);
11209
__pyx_cur_scope->__pyx_v_verb = __pyx_v_verb;
11210
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_verb);
11211
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_verb);
11212
__pyx_cur_scope->__pyx_v_force_mulmod = __pyx_v_force_mulmod;
11213
__Pyx_INCREF(__pyx_cur_scope->__pyx_v_force_mulmod);
11214
__Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_force_mulmod);
11215
__Pyx_INCREF(__pyx_v_ncpus);
11216
11217
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":471
11218
* # p separate tasks, doing those in separate processes,
11219
* # combining the results, etc.
11220
* from sage.all import parallel # <<<<<<<<<<<<<<
11221
* if ncpus is None:
11222
* import sage.parallel.ncpus
11223
*/
11224
__pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
11225
__Pyx_GOTREF(__pyx_t_1);
11226
__Pyx_INCREF(__pyx_n_s_parallel);
11227
__Pyx_GIVEREF(__pyx_n_s_parallel);
11228
PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_parallel);
11229
__pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_all, __pyx_t_1, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 471, __pyx_L1_error)
11230
__Pyx_GOTREF(__pyx_t_2);
11231
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11232
__pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_parallel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 471, __pyx_L1_error)
11233
__Pyx_GOTREF(__pyx_t_1);
11234
__Pyx_INCREF(__pyx_t_1);
11235
__pyx_v_parallel = __pyx_t_1;
11236
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11237
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11238
11239
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":472
11240
* # combining the results, etc.
11241
* from sage.all import parallel
11242
* if ncpus is None: # <<<<<<<<<<<<<<
11243
* import sage.parallel.ncpus
11244
* ncpus = sage.parallel.ncpus.ncpus()
11245
*/
11246
__pyx_t_3 = (__pyx_v_ncpus == Py_None);
11247
__pyx_t_4 = (__pyx_t_3 != 0);
11248
if (__pyx_t_4) {
11249
11250
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":473
11251
* from sage.all import parallel
11252
* if ncpus is None:
11253
* import sage.parallel.ncpus # <<<<<<<<<<<<<<
11254
* ncpus = sage.parallel.ncpus.ncpus()
11255
* @parallel(ncpus)
11256
*/
11257
__pyx_t_2 = __Pyx_Import(__pyx_n_s_sage_parallel_ncpus, 0, -1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 473, __pyx_L1_error)
11258
__Pyx_GOTREF(__pyx_t_2);
11259
__pyx_v_sage = __pyx_t_2;
11260
__pyx_t_2 = 0;
11261
11262
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":474
11263
* if ncpus is None:
11264
* import sage.parallel.ncpus
11265
* ncpus = sage.parallel.ncpus.ncpus() # <<<<<<<<<<<<<<
11266
* @parallel(ncpus)
11267
* def f(start, stop):
11268
*/
11269
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_sage, __pyx_n_s_parallel); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11270
__Pyx_GOTREF(__pyx_t_1);
11271
__pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_ncpus); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 474, __pyx_L1_error)
11272
__Pyx_GOTREF(__pyx_t_5);
11273
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11274
__pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_ncpus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 474, __pyx_L1_error)
11275
__Pyx_GOTREF(__pyx_t_1);
11276
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11277
__pyx_t_5 = NULL;
11278
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
11279
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
11280
if (likely(__pyx_t_5)) {
11281
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11282
__Pyx_INCREF(__pyx_t_5);
11283
__Pyx_INCREF(function);
11284
__Pyx_DECREF_SET(__pyx_t_1, function);
11285
}
11286
}
11287
if (__pyx_t_5) {
11288
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11289
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11290
} else {
11291
__pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 474, __pyx_L1_error)
11292
}
11293
__Pyx_GOTREF(__pyx_t_2);
11294
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11295
__Pyx_DECREF_SET(__pyx_v_ncpus, __pyx_t_2);
11296
__pyx_t_2 = 0;
11297
11298
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":472
11299
* # combining the results, etc.
11300
* from sage.all import parallel
11301
* if ncpus is None: # <<<<<<<<<<<<<<
11302
* import sage.parallel.ncpus
11303
* ncpus = sage.parallel.ncpus.ncpus()
11304
*/
11305
}
11306
11307
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":475
11308
* import sage.parallel.ncpus
11309
* ncpus = sage.parallel.ncpus.ncpus()
11310
* @parallel(ncpus) # <<<<<<<<<<<<<<
11311
* def f(start, stop):
11312
* return L._series(n, prec, ser_prec, verb, force_mulmod, start, stop)
11313
*/
11314
__Pyx_INCREF(__pyx_v_parallel);
11315
__pyx_t_5 = __pyx_v_parallel; __pyx_t_6 = NULL;
11316
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
11317
__pyx_t_6 = PyMethod_GET_SELF(__pyx_t_5);
11318
if (likely(__pyx_t_6)) {
11319
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
11320
__Pyx_INCREF(__pyx_t_6);
11321
__Pyx_INCREF(function);
11322
__Pyx_DECREF_SET(__pyx_t_5, function);
11323
}
11324
}
11325
if (!__pyx_t_6) {
11326
__pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_5, __pyx_v_ncpus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11327
__Pyx_GOTREF(__pyx_t_1);
11328
} else {
11329
#if CYTHON_FAST_PYCALL
11330
if (PyFunction_Check(__pyx_t_5)) {
11331
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_ncpus};
11332
__pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11333
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11334
__Pyx_GOTREF(__pyx_t_1);
11335
} else
11336
#endif
11337
#if CYTHON_FAST_PYCCALL
11338
if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
11339
PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v_ncpus};
11340
__pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11341
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11342
__Pyx_GOTREF(__pyx_t_1);
11343
} else
11344
#endif
11345
{
11346
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 475, __pyx_L1_error)
11347
__Pyx_GOTREF(__pyx_t_7);
11348
__Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_6); __pyx_t_6 = NULL;
11349
__Pyx_INCREF(__pyx_v_ncpus);
11350
__Pyx_GIVEREF(__pyx_v_ncpus);
11351
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_v_ncpus);
11352
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 475, __pyx_L1_error)
11353
__Pyx_GOTREF(__pyx_t_1);
11354
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11355
}
11356
}
11357
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11358
11359
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":476
11360
* ncpus = sage.parallel.ncpus.ncpus()
11361
* @parallel(ncpus)
11362
* def f(start, stop): # <<<<<<<<<<<<<<
11363
* return L._series(n, prec, ser_prec, verb, force_mulmod, start, stop)
11364
*
11365
*/
11366
__pyx_t_5 = __Pyx_CyFunction_NewEx(&__pyx_mdef_5psage_7modform_8rational_27padic_elliptic_lseries_fast_15series_parallel_1f, 0, __pyx_n_s_series_parallel_locals_f, ((PyObject*)__pyx_cur_scope), __pyx_n_s_psage_modform_rational_padic_ell, __pyx_d, ((PyObject *)__pyx_codeobj__6)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 476, __pyx_L1_error)
11367
__Pyx_GOTREF(__pyx_t_5);
11368
__pyx_t_7 = NULL;
11369
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11370
__pyx_t_7 = PyMethod_GET_SELF(__pyx_t_1);
11371
if (likely(__pyx_t_7)) {
11372
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11373
__Pyx_INCREF(__pyx_t_7);
11374
__Pyx_INCREF(function);
11375
__Pyx_DECREF_SET(__pyx_t_1, function);
11376
}
11377
}
11378
if (!__pyx_t_7) {
11379
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11380
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11381
__Pyx_GOTREF(__pyx_t_2);
11382
} else {
11383
#if CYTHON_FAST_PYCALL
11384
if (PyFunction_Check(__pyx_t_1)) {
11385
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
11386
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11387
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11388
__Pyx_GOTREF(__pyx_t_2);
11389
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11390
} else
11391
#endif
11392
#if CYTHON_FAST_PYCCALL
11393
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
11394
PyObject *__pyx_temp[2] = {__pyx_t_7, __pyx_t_5};
11395
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11396
__Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11397
__Pyx_GOTREF(__pyx_t_2);
11398
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
11399
} else
11400
#endif
11401
{
11402
__pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 475, __pyx_L1_error)
11403
__Pyx_GOTREF(__pyx_t_6);
11404
__Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_7); __pyx_t_7 = NULL;
11405
__Pyx_GIVEREF(__pyx_t_5);
11406
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_5);
11407
__pyx_t_5 = 0;
11408
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 475, __pyx_L1_error)
11409
__Pyx_GOTREF(__pyx_t_2);
11410
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11411
}
11412
}
11413
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11414
__pyx_v_f = __pyx_t_2;
11415
__pyx_t_2 = 0;
11416
11417
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":483
11418
* # range(0, p^(n-1))
11419
* # up into ncpus sublists.
11420
* last = ZZ(L.p)**(n-1) # <<<<<<<<<<<<<<
11421
* intervals = []
11422
* start = 0; stop = last//ncpus
11423
*/
11424
__pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_ZZ); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
11425
__Pyx_GOTREF(__pyx_t_1);
11426
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_cur_scope->__pyx_v_L, __pyx_n_s_p); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 483, __pyx_L1_error)
11427
__Pyx_GOTREF(__pyx_t_6);
11428
__pyx_t_5 = NULL;
11429
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_1))) {
11430
__pyx_t_5 = PyMethod_GET_SELF(__pyx_t_1);
11431
if (likely(__pyx_t_5)) {
11432
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
11433
__Pyx_INCREF(__pyx_t_5);
11434
__Pyx_INCREF(function);
11435
__Pyx_DECREF_SET(__pyx_t_1, function);
11436
}
11437
}
11438
if (!__pyx_t_5) {
11439
__pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_1, __pyx_t_6); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
11440
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11441
__Pyx_GOTREF(__pyx_t_2);
11442
} else {
11443
#if CYTHON_FAST_PYCALL
11444
if (PyFunction_Check(__pyx_t_1)) {
11445
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
11446
__pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
11447
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11448
__Pyx_GOTREF(__pyx_t_2);
11449
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11450
} else
11451
#endif
11452
#if CYTHON_FAST_PYCCALL
11453
if (__Pyx_PyFastCFunction_Check(__pyx_t_1)) {
11454
PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_6};
11455
__pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_1, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
11456
__Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11457
__Pyx_GOTREF(__pyx_t_2);
11458
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11459
} else
11460
#endif
11461
{
11462
__pyx_t_7 = PyTuple_New(1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
11463
__Pyx_GOTREF(__pyx_t_7);
11464
__Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_t_5); __pyx_t_5 = NULL;
11465
__Pyx_GIVEREF(__pyx_t_6);
11466
PyTuple_SET_ITEM(__pyx_t_7, 0+1, __pyx_t_6);
11467
__pyx_t_6 = 0;
11468
__pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_7, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 483, __pyx_L1_error)
11469
__Pyx_GOTREF(__pyx_t_2);
11470
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11471
}
11472
}
11473
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11474
__pyx_t_1 = __Pyx_PyInt_SubtractObjC(__pyx_cur_scope->__pyx_v_n, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
11475
__Pyx_GOTREF(__pyx_t_1);
11476
__pyx_t_7 = PyNumber_Power(__pyx_t_2, __pyx_t_1, Py_None); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 483, __pyx_L1_error)
11477
__Pyx_GOTREF(__pyx_t_7);
11478
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11479
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11480
__pyx_v_last = __pyx_t_7;
11481
__pyx_t_7 = 0;
11482
11483
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":484
11484
* # up into ncpus sublists.
11485
* last = ZZ(L.p)**(n-1)
11486
* intervals = [] # <<<<<<<<<<<<<<
11487
* start = 0; stop = last//ncpus
11488
* for i in range(ncpus):
11489
*/
11490
__pyx_t_7 = PyList_New(0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 484, __pyx_L1_error)
11491
__Pyx_GOTREF(__pyx_t_7);
11492
__pyx_v_intervals = ((PyObject*)__pyx_t_7);
11493
__pyx_t_7 = 0;
11494
11495
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":485
11496
* last = ZZ(L.p)**(n-1)
11497
* intervals = []
11498
* start = 0; stop = last//ncpus # <<<<<<<<<<<<<<
11499
* for i in range(ncpus):
11500
* intervals.append((start, stop))
11501
*/
11502
__Pyx_INCREF(__pyx_int_0);
11503
__pyx_v_start = __pyx_int_0;
11504
__pyx_t_7 = PyNumber_FloorDivide(__pyx_v_last, __pyx_v_ncpus); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 485, __pyx_L1_error)
11505
__Pyx_GOTREF(__pyx_t_7);
11506
__pyx_v_stop = __pyx_t_7;
11507
__pyx_t_7 = 0;
11508
11509
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":486
11510
* intervals = []
11511
* start = 0; stop = last//ncpus
11512
* for i in range(ncpus): # <<<<<<<<<<<<<<
11513
* intervals.append((start, stop))
11514
* start = stop
11515
*/
11516
__pyx_t_7 = PyTuple_New(1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error)
11517
__Pyx_GOTREF(__pyx_t_7);
11518
__Pyx_INCREF(__pyx_v_ncpus);
11519
__Pyx_GIVEREF(__pyx_v_ncpus);
11520
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_ncpus);
11521
__pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_7, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
11522
__Pyx_GOTREF(__pyx_t_1);
11523
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11524
if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
11525
__pyx_t_7 = __pyx_t_1; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
11526
__pyx_t_9 = NULL;
11527
} else {
11528
__pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 486, __pyx_L1_error)
11529
__Pyx_GOTREF(__pyx_t_7);
11530
__pyx_t_9 = Py_TYPE(__pyx_t_7)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 486, __pyx_L1_error)
11531
}
11532
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11533
for (;;) {
11534
if (likely(!__pyx_t_9)) {
11535
if (likely(PyList_CheckExact(__pyx_t_7))) {
11536
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
11537
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11538
__pyx_t_1 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 486, __pyx_L1_error)
11539
#else
11540
__pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
11541
__Pyx_GOTREF(__pyx_t_1);
11542
#endif
11543
} else {
11544
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
11545
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11546
__pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_1); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 486, __pyx_L1_error)
11547
#else
11548
__pyx_t_1 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
11549
__Pyx_GOTREF(__pyx_t_1);
11550
#endif
11551
}
11552
} else {
11553
__pyx_t_1 = __pyx_t_9(__pyx_t_7);
11554
if (unlikely(!__pyx_t_1)) {
11555
PyObject* exc_type = PyErr_Occurred();
11556
if (exc_type) {
11557
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11558
else __PYX_ERR(0, 486, __pyx_L1_error)
11559
}
11560
break;
11561
}
11562
__Pyx_GOTREF(__pyx_t_1);
11563
}
11564
__Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
11565
__pyx_t_1 = 0;
11566
11567
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":487
11568
* start = 0; stop = last//ncpus
11569
* for i in range(ncpus):
11570
* intervals.append((start, stop)) # <<<<<<<<<<<<<<
11571
* start = stop
11572
* stop += last//ncpus
11573
*/
11574
__pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 487, __pyx_L1_error)
11575
__Pyx_GOTREF(__pyx_t_1);
11576
__Pyx_INCREF(__pyx_v_start);
11577
__Pyx_GIVEREF(__pyx_v_start);
11578
PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_start);
11579
__Pyx_INCREF(__pyx_v_stop);
11580
__Pyx_GIVEREF(__pyx_v_stop);
11581
PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_v_stop);
11582
__pyx_t_10 = __Pyx_PyList_Append(__pyx_v_intervals, __pyx_t_1); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 487, __pyx_L1_error)
11583
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11584
11585
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":488
11586
* for i in range(ncpus):
11587
* intervals.append((start, stop))
11588
* start = stop # <<<<<<<<<<<<<<
11589
* stop += last//ncpus
11590
* if start < last:
11591
*/
11592
__Pyx_INCREF(__pyx_v_stop);
11593
__Pyx_DECREF_SET(__pyx_v_start, __pyx_v_stop);
11594
11595
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":489
11596
* intervals.append((start, stop))
11597
* start = stop
11598
* stop += last//ncpus # <<<<<<<<<<<<<<
11599
* if start < last:
11600
* intervals.append((start, last))
11601
*/
11602
__pyx_t_1 = PyNumber_FloorDivide(__pyx_v_last, __pyx_v_ncpus); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 489, __pyx_L1_error)
11603
__Pyx_GOTREF(__pyx_t_1);
11604
__pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_stop, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 489, __pyx_L1_error)
11605
__Pyx_GOTREF(__pyx_t_2);
11606
__Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11607
__Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_2);
11608
__pyx_t_2 = 0;
11609
11610
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":486
11611
* intervals = []
11612
* start = 0; stop = last//ncpus
11613
* for i in range(ncpus): # <<<<<<<<<<<<<<
11614
* intervals.append((start, stop))
11615
* start = stop
11616
*/
11617
}
11618
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11619
11620
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":490
11621
* start = stop
11622
* stop += last//ncpus
11623
* if start < last: # <<<<<<<<<<<<<<
11624
* intervals.append((start, last))
11625
* P = 0
11626
*/
11627
__pyx_t_7 = PyObject_RichCompare(__pyx_v_start, __pyx_v_last, Py_LT); __Pyx_XGOTREF(__pyx_t_7); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 490, __pyx_L1_error)
11628
__pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_7); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 490, __pyx_L1_error)
11629
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11630
if (__pyx_t_4) {
11631
11632
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":491
11633
* stop += last//ncpus
11634
* if start < last:
11635
* intervals.append((start, last)) # <<<<<<<<<<<<<<
11636
* P = 0
11637
* for x in f(intervals):
11638
*/
11639
__pyx_t_7 = PyTuple_New(2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 491, __pyx_L1_error)
11640
__Pyx_GOTREF(__pyx_t_7);
11641
__Pyx_INCREF(__pyx_v_start);
11642
__Pyx_GIVEREF(__pyx_v_start);
11643
PyTuple_SET_ITEM(__pyx_t_7, 0, __pyx_v_start);
11644
__Pyx_INCREF(__pyx_v_last);
11645
__Pyx_GIVEREF(__pyx_v_last);
11646
PyTuple_SET_ITEM(__pyx_t_7, 1, __pyx_v_last);
11647
__pyx_t_10 = __Pyx_PyList_Append(__pyx_v_intervals, __pyx_t_7); if (unlikely(__pyx_t_10 == -1)) __PYX_ERR(0, 491, __pyx_L1_error)
11648
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11649
11650
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":490
11651
* start = stop
11652
* stop += last//ncpus
11653
* if start < last: # <<<<<<<<<<<<<<
11654
* intervals.append((start, last))
11655
* P = 0
11656
*/
11657
}
11658
11659
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":492
11660
* if start < last:
11661
* intervals.append((start, last))
11662
* P = 0 # <<<<<<<<<<<<<<
11663
* for x in f(intervals):
11664
* P += x[-1]
11665
*/
11666
__Pyx_INCREF(__pyx_int_0);
11667
__pyx_v_P = __pyx_int_0;
11668
11669
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":493
11670
* intervals.append((start, last))
11671
* P = 0
11672
* for x in f(intervals): # <<<<<<<<<<<<<<
11673
* P += x[-1]
11674
* return P
11675
*/
11676
__Pyx_INCREF(__pyx_v_f);
11677
__pyx_t_2 = __pyx_v_f; __pyx_t_1 = NULL;
11678
if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
11679
__pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
11680
if (likely(__pyx_t_1)) {
11681
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
11682
__Pyx_INCREF(__pyx_t_1);
11683
__Pyx_INCREF(function);
11684
__Pyx_DECREF_SET(__pyx_t_2, function);
11685
}
11686
}
11687
if (!__pyx_t_1) {
11688
__pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v_intervals); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
11689
__Pyx_GOTREF(__pyx_t_7);
11690
} else {
11691
#if CYTHON_FAST_PYCALL
11692
if (PyFunction_Check(__pyx_t_2)) {
11693
PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_intervals};
11694
__pyx_t_7 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
11695
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11696
__Pyx_GOTREF(__pyx_t_7);
11697
} else
11698
#endif
11699
#if CYTHON_FAST_PYCCALL
11700
if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
11701
PyObject *__pyx_temp[2] = {__pyx_t_1, __pyx_v_intervals};
11702
__pyx_t_7 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
11703
__Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
11704
__Pyx_GOTREF(__pyx_t_7);
11705
} else
11706
#endif
11707
{
11708
__pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 493, __pyx_L1_error)
11709
__Pyx_GOTREF(__pyx_t_6);
11710
__Pyx_GIVEREF(__pyx_t_1); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_1); __pyx_t_1 = NULL;
11711
__Pyx_INCREF(__pyx_v_intervals);
11712
__Pyx_GIVEREF(__pyx_v_intervals);
11713
PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_v_intervals);
11714
__pyx_t_7 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
11715
__Pyx_GOTREF(__pyx_t_7);
11716
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11717
}
11718
}
11719
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11720
if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
11721
__pyx_t_2 = __pyx_t_7; __Pyx_INCREF(__pyx_t_2); __pyx_t_8 = 0;
11722
__pyx_t_9 = NULL;
11723
} else {
11724
__pyx_t_8 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
11725
__Pyx_GOTREF(__pyx_t_2);
11726
__pyx_t_9 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 493, __pyx_L1_error)
11727
}
11728
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11729
for (;;) {
11730
if (likely(!__pyx_t_9)) {
11731
if (likely(PyList_CheckExact(__pyx_t_2))) {
11732
if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_2)) break;
11733
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11734
__pyx_t_7 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
11735
#else
11736
__pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
11737
__Pyx_GOTREF(__pyx_t_7);
11738
#endif
11739
} else {
11740
if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
11741
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11742
__pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_8); __Pyx_INCREF(__pyx_t_7); __pyx_t_8++; if (unlikely(0 < 0)) __PYX_ERR(0, 493, __pyx_L1_error)
11743
#else
11744
__pyx_t_7 = PySequence_ITEM(__pyx_t_2, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 493, __pyx_L1_error)
11745
__Pyx_GOTREF(__pyx_t_7);
11746
#endif
11747
}
11748
} else {
11749
__pyx_t_7 = __pyx_t_9(__pyx_t_2);
11750
if (unlikely(!__pyx_t_7)) {
11751
PyObject* exc_type = PyErr_Occurred();
11752
if (exc_type) {
11753
if (likely(exc_type == PyExc_StopIteration || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
11754
else __PYX_ERR(0, 493, __pyx_L1_error)
11755
}
11756
break;
11757
}
11758
__Pyx_GOTREF(__pyx_t_7);
11759
}
11760
__Pyx_XDECREF_SET(__pyx_v_x, __pyx_t_7);
11761
__pyx_t_7 = 0;
11762
11763
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":494
11764
* P = 0
11765
* for x in f(intervals):
11766
* P += x[-1] # <<<<<<<<<<<<<<
11767
* return P
11768
*/
11769
__pyx_t_7 = __Pyx_GetItemInt(__pyx_v_x, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 494, __pyx_L1_error)
11770
__Pyx_GOTREF(__pyx_t_7);
11771
__pyx_t_6 = PyNumber_InPlaceAdd(__pyx_v_P, __pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 494, __pyx_L1_error)
11772
__Pyx_GOTREF(__pyx_t_6);
11773
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11774
__Pyx_DECREF_SET(__pyx_v_P, __pyx_t_6);
11775
__pyx_t_6 = 0;
11776
11777
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":493
11778
* intervals.append((start, last))
11779
* P = 0
11780
* for x in f(intervals): # <<<<<<<<<<<<<<
11781
* P += x[-1]
11782
* return P
11783
*/
11784
}
11785
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11786
11787
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":495
11788
* for x in f(intervals):
11789
* P += x[-1]
11790
* return P # <<<<<<<<<<<<<<
11791
*/
11792
__Pyx_XDECREF(__pyx_r);
11793
__Pyx_INCREF(__pyx_v_P);
11794
__pyx_r = __pyx_v_P;
11795
goto __pyx_L0;
11796
11797
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":467
11798
* return sha, L, reg
11799
*
11800
* def series_parallel(L, n, prec, ser_prec=5, verb=False, force_mulmod=False, ncpus=None): # <<<<<<<<<<<<<<
11801
* # Use @parallel to do this computation by dividing it up into
11802
* # p separate tasks, doing those in separate processes,
11803
*/
11804
11805
/* function exit code */
11806
__pyx_L1_error:;
11807
__Pyx_XDECREF(__pyx_t_1);
11808
__Pyx_XDECREF(__pyx_t_2);
11809
__Pyx_XDECREF(__pyx_t_5);
11810
__Pyx_XDECREF(__pyx_t_6);
11811
__Pyx_XDECREF(__pyx_t_7);
11812
__Pyx_AddTraceback("psage.modform.rational.padic_elliptic_lseries_fast.series_parallel", __pyx_clineno, __pyx_lineno, __pyx_filename);
11813
__pyx_r = NULL;
11814
__pyx_L0:;
11815
__Pyx_XDECREF(__pyx_v_parallel);
11816
__Pyx_XDECREF(__pyx_v_sage);
11817
__Pyx_XDECREF(__pyx_v_f);
11818
__Pyx_XDECREF(__pyx_v_last);
11819
__Pyx_XDECREF(__pyx_v_intervals);
11820
__Pyx_XDECREF(__pyx_v_start);
11821
__Pyx_XDECREF(__pyx_v_stop);
11822
__Pyx_XDECREF(__pyx_v_i);
11823
__Pyx_XDECREF(__pyx_v_P);
11824
__Pyx_XDECREF(__pyx_v_x);
11825
__Pyx_XDECREF(__pyx_v_ncpus);
11826
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
11827
__Pyx_XGIVEREF(__pyx_r);
11828
__Pyx_RefNannyFinishContext();
11829
return __pyx_r;
11830
}
11831
11832
/* "sage/structure/element.pxd":7
11833
*
11834
*
11835
* cpdef inline parent(x): # <<<<<<<<<<<<<<
11836
* """
11837
* Return the parent of the element ``x``.
11838
*/
11839
11840
static PyObject *__pyx_pw_4sage_9structure_7element_1parent(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
11841
static CYTHON_INLINE PyObject *__pyx_f_4sage_9structure_7element_parent(PyObject *__pyx_v_x, CYTHON_UNUSED int __pyx_skip_dispatch) {
11842
PyObject *__pyx_v_p = NULL;
11843
PyObject *__pyx_r = NULL;
11844
__Pyx_RefNannyDeclarations
11845
int __pyx_t_1;
11846
int __pyx_t_2;
11847
PyObject *__pyx_t_3 = NULL;
11848
PyObject *__pyx_t_4 = NULL;
11849
PyObject *__pyx_t_5 = NULL;
11850
PyObject *__pyx_t_6 = NULL;
11851
PyObject *__pyx_t_7 = NULL;
11852
PyObject *__pyx_t_8 = NULL;
11853
int __pyx_t_9;
11854
__Pyx_RefNannySetupContext("parent", 0);
11855
11856
/* "sage/structure/element.pxd":63
11857
* <... 'list'>
11858
* """
11859
* if isinstance(x, Element): # <<<<<<<<<<<<<<
11860
* return (<Element>x)._parent
11861
* # Fast check for "number" types, including int and float
11862
*/
11863
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_x, __pyx_ptype_4sage_9structure_7element_Element);
11864
__pyx_t_2 = (__pyx_t_1 != 0);
11865
if (__pyx_t_2) {
11866
11867
/* "sage/structure/element.pxd":64
11868
* """
11869
* if isinstance(x, Element):
11870
* return (<Element>x)._parent # <<<<<<<<<<<<<<
11871
* # Fast check for "number" types, including int and float
11872
* if PyNumber_Check(x):
11873
*/
11874
__Pyx_XDECREF(__pyx_r);
11875
__Pyx_INCREF(((PyObject *)((struct __pyx_obj_4sage_9structure_7element_Element *)__pyx_v_x)->_parent));
11876
__pyx_r = ((PyObject *)((struct __pyx_obj_4sage_9structure_7element_Element *)__pyx_v_x)->_parent);
11877
goto __pyx_L0;
11878
11879
/* "sage/structure/element.pxd":63
11880
* <... 'list'>
11881
* """
11882
* if isinstance(x, Element): # <<<<<<<<<<<<<<
11883
* return (<Element>x)._parent
11884
* # Fast check for "number" types, including int and float
11885
*/
11886
}
11887
11888
/* "sage/structure/element.pxd":66
11889
* return (<Element>x)._parent
11890
* # Fast check for "number" types, including int and float
11891
* if PyNumber_Check(x): # <<<<<<<<<<<<<<
11892
* return type(x)
11893
* try:
11894
*/
11895
__pyx_t_2 = (PyNumber_Check(__pyx_v_x) != 0);
11896
if (__pyx_t_2) {
11897
11898
/* "sage/structure/element.pxd":67
11899
* # Fast check for "number" types, including int and float
11900
* if PyNumber_Check(x):
11901
* return type(x) # <<<<<<<<<<<<<<
11902
* try:
11903
* p = x.parent
11904
*/
11905
__Pyx_XDECREF(__pyx_r);
11906
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_x)));
11907
__pyx_r = ((PyObject *)Py_TYPE(__pyx_v_x));
11908
goto __pyx_L0;
11909
11910
/* "sage/structure/element.pxd":66
11911
* return (<Element>x)._parent
11912
* # Fast check for "number" types, including int and float
11913
* if PyNumber_Check(x): # <<<<<<<<<<<<<<
11914
* return type(x)
11915
* try:
11916
*/
11917
}
11918
11919
/* "sage/structure/element.pxd":68
11920
* if PyNumber_Check(x):
11921
* return type(x)
11922
* try: # <<<<<<<<<<<<<<
11923
* p = x.parent
11924
* except AttributeError:
11925
*/
11926
{
11927
__Pyx_PyThreadState_declare
11928
__Pyx_PyThreadState_assign
11929
__Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11930
__Pyx_XGOTREF(__pyx_t_3);
11931
__Pyx_XGOTREF(__pyx_t_4);
11932
__Pyx_XGOTREF(__pyx_t_5);
11933
/*try:*/ {
11934
11935
/* "sage/structure/element.pxd":69
11936
* return type(x)
11937
* try:
11938
* p = x.parent # <<<<<<<<<<<<<<
11939
* except AttributeError:
11940
* return type(x)
11941
*/
11942
__pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_x, __pyx_n_s_parent); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 69, __pyx_L5_error)
11943
__Pyx_GOTREF(__pyx_t_6);
11944
__pyx_v_p = __pyx_t_6;
11945
__pyx_t_6 = 0;
11946
11947
/* "sage/structure/element.pxd":68
11948
* if PyNumber_Check(x):
11949
* return type(x)
11950
* try: # <<<<<<<<<<<<<<
11951
* p = x.parent
11952
* except AttributeError:
11953
*/
11954
}
11955
11956
/* "sage/structure/element.pxd":73
11957
* return type(x)
11958
* else:
11959
* return p() # <<<<<<<<<<<<<<
11960
*
11961
*
11962
*/
11963
/*else:*/ {
11964
__Pyx_XDECREF(__pyx_r);
11965
__Pyx_INCREF(__pyx_v_p);
11966
__pyx_t_7 = __pyx_v_p; __pyx_t_8 = NULL;
11967
if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
11968
__pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
11969
if (likely(__pyx_t_8)) {
11970
PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
11971
__Pyx_INCREF(__pyx_t_8);
11972
__Pyx_INCREF(function);
11973
__Pyx_DECREF_SET(__pyx_t_7, function);
11974
}
11975
}
11976
if (__pyx_t_8) {
11977
__pyx_t_6 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_8); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 73, __pyx_L7_except_error)
11978
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11979
} else {
11980
__pyx_t_6 = __Pyx_PyObject_CallNoArg(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 73, __pyx_L7_except_error)
11981
}
11982
__Pyx_GOTREF(__pyx_t_6);
11983
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11984
__pyx_r = __pyx_t_6;
11985
__pyx_t_6 = 0;
11986
goto __pyx_L8_except_return;
11987
}
11988
__pyx_L5_error:;
11989
__Pyx_PyThreadState_assign
11990
__Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11991
11992
/* "sage/structure/element.pxd":70
11993
* try:
11994
* p = x.parent
11995
* except AttributeError: # <<<<<<<<<<<<<<
11996
* return type(x)
11997
* else:
11998
*/
11999
__pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_AttributeError);
12000
if (__pyx_t_9) {
12001
__Pyx_AddTraceback("sage.structure.element.parent", __pyx_clineno, __pyx_lineno, __pyx_filename);
12002
if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 70, __pyx_L7_except_error)
12003
__Pyx_GOTREF(__pyx_t_6);
12004
__Pyx_GOTREF(__pyx_t_7);
12005
__Pyx_GOTREF(__pyx_t_8);
12006
12007
/* "sage/structure/element.pxd":71
12008
* p = x.parent
12009
* except AttributeError:
12010
* return type(x) # <<<<<<<<<<<<<<
12011
* else:
12012
* return p()
12013
*/
12014
__Pyx_XDECREF(__pyx_r);
12015
__Pyx_INCREF(((PyObject *)Py_TYPE(__pyx_v_x)));
12016
__pyx_r = ((PyObject *)Py_TYPE(__pyx_v_x));
12017
__Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12018
__Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
12019
__Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12020
goto __pyx_L8_except_return;
12021
}
12022
goto __pyx_L7_except_error;
12023
__pyx_L7_except_error:;
12024
12025
/* "sage/structure/element.pxd":68
12026
* if PyNumber_Check(x):
12027
* return type(x)
12028
* try: # <<<<<<<<<<<<<<
12029
* p = x.parent
12030
* except AttributeError:
12031
*/
12032
__Pyx_PyThreadState_assign
12033
__Pyx_XGIVEREF(__pyx_t_3);
12034
__Pyx_XGIVEREF(__pyx_t_4);
12035
__Pyx_XGIVEREF(__pyx_t_5);
12036
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12037
goto __pyx_L1_error;
12038
__pyx_L8_except_return:;
12039
__Pyx_PyThreadState_assign
12040
__Pyx_XGIVEREF(__pyx_t_3);
12041
__Pyx_XGIVEREF(__pyx_t_4);
12042
__Pyx_XGIVEREF(__pyx_t_5);
12043
__Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
12044
goto __pyx_L0;
12045
}
12046
12047
/* "sage/structure/element.pxd":7
12048
*
12049
*
12050
* cpdef inline parent(x): # <<<<<<<<<<<<<<
12051
* """
12052
* Return the parent of the element ``x``.
12053
*/
12054
12055
/* function exit code */
12056
__pyx_L1_error:;
12057
__Pyx_XDECREF(__pyx_t_6);
12058
__Pyx_XDECREF(__pyx_t_7);
12059
__Pyx_XDECREF(__pyx_t_8);
12060
__Pyx_AddTraceback("sage.structure.element.parent", __pyx_clineno, __pyx_lineno, __pyx_filename);
12061
__pyx_r = 0;
12062
__pyx_L0:;
12063
__Pyx_XDECREF(__pyx_v_p);
12064
__Pyx_XGIVEREF(__pyx_r);
12065
__Pyx_RefNannyFinishContext();
12066
return __pyx_r;
12067
}
12068
12069
/* Python wrapper */
12070
static PyObject *__pyx_pw_4sage_9structure_7element_1parent(PyObject *__pyx_self, PyObject *__pyx_v_x); /*proto*/
12071
static char __pyx_doc_4sage_9structure_7element_parent[] = "File: (starting at line 7)\n\n Return the parent of the element ``x``.\n\n Usually, this means the mathematical object of which ``x`` is an\n element.\n\n INPUT:\n\n - ``x`` -- an element\n\n OUTPUT:\n\n - If ``x`` is a Sage :class:`Element`, return ``x.parent()``.\n\n - If ``x`` has a ``parent`` method and ``x`` does not have an\n ``__int__`` or ``__float__`` method, return ``x.parent()``.\n\n - Otherwise, return ``type(x)``.\n\n .. SEEALSO::\n\n `Parents, Conversion and Coercion <http://doc.sagemath.org/html/en/tutorial/tour_coercion.html>`_\n Section in the Sage Tutorial\n\n EXAMPLES::\n\n sage: a = 42\n sage: parent(a)\n Integer Ring\n sage: b = 42/1\n sage: parent(b)\n Rational Field\n sage: c = 42.0\n sage: parent(c)\n Real Field with 53 bits of precision\n\n Some more complicated examples::\n\n sage: x = Partition([3,2,1,1,1])\n sage: parent(x)\n Partitions\n sage: v = vector(RDF, [1,2,3])\n sage: parent(v)\n Vector space of dimension 3 over Real Double Field\n\n The following are not considered to be elements, so the type is\n returned::\n\n sage: d = int(42) # Python int\n sage: parent(d)\n <type 'int'>\n sage: L = list(range(10))\n sage: parent(L)\n <... 'list'>\n ";
12072
static PyObject *__pyx_pw_4sage_9structure_7element_1parent(PyObject *__pyx_self, PyObject *__pyx_v_x) {
12073
PyObject *__pyx_r = 0;
12074
__Pyx_RefNannyDeclarations
12075
__Pyx_RefNannySetupContext("parent (wrapper)", 0);
12076
__pyx_r = __pyx_pf_4sage_9structure_7element_parent(__pyx_self, ((PyObject *)__pyx_v_x));
12077
12078
/* function exit code */
12079
__Pyx_RefNannyFinishContext();
12080
return __pyx_r;
12081
}
12082
12083
static PyObject *__pyx_pf_4sage_9structure_7element_parent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x) {
12084
PyObject *__pyx_r = NULL;
12085
__Pyx_RefNannyDeclarations
12086
PyObject *__pyx_t_1 = NULL;
12087
__Pyx_RefNannySetupContext("parent", 0);
12088
__Pyx_XDECREF(__pyx_r);
12089
__pyx_t_1 = __pyx_f_4sage_9structure_7element_parent(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 7, __pyx_L1_error)
12090
__Pyx_GOTREF(__pyx_t_1);
12091
__pyx_r = __pyx_t_1;
12092
__pyx_t_1 = 0;
12093
goto __pyx_L0;
12094
12095
/* function exit code */
12096
__pyx_L1_error:;
12097
__Pyx_XDECREF(__pyx_t_1);
12098
__Pyx_AddTraceback("sage.structure.element.parent", __pyx_clineno, __pyx_lineno, __pyx_filename);
12099
__pyx_r = NULL;
12100
__pyx_L0:;
12101
__Pyx_XGIVEREF(__pyx_r);
12102
__Pyx_RefNannyFinishContext();
12103
return __pyx_r;
12104
}
12105
12106
/* "sage/structure/element.pxd":76
12107
*
12108
*
12109
* cdef inline int classify_elements(left, right): # <<<<<<<<<<<<<<
12110
* """
12111
* Given two objects, at least one which is an :class:`Element`,
12112
*/
12113
12114
static CYTHON_INLINE int __pyx_f_4sage_9structure_7element_classify_elements(PyObject *__pyx_v_left, PyObject *__pyx_v_right) {
12115
int __pyx_r;
12116
__Pyx_RefNannyDeclarations
12117
int __pyx_t_1;
12118
int __pyx_t_2;
12119
__Pyx_RefNannySetupContext("classify_elements", 0);
12120
12121
/* "sage/structure/element.pxd":99
12122
* - 0o37: both are Element, same type, same parent
12123
* """
12124
* if type(left) is type(right): # <<<<<<<<<<<<<<
12125
* # We know at least one of the arguments is an Element. So if
12126
* # their types are *equal* (fast to check) then they are both
12127
*/
12128
__pyx_t_1 = (((PyObject *)Py_TYPE(__pyx_v_left)) == ((PyObject *)Py_TYPE(__pyx_v_right)));
12129
__pyx_t_2 = (__pyx_t_1 != 0);
12130
if (__pyx_t_2) {
12131
12132
/* "sage/structure/element.pxd":103
12133
* # their types are *equal* (fast to check) then they are both
12134
* # Elements.
12135
* if (<Element>left)._parent is (<Element>right)._parent: # <<<<<<<<<<<<<<
12136
* return 0o37
12137
* else:
12138
*/
12139
__pyx_t_2 = (((struct __pyx_obj_4sage_9structure_7element_Element *)__pyx_v_left)->_parent == ((struct __pyx_obj_4sage_9structure_7element_Element *)__pyx_v_right)->_parent);
12140
__pyx_t_1 = (__pyx_t_2 != 0);
12141
if (__pyx_t_1) {
12142
12143
/* "sage/structure/element.pxd":104
12144
* # Elements.
12145
* if (<Element>left)._parent is (<Element>right)._parent:
12146
* return 0o37 # <<<<<<<<<<<<<<
12147
* else:
12148
* return 0o17
12149
*/
12150
__pyx_r = 037;
12151
goto __pyx_L0;
12152
12153
/* "sage/structure/element.pxd":103
12154
* # their types are *equal* (fast to check) then they are both
12155
* # Elements.
12156
* if (<Element>left)._parent is (<Element>right)._parent: # <<<<<<<<<<<<<<
12157
* return 0o37
12158
* else:
12159
*/
12160
}
12161
12162
/* "sage/structure/element.pxd":106
12163
* return 0o37
12164
* else:
12165
* return 0o17 # <<<<<<<<<<<<<<
12166
* if not isinstance(right, Element):
12167
* return 0o01
12168
*/
12169
/*else*/ {
12170
__pyx_r = 017;
12171
goto __pyx_L0;
12172
}
12173
12174
/* "sage/structure/element.pxd":99
12175
* - 0o37: both are Element, same type, same parent
12176
* """
12177
* if type(left) is type(right): # <<<<<<<<<<<<<<
12178
* # We know at least one of the arguments is an Element. So if
12179
* # their types are *equal* (fast to check) then they are both
12180
*/
12181
}
12182
12183
/* "sage/structure/element.pxd":107
12184
* else:
12185
* return 0o17
12186
* if not isinstance(right, Element): # <<<<<<<<<<<<<<
12187
* return 0o01
12188
* if not isinstance(left, Element):
12189
*/
12190
__pyx_t_1 = __Pyx_TypeCheck(__pyx_v_right, __pyx_ptype_4sage_9structure_7element_Element);
12191
__pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
12192
if (__pyx_t_2) {
12193
12194
/* "sage/structure/element.pxd":108
12195
* return 0o17
12196
* if not isinstance(right, Element):
12197
* return 0o01 # <<<<<<<<<<<<<<
12198
* if not isinstance(left, Element):
12199
* return 0o02
12200
*/
12201
__pyx_r = 001;
12202
goto __pyx_L0;
12203
12204
/* "sage/structure/element.pxd":107
12205
* else:
12206
* return 0o17
12207
* if not isinstance(right, Element): # <<<<<<<<<<<<<<
12208
* return 0o01
12209
* if not isinstance(left, Element):
12210
*/
12211
}
12212
12213
/* "sage/structure/element.pxd":109
12214
* if not isinstance(right, Element):
12215
* return 0o01
12216
* if not isinstance(left, Element): # <<<<<<<<<<<<<<
12217
* return 0o02
12218
* if (<Element>left)._parent is (<Element>right)._parent:
12219
*/
12220
__pyx_t_2 = __Pyx_TypeCheck(__pyx_v_left, __pyx_ptype_4sage_9structure_7element_Element);
12221
__pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
12222
if (__pyx_t_1) {
12223
12224
/* "sage/structure/element.pxd":110
12225
* return 0o01
12226
* if not isinstance(left, Element):
12227
* return 0o02 # <<<<<<<<<<<<<<
12228
* if (<Element>left)._parent is (<Element>right)._parent:
12229
* return 0o27
12230
*/
12231
__pyx_r = 002;
12232
goto __pyx_L0;
12233
12234
/* "sage/structure/element.pxd":109
12235
* if not isinstance(right, Element):
12236
* return 0o01
12237
* if not isinstance(left, Element): # <<<<<<<<<<<<<<
12238
* return 0o02
12239
* if (<Element>left)._parent is (<Element>right)._parent:
12240
*/
12241
}
12242
12243
/* "sage/structure/element.pxd":111
12244
* if not isinstance(left, Element):
12245
* return 0o02
12246
* if (<Element>left)._parent is (<Element>right)._parent: # <<<<<<<<<<<<<<
12247
* return 0o27
12248
* else:
12249
*/
12250
__pyx_t_1 = (((struct __pyx_obj_4sage_9structure_7element_Element *)__pyx_v_left)->_parent == ((struct __pyx_obj_4sage_9structure_7element_Element *)__pyx_v_right)->_parent);
12251
__pyx_t_2 = (__pyx_t_1 != 0);
12252
if (__pyx_t_2) {
12253
12254
/* "sage/structure/element.pxd":112
12255
* return 0o02
12256
* if (<Element>left)._parent is (<Element>right)._parent:
12257
* return 0o27 # <<<<<<<<<<<<<<
12258
* else:
12259
* return 0o07
12260
*/
12261
__pyx_r = 027;
12262
goto __pyx_L0;
12263
12264
/* "sage/structure/element.pxd":111
12265
* if not isinstance(left, Element):
12266
* return 0o02
12267
* if (<Element>left)._parent is (<Element>right)._parent: # <<<<<<<<<<<<<<
12268
* return 0o27
12269
* else:
12270
*/
12271
}
12272
12273
/* "sage/structure/element.pxd":114
12274
* return 0o27
12275
* else:
12276
* return 0o07 # <<<<<<<<<<<<<<
12277
*
12278
* # Functions to help understand the result of classify_elements()
12279
*/
12280
/*else*/ {
12281
__pyx_r = 007;
12282
goto __pyx_L0;
12283
}
12284
12285
/* "sage/structure/element.pxd":76
12286
*
12287
*
12288
* cdef inline int classify_elements(left, right): # <<<<<<<<<<<<<<
12289
* """
12290
* Given two objects, at least one which is an :class:`Element`,
12291
*/
12292
12293
/* function exit code */
12294
__pyx_L0:;
12295
__Pyx_RefNannyFinishContext();
12296
return __pyx_r;
12297
}
12298
12299
/* "sage/structure/element.pxd":117
12300
*
12301
* # Functions to help understand the result of classify_elements()
12302
* cdef inline bint BOTH_ARE_ELEMENT(int cl): # <<<<<<<<<<<<<<
12303
* return cl & 0o04
12304
* cdef inline bint HAVE_SAME_PARENT(int cl):
12305
*/
12306
12307
static CYTHON_INLINE int __pyx_f_4sage_9structure_7element_BOTH_ARE_ELEMENT(int __pyx_v_cl) {
12308
int __pyx_r;
12309
__Pyx_RefNannyDeclarations
12310
__Pyx_RefNannySetupContext("BOTH_ARE_ELEMENT", 0);
12311
12312
/* "sage/structure/element.pxd":118
12313
* # Functions to help understand the result of classify_elements()
12314
* cdef inline bint BOTH_ARE_ELEMENT(int cl):
12315
* return cl & 0o04 # <<<<<<<<<<<<<<
12316
* cdef inline bint HAVE_SAME_PARENT(int cl):
12317
* return cl & 0o20
12318
*/
12319
__pyx_r = (__pyx_v_cl & 004);
12320
goto __pyx_L0;
12321
12322
/* "sage/structure/element.pxd":117
12323
*
12324
* # Functions to help understand the result of classify_elements()
12325
* cdef inline bint BOTH_ARE_ELEMENT(int cl): # <<<<<<<<<<<<<<
12326
* return cl & 0o04
12327
* cdef inline bint HAVE_SAME_PARENT(int cl):
12328
*/
12329
12330
/* function exit code */
12331
__pyx_L0:;
12332
__Pyx_RefNannyFinishContext();
12333
return __pyx_r;
12334
}
12335
12336
/* "sage/structure/element.pxd":119
12337
* cdef inline bint BOTH_ARE_ELEMENT(int cl):
12338
* return cl & 0o04
12339
* cdef inline bint HAVE_SAME_PARENT(int cl): # <<<<<<<<<<<<<<
12340
* return cl & 0o20
12341
*
12342
*/
12343
12344
static CYTHON_INLINE int __pyx_f_4sage_9structure_7element_HAVE_SAME_PARENT(int __pyx_v_cl) {
12345
int __pyx_r;
12346
__Pyx_RefNannyDeclarations
12347
__Pyx_RefNannySetupContext("HAVE_SAME_PARENT", 0);
12348
12349
/* "sage/structure/element.pxd":120
12350
* return cl & 0o04
12351
* cdef inline bint HAVE_SAME_PARENT(int cl):
12352
* return cl & 0o20 # <<<<<<<<<<<<<<
12353
*
12354
*
12355
*/
12356
__pyx_r = (__pyx_v_cl & 020);
12357
goto __pyx_L0;
12358
12359
/* "sage/structure/element.pxd":119
12360
* cdef inline bint BOTH_ARE_ELEMENT(int cl):
12361
* return cl & 0o04
12362
* cdef inline bint HAVE_SAME_PARENT(int cl): # <<<<<<<<<<<<<<
12363
* return cl & 0o20
12364
*
12365
*/
12366
12367
/* function exit code */
12368
__pyx_L0:;
12369
__Pyx_RefNannyFinishContext();
12370
return __pyx_r;
12371
}
12372
12373
/* "sage/structure/element.pxd":123
12374
*
12375
*
12376
* cpdef inline bint have_same_parent(left, right): # <<<<<<<<<<<<<<
12377
* """
12378
* Return ``True`` if and only if ``left`` and ``right`` have the
12379
*/
12380
12381
static PyObject *__pyx_pw_4sage_9structure_7element_3have_same_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12382
static CYTHON_INLINE int __pyx_f_4sage_9structure_7element_have_same_parent(PyObject *__pyx_v_left, PyObject *__pyx_v_right, CYTHON_UNUSED int __pyx_skip_dispatch) {
12383
int __pyx_r;
12384
__Pyx_RefNannyDeclarations
12385
__Pyx_RefNannySetupContext("have_same_parent", 0);
12386
12387
/* "sage/structure/element.pxd":155
12388
* True
12389
* """
12390
* return HAVE_SAME_PARENT(classify_elements(left, right)) # <<<<<<<<<<<<<<
12391
*
12392
*
12393
*/
12394
__pyx_r = __pyx_f_4sage_9structure_7element_HAVE_SAME_PARENT(__pyx_f_4sage_9structure_7element_classify_elements(__pyx_v_left, __pyx_v_right));
12395
goto __pyx_L0;
12396
12397
/* "sage/structure/element.pxd":123
12398
*
12399
*
12400
* cpdef inline bint have_same_parent(left, right): # <<<<<<<<<<<<<<
12401
* """
12402
* Return ``True`` if and only if ``left`` and ``right`` have the
12403
*/
12404
12405
/* function exit code */
12406
__pyx_L0:;
12407
__Pyx_RefNannyFinishContext();
12408
return __pyx_r;
12409
}
12410
12411
/* Python wrapper */
12412
static PyObject *__pyx_pw_4sage_9structure_7element_3have_same_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
12413
static char __pyx_doc_4sage_9structure_7element_2have_same_parent[] = "File: (starting at line 123)\n\n Return ``True`` if and only if ``left`` and ``right`` have the\n same parent.\n\n .. WARNING::\n\n This function assumes that at least one of the arguments is a\n Sage :class:`Element`. When in doubt, use the slower\n ``parent(left) is parent(right)`` instead.\n\n EXAMPLES::\n\n sage: from sage.structure.element import have_same_parent\n sage: have_same_parent(1, 3)\n True\n sage: have_same_parent(1, 1/2)\n False\n sage: have_same_parent(gap(1), gap(1/2))\n True\n\n These have different types but the same parent::\n\n sage: a = RLF(2)\n sage: b = exp(a)\n sage: type(a)\n <type 'sage.rings.real_lazy.LazyWrapper'>\n sage: type(b)\n <type 'sage.rings.real_lazy.LazyNamedUnop'>\n sage: have_same_parent(a, b)\n True\n ";
12414
static PyObject *__pyx_pw_4sage_9structure_7element_3have_same_parent(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
12415
PyObject *__pyx_v_left = 0;
12416
PyObject *__pyx_v_right = 0;
12417
PyObject *__pyx_r = 0;
12418
__Pyx_RefNannyDeclarations
12419
__Pyx_RefNannySetupContext("have_same_parent (wrapper)", 0);
12420
{
12421
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_left,&__pyx_n_s_right,0};
12422
PyObject* values[2] = {0,0};
12423
if (unlikely(__pyx_kwds)) {
12424
Py_ssize_t kw_args;
12425
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
12426
switch (pos_args) {
12427
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12428
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12429
case 0: break;
12430
default: goto __pyx_L5_argtuple_error;
12431
}
12432
kw_args = PyDict_Size(__pyx_kwds);
12433
switch (pos_args) {
12434
case 0:
12435
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_left)) != 0)) kw_args--;
12436
else goto __pyx_L5_argtuple_error;
12437
case 1:
12438
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_right)) != 0)) kw_args--;
12439
else {
12440
__Pyx_RaiseArgtupleInvalid("have_same_parent", 1, 2, 2, 1); __PYX_ERR(1, 123, __pyx_L3_error)
12441
}
12442
}
12443
if (unlikely(kw_args > 0)) {
12444
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "have_same_parent") < 0)) __PYX_ERR(1, 123, __pyx_L3_error)
12445
}
12446
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
12447
goto __pyx_L5_argtuple_error;
12448
} else {
12449
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
12450
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
12451
}
12452
__pyx_v_left = values[0];
12453
__pyx_v_right = values[1];
12454
}
12455
goto __pyx_L4_argument_unpacking_done;
12456
__pyx_L5_argtuple_error:;
12457
__Pyx_RaiseArgtupleInvalid("have_same_parent", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 123, __pyx_L3_error)
12458
__pyx_L3_error:;
12459
__Pyx_AddTraceback("sage.structure.element.have_same_parent", __pyx_clineno, __pyx_lineno, __pyx_filename);
12460
__Pyx_RefNannyFinishContext();
12461
return NULL;
12462
__pyx_L4_argument_unpacking_done:;
12463
__pyx_r = __pyx_pf_4sage_9structure_7element_2have_same_parent(__pyx_self, __pyx_v_left, __pyx_v_right);
12464
12465
/* function exit code */
12466
__Pyx_RefNannyFinishContext();
12467
return __pyx_r;
12468
}
12469
12470
static PyObject *__pyx_pf_4sage_9structure_7element_2have_same_parent(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_left, PyObject *__pyx_v_right) {
12471
PyObject *__pyx_r = NULL;
12472
__Pyx_RefNannyDeclarations
12473
PyObject *__pyx_t_1 = NULL;
12474
__Pyx_RefNannySetupContext("have_same_parent", 0);
12475
__Pyx_XDECREF(__pyx_r);
12476
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_4sage_9structure_7element_have_same_parent(__pyx_v_left, __pyx_v_right, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 123, __pyx_L1_error)
12477
__Pyx_GOTREF(__pyx_t_1);
12478
__pyx_r = __pyx_t_1;
12479
__pyx_t_1 = 0;
12480
goto __pyx_L0;
12481
12482
/* function exit code */
12483
__pyx_L1_error:;
12484
__Pyx_XDECREF(__pyx_t_1);
12485
__Pyx_AddTraceback("sage.structure.element.have_same_parent", __pyx_clineno, __pyx_lineno, __pyx_filename);
12486
__pyx_r = NULL;
12487
__pyx_L0:;
12488
__Pyx_XGIVEREF(__pyx_r);
12489
__Pyx_RefNannyFinishContext();
12490
return __pyx_r;
12491
}
12492
12493
/* "sage/structure/element.pxd":158
12494
*
12495
*
12496
* cdef inline parent_c(x): # <<<<<<<<<<<<<<
12497
* """
12498
* Deprecated alias for :func:`parent`.
12499
*/
12500
12501
static CYTHON_INLINE PyObject *__pyx_f_4sage_9structure_7element_parent_c(PyObject *__pyx_v_x) {
12502
PyObject *__pyx_r = NULL;
12503
__Pyx_RefNannyDeclarations
12504
PyObject *__pyx_t_1 = NULL;
12505
__Pyx_RefNannySetupContext("parent_c", 0);
12506
12507
/* "sage/structure/element.pxd":162
12508
* Deprecated alias for :func:`parent`.
12509
* """
12510
* return parent(x) # <<<<<<<<<<<<<<
12511
*
12512
*
12513
*/
12514
__Pyx_XDECREF(__pyx_r);
12515
__pyx_t_1 = __pyx_f_4sage_9structure_7element_parent(__pyx_v_x, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 162, __pyx_L1_error)
12516
__Pyx_GOTREF(__pyx_t_1);
12517
__pyx_r = __pyx_t_1;
12518
__pyx_t_1 = 0;
12519
goto __pyx_L0;
12520
12521
/* "sage/structure/element.pxd":158
12522
*
12523
*
12524
* cdef inline parent_c(x): # <<<<<<<<<<<<<<
12525
* """
12526
* Deprecated alias for :func:`parent`.
12527
*/
12528
12529
/* function exit code */
12530
__pyx_L1_error:;
12531
__Pyx_XDECREF(__pyx_t_1);
12532
__Pyx_AddTraceback("sage.structure.element.parent_c", __pyx_clineno, __pyx_lineno, __pyx_filename);
12533
__pyx_r = 0;
12534
__pyx_L0:;
12535
__Pyx_XGIVEREF(__pyx_r);
12536
__Pyx_RefNannyFinishContext();
12537
return __pyx_r;
12538
}
12539
12540
/* "cysignals/memory.pxd":40
12541
*
12542
*
12543
* cdef inline void* sig_malloc "sig_malloc"(size_t n) nogil: # <<<<<<<<<<<<<<
12544
* sig_block()
12545
* cdef void* ret = malloc(n)
12546
*/
12547
12548
static CYTHON_INLINE void *sig_malloc(size_t __pyx_v_n) {
12549
void *__pyx_v_ret;
12550
void *__pyx_r;
12551
12552
/* "cysignals/memory.pxd":41
12553
*
12554
* cdef inline void* sig_malloc "sig_malloc"(size_t n) nogil:
12555
* sig_block() # <<<<<<<<<<<<<<
12556
* cdef void* ret = malloc(n)
12557
* sig_unblock()
12558
*/
12559
sig_block();
12560
12561
/* "cysignals/memory.pxd":42
12562
* cdef inline void* sig_malloc "sig_malloc"(size_t n) nogil:
12563
* sig_block()
12564
* cdef void* ret = malloc(n) # <<<<<<<<<<<<<<
12565
* sig_unblock()
12566
* return ret
12567
*/
12568
__pyx_v_ret = malloc(__pyx_v_n);
12569
12570
/* "cysignals/memory.pxd":43
12571
* sig_block()
12572
* cdef void* ret = malloc(n)
12573
* sig_unblock() # <<<<<<<<<<<<<<
12574
* return ret
12575
*
12576
*/
12577
sig_unblock();
12578
12579
/* "cysignals/memory.pxd":44
12580
* cdef void* ret = malloc(n)
12581
* sig_unblock()
12582
* return ret # <<<<<<<<<<<<<<
12583
*
12584
*
12585
*/
12586
__pyx_r = __pyx_v_ret;
12587
goto __pyx_L0;
12588
12589
/* "cysignals/memory.pxd":40
12590
*
12591
*
12592
* cdef inline void* sig_malloc "sig_malloc"(size_t n) nogil: # <<<<<<<<<<<<<<
12593
* sig_block()
12594
* cdef void* ret = malloc(n)
12595
*/
12596
12597
/* function exit code */
12598
__pyx_L0:;
12599
return __pyx_r;
12600
}
12601
12602
/* "cysignals/memory.pxd":47
12603
*
12604
*
12605
* cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) nogil: # <<<<<<<<<<<<<<
12606
* sig_block()
12607
* cdef void* ret = realloc(ptr, size)
12608
*/
12609
12610
static CYTHON_INLINE void *sig_realloc(void *__pyx_v_ptr, size_t __pyx_v_size) {
12611
void *__pyx_v_ret;
12612
void *__pyx_r;
12613
12614
/* "cysignals/memory.pxd":48
12615
*
12616
* cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) nogil:
12617
* sig_block() # <<<<<<<<<<<<<<
12618
* cdef void* ret = realloc(ptr, size)
12619
* sig_unblock()
12620
*/
12621
sig_block();
12622
12623
/* "cysignals/memory.pxd":49
12624
* cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) nogil:
12625
* sig_block()
12626
* cdef void* ret = realloc(ptr, size) # <<<<<<<<<<<<<<
12627
* sig_unblock()
12628
* return ret
12629
*/
12630
__pyx_v_ret = realloc(__pyx_v_ptr, __pyx_v_size);
12631
12632
/* "cysignals/memory.pxd":50
12633
* sig_block()
12634
* cdef void* ret = realloc(ptr, size)
12635
* sig_unblock() # <<<<<<<<<<<<<<
12636
* return ret
12637
*
12638
*/
12639
sig_unblock();
12640
12641
/* "cysignals/memory.pxd":51
12642
* cdef void* ret = realloc(ptr, size)
12643
* sig_unblock()
12644
* return ret # <<<<<<<<<<<<<<
12645
*
12646
*
12647
*/
12648
__pyx_r = __pyx_v_ret;
12649
goto __pyx_L0;
12650
12651
/* "cysignals/memory.pxd":47
12652
*
12653
*
12654
* cdef inline void* sig_realloc "sig_realloc"(void* ptr, size_t size) nogil: # <<<<<<<<<<<<<<
12655
* sig_block()
12656
* cdef void* ret = realloc(ptr, size)
12657
*/
12658
12659
/* function exit code */
12660
__pyx_L0:;
12661
return __pyx_r;
12662
}
12663
12664
/* "cysignals/memory.pxd":54
12665
*
12666
*
12667
* cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) nogil: # <<<<<<<<<<<<<<
12668
* sig_block()
12669
* cdef void* ret = calloc(nmemb, size)
12670
*/
12671
12672
static CYTHON_INLINE void *sig_calloc(size_t __pyx_v_nmemb, size_t __pyx_v_size) {
12673
void *__pyx_v_ret;
12674
void *__pyx_r;
12675
12676
/* "cysignals/memory.pxd":55
12677
*
12678
* cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) nogil:
12679
* sig_block() # <<<<<<<<<<<<<<
12680
* cdef void* ret = calloc(nmemb, size)
12681
* sig_unblock()
12682
*/
12683
sig_block();
12684
12685
/* "cysignals/memory.pxd":56
12686
* cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) nogil:
12687
* sig_block()
12688
* cdef void* ret = calloc(nmemb, size) # <<<<<<<<<<<<<<
12689
* sig_unblock()
12690
* return ret
12691
*/
12692
__pyx_v_ret = calloc(__pyx_v_nmemb, __pyx_v_size);
12693
12694
/* "cysignals/memory.pxd":57
12695
* sig_block()
12696
* cdef void* ret = calloc(nmemb, size)
12697
* sig_unblock() # <<<<<<<<<<<<<<
12698
* return ret
12699
*
12700
*/
12701
sig_unblock();
12702
12703
/* "cysignals/memory.pxd":58
12704
* cdef void* ret = calloc(nmemb, size)
12705
* sig_unblock()
12706
* return ret # <<<<<<<<<<<<<<
12707
*
12708
*
12709
*/
12710
__pyx_r = __pyx_v_ret;
12711
goto __pyx_L0;
12712
12713
/* "cysignals/memory.pxd":54
12714
*
12715
*
12716
* cdef inline void* sig_calloc "sig_calloc"(size_t nmemb, size_t size) nogil: # <<<<<<<<<<<<<<
12717
* sig_block()
12718
* cdef void* ret = calloc(nmemb, size)
12719
*/
12720
12721
/* function exit code */
12722
__pyx_L0:;
12723
return __pyx_r;
12724
}
12725
12726
/* "cysignals/memory.pxd":61
12727
*
12728
*
12729
* cdef inline void sig_free "sig_free"(void* ptr) nogil: # <<<<<<<<<<<<<<
12730
* sig_block()
12731
* free(ptr)
12732
*/
12733
12734
static CYTHON_INLINE void sig_free(void *__pyx_v_ptr) {
12735
12736
/* "cysignals/memory.pxd":62
12737
*
12738
* cdef inline void sig_free "sig_free"(void* ptr) nogil:
12739
* sig_block() # <<<<<<<<<<<<<<
12740
* free(ptr)
12741
* sig_unblock()
12742
*/
12743
sig_block();
12744
12745
/* "cysignals/memory.pxd":63
12746
* cdef inline void sig_free "sig_free"(void* ptr) nogil:
12747
* sig_block()
12748
* free(ptr) # <<<<<<<<<<<<<<
12749
* sig_unblock()
12750
*
12751
*/
12752
free(__pyx_v_ptr);
12753
12754
/* "cysignals/memory.pxd":64
12755
* sig_block()
12756
* free(ptr)
12757
* sig_unblock() # <<<<<<<<<<<<<<
12758
*
12759
*
12760
*/
12761
sig_unblock();
12762
12763
/* "cysignals/memory.pxd":61
12764
*
12765
*
12766
* cdef inline void sig_free "sig_free"(void* ptr) nogil: # <<<<<<<<<<<<<<
12767
* sig_block()
12768
* free(ptr)
12769
*/
12770
12771
/* function exit code */
12772
}
12773
12774
/* "cysignals/memory.pxd":68
12775
*
12776
* @cython.cdivision(True)
12777
* cdef inline size_t mul_overflowcheck(size_t a, size_t b) nogil: # <<<<<<<<<<<<<<
12778
* """
12779
* Return a*b, checking for overflow. Assume that a > 0.
12780
*/
12781
12782
static CYTHON_INLINE size_t __pyx_f_9cysignals_6memory_mul_overflowcheck(size_t __pyx_v_a, size_t __pyx_v_b) {
12783
size_t __pyx_v_MUL_NO_OVERFLOW;
12784
size_t __pyx_r;
12785
int __pyx_t_1;
12786
int __pyx_t_2;
12787
12788
/* "cysignals/memory.pxd":75
12789
* """
12790
* # If a and b both less than MUL_NO_OVERFLOW, no overflow can occur
12791
* cdef size_t MUL_NO_OVERFLOW = ((<size_t>1) << (4*sizeof(size_t))) # <<<<<<<<<<<<<<
12792
* if a >= MUL_NO_OVERFLOW or b >= MUL_NO_OVERFLOW:
12793
* if unlikely(b > (<size_t>-1) // a):
12794
*/
12795
__pyx_v_MUL_NO_OVERFLOW = (((size_t)1) << (4 * (sizeof(size_t))));
12796
12797
/* "cysignals/memory.pxd":76
12798
* # If a and b both less than MUL_NO_OVERFLOW, no overflow can occur
12799
* cdef size_t MUL_NO_OVERFLOW = ((<size_t>1) << (4*sizeof(size_t)))
12800
* if a >= MUL_NO_OVERFLOW or b >= MUL_NO_OVERFLOW: # <<<<<<<<<<<<<<
12801
* if unlikely(b > (<size_t>-1) // a):
12802
* return <size_t>(-1)
12803
*/
12804
__pyx_t_2 = ((__pyx_v_a >= __pyx_v_MUL_NO_OVERFLOW) != 0);
12805
if (!__pyx_t_2) {
12806
} else {
12807
__pyx_t_1 = __pyx_t_2;
12808
goto __pyx_L4_bool_binop_done;
12809
}
12810
__pyx_t_2 = ((__pyx_v_b >= __pyx_v_MUL_NO_OVERFLOW) != 0);
12811
__pyx_t_1 = __pyx_t_2;
12812
__pyx_L4_bool_binop_done:;
12813
if (__pyx_t_1) {
12814
12815
/* "cysignals/memory.pxd":77
12816
* cdef size_t MUL_NO_OVERFLOW = ((<size_t>1) << (4*sizeof(size_t)))
12817
* if a >= MUL_NO_OVERFLOW or b >= MUL_NO_OVERFLOW:
12818
* if unlikely(b > (<size_t>-1) // a): # <<<<<<<<<<<<<<
12819
* return <size_t>(-1)
12820
* return a*b
12821
*/
12822
__pyx_t_1 = (unlikely((__pyx_v_b > (((size_t)-1L) / __pyx_v_a))) != 0);
12823
if (__pyx_t_1) {
12824
12825
/* "cysignals/memory.pxd":78
12826
* if a >= MUL_NO_OVERFLOW or b >= MUL_NO_OVERFLOW:
12827
* if unlikely(b > (<size_t>-1) // a):
12828
* return <size_t>(-1) # <<<<<<<<<<<<<<
12829
* return a*b
12830
*
12831
*/
12832
__pyx_r = ((size_t)-1L);
12833
goto __pyx_L0;
12834
12835
/* "cysignals/memory.pxd":77
12836
* cdef size_t MUL_NO_OVERFLOW = ((<size_t>1) << (4*sizeof(size_t)))
12837
* if a >= MUL_NO_OVERFLOW or b >= MUL_NO_OVERFLOW:
12838
* if unlikely(b > (<size_t>-1) // a): # <<<<<<<<<<<<<<
12839
* return <size_t>(-1)
12840
* return a*b
12841
*/
12842
}
12843
12844
/* "cysignals/memory.pxd":76
12845
* # If a and b both less than MUL_NO_OVERFLOW, no overflow can occur
12846
* cdef size_t MUL_NO_OVERFLOW = ((<size_t>1) << (4*sizeof(size_t)))
12847
* if a >= MUL_NO_OVERFLOW or b >= MUL_NO_OVERFLOW: # <<<<<<<<<<<<<<
12848
* if unlikely(b > (<size_t>-1) // a):
12849
* return <size_t>(-1)
12850
*/
12851
}
12852
12853
/* "cysignals/memory.pxd":79
12854
* if unlikely(b > (<size_t>-1) // a):
12855
* return <size_t>(-1)
12856
* return a*b # <<<<<<<<<<<<<<
12857
*
12858
*
12859
*/
12860
__pyx_r = (__pyx_v_a * __pyx_v_b);
12861
goto __pyx_L0;
12862
12863
/* "cysignals/memory.pxd":68
12864
*
12865
* @cython.cdivision(True)
12866
* cdef inline size_t mul_overflowcheck(size_t a, size_t b) nogil: # <<<<<<<<<<<<<<
12867
* """
12868
* Return a*b, checking for overflow. Assume that a > 0.
12869
*/
12870
12871
/* function exit code */
12872
__pyx_L0:;
12873
return __pyx_r;
12874
}
12875
12876
/* "cysignals/memory.pxd":82
12877
*
12878
*
12879
* cdef inline void* check_allocarray(size_t nmemb, size_t size) except? NULL: # <<<<<<<<<<<<<<
12880
* """
12881
* Allocate memory for ``nmemb`` elements of size ``size``.
12882
*/
12883
12884
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_allocarray(size_t __pyx_v_nmemb, size_t __pyx_v_size) {
12885
size_t __pyx_v_n;
12886
void *__pyx_v_ret;
12887
void *__pyx_r;
12888
__Pyx_RefNannyDeclarations
12889
int __pyx_t_1;
12890
PyObject *__pyx_t_2 = NULL;
12891
PyObject *__pyx_t_3 = NULL;
12892
PyObject *__pyx_t_4 = NULL;
12893
__Pyx_RefNannySetupContext("check_allocarray", 0);
12894
12895
/* "cysignals/memory.pxd":86
12896
* Allocate memory for ``nmemb`` elements of size ``size``.
12897
* """
12898
* if nmemb == 0: # <<<<<<<<<<<<<<
12899
* return NULL
12900
* cdef size_t n = mul_overflowcheck(nmemb, size)
12901
*/
12902
__pyx_t_1 = ((__pyx_v_nmemb == 0) != 0);
12903
if (__pyx_t_1) {
12904
12905
/* "cysignals/memory.pxd":87
12906
* """
12907
* if nmemb == 0:
12908
* return NULL # <<<<<<<<<<<<<<
12909
* cdef size_t n = mul_overflowcheck(nmemb, size)
12910
* cdef void* ret = sig_malloc(n)
12911
*/
12912
__pyx_r = NULL;
12913
goto __pyx_L0;
12914
12915
/* "cysignals/memory.pxd":86
12916
* Allocate memory for ``nmemb`` elements of size ``size``.
12917
* """
12918
* if nmemb == 0: # <<<<<<<<<<<<<<
12919
* return NULL
12920
* cdef size_t n = mul_overflowcheck(nmemb, size)
12921
*/
12922
}
12923
12924
/* "cysignals/memory.pxd":88
12925
* if nmemb == 0:
12926
* return NULL
12927
* cdef size_t n = mul_overflowcheck(nmemb, size) # <<<<<<<<<<<<<<
12928
* cdef void* ret = sig_malloc(n)
12929
* if unlikely(ret == NULL):
12930
*/
12931
__pyx_v_n = __pyx_f_9cysignals_6memory_mul_overflowcheck(__pyx_v_nmemb, __pyx_v_size);
12932
12933
/* "cysignals/memory.pxd":89
12934
* return NULL
12935
* cdef size_t n = mul_overflowcheck(nmemb, size)
12936
* cdef void* ret = sig_malloc(n) # <<<<<<<<<<<<<<
12937
* if unlikely(ret == NULL):
12938
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
12939
*/
12940
__pyx_v_ret = sig_malloc(__pyx_v_n);
12941
12942
/* "cysignals/memory.pxd":90
12943
* cdef size_t n = mul_overflowcheck(nmemb, size)
12944
* cdef void* ret = sig_malloc(n)
12945
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
12946
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
12947
* return ret
12948
*/
12949
__pyx_t_1 = (unlikely((__pyx_v_ret == NULL)) != 0);
12950
if (__pyx_t_1) {
12951
12952
/* "cysignals/memory.pxd":91
12953
* cdef void* ret = sig_malloc(n)
12954
* if unlikely(ret == NULL):
12955
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size)) # <<<<<<<<<<<<<<
12956
* return ret
12957
*
12958
*/
12959
__pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nmemb); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 91, __pyx_L1_error)
12960
__Pyx_GOTREF(__pyx_t_2);
12961
__pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 91, __pyx_L1_error)
12962
__Pyx_GOTREF(__pyx_t_3);
12963
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 91, __pyx_L1_error)
12964
__Pyx_GOTREF(__pyx_t_4);
12965
__Pyx_GIVEREF(__pyx_t_2);
12966
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
12967
__Pyx_GIVEREF(__pyx_t_3);
12968
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
12969
__pyx_t_2 = 0;
12970
__pyx_t_3 = 0;
12971
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_allocate_s_s_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 91, __pyx_L1_error)
12972
__Pyx_GOTREF(__pyx_t_3);
12973
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12974
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 91, __pyx_L1_error)
12975
__Pyx_GOTREF(__pyx_t_4);
12976
__Pyx_GIVEREF(__pyx_t_3);
12977
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
12978
__pyx_t_3 = 0;
12979
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 91, __pyx_L1_error)
12980
__Pyx_GOTREF(__pyx_t_3);
12981
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12982
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
12983
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12984
__PYX_ERR(2, 91, __pyx_L1_error)
12985
12986
/* "cysignals/memory.pxd":90
12987
* cdef size_t n = mul_overflowcheck(nmemb, size)
12988
* cdef void* ret = sig_malloc(n)
12989
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
12990
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
12991
* return ret
12992
*/
12993
}
12994
12995
/* "cysignals/memory.pxd":92
12996
* if unlikely(ret == NULL):
12997
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
12998
* return ret # <<<<<<<<<<<<<<
12999
*
13000
*
13001
*/
13002
__pyx_r = __pyx_v_ret;
13003
goto __pyx_L0;
13004
13005
/* "cysignals/memory.pxd":82
13006
*
13007
*
13008
* cdef inline void* check_allocarray(size_t nmemb, size_t size) except? NULL: # <<<<<<<<<<<<<<
13009
* """
13010
* Allocate memory for ``nmemb`` elements of size ``size``.
13011
*/
13012
13013
/* function exit code */
13014
__pyx_L1_error:;
13015
__Pyx_XDECREF(__pyx_t_2);
13016
__Pyx_XDECREF(__pyx_t_3);
13017
__Pyx_XDECREF(__pyx_t_4);
13018
__Pyx_AddTraceback("cysignals.memory.check_allocarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
13019
__pyx_r = NULL;
13020
__pyx_L0:;
13021
__Pyx_RefNannyFinishContext();
13022
return __pyx_r;
13023
}
13024
13025
/* "cysignals/memory.pxd":95
13026
*
13027
*
13028
* cdef inline void* check_reallocarray(void* ptr, size_t nmemb, size_t size) except? NULL: # <<<<<<<<<<<<<<
13029
* """
13030
* Re-allocate memory at ``ptr`` to hold ``nmemb`` elements of size
13031
*/
13032
13033
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_reallocarray(void *__pyx_v_ptr, size_t __pyx_v_nmemb, size_t __pyx_v_size) {
13034
size_t __pyx_v_n;
13035
void *__pyx_v_ret;
13036
void *__pyx_r;
13037
__Pyx_RefNannyDeclarations
13038
int __pyx_t_1;
13039
PyObject *__pyx_t_2 = NULL;
13040
PyObject *__pyx_t_3 = NULL;
13041
PyObject *__pyx_t_4 = NULL;
13042
__Pyx_RefNannySetupContext("check_reallocarray", 0);
13043
13044
/* "cysignals/memory.pxd":103
13045
* When ``nmemb`` equals 0, then free the memory at ``ptr``.
13046
* """
13047
* if nmemb == 0: # <<<<<<<<<<<<<<
13048
* sig_free(ptr)
13049
* return NULL
13050
*/
13051
__pyx_t_1 = ((__pyx_v_nmemb == 0) != 0);
13052
if (__pyx_t_1) {
13053
13054
/* "cysignals/memory.pxd":104
13055
* """
13056
* if nmemb == 0:
13057
* sig_free(ptr) # <<<<<<<<<<<<<<
13058
* return NULL
13059
* cdef size_t n = mul_overflowcheck(nmemb, size)
13060
*/
13061
sig_free(__pyx_v_ptr);
13062
13063
/* "cysignals/memory.pxd":105
13064
* if nmemb == 0:
13065
* sig_free(ptr)
13066
* return NULL # <<<<<<<<<<<<<<
13067
* cdef size_t n = mul_overflowcheck(nmemb, size)
13068
* cdef void* ret = sig_realloc(ptr, n)
13069
*/
13070
__pyx_r = NULL;
13071
goto __pyx_L0;
13072
13073
/* "cysignals/memory.pxd":103
13074
* When ``nmemb`` equals 0, then free the memory at ``ptr``.
13075
* """
13076
* if nmemb == 0: # <<<<<<<<<<<<<<
13077
* sig_free(ptr)
13078
* return NULL
13079
*/
13080
}
13081
13082
/* "cysignals/memory.pxd":106
13083
* sig_free(ptr)
13084
* return NULL
13085
* cdef size_t n = mul_overflowcheck(nmemb, size) # <<<<<<<<<<<<<<
13086
* cdef void* ret = sig_realloc(ptr, n)
13087
* if unlikely(ret == NULL):
13088
*/
13089
__pyx_v_n = __pyx_f_9cysignals_6memory_mul_overflowcheck(__pyx_v_nmemb, __pyx_v_size);
13090
13091
/* "cysignals/memory.pxd":107
13092
* return NULL
13093
* cdef size_t n = mul_overflowcheck(nmemb, size)
13094
* cdef void* ret = sig_realloc(ptr, n) # <<<<<<<<<<<<<<
13095
* if unlikely(ret == NULL):
13096
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13097
*/
13098
__pyx_v_ret = sig_realloc(__pyx_v_ptr, __pyx_v_n);
13099
13100
/* "cysignals/memory.pxd":108
13101
* cdef size_t n = mul_overflowcheck(nmemb, size)
13102
* cdef void* ret = sig_realloc(ptr, n)
13103
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13104
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13105
* return ret
13106
*/
13107
__pyx_t_1 = (unlikely((__pyx_v_ret == NULL)) != 0);
13108
if (__pyx_t_1) {
13109
13110
/* "cysignals/memory.pxd":109
13111
* cdef void* ret = sig_realloc(ptr, n)
13112
* if unlikely(ret == NULL):
13113
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size)) # <<<<<<<<<<<<<<
13114
* return ret
13115
*
13116
*/
13117
__pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nmemb); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 109, __pyx_L1_error)
13118
__Pyx_GOTREF(__pyx_t_2);
13119
__pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 109, __pyx_L1_error)
13120
__Pyx_GOTREF(__pyx_t_3);
13121
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 109, __pyx_L1_error)
13122
__Pyx_GOTREF(__pyx_t_4);
13123
__Pyx_GIVEREF(__pyx_t_2);
13124
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
13125
__Pyx_GIVEREF(__pyx_t_3);
13126
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
13127
__pyx_t_2 = 0;
13128
__pyx_t_3 = 0;
13129
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_allocate_s_s_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 109, __pyx_L1_error)
13130
__Pyx_GOTREF(__pyx_t_3);
13131
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13132
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 109, __pyx_L1_error)
13133
__Pyx_GOTREF(__pyx_t_4);
13134
__Pyx_GIVEREF(__pyx_t_3);
13135
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
13136
__pyx_t_3 = 0;
13137
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 109, __pyx_L1_error)
13138
__Pyx_GOTREF(__pyx_t_3);
13139
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13140
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
13141
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13142
__PYX_ERR(2, 109, __pyx_L1_error)
13143
13144
/* "cysignals/memory.pxd":108
13145
* cdef size_t n = mul_overflowcheck(nmemb, size)
13146
* cdef void* ret = sig_realloc(ptr, n)
13147
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13148
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13149
* return ret
13150
*/
13151
}
13152
13153
/* "cysignals/memory.pxd":110
13154
* if unlikely(ret == NULL):
13155
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13156
* return ret # <<<<<<<<<<<<<<
13157
*
13158
*
13159
*/
13160
__pyx_r = __pyx_v_ret;
13161
goto __pyx_L0;
13162
13163
/* "cysignals/memory.pxd":95
13164
*
13165
*
13166
* cdef inline void* check_reallocarray(void* ptr, size_t nmemb, size_t size) except? NULL: # <<<<<<<<<<<<<<
13167
* """
13168
* Re-allocate memory at ``ptr`` to hold ``nmemb`` elements of size
13169
*/
13170
13171
/* function exit code */
13172
__pyx_L1_error:;
13173
__Pyx_XDECREF(__pyx_t_2);
13174
__Pyx_XDECREF(__pyx_t_3);
13175
__Pyx_XDECREF(__pyx_t_4);
13176
__Pyx_AddTraceback("cysignals.memory.check_reallocarray", __pyx_clineno, __pyx_lineno, __pyx_filename);
13177
__pyx_r = NULL;
13178
__pyx_L0:;
13179
__Pyx_RefNannyFinishContext();
13180
return __pyx_r;
13181
}
13182
13183
/* "cysignals/memory.pxd":113
13184
*
13185
*
13186
* cdef inline void* check_malloc(size_t n) except? NULL: # <<<<<<<<<<<<<<
13187
* """
13188
* Allocate ``n`` bytes of memory.
13189
*/
13190
13191
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_malloc(size_t __pyx_v_n) {
13192
void *__pyx_v_ret;
13193
void *__pyx_r;
13194
__Pyx_RefNannyDeclarations
13195
int __pyx_t_1;
13196
PyObject *__pyx_t_2 = NULL;
13197
PyObject *__pyx_t_3 = NULL;
13198
__Pyx_RefNannySetupContext("check_malloc", 0);
13199
13200
/* "cysignals/memory.pxd":117
13201
* Allocate ``n`` bytes of memory.
13202
* """
13203
* if n == 0: # <<<<<<<<<<<<<<
13204
* return NULL
13205
* cdef void* ret = sig_malloc(n)
13206
*/
13207
__pyx_t_1 = ((__pyx_v_n == 0) != 0);
13208
if (__pyx_t_1) {
13209
13210
/* "cysignals/memory.pxd":118
13211
* """
13212
* if n == 0:
13213
* return NULL # <<<<<<<<<<<<<<
13214
* cdef void* ret = sig_malloc(n)
13215
* if unlikely(ret == NULL):
13216
*/
13217
__pyx_r = NULL;
13218
goto __pyx_L0;
13219
13220
/* "cysignals/memory.pxd":117
13221
* Allocate ``n`` bytes of memory.
13222
* """
13223
* if n == 0: # <<<<<<<<<<<<<<
13224
* return NULL
13225
* cdef void* ret = sig_malloc(n)
13226
*/
13227
}
13228
13229
/* "cysignals/memory.pxd":119
13230
* if n == 0:
13231
* return NULL
13232
* cdef void* ret = sig_malloc(n) # <<<<<<<<<<<<<<
13233
* if unlikely(ret == NULL):
13234
* raise MemoryError("failed to allocate %s bytes" % n)
13235
*/
13236
__pyx_v_ret = sig_malloc(__pyx_v_n);
13237
13238
/* "cysignals/memory.pxd":120
13239
* return NULL
13240
* cdef void* ret = sig_malloc(n)
13241
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13242
* raise MemoryError("failed to allocate %s bytes" % n)
13243
* return ret
13244
*/
13245
__pyx_t_1 = (unlikely((__pyx_v_ret == NULL)) != 0);
13246
if (__pyx_t_1) {
13247
13248
/* "cysignals/memory.pxd":121
13249
* cdef void* ret = sig_malloc(n)
13250
* if unlikely(ret == NULL):
13251
* raise MemoryError("failed to allocate %s bytes" % n) # <<<<<<<<<<<<<<
13252
* return ret
13253
*
13254
*/
13255
__pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 121, __pyx_L1_error)
13256
__Pyx_GOTREF(__pyx_t_2);
13257
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_allocate_s_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 121, __pyx_L1_error)
13258
__Pyx_GOTREF(__pyx_t_3);
13259
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13260
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 121, __pyx_L1_error)
13261
__Pyx_GOTREF(__pyx_t_2);
13262
__Pyx_GIVEREF(__pyx_t_3);
13263
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
13264
__pyx_t_3 = 0;
13265
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 121, __pyx_L1_error)
13266
__Pyx_GOTREF(__pyx_t_3);
13267
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13268
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
13269
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13270
__PYX_ERR(2, 121, __pyx_L1_error)
13271
13272
/* "cysignals/memory.pxd":120
13273
* return NULL
13274
* cdef void* ret = sig_malloc(n)
13275
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13276
* raise MemoryError("failed to allocate %s bytes" % n)
13277
* return ret
13278
*/
13279
}
13280
13281
/* "cysignals/memory.pxd":122
13282
* if unlikely(ret == NULL):
13283
* raise MemoryError("failed to allocate %s bytes" % n)
13284
* return ret # <<<<<<<<<<<<<<
13285
*
13286
*
13287
*/
13288
__pyx_r = __pyx_v_ret;
13289
goto __pyx_L0;
13290
13291
/* "cysignals/memory.pxd":113
13292
*
13293
*
13294
* cdef inline void* check_malloc(size_t n) except? NULL: # <<<<<<<<<<<<<<
13295
* """
13296
* Allocate ``n`` bytes of memory.
13297
*/
13298
13299
/* function exit code */
13300
__pyx_L1_error:;
13301
__Pyx_XDECREF(__pyx_t_2);
13302
__Pyx_XDECREF(__pyx_t_3);
13303
__Pyx_AddTraceback("cysignals.memory.check_malloc", __pyx_clineno, __pyx_lineno, __pyx_filename);
13304
__pyx_r = NULL;
13305
__pyx_L0:;
13306
__Pyx_RefNannyFinishContext();
13307
return __pyx_r;
13308
}
13309
13310
/* "cysignals/memory.pxd":125
13311
*
13312
*
13313
* cdef inline void* check_realloc(void* ptr, size_t n) except? NULL: # <<<<<<<<<<<<<<
13314
* """
13315
* Re-allocate memory at ``ptr`` to hold ``n`` bytes.
13316
*/
13317
13318
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_realloc(void *__pyx_v_ptr, size_t __pyx_v_n) {
13319
void *__pyx_v_ret;
13320
void *__pyx_r;
13321
__Pyx_RefNannyDeclarations
13322
int __pyx_t_1;
13323
PyObject *__pyx_t_2 = NULL;
13324
PyObject *__pyx_t_3 = NULL;
13325
__Pyx_RefNannySetupContext("check_realloc", 0);
13326
13327
/* "cysignals/memory.pxd":130
13328
* If ``ptr`` equals ``NULL``, this behaves as ``check_malloc``.
13329
* """
13330
* if n == 0: # <<<<<<<<<<<<<<
13331
* sig_free(ptr)
13332
* return NULL
13333
*/
13334
__pyx_t_1 = ((__pyx_v_n == 0) != 0);
13335
if (__pyx_t_1) {
13336
13337
/* "cysignals/memory.pxd":131
13338
* """
13339
* if n == 0:
13340
* sig_free(ptr) # <<<<<<<<<<<<<<
13341
* return NULL
13342
* cdef void* ret = sig_realloc(ptr, n)
13343
*/
13344
sig_free(__pyx_v_ptr);
13345
13346
/* "cysignals/memory.pxd":132
13347
* if n == 0:
13348
* sig_free(ptr)
13349
* return NULL # <<<<<<<<<<<<<<
13350
* cdef void* ret = sig_realloc(ptr, n)
13351
* if unlikely(ret == NULL):
13352
*/
13353
__pyx_r = NULL;
13354
goto __pyx_L0;
13355
13356
/* "cysignals/memory.pxd":130
13357
* If ``ptr`` equals ``NULL``, this behaves as ``check_malloc``.
13358
* """
13359
* if n == 0: # <<<<<<<<<<<<<<
13360
* sig_free(ptr)
13361
* return NULL
13362
*/
13363
}
13364
13365
/* "cysignals/memory.pxd":133
13366
* sig_free(ptr)
13367
* return NULL
13368
* cdef void* ret = sig_realloc(ptr, n) # <<<<<<<<<<<<<<
13369
* if unlikely(ret == NULL):
13370
* raise MemoryError("failed to allocate %s bytes" % n)
13371
*/
13372
__pyx_v_ret = sig_realloc(__pyx_v_ptr, __pyx_v_n);
13373
13374
/* "cysignals/memory.pxd":134
13375
* return NULL
13376
* cdef void* ret = sig_realloc(ptr, n)
13377
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13378
* raise MemoryError("failed to allocate %s bytes" % n)
13379
* return ret
13380
*/
13381
__pyx_t_1 = (unlikely((__pyx_v_ret == NULL)) != 0);
13382
if (__pyx_t_1) {
13383
13384
/* "cysignals/memory.pxd":135
13385
* cdef void* ret = sig_realloc(ptr, n)
13386
* if unlikely(ret == NULL):
13387
* raise MemoryError("failed to allocate %s bytes" % n) # <<<<<<<<<<<<<<
13388
* return ret
13389
*
13390
*/
13391
__pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_n); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 135, __pyx_L1_error)
13392
__Pyx_GOTREF(__pyx_t_2);
13393
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_allocate_s_bytes, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error)
13394
__Pyx_GOTREF(__pyx_t_3);
13395
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13396
__pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 135, __pyx_L1_error)
13397
__Pyx_GOTREF(__pyx_t_2);
13398
__Pyx_GIVEREF(__pyx_t_3);
13399
PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_3);
13400
__pyx_t_3 = 0;
13401
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_2, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 135, __pyx_L1_error)
13402
__Pyx_GOTREF(__pyx_t_3);
13403
__Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13404
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
13405
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13406
__PYX_ERR(2, 135, __pyx_L1_error)
13407
13408
/* "cysignals/memory.pxd":134
13409
* return NULL
13410
* cdef void* ret = sig_realloc(ptr, n)
13411
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13412
* raise MemoryError("failed to allocate %s bytes" % n)
13413
* return ret
13414
*/
13415
}
13416
13417
/* "cysignals/memory.pxd":136
13418
* if unlikely(ret == NULL):
13419
* raise MemoryError("failed to allocate %s bytes" % n)
13420
* return ret # <<<<<<<<<<<<<<
13421
*
13422
*
13423
*/
13424
__pyx_r = __pyx_v_ret;
13425
goto __pyx_L0;
13426
13427
/* "cysignals/memory.pxd":125
13428
*
13429
*
13430
* cdef inline void* check_realloc(void* ptr, size_t n) except? NULL: # <<<<<<<<<<<<<<
13431
* """
13432
* Re-allocate memory at ``ptr`` to hold ``n`` bytes.
13433
*/
13434
13435
/* function exit code */
13436
__pyx_L1_error:;
13437
__Pyx_XDECREF(__pyx_t_2);
13438
__Pyx_XDECREF(__pyx_t_3);
13439
__Pyx_AddTraceback("cysignals.memory.check_realloc", __pyx_clineno, __pyx_lineno, __pyx_filename);
13440
__pyx_r = NULL;
13441
__pyx_L0:;
13442
__Pyx_RefNannyFinishContext();
13443
return __pyx_r;
13444
}
13445
13446
/* "cysignals/memory.pxd":139
13447
*
13448
*
13449
* cdef inline void* check_calloc(size_t nmemb, size_t size) except? NULL: # <<<<<<<<<<<<<<
13450
* """
13451
* Allocate memory for ``nmemb`` elements of size ``size``. The
13452
*/
13453
13454
static CYTHON_INLINE void *__pyx_f_9cysignals_6memory_check_calloc(size_t __pyx_v_nmemb, size_t __pyx_v_size) {
13455
void *__pyx_v_ret;
13456
void *__pyx_r;
13457
__Pyx_RefNannyDeclarations
13458
int __pyx_t_1;
13459
PyObject *__pyx_t_2 = NULL;
13460
PyObject *__pyx_t_3 = NULL;
13461
PyObject *__pyx_t_4 = NULL;
13462
__Pyx_RefNannySetupContext("check_calloc", 0);
13463
13464
/* "cysignals/memory.pxd":144
13465
* resulting memory is zeroed.
13466
* """
13467
* if nmemb == 0: # <<<<<<<<<<<<<<
13468
* return NULL
13469
* cdef void* ret = sig_calloc(nmemb, size)
13470
*/
13471
__pyx_t_1 = ((__pyx_v_nmemb == 0) != 0);
13472
if (__pyx_t_1) {
13473
13474
/* "cysignals/memory.pxd":145
13475
* """
13476
* if nmemb == 0:
13477
* return NULL # <<<<<<<<<<<<<<
13478
* cdef void* ret = sig_calloc(nmemb, size)
13479
* if unlikely(ret == NULL):
13480
*/
13481
__pyx_r = NULL;
13482
goto __pyx_L0;
13483
13484
/* "cysignals/memory.pxd":144
13485
* resulting memory is zeroed.
13486
* """
13487
* if nmemb == 0: # <<<<<<<<<<<<<<
13488
* return NULL
13489
* cdef void* ret = sig_calloc(nmemb, size)
13490
*/
13491
}
13492
13493
/* "cysignals/memory.pxd":146
13494
* if nmemb == 0:
13495
* return NULL
13496
* cdef void* ret = sig_calloc(nmemb, size) # <<<<<<<<<<<<<<
13497
* if unlikely(ret == NULL):
13498
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13499
*/
13500
__pyx_v_ret = sig_calloc(__pyx_v_nmemb, __pyx_v_size);
13501
13502
/* "cysignals/memory.pxd":147
13503
* return NULL
13504
* cdef void* ret = sig_calloc(nmemb, size)
13505
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13506
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13507
* return ret
13508
*/
13509
__pyx_t_1 = (unlikely((__pyx_v_ret == NULL)) != 0);
13510
if (__pyx_t_1) {
13511
13512
/* "cysignals/memory.pxd":148
13513
* cdef void* ret = sig_calloc(nmemb, size)
13514
* if unlikely(ret == NULL):
13515
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size)) # <<<<<<<<<<<<<<
13516
* return ret
13517
*/
13518
__pyx_t_2 = __Pyx_PyInt_FromSize_t(__pyx_v_nmemb); if (unlikely(!__pyx_t_2)) __PYX_ERR(2, 148, __pyx_L1_error)
13519
__Pyx_GOTREF(__pyx_t_2);
13520
__pyx_t_3 = __Pyx_PyInt_FromSize_t(__pyx_v_size); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
13521
__Pyx_GOTREF(__pyx_t_3);
13522
__pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 148, __pyx_L1_error)
13523
__Pyx_GOTREF(__pyx_t_4);
13524
__Pyx_GIVEREF(__pyx_t_2);
13525
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_2);
13526
__Pyx_GIVEREF(__pyx_t_3);
13527
PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_3);
13528
__pyx_t_2 = 0;
13529
__pyx_t_3 = 0;
13530
__pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_failed_to_allocate_s_s_bytes, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
13531
__Pyx_GOTREF(__pyx_t_3);
13532
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13533
__pyx_t_4 = PyTuple_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(2, 148, __pyx_L1_error)
13534
__Pyx_GOTREF(__pyx_t_4);
13535
__Pyx_GIVEREF(__pyx_t_3);
13536
PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_3);
13537
__pyx_t_3 = 0;
13538
__pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(2, 148, __pyx_L1_error)
13539
__Pyx_GOTREF(__pyx_t_3);
13540
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
13541
__Pyx_Raise(__pyx_t_3, 0, 0, 0);
13542
__Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13543
__PYX_ERR(2, 148, __pyx_L1_error)
13544
13545
/* "cysignals/memory.pxd":147
13546
* return NULL
13547
* cdef void* ret = sig_calloc(nmemb, size)
13548
* if unlikely(ret == NULL): # <<<<<<<<<<<<<<
13549
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13550
* return ret
13551
*/
13552
}
13553
13554
/* "cysignals/memory.pxd":149
13555
* if unlikely(ret == NULL):
13556
* raise MemoryError("failed to allocate %s * %s bytes" % (nmemb, size))
13557
* return ret # <<<<<<<<<<<<<<
13558
*/
13559
__pyx_r = __pyx_v_ret;
13560
goto __pyx_L0;
13561
13562
/* "cysignals/memory.pxd":139
13563
*
13564
*
13565
* cdef inline void* check_calloc(size_t nmemb, size_t size) except? NULL: # <<<<<<<<<<<<<<
13566
* """
13567
* Allocate memory for ``nmemb`` elements of size ``size``. The
13568
*/
13569
13570
/* function exit code */
13571
__pyx_L1_error:;
13572
__Pyx_XDECREF(__pyx_t_2);
13573
__Pyx_XDECREF(__pyx_t_3);
13574
__Pyx_XDECREF(__pyx_t_4);
13575
__Pyx_AddTraceback("cysignals.memory.check_calloc", __pyx_clineno, __pyx_lineno, __pyx_filename);
13576
__pyx_r = NULL;
13577
__pyx_L0:;
13578
__Pyx_RefNannyFinishContext();
13579
return __pyx_r;
13580
}
13581
13582
/* "parent.pxd":23
13583
* # Flags, see below
13584
* cdef int flags
13585
* cdef inline bint get_flag(self, int flag): # <<<<<<<<<<<<<<
13586
* return self.flags & flag
13587
*
13588
*/
13589
13590
static CYTHON_INLINE int __pyx_f_4sage_9structure_6parent_6Parent_get_flag(struct __pyx_obj_4sage_9structure_6parent_Parent *__pyx_v_self, int __pyx_v_flag) {
13591
int __pyx_r;
13592
__Pyx_RefNannyDeclarations
13593
__Pyx_RefNannySetupContext("get_flag", 0);
13594
13595
/* "parent.pxd":24
13596
* cdef int flags
13597
* cdef inline bint get_flag(self, int flag):
13598
* return self.flags & flag # <<<<<<<<<<<<<<
13599
*
13600
* cpdef bint is_coercion_cached(self, domain)
13601
*/
13602
__pyx_r = (__pyx_v_self->flags & __pyx_v_flag);
13603
goto __pyx_L0;
13604
13605
/* "parent.pxd":23
13606
* # Flags, see below
13607
* cdef int flags
13608
* cdef inline bint get_flag(self, int flag): # <<<<<<<<<<<<<<
13609
* return self.flags & flag
13610
*
13611
*/
13612
13613
/* function exit code */
13614
__pyx_L0:;
13615
__Pyx_RefNannyFinishContext();
13616
return __pyx_r;
13617
}
13618
13619
/* "sage_object.pxd":13
13620
*
13621
*
13622
* cpdef inline richcmp_not_equal(x, y, int op): # <<<<<<<<<<<<<<
13623
* """
13624
* Like ``richcmp(x, y, op)`` but assuming that `x` is not equal to `y`.
13625
*/
13626
13627
static PyObject *__pyx_pw_4sage_9structure_11sage_object_1richcmp_not_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13628
static CYTHON_INLINE PyObject *__pyx_f_4sage_9structure_11sage_object_richcmp_not_equal(PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op, CYTHON_UNUSED int __pyx_skip_dispatch) {
13629
PyObject *__pyx_r = NULL;
13630
__Pyx_RefNannyDeclarations
13631
int __pyx_t_1;
13632
PyObject *__pyx_t_2 = NULL;
13633
__Pyx_RefNannySetupContext("richcmp_not_equal", 0);
13634
13635
/* "sage_object.pxd":70
13636
* True
13637
* """
13638
* if op == Py_EQ: # <<<<<<<<<<<<<<
13639
* return False
13640
* elif op == Py_NE:
13641
*/
13642
__pyx_t_1 = ((__pyx_v_op == Py_EQ) != 0);
13643
if (__pyx_t_1) {
13644
13645
/* "sage_object.pxd":71
13646
* """
13647
* if op == Py_EQ:
13648
* return False # <<<<<<<<<<<<<<
13649
* elif op == Py_NE:
13650
* return True
13651
*/
13652
__Pyx_XDECREF(__pyx_r);
13653
__Pyx_INCREF(Py_False);
13654
__pyx_r = Py_False;
13655
goto __pyx_L0;
13656
13657
/* "sage_object.pxd":70
13658
* True
13659
* """
13660
* if op == Py_EQ: # <<<<<<<<<<<<<<
13661
* return False
13662
* elif op == Py_NE:
13663
*/
13664
}
13665
13666
/* "sage_object.pxd":72
13667
* if op == Py_EQ:
13668
* return False
13669
* elif op == Py_NE: # <<<<<<<<<<<<<<
13670
* return True
13671
* return richcmp(x, y, op)
13672
*/
13673
__pyx_t_1 = ((__pyx_v_op == Py_NE) != 0);
13674
if (__pyx_t_1) {
13675
13676
/* "sage_object.pxd":73
13677
* return False
13678
* elif op == Py_NE:
13679
* return True # <<<<<<<<<<<<<<
13680
* return richcmp(x, y, op)
13681
*
13682
*/
13683
__Pyx_XDECREF(__pyx_r);
13684
__Pyx_INCREF(Py_True);
13685
__pyx_r = Py_True;
13686
goto __pyx_L0;
13687
13688
/* "sage_object.pxd":72
13689
* if op == Py_EQ:
13690
* return False
13691
* elif op == Py_NE: # <<<<<<<<<<<<<<
13692
* return True
13693
* return richcmp(x, y, op)
13694
*/
13695
}
13696
13697
/* "sage_object.pxd":74
13698
* elif op == Py_NE:
13699
* return True
13700
* return richcmp(x, y, op) # <<<<<<<<<<<<<<
13701
*
13702
*
13703
*/
13704
__Pyx_XDECREF(__pyx_r);
13705
__pyx_t_2 = PyObject_RichCompare(__pyx_v_x, __pyx_v_y, __pyx_v_op); if (unlikely(!__pyx_t_2)) __PYX_ERR(3, 74, __pyx_L1_error)
13706
__Pyx_GOTREF(__pyx_t_2);
13707
__pyx_r = __pyx_t_2;
13708
__pyx_t_2 = 0;
13709
goto __pyx_L0;
13710
13711
/* "sage_object.pxd":13
13712
*
13713
*
13714
* cpdef inline richcmp_not_equal(x, y, int op): # <<<<<<<<<<<<<<
13715
* """
13716
* Like ``richcmp(x, y, op)`` but assuming that `x` is not equal to `y`.
13717
*/
13718
13719
/* function exit code */
13720
__pyx_L1_error:;
13721
__Pyx_XDECREF(__pyx_t_2);
13722
__Pyx_AddTraceback("sage.structure.sage_object.richcmp_not_equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
13723
__pyx_r = 0;
13724
__pyx_L0:;
13725
__Pyx_XGIVEREF(__pyx_r);
13726
__Pyx_RefNannyFinishContext();
13727
return __pyx_r;
13728
}
13729
13730
/* Python wrapper */
13731
static PyObject *__pyx_pw_4sage_9structure_11sage_object_1richcmp_not_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13732
static char __pyx_doc_4sage_9structure_11sage_object_richcmp_not_equal[] = "File: (starting at line 13)\n\n Like ``richcmp(x, y, op)`` but assuming that `x` is not equal to `y`.\n\n INPUT:\n\n - ``op`` -- a rich comparison operation (e.g. ``Py_EQ``)\n\n OUTPUT:\n\n If ``op`` is not ``op_EQ`` or ``op_NE``, the result of\n ``richcmp(x, y, op)``. If ``op`` is ``op_EQ``, return\n ``False``. If ``op`` is ``op_NE``, return ``True``.\n\n This is useful to compare lazily two objects A and B according to 2\n (or more) different parameters, say width and height for example.\n One could use::\n\n return richcmp((A.width(), A.height()), (B.width(), B.height()), op)\n\n but this will compute both width and height in all cases, even if\n A.width() and B.width() are enough to decide the comparison.\n\n Instead one can do::\n\n wA = A.width()\n wB = B.width()\n if wA != wB:\n return richcmp_not_equal(wA, wB, op)\n return richcmp(A.height(), B.height(), op)\n\n The difference with ``richcmp`` is that ``richcmp_not_equal``\n assumes that its arguments are not equal, which is excluding the case\n where the comparison cannot be decided so far, without\n knowing the rest of the parameters.\n\n EXAMPLES::\n\n sage: from sage.structure.sage_object import (richcmp_not_equal,\n ....: op_EQ, op_NE, op_LT, op_LE, op_GT, op_GE)\n sage: for op in (op_LT, op_LE, op_EQ, op_NE, op_GT, op_GE):\n ....: print(richcmp_not_equal(3, 4, op))\n True\n True\n False\n True\n False\n False\n sage: for op in (op_LT, op_LE, op_EQ, op_NE, op_GT, op_GE):\n ....: print(richcmp_not_equal(5, 4, op))\n False\n False\n False\n True\n True\n True\n ";
13733
static PyObject *__pyx_pw_4sage_9structure_11sage_object_1richcmp_not_equal(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13734
PyObject *__pyx_v_x = 0;
13735
PyObject *__pyx_v_y = 0;
13736
int __pyx_v_op;
13737
PyObject *__pyx_r = 0;
13738
__Pyx_RefNannyDeclarations
13739
__Pyx_RefNannySetupContext("richcmp_not_equal (wrapper)", 0);
13740
{
13741
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_y,&__pyx_n_s_op,0};
13742
PyObject* values[3] = {0,0,0};
13743
if (unlikely(__pyx_kwds)) {
13744
Py_ssize_t kw_args;
13745
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13746
switch (pos_args) {
13747
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13748
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13749
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13750
case 0: break;
13751
default: goto __pyx_L5_argtuple_error;
13752
}
13753
kw_args = PyDict_Size(__pyx_kwds);
13754
switch (pos_args) {
13755
case 0:
13756
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
13757
else goto __pyx_L5_argtuple_error;
13758
case 1:
13759
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_y)) != 0)) kw_args--;
13760
else {
13761
__Pyx_RaiseArgtupleInvalid("richcmp_not_equal", 1, 3, 3, 1); __PYX_ERR(3, 13, __pyx_L3_error)
13762
}
13763
case 2:
13764
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
13765
else {
13766
__Pyx_RaiseArgtupleInvalid("richcmp_not_equal", 1, 3, 3, 2); __PYX_ERR(3, 13, __pyx_L3_error)
13767
}
13768
}
13769
if (unlikely(kw_args > 0)) {
13770
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "richcmp_not_equal") < 0)) __PYX_ERR(3, 13, __pyx_L3_error)
13771
}
13772
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
13773
goto __pyx_L5_argtuple_error;
13774
} else {
13775
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13776
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13777
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
13778
}
13779
__pyx_v_x = values[0];
13780
__pyx_v_y = values[1];
13781
__pyx_v_op = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_op == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 13, __pyx_L3_error)
13782
}
13783
goto __pyx_L4_argument_unpacking_done;
13784
__pyx_L5_argtuple_error:;
13785
__Pyx_RaiseArgtupleInvalid("richcmp_not_equal", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 13, __pyx_L3_error)
13786
__pyx_L3_error:;
13787
__Pyx_AddTraceback("sage.structure.sage_object.richcmp_not_equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
13788
__Pyx_RefNannyFinishContext();
13789
return NULL;
13790
__pyx_L4_argument_unpacking_done:;
13791
__pyx_r = __pyx_pf_4sage_9structure_11sage_object_richcmp_not_equal(__pyx_self, __pyx_v_x, __pyx_v_y, __pyx_v_op);
13792
13793
/* function exit code */
13794
__Pyx_RefNannyFinishContext();
13795
return __pyx_r;
13796
}
13797
13798
static PyObject *__pyx_pf_4sage_9structure_11sage_object_richcmp_not_equal(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v_x, PyObject *__pyx_v_y, int __pyx_v_op) {
13799
PyObject *__pyx_r = NULL;
13800
__Pyx_RefNannyDeclarations
13801
PyObject *__pyx_t_1 = NULL;
13802
__Pyx_RefNannySetupContext("richcmp_not_equal", 0);
13803
__Pyx_XDECREF(__pyx_r);
13804
__pyx_t_1 = __pyx_f_4sage_9structure_11sage_object_richcmp_not_equal(__pyx_v_x, __pyx_v_y, __pyx_v_op, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 13, __pyx_L1_error)
13805
__Pyx_GOTREF(__pyx_t_1);
13806
__pyx_r = __pyx_t_1;
13807
__pyx_t_1 = 0;
13808
goto __pyx_L0;
13809
13810
/* function exit code */
13811
__pyx_L1_error:;
13812
__Pyx_XDECREF(__pyx_t_1);
13813
__Pyx_AddTraceback("sage.structure.sage_object.richcmp_not_equal", __pyx_clineno, __pyx_lineno, __pyx_filename);
13814
__pyx_r = NULL;
13815
__pyx_L0:;
13816
__Pyx_XGIVEREF(__pyx_r);
13817
__Pyx_RefNannyFinishContext();
13818
return __pyx_r;
13819
}
13820
13821
/* "sage_object.pxd":77
13822
*
13823
*
13824
* cpdef inline bint rich_to_bool(int op, int c): # <<<<<<<<<<<<<<
13825
* """
13826
* Return the corresponding ``True`` or ``False`` value for a rich
13827
*/
13828
13829
static PyObject *__pyx_pw_4sage_9structure_11sage_object_3rich_to_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13830
static CYTHON_INLINE int __pyx_f_4sage_9structure_11sage_object_rich_to_bool(int __pyx_v_op, int __pyx_v_c, CYTHON_UNUSED int __pyx_skip_dispatch) {
13831
uint32_t __pyx_v_less_bits;
13832
uint32_t __pyx_v_equal_bits;
13833
uint32_t __pyx_v_greater_bits;
13834
uint32_t __pyx_v_bits;
13835
int __pyx_v_shift;
13836
int __pyx_r;
13837
__Pyx_RefNannyDeclarations
13838
__Pyx_RefNannySetupContext("rich_to_bool", 0);
13839
13840
/* "sage_object.pxd":139
13841
* # The 4 lines below involve just constants, so the compiler should
13842
* # optimize them to just one constant value for "bits".
13843
* cdef uint32_t less_bits = (1 << Py_LT) + (1 << Py_LE) + (1 << Py_NE) # <<<<<<<<<<<<<<
13844
* cdef uint32_t equal_bits = (1 << Py_LE) + (1 << Py_GE) + (1 << Py_EQ)
13845
* cdef uint32_t greater_bits = (1 << Py_GT) + (1 << Py_GE) + (1 << Py_NE)
13846
*/
13847
__pyx_v_less_bits = (((1 << Py_LT) + (1 << Py_LE)) + (1 << Py_NE));
13848
13849
/* "sage_object.pxd":140
13850
* # optimize them to just one constant value for "bits".
13851
* cdef uint32_t less_bits = (1 << Py_LT) + (1 << Py_LE) + (1 << Py_NE)
13852
* cdef uint32_t equal_bits = (1 << Py_LE) + (1 << Py_GE) + (1 << Py_EQ) # <<<<<<<<<<<<<<
13853
* cdef uint32_t greater_bits = (1 << Py_GT) + (1 << Py_GE) + (1 << Py_NE)
13854
* cdef uint32_t bits = (less_bits << 24) + (equal_bits) + (greater_bits << 8)
13855
*/
13856
__pyx_v_equal_bits = (((1 << Py_LE) + (1 << Py_GE)) + (1 << Py_EQ));
13857
13858
/* "sage_object.pxd":141
13859
* cdef uint32_t less_bits = (1 << Py_LT) + (1 << Py_LE) + (1 << Py_NE)
13860
* cdef uint32_t equal_bits = (1 << Py_LE) + (1 << Py_GE) + (1 << Py_EQ)
13861
* cdef uint32_t greater_bits = (1 << Py_GT) + (1 << Py_GE) + (1 << Py_NE) # <<<<<<<<<<<<<<
13862
* cdef uint32_t bits = (less_bits << 24) + (equal_bits) + (greater_bits << 8)
13863
*
13864
*/
13865
__pyx_v_greater_bits = (((1 << Py_GT) + (1 << Py_GE)) + (1 << Py_NE));
13866
13867
/* "sage_object.pxd":142
13868
* cdef uint32_t equal_bits = (1 << Py_LE) + (1 << Py_GE) + (1 << Py_EQ)
13869
* cdef uint32_t greater_bits = (1 << Py_GT) + (1 << Py_GE) + (1 << Py_NE)
13870
* cdef uint32_t bits = (less_bits << 24) + (equal_bits) + (greater_bits << 8) # <<<<<<<<<<<<<<
13871
*
13872
* cdef int shift = 8*c + op
13873
*/
13874
__pyx_v_bits = (((__pyx_v_less_bits << 24) + __pyx_v_equal_bits) + (__pyx_v_greater_bits << 8));
13875
13876
/* "sage_object.pxd":144
13877
* cdef uint32_t bits = (less_bits << 24) + (equal_bits) + (greater_bits << 8)
13878
*
13879
* cdef int shift = 8*c + op # <<<<<<<<<<<<<<
13880
*
13881
* # The shift masking (shift & 31) will likely be optimized away by
13882
*/
13883
__pyx_v_shift = ((8 * __pyx_v_c) + __pyx_v_op);
13884
13885
/* "sage_object.pxd":149
13886
* # the compiler since shift and bit test instructions implicitly
13887
* # mask their offset.
13888
* return (bits >> (shift & 31)) & 1 # <<<<<<<<<<<<<<
13889
*
13890
*
13891
*/
13892
__pyx_r = ((__pyx_v_bits >> (__pyx_v_shift & 31)) & 1);
13893
goto __pyx_L0;
13894
13895
/* "sage_object.pxd":77
13896
*
13897
*
13898
* cpdef inline bint rich_to_bool(int op, int c): # <<<<<<<<<<<<<<
13899
* """
13900
* Return the corresponding ``True`` or ``False`` value for a rich
13901
*/
13902
13903
/* function exit code */
13904
__pyx_L0:;
13905
__Pyx_RefNannyFinishContext();
13906
return __pyx_r;
13907
}
13908
13909
/* Python wrapper */
13910
static PyObject *__pyx_pw_4sage_9structure_11sage_object_3rich_to_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
13911
static char __pyx_doc_4sage_9structure_11sage_object_2rich_to_bool[] = "File: (starting at line 77)\n\n Return the corresponding ``True`` or ``False`` value for a rich\n comparison, given the result of an ordinary comparison.\n\n INPUT:\n\n - ``op`` -- a rich comparison operation (e.g. ``Py_EQ``)\n\n - ``c`` -- the result of an ordinary comparison: -1, 0 or 1.\n\n OUTPUT: 1 or 0 (corresponding to ``True`` and ``False``)\n\n .. SEEALSO::\n\n ``rich_to_bool_sgn`` if ``c`` could be outside the [-1, 1]\n range.\n\n EXAMPLES::\n\n sage: from sage.structure.sage_object import (rich_to_bool,\n ....: op_EQ, op_NE, op_LT, op_LE, op_GT, op_GE)\n sage: for op in (op_LT, op_LE, op_EQ, op_NE, op_GT, op_GE):\n ....: for c in (-1,0,1):\n ....: print(rich_to_bool(op, c))\n True False False\n True True False\n False True False\n True False True\n False False True\n False True True\n\n Indirect tests using integers::\n\n sage: 0 < 5, 5 < 5, 5 < -8\n (True, False, False)\n sage: 0 <= 5, 5 <= 5, 5 <= -8\n (True, True, False)\n sage: 0 >= 5, 5 >= 5, 5 >= -8\n (False, True, True)\n sage: 0 > 5, 5 > 5, 5 > -8\n (False, False, True)\n sage: 0 == 5, 5 == 5, 5 == -8\n (False, True, False)\n sage: 0 != 5, 5 != 5, 5 != -8\n (True, False, True)\n\n TESTS::\n\n sage: from sage.structure.sage_object import py_rich_to_bool\n sage: py_rich_to_bool(op_EQ, 0)\n doctest:...: DeprecationWarning: py_rich_to_bool is deprecated. Please use sage.structure.sage_object.rich_to_bool instead.\n See http://trac.sagemath.org/21128 for details.\n True\n ";
13912
static PyObject *__pyx_pw_4sage_9structure_11sage_object_3rich_to_bool(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
13913
int __pyx_v_op;
13914
int __pyx_v_c;
13915
PyObject *__pyx_r = 0;
13916
__Pyx_RefNannyDeclarations
13917
__Pyx_RefNannySetupContext("rich_to_bool (wrapper)", 0);
13918
{
13919
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_c,0};
13920
PyObject* values[2] = {0,0};
13921
if (unlikely(__pyx_kwds)) {
13922
Py_ssize_t kw_args;
13923
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
13924
switch (pos_args) {
13925
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13926
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13927
case 0: break;
13928
default: goto __pyx_L5_argtuple_error;
13929
}
13930
kw_args = PyDict_Size(__pyx_kwds);
13931
switch (pos_args) {
13932
case 0:
13933
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
13934
else goto __pyx_L5_argtuple_error;
13935
case 1:
13936
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
13937
else {
13938
__Pyx_RaiseArgtupleInvalid("rich_to_bool", 1, 2, 2, 1); __PYX_ERR(3, 77, __pyx_L3_error)
13939
}
13940
}
13941
if (unlikely(kw_args > 0)) {
13942
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rich_to_bool") < 0)) __PYX_ERR(3, 77, __pyx_L3_error)
13943
}
13944
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
13945
goto __pyx_L5_argtuple_error;
13946
} else {
13947
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
13948
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
13949
}
13950
__pyx_v_op = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_op == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 77, __pyx_L3_error)
13951
__pyx_v_c = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_c == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 77, __pyx_L3_error)
13952
}
13953
goto __pyx_L4_argument_unpacking_done;
13954
__pyx_L5_argtuple_error:;
13955
__Pyx_RaiseArgtupleInvalid("rich_to_bool", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 77, __pyx_L3_error)
13956
__pyx_L3_error:;
13957
__Pyx_AddTraceback("sage.structure.sage_object.rich_to_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
13958
__Pyx_RefNannyFinishContext();
13959
return NULL;
13960
__pyx_L4_argument_unpacking_done:;
13961
__pyx_r = __pyx_pf_4sage_9structure_11sage_object_2rich_to_bool(__pyx_self, __pyx_v_op, __pyx_v_c);
13962
13963
/* function exit code */
13964
__Pyx_RefNannyFinishContext();
13965
return __pyx_r;
13966
}
13967
13968
static PyObject *__pyx_pf_4sage_9structure_11sage_object_2rich_to_bool(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_op, int __pyx_v_c) {
13969
PyObject *__pyx_r = NULL;
13970
__Pyx_RefNannyDeclarations
13971
PyObject *__pyx_t_1 = NULL;
13972
__Pyx_RefNannySetupContext("rich_to_bool", 0);
13973
__Pyx_XDECREF(__pyx_r);
13974
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_4sage_9structure_11sage_object_rich_to_bool(__pyx_v_op, __pyx_v_c, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 77, __pyx_L1_error)
13975
__Pyx_GOTREF(__pyx_t_1);
13976
__pyx_r = __pyx_t_1;
13977
__pyx_t_1 = 0;
13978
goto __pyx_L0;
13979
13980
/* function exit code */
13981
__pyx_L1_error:;
13982
__Pyx_XDECREF(__pyx_t_1);
13983
__Pyx_AddTraceback("sage.structure.sage_object.rich_to_bool", __pyx_clineno, __pyx_lineno, __pyx_filename);
13984
__pyx_r = NULL;
13985
__pyx_L0:;
13986
__Pyx_XGIVEREF(__pyx_r);
13987
__Pyx_RefNannyFinishContext();
13988
return __pyx_r;
13989
}
13990
13991
/* "sage_object.pxd":152
13992
*
13993
*
13994
* cpdef inline bint rich_to_bool_sgn(int op, int c): # <<<<<<<<<<<<<<
13995
* """
13996
* Same as ``rich_to_bool``, but allow any `c < 0` and `c > 0`
13997
*/
13998
13999
static PyObject *__pyx_pw_4sage_9structure_11sage_object_5rich_to_bool_sgn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14000
static CYTHON_INLINE int __pyx_f_4sage_9structure_11sage_object_rich_to_bool_sgn(int __pyx_v_op, int __pyx_v_c, CYTHON_UNUSED int __pyx_skip_dispatch) {
14001
int __pyx_r;
14002
__Pyx_RefNannyDeclarations
14003
__Pyx_RefNannySetupContext("rich_to_bool_sgn", 0);
14004
14005
/* "sage_object.pxd":161
14006
* This is in particular needed for ``mpz_cmp()``.
14007
* """
14008
* return rich_to_bool(op, (c > 0) - (c < 0)) # <<<<<<<<<<<<<<
14009
*/
14010
__pyx_r = __pyx_f_4sage_9structure_11sage_object_rich_to_bool(__pyx_v_op, ((__pyx_v_c > 0) - (__pyx_v_c < 0)), 0);
14011
goto __pyx_L0;
14012
14013
/* "sage_object.pxd":152
14014
*
14015
*
14016
* cpdef inline bint rich_to_bool_sgn(int op, int c): # <<<<<<<<<<<<<<
14017
* """
14018
* Same as ``rich_to_bool``, but allow any `c < 0` and `c > 0`
14019
*/
14020
14021
/* function exit code */
14022
__pyx_L0:;
14023
__Pyx_RefNannyFinishContext();
14024
return __pyx_r;
14025
}
14026
14027
/* Python wrapper */
14028
static PyObject *__pyx_pw_4sage_9structure_11sage_object_5rich_to_bool_sgn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14029
static char __pyx_doc_4sage_9structure_11sage_object_4rich_to_bool_sgn[] = "File: (starting at line 152)\n\n Same as ``rich_to_bool``, but allow any `c < 0` and `c > 0`\n instead of only `-1` and `1`.\n\n .. NOTE::\n\n This is in particular needed for ``mpz_cmp()``.\n ";
14030
static PyObject *__pyx_pw_4sage_9structure_11sage_object_5rich_to_bool_sgn(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14031
int __pyx_v_op;
14032
int __pyx_v_c;
14033
PyObject *__pyx_r = 0;
14034
__Pyx_RefNannyDeclarations
14035
__Pyx_RefNannySetupContext("rich_to_bool_sgn (wrapper)", 0);
14036
{
14037
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_op,&__pyx_n_s_c,0};
14038
PyObject* values[2] = {0,0};
14039
if (unlikely(__pyx_kwds)) {
14040
Py_ssize_t kw_args;
14041
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14042
switch (pos_args) {
14043
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14044
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14045
case 0: break;
14046
default: goto __pyx_L5_argtuple_error;
14047
}
14048
kw_args = PyDict_Size(__pyx_kwds);
14049
switch (pos_args) {
14050
case 0:
14051
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_op)) != 0)) kw_args--;
14052
else goto __pyx_L5_argtuple_error;
14053
case 1:
14054
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_c)) != 0)) kw_args--;
14055
else {
14056
__Pyx_RaiseArgtupleInvalid("rich_to_bool_sgn", 1, 2, 2, 1); __PYX_ERR(3, 152, __pyx_L3_error)
14057
}
14058
}
14059
if (unlikely(kw_args > 0)) {
14060
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "rich_to_bool_sgn") < 0)) __PYX_ERR(3, 152, __pyx_L3_error)
14061
}
14062
} else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
14063
goto __pyx_L5_argtuple_error;
14064
} else {
14065
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14066
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14067
}
14068
__pyx_v_op = __Pyx_PyInt_As_int(values[0]); if (unlikely((__pyx_v_op == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 152, __pyx_L3_error)
14069
__pyx_v_c = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_c == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 152, __pyx_L3_error)
14070
}
14071
goto __pyx_L4_argument_unpacking_done;
14072
__pyx_L5_argtuple_error:;
14073
__Pyx_RaiseArgtupleInvalid("rich_to_bool_sgn", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(3, 152, __pyx_L3_error)
14074
__pyx_L3_error:;
14075
__Pyx_AddTraceback("sage.structure.sage_object.rich_to_bool_sgn", __pyx_clineno, __pyx_lineno, __pyx_filename);
14076
__Pyx_RefNannyFinishContext();
14077
return NULL;
14078
__pyx_L4_argument_unpacking_done:;
14079
__pyx_r = __pyx_pf_4sage_9structure_11sage_object_4rich_to_bool_sgn(__pyx_self, __pyx_v_op, __pyx_v_c);
14080
14081
/* function exit code */
14082
__Pyx_RefNannyFinishContext();
14083
return __pyx_r;
14084
}
14085
14086
static PyObject *__pyx_pf_4sage_9structure_11sage_object_4rich_to_bool_sgn(CYTHON_UNUSED PyObject *__pyx_self, int __pyx_v_op, int __pyx_v_c) {
14087
PyObject *__pyx_r = NULL;
14088
__Pyx_RefNannyDeclarations
14089
PyObject *__pyx_t_1 = NULL;
14090
__Pyx_RefNannySetupContext("rich_to_bool_sgn", 0);
14091
__Pyx_XDECREF(__pyx_r);
14092
__pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_f_4sage_9structure_11sage_object_rich_to_bool_sgn(__pyx_v_op, __pyx_v_c, 0)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 152, __pyx_L1_error)
14093
__Pyx_GOTREF(__pyx_t_1);
14094
__pyx_r = __pyx_t_1;
14095
__pyx_t_1 = 0;
14096
goto __pyx_L0;
14097
14098
/* function exit code */
14099
__pyx_L1_error:;
14100
__Pyx_XDECREF(__pyx_t_1);
14101
__Pyx_AddTraceback("sage.structure.sage_object.rich_to_bool_sgn", __pyx_clineno, __pyx_lineno, __pyx_filename);
14102
__pyx_r = NULL;
14103
__pyx_L0:;
14104
__Pyx_XGIVEREF(__pyx_r);
14105
__Pyx_RefNannyFinishContext();
14106
return __pyx_r;
14107
}
14108
14109
/* "sage/ext/stdsage.pxd":16
14110
*
14111
*
14112
* cdef inline PY_NEW(type t): # <<<<<<<<<<<<<<
14113
* """
14114
* Return ``t.__new__(t)``. This works even for types like
14115
*/
14116
14117
static CYTHON_INLINE PyObject *__pyx_f_4sage_3ext_7stdsage_PY_NEW(PyTypeObject *__pyx_v_t) {
14118
PyObject *__pyx_r = NULL;
14119
__Pyx_RefNannyDeclarations
14120
PyObject *__pyx_t_1 = NULL;
14121
__Pyx_RefNannySetupContext("PY_NEW", 0);
14122
14123
/* "sage/ext/stdsage.pxd":22
14124
* optimizations assume that ``tp_new`` doesn't change).
14125
* """
14126
* return (<PyTypeObject*>t).tp_new(t, <object>NULL, <object>NULL) # <<<<<<<<<<<<<<
14127
*
14128
*
14129
*/
14130
__Pyx_XDECREF(__pyx_r);
14131
__pyx_t_1 = ((PyTypeObject *)__pyx_v_t)->tp_new(((PyTypeObject *)__pyx_v_t), ((PyObject *)NULL), ((PyObject *)NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(4, 22, __pyx_L1_error)
14132
__Pyx_GOTREF(__pyx_t_1);
14133
__pyx_r = __pyx_t_1;
14134
__pyx_t_1 = 0;
14135
goto __pyx_L0;
14136
14137
/* "sage/ext/stdsage.pxd":16
14138
*
14139
*
14140
* cdef inline PY_NEW(type t): # <<<<<<<<<<<<<<
14141
* """
14142
* Return ``t.__new__(t)``. This works even for types like
14143
*/
14144
14145
/* function exit code */
14146
__pyx_L1_error:;
14147
__Pyx_XDECREF(__pyx_t_1);
14148
__Pyx_AddTraceback("sage.ext.stdsage.PY_NEW", __pyx_clineno, __pyx_lineno, __pyx_filename);
14149
__pyx_r = 0;
14150
__pyx_L0:;
14151
__Pyx_XGIVEREF(__pyx_r);
14152
__Pyx_RefNannyFinishContext();
14153
return __pyx_r;
14154
}
14155
14156
/* "sage/ext/stdsage.pxd":25
14157
*
14158
*
14159
* cdef inline void PY_SET_TP_NEW(type dst, type src): # <<<<<<<<<<<<<<
14160
* """
14161
* Manually set ``dst.__new__`` to ``src.__new__``. This is used to
14162
*/
14163
14164
static CYTHON_INLINE void __pyx_f_4sage_3ext_7stdsage_PY_SET_TP_NEW(PyTypeObject *__pyx_v_dst, PyTypeObject *__pyx_v_src) {
14165
__Pyx_RefNannyDeclarations
14166
newfunc __pyx_t_1;
14167
__Pyx_RefNannySetupContext("PY_SET_TP_NEW", 0);
14168
14169
/* "sage/ext/stdsage.pxd":31
14170
* irrelevant base class ``tp_new`` methods.
14171
* """
14172
* (<PyTypeObject*>dst).tp_new = (<PyTypeObject*>src).tp_new # <<<<<<<<<<<<<<
14173
*
14174
*
14175
*/
14176
__pyx_t_1 = ((PyTypeObject *)__pyx_v_src)->tp_new;
14177
((PyTypeObject *)__pyx_v_dst)->tp_new = __pyx_t_1;
14178
14179
/* "sage/ext/stdsage.pxd":25
14180
*
14181
*
14182
* cdef inline void PY_SET_TP_NEW(type dst, type src): # <<<<<<<<<<<<<<
14183
* """
14184
* Manually set ``dst.__new__`` to ``src.__new__``. This is used to
14185
*/
14186
14187
/* function exit code */
14188
__Pyx_RefNannyFinishContext();
14189
}
14190
14191
/* "sage/ext/stdsage.pxd":34
14192
*
14193
*
14194
* cdef inline bint HAS_DICTIONARY(obj): # <<<<<<<<<<<<<<
14195
* """
14196
* Test whether the given object has a Python dictionary.
14197
*/
14198
14199
static CYTHON_INLINE int __pyx_f_4sage_3ext_7stdsage_HAS_DICTIONARY(PyObject *__pyx_v_obj) {
14200
int __pyx_r;
14201
__Pyx_RefNannyDeclarations
14202
__Pyx_RefNannySetupContext("HAS_DICTIONARY", 0);
14203
14204
/* "sage/ext/stdsage.pxd":38
14205
* Test whether the given object has a Python dictionary.
14206
* """
14207
* return Py_TYPE(obj).tp_dictoffset != 0 # <<<<<<<<<<<<<<
14208
*/
14209
__pyx_r = (Py_TYPE(__pyx_v_obj)->tp_dictoffset != 0);
14210
goto __pyx_L0;
14211
14212
/* "sage/ext/stdsage.pxd":34
14213
*
14214
*
14215
* cdef inline bint HAS_DICTIONARY(obj): # <<<<<<<<<<<<<<
14216
* """
14217
* Test whether the given object has a Python dictionary.
14218
*/
14219
14220
/* function exit code */
14221
__pyx_L0:;
14222
__Pyx_RefNannyFinishContext();
14223
return __pyx_r;
14224
}
14225
14226
/* "cysignals/signals.pxd":35
14227
* # (PyErr_Occurred() is non-NULL). To Cython, it will look like
14228
* # cython_check_exception() actually raised the exception.
14229
* cdef inline void cython_check_exception() nogil except *: # <<<<<<<<<<<<<<
14230
* pass
14231
*
14232
*/
14233
14234
static CYTHON_INLINE void __pyx_f_9cysignals_7signals_cython_check_exception(void) {
14235
14236
/* function exit code */
14237
}
14238
14239
/* "cfunc.to_py":65
14240
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
14241
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ):
14242
* def wrap(object arg0, object arg1, int arg2): # <<<<<<<<<<<<<<
14243
* """wrap(arg0, arg1, arg2: 'int')"""
14244
* return f(arg0, arg1, arg2)
14245
*/
14246
14247
/* Python wrapper */
14248
static PyObject *__pyx_pw_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
14249
static char __pyx_doc_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_wrap[] = "File: (starting at line 65)\nwrap(arg0, arg1, arg2: 'int')";
14250
static PyMethodDef __pyx_mdef_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_1wrap = {"wrap", (PyCFunction)__pyx_pw_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_1wrap, METH_VARARGS|METH_KEYWORDS, __pyx_doc_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_wrap};
14251
static PyObject *__pyx_pw_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_1wrap(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
14252
PyObject *__pyx_v_arg0 = 0;
14253
PyObject *__pyx_v_arg1 = 0;
14254
int __pyx_v_arg2;
14255
PyObject *__pyx_r = 0;
14256
__Pyx_RefNannyDeclarations
14257
__Pyx_RefNannySetupContext("wrap (wrapper)", 0);
14258
{
14259
static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_arg0,&__pyx_n_s_arg1,&__pyx_n_s_arg2,0};
14260
PyObject* values[3] = {0,0,0};
14261
if (unlikely(__pyx_kwds)) {
14262
Py_ssize_t kw_args;
14263
const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
14264
switch (pos_args) {
14265
case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14266
case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14267
case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14268
case 0: break;
14269
default: goto __pyx_L5_argtuple_error;
14270
}
14271
kw_args = PyDict_Size(__pyx_kwds);
14272
switch (pos_args) {
14273
case 0:
14274
if (likely((values[0] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg0)) != 0)) kw_args--;
14275
else goto __pyx_L5_argtuple_error;
14276
case 1:
14277
if (likely((values[1] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg1)) != 0)) kw_args--;
14278
else {
14279
__Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 1); __PYX_ERR(5, 65, __pyx_L3_error)
14280
}
14281
case 2:
14282
if (likely((values[2] = PyDict_GetItem(__pyx_kwds, __pyx_n_s_arg2)) != 0)) kw_args--;
14283
else {
14284
__Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, 2); __PYX_ERR(5, 65, __pyx_L3_error)
14285
}
14286
}
14287
if (unlikely(kw_args > 0)) {
14288
if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "wrap") < 0)) __PYX_ERR(5, 65, __pyx_L3_error)
14289
}
14290
} else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
14291
goto __pyx_L5_argtuple_error;
14292
} else {
14293
values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
14294
values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
14295
values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
14296
}
14297
__pyx_v_arg0 = values[0];
14298
__pyx_v_arg1 = values[1];
14299
__pyx_v_arg2 = __Pyx_PyInt_As_int(values[2]); if (unlikely((__pyx_v_arg2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(5, 65, __pyx_L3_error)
14300
}
14301
goto __pyx_L4_argument_unpacking_done;
14302
__pyx_L5_argtuple_error:;
14303
__Pyx_RaiseArgtupleInvalid("wrap", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(5, 65, __pyx_L3_error)
14304
__pyx_L3_error:;
14305
__Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____object____object____int___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
14306
__Pyx_RefNannyFinishContext();
14307
return NULL;
14308
__pyx_L4_argument_unpacking_done:;
14309
__pyx_r = __pyx_pf_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_wrap(__pyx_self, __pyx_v_arg0, __pyx_v_arg1, __pyx_v_arg2);
14310
14311
/* function exit code */
14312
__Pyx_RefNannyFinishContext();
14313
return __pyx_r;
14314
}
14315
14316
static PyObject *__pyx_pf_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_wrap(PyObject *__pyx_self, PyObject *__pyx_v_arg0, PyObject *__pyx_v_arg1, int __pyx_v_arg2) {
14317
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *__pyx_cur_scope;
14318
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *__pyx_outer_scope;
14319
PyObject *__pyx_r = NULL;
14320
__Pyx_RefNannyDeclarations
14321
PyObject *__pyx_t_1 = NULL;
14322
__Pyx_RefNannySetupContext("wrap", 0);
14323
__pyx_outer_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *) __Pyx_CyFunction_GetClosure(__pyx_self);
14324
__pyx_cur_scope = __pyx_outer_scope;
14325
14326
/* "cfunc.to_py":67
14327
* def wrap(object arg0, object arg1, int arg2):
14328
* """wrap(arg0, arg1, arg2: 'int')"""
14329
* return f(arg0, arg1, arg2) # <<<<<<<<<<<<<<
14330
* return wrap
14331
*
14332
*/
14333
__Pyx_XDECREF(__pyx_r);
14334
__pyx_t_1 = __pyx_cur_scope->__pyx_v_f(__pyx_v_arg0, __pyx_v_arg1, __pyx_v_arg2); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 67, __pyx_L1_error)
14335
__Pyx_GOTREF(__pyx_t_1);
14336
__pyx_r = __pyx_t_1;
14337
__pyx_t_1 = 0;
14338
goto __pyx_L0;
14339
14340
/* "cfunc.to_py":65
14341
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
14342
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ):
14343
* def wrap(object arg0, object arg1, int arg2): # <<<<<<<<<<<<<<
14344
* """wrap(arg0, arg1, arg2: 'int')"""
14345
* return f(arg0, arg1, arg2)
14346
*/
14347
14348
/* function exit code */
14349
__pyx_L1_error:;
14350
__Pyx_XDECREF(__pyx_t_1);
14351
__Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____object____object____int___to_py.wrap", __pyx_clineno, __pyx_lineno, __pyx_filename);
14352
__pyx_r = NULL;
14353
__pyx_L0:;
14354
__Pyx_XGIVEREF(__pyx_r);
14355
__Pyx_RefNannyFinishContext();
14356
return __pyx_r;
14357
}
14358
14359
/* "cfunc.to_py":64
14360
*
14361
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
14362
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ): # <<<<<<<<<<<<<<
14363
* def wrap(object arg0, object arg1, int arg2):
14364
* """wrap(arg0, arg1, arg2: 'int')"""
14365
*/
14366
14367
static PyObject *__Pyx_CFunc_object____object____object____int___to_py(PyObject *(*__pyx_v_f)(PyObject *, PyObject *, int)) {
14368
struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *__pyx_cur_scope;
14369
PyObject *__pyx_v_wrap = 0;
14370
PyObject *__pyx_r = NULL;
14371
__Pyx_RefNannyDeclarations
14372
PyObject *__pyx_t_1 = NULL;
14373
__Pyx_RefNannySetupContext("__Pyx_CFunc_object____object____object____int___to_py", 0);
14374
__pyx_cur_scope = (struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *)__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py(__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py, __pyx_empty_tuple, NULL);
14375
if (unlikely(!__pyx_cur_scope)) {
14376
__pyx_cur_scope = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *)Py_None);
14377
__Pyx_INCREF(Py_None);
14378
__PYX_ERR(5, 64, __pyx_L1_error)
14379
} else {
14380
__Pyx_GOTREF(__pyx_cur_scope);
14381
}
14382
__pyx_cur_scope->__pyx_v_f = __pyx_v_f;
14383
14384
/* "cfunc.to_py":65
14385
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
14386
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ):
14387
* def wrap(object arg0, object arg1, int arg2): # <<<<<<<<<<<<<<
14388
* """wrap(arg0, arg1, arg2: 'int')"""
14389
* return f(arg0, arg1, arg2)
14390
*/
14391
__pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_11cfunc_dot_to_py_53__Pyx_CFunc_object____object____object____int___to_py_1wrap, 0, __pyx_n_s_Pyx_CFunc_object____object, ((PyObject*)__pyx_cur_scope), __pyx_n_s_cfunc_to_py, __pyx_d, ((PyObject *)__pyx_codeobj__8)); if (unlikely(!__pyx_t_1)) __PYX_ERR(5, 65, __pyx_L1_error)
14392
__Pyx_GOTREF(__pyx_t_1);
14393
__pyx_v_wrap = __pyx_t_1;
14394
__pyx_t_1 = 0;
14395
14396
/* "cfunc.to_py":68
14397
* """wrap(arg0, arg1, arg2: 'int')"""
14398
* return f(arg0, arg1, arg2)
14399
* return wrap # <<<<<<<<<<<<<<
14400
*
14401
*
14402
*/
14403
__Pyx_XDECREF(__pyx_r);
14404
__Pyx_INCREF(__pyx_v_wrap);
14405
__pyx_r = __pyx_v_wrap;
14406
goto __pyx_L0;
14407
14408
/* "cfunc.to_py":64
14409
*
14410
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
14411
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ): # <<<<<<<<<<<<<<
14412
* def wrap(object arg0, object arg1, int arg2):
14413
* """wrap(arg0, arg1, arg2: 'int')"""
14414
*/
14415
14416
/* function exit code */
14417
__pyx_L1_error:;
14418
__Pyx_XDECREF(__pyx_t_1);
14419
__Pyx_AddTraceback("cfunc.to_py.__Pyx_CFunc_object____object____object____int___to_py", __pyx_clineno, __pyx_lineno, __pyx_filename);
14420
__pyx_r = 0;
14421
__pyx_L0:;
14422
__Pyx_XDECREF(__pyx_v_wrap);
14423
__Pyx_DECREF(((PyObject *)__pyx_cur_scope));
14424
__Pyx_XGIVEREF(__pyx_r);
14425
__Pyx_RefNannyFinishContext();
14426
return __pyx_r;
14427
}
14428
static struct __pyx_vtabstruct_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries __pyx_vtable_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries;
14429
14430
static PyObject *__pyx_tp_new_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
14431
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *p;
14432
PyObject *o;
14433
if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
14434
o = (*t->tp_alloc)(t, 0);
14435
} else {
14436
o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
14437
}
14438
if (unlikely(!o)) return 0;
14439
p = ((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)o);
14440
p->__pyx_vtab = __pyx_vtabptr_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries;
14441
p->E = Py_None; Py_INCREF(Py_None);
14442
p->modsym = ((struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)Py_None); Py_INCREF(Py_None);
14443
if (unlikely(__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1__cinit__(o, __pyx_empty_tuple, NULL) < 0)) goto bad;
14444
return o;
14445
bad:
14446
Py_DECREF(o); o = 0;
14447
return NULL;
14448
}
14449
14450
static void __pyx_tp_dealloc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries(PyObject *o) {
14451
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *p = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)o;
14452
#if PY_VERSION_HEX >= 0x030400a1
14453
if (unlikely(Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
14454
if (PyObject_CallFinalizerFromDealloc(o)) return;
14455
}
14456
#endif
14457
PyObject_GC_UnTrack(o);
14458
{
14459
PyObject *etype, *eval, *etb;
14460
PyErr_Fetch(&etype, &eval, &etb);
14461
++Py_REFCNT(o);
14462
__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_3__dealloc__(o);
14463
--Py_REFCNT(o);
14464
PyErr_Restore(etype, eval, etb);
14465
}
14466
Py_CLEAR(p->E);
14467
Py_CLEAR(p->modsym);
14468
(*Py_TYPE(o)->tp_free)(o);
14469
}
14470
14471
static int __pyx_tp_traverse_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries(PyObject *o, visitproc v, void *a) {
14472
int e;
14473
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *p = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)o;
14474
if (p->E) {
14475
e = (*v)(p->E, a); if (e) return e;
14476
}
14477
if (p->modsym) {
14478
e = (*v)(((PyObject*)p->modsym), a); if (e) return e;
14479
}
14480
return 0;
14481
}
14482
14483
static int __pyx_tp_clear_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries(PyObject *o) {
14484
PyObject* tmp;
14485
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *p = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *)o;
14486
tmp = ((PyObject*)p->E);
14487
p->E = Py_None; Py_INCREF(Py_None);
14488
Py_XDECREF(tmp);
14489
tmp = ((PyObject*)p->modsym);
14490
p->modsym = ((struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap *)Py_None); Py_INCREF(Py_None);
14491
Py_XDECREF(tmp);
14492
return 0;
14493
}
14494
14495
static PyObject *__pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_E(PyObject *o, CYTHON_UNUSED void *x) {
14496
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_1__get__(o);
14497
}
14498
14499
static int __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_E(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
14500
if (v) {
14501
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_3__set__(o, v);
14502
}
14503
else {
14504
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1E_5__del__(o);
14505
}
14506
}
14507
14508
static PyObject *__pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_p(PyObject *o, CYTHON_UNUSED void *x) {
14509
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_1__get__(o);
14510
}
14511
14512
static int __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_p(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
14513
if (v) {
14514
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_1p_3__set__(o, v);
14515
}
14516
else {
14517
PyErr_SetString(PyExc_NotImplementedError, "__del__");
14518
return -1;
14519
}
14520
}
14521
14522
static PyObject *__pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_prec(PyObject *o, CYTHON_UNUSED void *x) {
14523
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_1__get__(o);
14524
}
14525
14526
static int __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_prec(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
14527
if (v) {
14528
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4prec_3__set__(o, v);
14529
}
14530
else {
14531
PyErr_SetString(PyExc_NotImplementedError, "__del__");
14532
return -1;
14533
}
14534
}
14535
14536
static PyObject *__pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization(PyObject *o, CYTHON_UNUSED void *x) {
14537
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_1__get__(o);
14538
}
14539
14540
static int __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
14541
if (v) {
14542
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13normalization_3__set__(o, v);
14543
}
14544
else {
14545
PyErr_SetString(PyExc_NotImplementedError, "__del__");
14546
return -1;
14547
}
14548
}
14549
14550
static PyObject *__pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization_mulmod(PyObject *o, CYTHON_UNUSED void *x) {
14551
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_1__get__(o);
14552
}
14553
14554
static int __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization_mulmod(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
14555
if (v) {
14556
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20normalization_mulmod_3__set__(o, v);
14557
}
14558
else {
14559
PyErr_SetString(PyExc_NotImplementedError, "__del__");
14560
return -1;
14561
}
14562
}
14563
14564
static PyObject *__pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries__alpha(PyObject *o, CYTHON_UNUSED void *x) {
14565
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_1__get__(o);
14566
}
14567
14568
static int __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries__alpha(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
14569
if (v) {
14570
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6_alpha_3__set__(o, v);
14571
}
14572
else {
14573
PyErr_SetString(PyExc_NotImplementedError, "__del__");
14574
return -1;
14575
}
14576
}
14577
14578
static PyObject *__pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modsym(PyObject *o, CYTHON_UNUSED void *x) {
14579
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_1__get__(o);
14580
}
14581
14582
static int __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modsym(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
14583
if (v) {
14584
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_3__set__(o, v);
14585
}
14586
else {
14587
return __pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6modsym_5__del__(o);
14588
}
14589
}
14590
14591
static PyMethodDef __pyx_methods_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries[] = {
14592
{"alpha", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_9alpha, METH_NOARGS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_8alpha},
14593
{"modular_symbol", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_11modular_symbol, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_10modular_symbol},
14594
{"measure", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_13measure, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_12measure},
14595
{"measure_mulmod", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_15measure_mulmod, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_14measure_mulmod},
14596
{"_series", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_17_series, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_16_series},
14597
{"_series_parallel", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_19_series_parallel, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_18_series_parallel},
14598
{"_prec_bounds", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_21_prec_bounds, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_20_prec_bounds},
14599
{"series", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_23series, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_22series},
14600
{"series_modp", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_25series_modp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_24series_modp},
14601
{"series_to_enough_prec", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_27series_to_enough_prec, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_26series_to_enough_prec},
14602
{"sha_modp", (PyCFunction)__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_29sha_modp, METH_VARARGS|METH_KEYWORDS, __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_28sha_modp},
14603
{0, 0, 0, 0}
14604
};
14605
14606
static struct PyGetSetDef __pyx_getsets_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries[] = {
14607
{(char *)"E", __pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_E, __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_E, (char *)"File: padic_elliptic_lseries_fast.pyx (starting at line 51)", 0},
14608
{(char *)"p", __pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_p, __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_p, (char *)"File: padic_elliptic_lseries_fast.pyx (starting at line 52)", 0},
14609
{(char *)"prec", __pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_prec, __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_prec, (char *)"File: padic_elliptic_lseries_fast.pyx (starting at line 52)", 0},
14610
{(char *)"normalization", __pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization, __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization, (char *)"File: padic_elliptic_lseries_fast.pyx (starting at line 53)", 0},
14611
{(char *)"normalization_mulmod", __pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization_mulmod, __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_normalization_mulmod, (char *)"File: padic_elliptic_lseries_fast.pyx (starting at line 53)", 0},
14612
{(char *)"_alpha", __pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries__alpha, __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries__alpha, (char *)"File: padic_elliptic_lseries_fast.pyx (starting at line 54)", 0},
14613
{(char *)"modsym", __pyx_getprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modsym, __pyx_setprop_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modsym, (char *)"File: padic_elliptic_lseries_fast.pyx (starting at line 59)", 0},
14614
{0, 0, 0, 0, 0}
14615
};
14616
14617
static PyTypeObject __pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries = {
14618
PyVarObject_HEAD_INIT(0, 0)
14619
"psage.modform.rational.padic_elliptic_lseries_fast.pAdicLseries", /*tp_name*/
14620
sizeof(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries), /*tp_basicsize*/
14621
0, /*tp_itemsize*/
14622
__pyx_tp_dealloc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, /*tp_dealloc*/
14623
0, /*tp_print*/
14624
0, /*tp_getattr*/
14625
0, /*tp_setattr*/
14626
#if PY_MAJOR_VERSION < 3
14627
0, /*tp_compare*/
14628
#endif
14629
#if PY_MAJOR_VERSION >= 3
14630
0, /*tp_as_async*/
14631
#endif
14632
__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_7__repr__, /*tp_repr*/
14633
0, /*tp_as_number*/
14634
0, /*tp_as_sequence*/
14635
0, /*tp_as_mapping*/
14636
0, /*tp_hash*/
14637
0, /*tp_call*/
14638
0, /*tp_str*/
14639
0, /*tp_getattro*/
14640
0, /*tp_setattro*/
14641
0, /*tp_as_buffer*/
14642
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14643
0, /*tp_doc*/
14644
__pyx_tp_traverse_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, /*tp_traverse*/
14645
__pyx_tp_clear_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, /*tp_clear*/
14646
0, /*tp_richcompare*/
14647
0, /*tp_weaklistoffset*/
14648
0, /*tp_iter*/
14649
0, /*tp_iternext*/
14650
__pyx_methods_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, /*tp_methods*/
14651
0, /*tp_members*/
14652
__pyx_getsets_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, /*tp_getset*/
14653
0, /*tp_base*/
14654
0, /*tp_dict*/
14655
0, /*tp_descr_get*/
14656
0, /*tp_descr_set*/
14657
0, /*tp_dictoffset*/
14658
__pyx_pw_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_5__init__, /*tp_init*/
14659
0, /*tp_alloc*/
14660
__pyx_tp_new_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, /*tp_new*/
14661
0, /*tp_free*/
14662
0, /*tp_is_gc*/
14663
0, /*tp_bases*/
14664
0, /*tp_mro*/
14665
0, /*tp_cache*/
14666
0, /*tp_subclasses*/
14667
0, /*tp_weaklist*/
14668
0, /*tp_del*/
14669
0, /*tp_version_tag*/
14670
#if PY_VERSION_HEX >= 0x030400a1
14671
0, /*tp_finalize*/
14672
#endif
14673
};
14674
14675
static struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *__pyx_freelist_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel[8];
14676
static int __pyx_freecount_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel = 0;
14677
14678
static PyObject *__pyx_tp_new_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
14679
PyObject *o;
14680
if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel)))) {
14681
o = (PyObject*)__pyx_freelist_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel[--__pyx_freecount_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel];
14682
memset(o, 0, sizeof(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel));
14683
(void) PyObject_INIT(o, t);
14684
PyObject_GC_Track(o);
14685
} else {
14686
o = (*t->tp_alloc)(t, 0);
14687
if (unlikely(!o)) return 0;
14688
}
14689
return o;
14690
}
14691
14692
static void __pyx_tp_dealloc_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel(PyObject *o) {
14693
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *p = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *)o;
14694
PyObject_GC_UnTrack(o);
14695
Py_CLEAR(p->__pyx_v_L);
14696
Py_CLEAR(p->__pyx_v_force_mulmod);
14697
Py_CLEAR(p->__pyx_v_n);
14698
Py_CLEAR(p->__pyx_v_prec);
14699
Py_CLEAR(p->__pyx_v_ser_prec);
14700
Py_CLEAR(p->__pyx_v_verb);
14701
if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel)))) {
14702
__pyx_freelist_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel[__pyx_freecount_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel++] = ((struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *)o);
14703
} else {
14704
(*Py_TYPE(o)->tp_free)(o);
14705
}
14706
}
14707
14708
static int __pyx_tp_traverse_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel(PyObject *o, visitproc v, void *a) {
14709
int e;
14710
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *p = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *)o;
14711
if (p->__pyx_v_L) {
14712
e = (*v)(p->__pyx_v_L, a); if (e) return e;
14713
}
14714
if (p->__pyx_v_force_mulmod) {
14715
e = (*v)(p->__pyx_v_force_mulmod, a); if (e) return e;
14716
}
14717
if (p->__pyx_v_n) {
14718
e = (*v)(p->__pyx_v_n, a); if (e) return e;
14719
}
14720
if (p->__pyx_v_prec) {
14721
e = (*v)(p->__pyx_v_prec, a); if (e) return e;
14722
}
14723
if (p->__pyx_v_ser_prec) {
14724
e = (*v)(p->__pyx_v_ser_prec, a); if (e) return e;
14725
}
14726
if (p->__pyx_v_verb) {
14727
e = (*v)(p->__pyx_v_verb, a); if (e) return e;
14728
}
14729
return 0;
14730
}
14731
14732
static int __pyx_tp_clear_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel(PyObject *o) {
14733
PyObject* tmp;
14734
struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *p = (struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel *)o;
14735
tmp = ((PyObject*)p->__pyx_v_L);
14736
p->__pyx_v_L = Py_None; Py_INCREF(Py_None);
14737
Py_XDECREF(tmp);
14738
tmp = ((PyObject*)p->__pyx_v_force_mulmod);
14739
p->__pyx_v_force_mulmod = Py_None; Py_INCREF(Py_None);
14740
Py_XDECREF(tmp);
14741
tmp = ((PyObject*)p->__pyx_v_n);
14742
p->__pyx_v_n = Py_None; Py_INCREF(Py_None);
14743
Py_XDECREF(tmp);
14744
tmp = ((PyObject*)p->__pyx_v_prec);
14745
p->__pyx_v_prec = Py_None; Py_INCREF(Py_None);
14746
Py_XDECREF(tmp);
14747
tmp = ((PyObject*)p->__pyx_v_ser_prec);
14748
p->__pyx_v_ser_prec = Py_None; Py_INCREF(Py_None);
14749
Py_XDECREF(tmp);
14750
tmp = ((PyObject*)p->__pyx_v_verb);
14751
p->__pyx_v_verb = Py_None; Py_INCREF(Py_None);
14752
Py_XDECREF(tmp);
14753
return 0;
14754
}
14755
14756
static PyTypeObject __pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel = {
14757
PyVarObject_HEAD_INIT(0, 0)
14758
"psage.modform.rational.padic_elliptic_lseries_fast.__pyx_scope_struct__series_parallel", /*tp_name*/
14759
sizeof(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel), /*tp_basicsize*/
14760
0, /*tp_itemsize*/
14761
__pyx_tp_dealloc_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel, /*tp_dealloc*/
14762
0, /*tp_print*/
14763
0, /*tp_getattr*/
14764
0, /*tp_setattr*/
14765
#if PY_MAJOR_VERSION < 3
14766
0, /*tp_compare*/
14767
#endif
14768
#if PY_MAJOR_VERSION >= 3
14769
0, /*tp_as_async*/
14770
#endif
14771
0, /*tp_repr*/
14772
0, /*tp_as_number*/
14773
0, /*tp_as_sequence*/
14774
0, /*tp_as_mapping*/
14775
0, /*tp_hash*/
14776
0, /*tp_call*/
14777
0, /*tp_str*/
14778
0, /*tp_getattro*/
14779
0, /*tp_setattro*/
14780
0, /*tp_as_buffer*/
14781
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
14782
0, /*tp_doc*/
14783
__pyx_tp_traverse_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel, /*tp_traverse*/
14784
__pyx_tp_clear_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel, /*tp_clear*/
14785
0, /*tp_richcompare*/
14786
0, /*tp_weaklistoffset*/
14787
0, /*tp_iter*/
14788
0, /*tp_iternext*/
14789
0, /*tp_methods*/
14790
0, /*tp_members*/
14791
0, /*tp_getset*/
14792
0, /*tp_base*/
14793
0, /*tp_dict*/
14794
0, /*tp_descr_get*/
14795
0, /*tp_descr_set*/
14796
0, /*tp_dictoffset*/
14797
0, /*tp_init*/
14798
0, /*tp_alloc*/
14799
__pyx_tp_new_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel, /*tp_new*/
14800
0, /*tp_free*/
14801
0, /*tp_is_gc*/
14802
0, /*tp_bases*/
14803
0, /*tp_mro*/
14804
0, /*tp_cache*/
14805
0, /*tp_subclasses*/
14806
0, /*tp_weaklist*/
14807
0, /*tp_del*/
14808
0, /*tp_version_tag*/
14809
#if PY_VERSION_HEX >= 0x030400a1
14810
0, /*tp_finalize*/
14811
#endif
14812
};
14813
14814
static struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py[8];
14815
static int __pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py = 0;
14816
14817
static PyObject *__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
14818
PyObject *o;
14819
if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py)))) {
14820
o = (PyObject*)__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py[--__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py];
14821
memset(o, 0, sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py));
14822
(void) PyObject_INIT(o, t);
14823
} else {
14824
o = (*t->tp_alloc)(t, 0);
14825
if (unlikely(!o)) return 0;
14826
}
14827
return o;
14828
}
14829
14830
static void __pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py(PyObject *o) {
14831
if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py)))) {
14832
__pyx_freelist___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py[__pyx_freecount___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py++] = ((struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py *)o);
14833
} else {
14834
(*Py_TYPE(o)->tp_free)(o);
14835
}
14836
}
14837
14838
static PyTypeObject __pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py = {
14839
PyVarObject_HEAD_INIT(0, 0)
14840
"psage.modform.rational.padic_elliptic_lseries_fast.__pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py", /*tp_name*/
14841
sizeof(struct __pyx_obj___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py), /*tp_basicsize*/
14842
0, /*tp_itemsize*/
14843
__pyx_tp_dealloc___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py, /*tp_dealloc*/
14844
0, /*tp_print*/
14845
0, /*tp_getattr*/
14846
0, /*tp_setattr*/
14847
#if PY_MAJOR_VERSION < 3
14848
0, /*tp_compare*/
14849
#endif
14850
#if PY_MAJOR_VERSION >= 3
14851
0, /*tp_as_async*/
14852
#endif
14853
0, /*tp_repr*/
14854
0, /*tp_as_number*/
14855
0, /*tp_as_sequence*/
14856
0, /*tp_as_mapping*/
14857
0, /*tp_hash*/
14858
0, /*tp_call*/
14859
0, /*tp_str*/
14860
0, /*tp_getattro*/
14861
0, /*tp_setattro*/
14862
0, /*tp_as_buffer*/
14863
Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER, /*tp_flags*/
14864
0, /*tp_doc*/
14865
0, /*tp_traverse*/
14866
0, /*tp_clear*/
14867
0, /*tp_richcompare*/
14868
0, /*tp_weaklistoffset*/
14869
0, /*tp_iter*/
14870
0, /*tp_iternext*/
14871
0, /*tp_methods*/
14872
0, /*tp_members*/
14873
0, /*tp_getset*/
14874
0, /*tp_base*/
14875
0, /*tp_dict*/
14876
0, /*tp_descr_get*/
14877
0, /*tp_descr_set*/
14878
0, /*tp_dictoffset*/
14879
0, /*tp_init*/
14880
0, /*tp_alloc*/
14881
__pyx_tp_new___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py, /*tp_new*/
14882
0, /*tp_free*/
14883
0, /*tp_is_gc*/
14884
0, /*tp_bases*/
14885
0, /*tp_mro*/
14886
0, /*tp_cache*/
14887
0, /*tp_subclasses*/
14888
0, /*tp_weaklist*/
14889
0, /*tp_del*/
14890
0, /*tp_version_tag*/
14891
#if PY_VERSION_HEX >= 0x030400a1
14892
0, /*tp_finalize*/
14893
#endif
14894
};
14895
14896
static PyMethodDef __pyx_methods[] = {
14897
{0, 0, 0, 0}
14898
};
14899
14900
#if PY_MAJOR_VERSION >= 3
14901
static struct PyModuleDef __pyx_moduledef = {
14902
#if PY_VERSION_HEX < 0x03020000
14903
{ PyObject_HEAD_INIT(NULL) NULL, 0, NULL },
14904
#else
14905
PyModuleDef_HEAD_INIT,
14906
#endif
14907
"padic_elliptic_lseries_fast",
14908
__pyx_k_File_padic_elliptic_lseries_fast, /* m_doc */
14909
-1, /* m_size */
14910
__pyx_methods /* m_methods */,
14911
NULL, /* m_reload */
14912
NULL, /* m_traverse */
14913
NULL, /* m_clear */
14914
NULL /* m_free */
14915
};
14916
#endif
14917
14918
static __Pyx_StringTabEntry __pyx_string_tab[] = {
14919
{&__pyx_n_s_AttributeError, __pyx_k_AttributeError, sizeof(__pyx_k_AttributeError), 0, 0, 1, 1},
14920
{&__pyx_n_s_E, __pyx_k_E, sizeof(__pyx_k_E), 0, 0, 1, 1},
14921
{&__pyx_n_s_Integers, __pyx_k_Integers, sizeof(__pyx_k_Integers), 0, 0, 1, 1},
14922
{&__pyx_kp_s_L, __pyx_k_L, sizeof(__pyx_k_L), 0, 0, 1, 0},
14923
{&__pyx_n_s_L_2, __pyx_k_L_2, sizeof(__pyx_k_L_2), 0, 0, 1, 1},
14924
{&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
14925
{&__pyx_n_s_Mod, __pyx_k_Mod, sizeof(__pyx_k_Mod), 0, 0, 1, 1},
14926
{&__pyx_n_s_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 1, 1},
14927
{&__pyx_n_s_P, __pyx_k_P, sizeof(__pyx_k_P), 0, 0, 1, 1},
14928
{&__pyx_n_s_Pyx_CFunc_object____object, __pyx_k_Pyx_CFunc_object____object, sizeof(__pyx_k_Pyx_CFunc_object____object), 0, 0, 1, 1},
14929
{&__pyx_n_s_Qp, __pyx_k_Qp, sizeof(__pyx_k_Qp), 0, 0, 1, 1},
14930
{&__pyx_n_s_T, __pyx_k_T, sizeof(__pyx_k_T), 0, 0, 1, 1},
14931
{&__pyx_kp_s_Using_mulmod, __pyx_k_Using_mulmod, sizeof(__pyx_k_Using_mulmod), 0, 0, 1, 0},
14932
{&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
14933
{&__pyx_n_s_ZZ, __pyx_k_ZZ, sizeof(__pyx_k_ZZ), 0, 0, 1, 1},
14934
{&__pyx_n_s_Zp, __pyx_k_Zp, sizeof(__pyx_k_Zp), 0, 0, 1, 1},
14935
{&__pyx_n_s_a, __pyx_k_a, sizeof(__pyx_k_a), 0, 0, 1, 1},
14936
{&__pyx_n_s_a_invariants, __pyx_k_a_invariants, sizeof(__pyx_k_a_invariants), 0, 0, 1, 1},
14937
{&__pyx_n_s_algorithm, __pyx_k_algorithm, sizeof(__pyx_k_algorithm), 0, 0, 1, 1},
14938
{&__pyx_n_s_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 0, 1, 1},
14939
{&__pyx_n_s_ap, __pyx_k_ap, sizeof(__pyx_k_ap), 0, 0, 1, 1},
14940
{&__pyx_n_s_arg0, __pyx_k_arg0, sizeof(__pyx_k_arg0), 0, 0, 1, 1},
14941
{&__pyx_n_s_arg1, __pyx_k_arg1, sizeof(__pyx_k_arg1), 0, 0, 1, 1},
14942
{&__pyx_n_s_arg2, __pyx_k_arg2, sizeof(__pyx_k_arg2), 0, 0, 1, 1},
14943
{&__pyx_n_s_b, __pyx_k_b, sizeof(__pyx_k_b), 0, 0, 1, 1},
14944
{&__pyx_n_s_binomial, __pyx_k_binomial, sizeof(__pyx_k_binomial), 0, 0, 1, 1},
14945
{&__pyx_kp_s_bug_in_computing_p_adic_L_series, __pyx_k_bug_in_computing_p_adic_L_series, sizeof(__pyx_k_bug_in_computing_p_adic_L_series), 0, 0, 1, 0},
14946
{&__pyx_kp_s_bug_must_have_unit_root_p_s, __pyx_k_bug_must_have_unit_root_p_s, sizeof(__pyx_k_bug_must_have_unit_root_p_s), 0, 0, 1, 0},
14947
{&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
14948
{&__pyx_n_s_cfunc_to_py, __pyx_k_cfunc_to_py, sizeof(__pyx_k_cfunc_to_py), 0, 0, 1, 1},
14949
{&__pyx_n_s_change_ring, __pyx_k_change_ring, sizeof(__pyx_k_change_ring), 0, 0, 1, 1},
14950
{&__pyx_n_s_check, __pyx_k_check, sizeof(__pyx_k_check), 0, 0, 1, 1},
14951
{&__pyx_n_s_deprecation, __pyx_k_deprecation, sizeof(__pyx_k_deprecation), 0, 0, 1, 1},
14952
{&__pyx_n_s_eclib, __pyx_k_eclib, sizeof(__pyx_k_eclib), 0, 0, 1, 1},
14953
{&__pyx_n_s_end, __pyx_k_end, sizeof(__pyx_k_end), 0, 0, 1, 1},
14954
{&__pyx_n_s_exact_log, __pyx_k_exact_log, sizeof(__pyx_k_exact_log), 0, 0, 1, 1},
14955
{&__pyx_n_s_extend, __pyx_k_extend, sizeof(__pyx_k_extend), 0, 0, 1, 1},
14956
{&__pyx_n_s_f, __pyx_k_f, sizeof(__pyx_k_f), 0, 0, 1, 1},
14957
{&__pyx_n_s_factor_padic, __pyx_k_factor_padic, sizeof(__pyx_k_factor_padic), 0, 0, 1, 1},
14958
{&__pyx_kp_s_failed_to_allocate_s_bytes, __pyx_k_failed_to_allocate_s_bytes, sizeof(__pyx_k_failed_to_allocate_s_bytes), 0, 0, 1, 0},
14959
{&__pyx_kp_s_failed_to_allocate_s_s_bytes, __pyx_k_failed_to_allocate_s_s_bytes, sizeof(__pyx_k_failed_to_allocate_s_s_bytes), 0, 0, 1, 0},
14960
{&__pyx_n_s_file, __pyx_k_file, sizeof(__pyx_k_file), 0, 0, 1, 1},
14961
{&__pyx_n_s_force_mulmod, __pyx_k_force_mulmod, sizeof(__pyx_k_force_mulmod), 0, 0, 1, 1},
14962
{&__pyx_n_s_galois_representation, __pyx_k_galois_representation, sizeof(__pyx_k_galois_representation), 0, 0, 1, 1},
14963
{&__pyx_n_s_gen, __pyx_k_gen, sizeof(__pyx_k_gen), 0, 0, 1, 1},
14964
{&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
14965
{&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
14966
{&__pyx_kp_s_import_cysignals_signals_pxi_ins, __pyx_k_import_cysignals_signals_pxi_ins, sizeof(__pyx_k_import_cysignals_signals_pxi_ins), 0, 0, 1, 0},
14967
{&__pyx_n_s_infinity, __pyx_k_infinity, sizeof(__pyx_k_infinity), 0, 0, 1, 1},
14968
{&__pyx_n_s_init_memory_functions, __pyx_k_init_memory_functions, sizeof(__pyx_k_init_memory_functions), 0, 0, 1, 1},
14969
{&__pyx_kp_s_internal_modsym_denominator_must, __pyx_k_internal_modsym_denominator_must, sizeof(__pyx_k_internal_modsym_denominator_must), 0, 0, 1, 0},
14970
{&__pyx_n_s_intervals, __pyx_k_intervals, sizeof(__pyx_k_intervals), 0, 0, 1, 1},
14971
{&__pyx_n_s_inverse_mod, __pyx_k_inverse_mod, sizeof(__pyx_k_inverse_mod), 0, 0, 1, 1},
14972
{&__pyx_n_s_is_good, __pyx_k_is_good, sizeof(__pyx_k_is_good), 0, 0, 1, 1},
14973
{&__pyx_n_s_is_ordinary, __pyx_k_is_ordinary, sizeof(__pyx_k_is_ordinary), 0, 0, 1, 1},
14974
{&__pyx_n_s_is_pseudoprime, __pyx_k_is_pseudoprime, sizeof(__pyx_k_is_pseudoprime), 0, 0, 1, 1},
14975
{&__pyx_n_s_is_surjective, __pyx_k_is_surjective, sizeof(__pyx_k_is_surjective), 0, 0, 1, 1},
14976
{&__pyx_n_s_last, __pyx_k_last, sizeof(__pyx_k_last), 0, 0, 1, 1},
14977
{&__pyx_n_s_left, __pyx_k_left, sizeof(__pyx_k_left), 0, 0, 1, 1},
14978
{&__pyx_n_s_lift, __pyx_k_lift, sizeof(__pyx_k_lift), 0, 0, 1, 1},
14979
{&__pyx_n_s_list, __pyx_k_list, sizeof(__pyx_k_list), 0, 0, 1, 1},
14980
{&__pyx_n_s_log, __pyx_k_log, sizeof(__pyx_k_log), 0, 0, 1, 1},
14981
{&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
14982
{&__pyx_n_s_measure, __pyx_k_measure, sizeof(__pyx_k_measure), 0, 0, 1, 1},
14983
{&__pyx_n_s_measure_mulmod, __pyx_k_measure_mulmod, sizeof(__pyx_k_measure_mulmod), 0, 0, 1, 1},
14984
{&__pyx_n_s_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 0, 1, 1},
14985
{&__pyx_n_s_modsym, __pyx_k_modsym, sizeof(__pyx_k_modsym), 0, 0, 1, 1},
14986
{&__pyx_n_s_modular_symbol, __pyx_k_modular_symbol, sizeof(__pyx_k_modular_symbol), 0, 0, 1, 1},
14987
{&__pyx_n_s_modular_symbol_space, __pyx_k_modular_symbol_space, sizeof(__pyx_k_modular_symbol_space), 0, 0, 1, 1},
14988
{&__pyx_n_s_n, __pyx_k_n, sizeof(__pyx_k_n), 0, 0, 1, 1},
14989
{&__pyx_kp_s_n_too_large_to_compute_measure, __pyx_k_n_too_large_to_compute_measure, sizeof(__pyx_k_n_too_large_to_compute_measure), 0, 0, 1, 0},
14990
{&__pyx_n_s_ncpus, __pyx_k_ncpus, sizeof(__pyx_k_ncpus), 0, 0, 1, 1},
14991
{&__pyx_n_s_op, __pyx_k_op, sizeof(__pyx_k_op), 0, 0, 1, 1},
14992
{&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
14993
{&__pyx_kp_s_p_s_must_be_good_for_E, __pyx_k_p_s_must_be_good_for_E, sizeof(__pyx_k_p_s_must_be_good_for_E), 0, 0, 1, 0},
14994
{&__pyx_kp_s_p_s_must_be_ordinary_for_E, __pyx_k_p_s_must_be_ordinary_for_E, sizeof(__pyx_k_p_s_must_be_ordinary_for_E), 0, 0, 1, 0},
14995
{&__pyx_kp_s_p_s_must_be_prime, __pyx_k_p_s_must_be_prime, sizeof(__pyx_k_p_s_must_be_prime), 0, 0, 1, 0},
14996
{&__pyx_kp_s_p_s_must_be_surjective_for_E, __pyx_k_p_s_must_be_surjective_for_E, sizeof(__pyx_k_p_s_must_be_surjective_for_E), 0, 0, 1, 0},
14997
{&__pyx_n_s_padic_regulator, __pyx_k_padic_regulator, sizeof(__pyx_k_padic_regulator), 0, 0, 1, 1},
14998
{&__pyx_n_s_parallel, __pyx_k_parallel, sizeof(__pyx_k_parallel), 0, 0, 1, 1},
14999
{&__pyx_n_s_parent, __pyx_k_parent, sizeof(__pyx_k_parent), 0, 0, 1, 1},
15000
{&__pyx_n_s_pp, __pyx_k_pp, sizeof(__pyx_k_pp), 0, 0, 1, 1},
15001
{&__pyx_n_s_prec, __pyx_k_prec, sizeof(__pyx_k_prec), 0, 0, 1, 1},
15002
{&__pyx_n_s_prec_bounds, __pyx_k_prec_bounds, sizeof(__pyx_k_prec_bounds), 0, 0, 1, 1},
15003
{&__pyx_kp_s_prec_s_must_be_as_large_as_appro, __pyx_k_prec_s_must_be_as_large_as_appro, sizeof(__pyx_k_prec_s_must_be_as_large_as_appro), 0, 0, 1, 0},
15004
{&__pyx_n_s_precision_absolute, __pyx_k_precision_absolute, sizeof(__pyx_k_precision_absolute), 0, 0, 1, 1},
15005
{&__pyx_n_s_print, __pyx_k_print, sizeof(__pyx_k_print), 0, 0, 1, 1},
15006
{&__pyx_kp_s_projects_68c8b2b8_03ba_44d4_a0d, __pyx_k_projects_68c8b2b8_03ba_44d4_a0d, sizeof(__pyx_k_projects_68c8b2b8_03ba_44d4_a0d), 0, 0, 1, 0},
15007
{&__pyx_n_s_psage_modform_rational_padic_ell, __pyx_k_psage_modform_rational_padic_ell, sizeof(__pyx_k_psage_modform_rational_padic_ell), 0, 0, 1, 1},
15008
{&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
15009
{&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
15010
{&__pyx_n_s_rank, __pyx_k_rank, sizeof(__pyx_k_rank), 0, 0, 1, 1},
15011
{&__pyx_n_s_real_components, __pyx_k_real_components, sizeof(__pyx_k_real_components), 0, 0, 1, 1},
15012
{&__pyx_kp_s_requested_precision_s_too_large, __pyx_k_requested_precision_s_too_large, sizeof(__pyx_k_requested_precision_s_too_large), 0, 0, 1, 0},
15013
{&__pyx_n_s_right, __pyx_k_right, sizeof(__pyx_k_right), 0, 0, 1, 1},
15014
{&__pyx_kp_s_s_adic_L_series_of_s, __pyx_k_s_adic_L_series_of_s, sizeof(__pyx_k_s_adic_L_series_of_s), 0, 0, 1, 0},
15015
{&__pyx_n_s_sage, __pyx_k_sage, sizeof(__pyx_k_sage), 0, 0, 1, 1},
15016
{&__pyx_n_s_sage_all, __pyx_k_sage_all, sizeof(__pyx_k_sage_all), 0, 0, 1, 1},
15017
{&__pyx_n_s_sage_ext_memory, __pyx_k_sage_ext_memory, sizeof(__pyx_k_sage_ext_memory), 0, 0, 1, 1},
15018
{&__pyx_n_s_sage_misc_superseded, __pyx_k_sage_misc_superseded, sizeof(__pyx_k_sage_misc_superseded), 0, 0, 1, 1},
15019
{&__pyx_n_s_sage_parallel_ncpus, __pyx_k_sage_parallel_ncpus, sizeof(__pyx_k_sage_parallel_ncpus), 0, 0, 1, 1},
15020
{&__pyx_n_s_sage_rings_all, __pyx_k_sage_rings_all, sizeof(__pyx_k_sage_rings_all), 0, 0, 1, 1},
15021
{&__pyx_n_s_ser_prec, __pyx_k_ser_prec, sizeof(__pyx_k_ser_prec), 0, 0, 1, 1},
15022
{&__pyx_n_s_series, __pyx_k_series, sizeof(__pyx_k_series), 0, 0, 1, 1},
15023
{&__pyx_n_s_series_2, __pyx_k_series_2, sizeof(__pyx_k_series_2), 0, 0, 1, 1},
15024
{&__pyx_n_s_series_parallel, __pyx_k_series_parallel, sizeof(__pyx_k_series_parallel), 0, 0, 1, 1},
15025
{&__pyx_n_s_series_parallel_2, __pyx_k_series_parallel_2, sizeof(__pyx_k_series_parallel_2), 0, 0, 1, 1},
15026
{&__pyx_n_s_series_parallel_locals_f, __pyx_k_series_parallel_locals_f, sizeof(__pyx_k_series_parallel_locals_f), 0, 0, 1, 1},
15027
{&__pyx_kp_s_series_s_computing_mod_p_s, __pyx_k_series_s_computing_mod_p_s, sizeof(__pyx_k_series_s_computing_mod_p_s), 0, 0, 1, 0},
15028
{&__pyx_n_s_series_to_enough_prec, __pyx_k_series_to_enough_prec, sizeof(__pyx_k_series_to_enough_prec), 0, 0, 1, 1},
15029
{&__pyx_n_s_sign, __pyx_k_sign, sizeof(__pyx_k_sign), 0, 0, 1, 1},
15030
{&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
15031
{&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
15032
{&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
15033
{&__pyx_n_s_tamagawa_product, __pyx_k_tamagawa_product, sizeof(__pyx_k_tamagawa_product), 0, 0, 1, 1},
15034
{&__pyx_n_s_teichmuller, __pyx_k_teichmuller, sizeof(__pyx_k_teichmuller), 0, 0, 1, 1},
15035
{&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
15036
{&__pyx_n_s_torsion_order, __pyx_k_torsion_order, sizeof(__pyx_k_torsion_order), 0, 0, 1, 1},
15037
{&__pyx_n_s_truncate, __pyx_k_truncate, sizeof(__pyx_k_truncate), 0, 0, 1, 1},
15038
{&__pyx_kp_s_unknown_algorithm_s, __pyx_k_unknown_algorithm_s, sizeof(__pyx_k_unknown_algorithm_s), 0, 0, 1, 0},
15039
{&__pyx_n_s_use_eclib, __pyx_k_use_eclib, sizeof(__pyx_k_use_eclib), 0, 0, 1, 1},
15040
{&__pyx_n_s_valuation, __pyx_k_valuation, sizeof(__pyx_k_valuation), 0, 0, 1, 1},
15041
{&__pyx_n_s_verb, __pyx_k_verb, sizeof(__pyx_k_verb), 0, 0, 1, 1},
15042
{&__pyx_n_s_wrap, __pyx_k_wrap, sizeof(__pyx_k_wrap), 0, 0, 1, 1},
15043
{&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
15044
{&__pyx_n_s_y, __pyx_k_y, sizeof(__pyx_k_y), 0, 0, 1, 1},
15045
{0, 0, 0, 0, 0, 0, 0}
15046
};
15047
static int __Pyx_InitCachedBuiltins(void) {
15048
__pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(0, 156, __pyx_L1_error)
15049
__pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 180, __pyx_L1_error)
15050
__pyx_builtin_min = __Pyx_GetBuiltinName(__pyx_n_s_min); if (!__pyx_builtin_min) __PYX_ERR(0, 401, __pyx_L1_error)
15051
__pyx_builtin_AttributeError = __Pyx_GetBuiltinName(__pyx_n_s_AttributeError); if (!__pyx_builtin_AttributeError) __PYX_ERR(1, 70, __pyx_L1_error)
15052
__pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(2, 91, __pyx_L1_error)
15053
return 0;
15054
__pyx_L1_error:;
15055
return -1;
15056
}
15057
15058
static int __Pyx_InitCachedConstants(void) {
15059
__Pyx_RefNannyDeclarations
15060
__Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
15061
15062
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":140
15063
*
15064
* # prec = biggest n such that p^n <= 2^63, so n = floor(log_p(2^63))
15065
* self.prec = ZZ(2**63).exact_log(p) # <<<<<<<<<<<<<<
15066
*
15067
* assert Integer(p).is_pseudoprime(), "p (=%s) must be prime"%p
15068
*/
15069
__pyx_tuple_ = PyTuple_Pack(1, __pyx_int_9223372036854775808); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 140, __pyx_L1_error)
15070
__Pyx_GOTREF(__pyx_tuple_);
15071
__Pyx_GIVEREF(__pyx_tuple_);
15072
15073
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":297
15074
* R = Integers(pp)['T']
15075
* T = R.gen()
15076
* one_plus_T_factor = R(1) # <<<<<<<<<<<<<<
15077
* L = R(0)
15078
* one_plus_T = 1+T
15079
*/
15080
__pyx_tuple__2 = PyTuple_Pack(1, __pyx_int_1); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 297, __pyx_L1_error)
15081
__Pyx_GOTREF(__pyx_tuple__2);
15082
__Pyx_GIVEREF(__pyx_tuple__2);
15083
15084
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":298
15085
* T = R.gen()
15086
* one_plus_T_factor = R(1)
15087
* L = R(0) # <<<<<<<<<<<<<<
15088
* one_plus_T = 1+T
15089
*
15090
*/
15091
__pyx_tuple__3 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 298, __pyx_L1_error)
15092
__Pyx_GOTREF(__pyx_tuple__3);
15093
__Pyx_GIVEREF(__pyx_tuple__3);
15094
15095
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":400
15096
* aj = [R(aj[0], prec-2)] + [R(aj[j], bounds[j]) for j in range(1,len(aj))]
15097
* # make unknown coefficients show as 0 precision.
15098
* aj.extend([R(0,0) for _ in range(ser_prec-len(aj))]) # <<<<<<<<<<<<<<
15099
* ser_prec = min([ser_prec] + [i for i in range(len(aj)) if aj[i].precision_absolute() == 0])
15100
* L = R[['T']](aj, ser_prec)
15101
*/
15102
__pyx_tuple__4 = PyTuple_Pack(2, __pyx_int_0, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 400, __pyx_L1_error)
15103
__Pyx_GOTREF(__pyx_tuple__4);
15104
__Pyx_GIVEREF(__pyx_tuple__4);
15105
15106
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":476
15107
* ncpus = sage.parallel.ncpus.ncpus()
15108
* @parallel(ncpus)
15109
* def f(start, stop): # <<<<<<<<<<<<<<
15110
* return L._series(n, prec, ser_prec, verb, force_mulmod, start, stop)
15111
*
15112
*/
15113
__pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_s_start, __pyx_n_s_stop); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 476, __pyx_L1_error)
15114
__Pyx_GOTREF(__pyx_tuple__5);
15115
__Pyx_GIVEREF(__pyx_tuple__5);
15116
__pyx_codeobj__6 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__5, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_projects_68c8b2b8_03ba_44d4_a0d, __pyx_n_s_f, 476, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__6)) __PYX_ERR(0, 476, __pyx_L1_error)
15117
15118
/* "cfunc.to_py":65
15119
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
15120
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ):
15121
* def wrap(object arg0, object arg1, int arg2): # <<<<<<<<<<<<<<
15122
* """wrap(arg0, arg1, arg2: 'int')"""
15123
* return f(arg0, arg1, arg2)
15124
*/
15125
__pyx_tuple__7 = PyTuple_Pack(3, __pyx_n_s_arg0, __pyx_n_s_arg1, __pyx_n_s_arg2); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(5, 65, __pyx_L1_error)
15126
__Pyx_GOTREF(__pyx_tuple__7);
15127
__Pyx_GIVEREF(__pyx_tuple__7);
15128
__pyx_codeobj__8 = (PyObject*)__Pyx_PyCode_New(3, 0, 3, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__7, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_wrap, 65, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__8)) __PYX_ERR(5, 65, __pyx_L1_error)
15129
15130
/* "../../../../../../../sage/sage-7.5/src/sage/ext/interrupt.pxi":2
15131
* from sage.misc.superseded import deprecation
15132
* deprecation(20002, '''import "cysignals/signals.pxi" instead of "sage/ext/interrupt.pxi"''') # <<<<<<<<<<<<<<
15133
*
15134
* include "cysignals/signals.pxi"
15135
*/
15136
__pyx_tuple__9 = PyTuple_Pack(2, __pyx_int_20002, __pyx_kp_s_import_cysignals_signals_pxi_ins); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(20, 2, __pyx_L1_error)
15137
__Pyx_GOTREF(__pyx_tuple__9);
15138
__Pyx_GIVEREF(__pyx_tuple__9);
15139
15140
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":33
15141
* # Global temps so we don't have to call mpz_init repeatedly in mulmod.
15142
* # Also, this way we ensure that we don't leak 3 gmp ints.
15143
* cdef Integer aa=Integer(0), bb=Integer(0), cc=Integer(0) # <<<<<<<<<<<<<<
15144
* # Necessary gmp imports for the mulmod function
15145
* from sage.libs.gmp.mpz cimport mpz_fdiv_ui, mpz_set_si, mpz_mul
15146
*/
15147
__pyx_tuple__10 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(0, 33, __pyx_L1_error)
15148
__Pyx_GOTREF(__pyx_tuple__10);
15149
__Pyx_GIVEREF(__pyx_tuple__10);
15150
__pyx_tuple__11 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(0, 33, __pyx_L1_error)
15151
__Pyx_GOTREF(__pyx_tuple__11);
15152
__Pyx_GIVEREF(__pyx_tuple__11);
15153
__pyx_tuple__12 = PyTuple_Pack(1, __pyx_int_0); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 33, __pyx_L1_error)
15154
__Pyx_GOTREF(__pyx_tuple__12);
15155
__Pyx_GIVEREF(__pyx_tuple__12);
15156
15157
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":467
15158
* return sha, L, reg
15159
*
15160
* def series_parallel(L, n, prec, ser_prec=5, verb=False, force_mulmod=False, ncpus=None): # <<<<<<<<<<<<<<
15161
* # Use @parallel to do this computation by dividing it up into
15162
* # p separate tasks, doing those in separate processes,
15163
*/
15164
__pyx_tuple__13 = PyTuple_Pack(18, __pyx_n_s_L_2, __pyx_n_s_n, __pyx_n_s_prec, __pyx_n_s_ser_prec, __pyx_n_s_verb, __pyx_n_s_force_mulmod, __pyx_n_s_ncpus, __pyx_n_s_parallel, __pyx_n_s_sage, __pyx_n_s_f, __pyx_n_s_f, __pyx_n_s_last, __pyx_n_s_intervals, __pyx_n_s_start, __pyx_n_s_stop, __pyx_n_s_i, __pyx_n_s_P, __pyx_n_s_x); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 467, __pyx_L1_error)
15165
__Pyx_GOTREF(__pyx_tuple__13);
15166
__Pyx_GIVEREF(__pyx_tuple__13);
15167
__pyx_codeobj__14 = (PyObject*)__Pyx_PyCode_New(7, 0, 18, 0, 0, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__13, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_projects_68c8b2b8_03ba_44d4_a0d, __pyx_n_s_series_parallel, 467, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__14)) __PYX_ERR(0, 467, __pyx_L1_error)
15168
__Pyx_RefNannyFinishContext();
15169
return 0;
15170
__pyx_L1_error:;
15171
__Pyx_RefNannyFinishContext();
15172
return -1;
15173
}
15174
15175
static int __Pyx_InitGlobals(void) {
15176
if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
15177
__pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
15178
__pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
15179
__pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
15180
__pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
15181
__pyx_int_5 = PyInt_FromLong(5); if (unlikely(!__pyx_int_5)) __PYX_ERR(0, 1, __pyx_L1_error)
15182
__pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
15183
__pyx_int_20002 = PyInt_FromLong(20002L); if (unlikely(!__pyx_int_20002)) __PYX_ERR(0, 1, __pyx_L1_error)
15184
__pyx_int_9223372036854775808 = PyInt_FromString((char *)"9223372036854775808", 0, 0); if (unlikely(!__pyx_int_9223372036854775808)) __PYX_ERR(0, 1, __pyx_L1_error)
15185
return 0;
15186
__pyx_L1_error:;
15187
return -1;
15188
}
15189
15190
#if PY_MAJOR_VERSION < 3
15191
PyMODINIT_FUNC initpadic_elliptic_lseries_fast(void); /*proto*/
15192
PyMODINIT_FUNC initpadic_elliptic_lseries_fast(void)
15193
#else
15194
PyMODINIT_FUNC PyInit_padic_elliptic_lseries_fast(void); /*proto*/
15195
PyMODINIT_FUNC PyInit_padic_elliptic_lseries_fast(void)
15196
#endif
15197
{
15198
PyObject *__pyx_t_1 = NULL;
15199
PyObject *__pyx_t_2 = NULL;
15200
int __pyx_t_3;
15201
PyObject *__pyx_t_4 = NULL;
15202
PyObject *__pyx_t_5 = NULL;
15203
__Pyx_RefNannyDeclarations
15204
#if CYTHON_REFNANNY
15205
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
15206
if (!__Pyx_RefNanny) {
15207
PyErr_Clear();
15208
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
15209
if (!__Pyx_RefNanny)
15210
Py_FatalError("failed to import 'refnanny' module");
15211
}
15212
#endif
15213
__Pyx_RefNannySetupContext("PyMODINIT_FUNC PyInit_padic_elliptic_lseries_fast(void)", 0);
15214
if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15215
__pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
15216
__pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
15217
__pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
15218
#ifdef __Pyx_CyFunction_USED
15219
if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15220
#endif
15221
#ifdef __Pyx_FusedFunction_USED
15222
if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15223
#endif
15224
#ifdef __Pyx_Coroutine_USED
15225
if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15226
#endif
15227
#ifdef __Pyx_Generator_USED
15228
if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15229
#endif
15230
#ifdef __Pyx_StopAsyncIteration_USED
15231
if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15232
#endif
15233
/*--- Library function declarations ---*/
15234
/*--- Threads initialization code ---*/
15235
#if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
15236
#ifdef WITH_THREAD /* Python build with threading support? */
15237
PyEval_InitThreads();
15238
#endif
15239
#endif
15240
/*--- Module creation code ---*/
15241
#if PY_MAJOR_VERSION < 3
15242
__pyx_m = Py_InitModule4("padic_elliptic_lseries_fast", __pyx_methods, __pyx_k_File_padic_elliptic_lseries_fast, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
15243
#else
15244
__pyx_m = PyModule_Create(&__pyx_moduledef);
15245
#endif
15246
if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
15247
__pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
15248
Py_INCREF(__pyx_d);
15249
__pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
15250
#if CYTHON_COMPILING_IN_PYPY
15251
Py_INCREF(__pyx_b);
15252
#endif
15253
if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
15254
/*--- Initialize various global constants etc. ---*/
15255
if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15256
#if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
15257
if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15258
#endif
15259
if (__pyx_module_is_main_psage__modform__rational__padic_elliptic_lseries_fast) {
15260
if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15261
}
15262
#if PY_MAJOR_VERSION >= 3
15263
{
15264
PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
15265
if (!PyDict_GetItemString(modules, "psage.modform.rational.padic_elliptic_lseries_fast")) {
15266
if (unlikely(PyDict_SetItemString(modules, "psage.modform.rational.padic_elliptic_lseries_fast", __pyx_m) < 0)) __PYX_ERR(0, 1, __pyx_L1_error)
15267
}
15268
}
15269
#endif
15270
/*--- Builtin init code ---*/
15271
if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15272
/*--- Constants init code ---*/
15273
if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15274
/*--- Global init code ---*/
15275
__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_aa = ((struct __pyx_obj_4sage_5rings_7integer_Integer *)Py_None); Py_INCREF(Py_None);
15276
__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_bb = ((struct __pyx_obj_4sage_5rings_7integer_Integer *)Py_None); Py_INCREF(Py_None);
15277
__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_cc = ((struct __pyx_obj_4sage_5rings_7integer_Integer *)Py_None); Py_INCREF(Py_None);
15278
/*--- Variable export code ---*/
15279
/*--- Function export code ---*/
15280
/*--- Type init code ---*/
15281
__pyx_vtabptr_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries = &__pyx_vtable_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries;
15282
__pyx_vtable_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries.modular_symbol = (long (*)(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *, long, long, int __pyx_skip_dispatch))__pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_modular_symbol;
15283
__pyx_vtable_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries.measure = (long (*)(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *, long, int, int __pyx_skip_dispatch))__pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure;
15284
__pyx_vtable_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries.measure_mulmod = (long (*)(struct __pyx_obj_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries *, long, int, long, int __pyx_skip_dispatch))__pyx_f_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_measure_mulmod;
15285
if (PyType_Ready(&__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
15286
__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries.tp_print = 0;
15287
#if CYTHON_COMPILING_IN_CPYTHON
15288
{
15289
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, "__init__"); if (unlikely(!wrapper)) __PYX_ERR(0, 49, __pyx_L1_error)
15290
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
15291
__pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__ = *((PyWrapperDescrObject *)wrapper)->d_base;
15292
__pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__.doc = __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__;
15293
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_4__init__;
15294
}
15295
}
15296
#endif
15297
#if CYTHON_COMPILING_IN_CPYTHON
15298
{
15299
PyObject *wrapper = PyObject_GetAttrString((PyObject *)&__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries, "__repr__"); if (unlikely(!wrapper)) __PYX_ERR(0, 49, __pyx_L1_error)
15300
if (Py_TYPE(wrapper) == &PyWrapperDescr_Type) {
15301
__pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__ = *((PyWrapperDescrObject *)wrapper)->d_base;
15302
__pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__.doc = __pyx_doc_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__;
15303
((PyWrapperDescrObject *)wrapper)->d_base = &__pyx_wrapperbase_5psage_7modform_8rational_27padic_elliptic_lseries_fast_12pAdicLseries_6__repr__;
15304
}
15305
}
15306
#endif
15307
if (__Pyx_SetVtable(__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries.tp_dict, __pyx_vtabptr_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
15308
if (PyObject_SetAttrString(__pyx_m, "pAdicLseries", (PyObject *)&__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries) < 0) __PYX_ERR(0, 49, __pyx_L1_error)
15309
__pyx_ptype_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries = &__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast_pAdicLseries;
15310
if (PyType_Ready(&__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel) < 0) __PYX_ERR(0, 467, __pyx_L1_error)
15311
__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel.tp_print = 0;
15312
__pyx_ptype_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel = &__pyx_type_5psage_7modform_8rational_27padic_elliptic_lseries_fast___pyx_scope_struct__series_parallel;
15313
if (PyType_Ready(&__pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py) < 0) __PYX_ERR(5, 64, __pyx_L1_error)
15314
__pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py.tp_print = 0;
15315
__pyx_ptype___pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py = &__pyx_scope_struct____Pyx_CFunc_object____object____object____int___to_py;
15316
/*--- Type import code ---*/
15317
__pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
15318
#if CYTHON_COMPILING_IN_PYPY
15319
sizeof(PyTypeObject),
15320
#else
15321
sizeof(PyHeapTypeObject),
15322
#endif
15323
0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(6, 9, __pyx_L1_error)
15324
__pyx_ptype_7cpython_4bool_bool = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "bool", sizeof(PyBoolObject), 0); if (unlikely(!__pyx_ptype_7cpython_4bool_bool)) __PYX_ERR(7, 8, __pyx_L1_error)
15325
__pyx_ptype_7cpython_7complex_complex = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "complex", sizeof(PyComplexObject), 0); if (unlikely(!__pyx_ptype_7cpython_7complex_complex)) __PYX_ERR(8, 15, __pyx_L1_error)
15326
__pyx_ptype_4sage_9structure_11sage_object_SageObject = __Pyx_ImportType("sage.structure.sage_object", "SageObject", sizeof(struct __pyx_obj_4sage_9structure_11sage_object_SageObject), 1); if (unlikely(!__pyx_ptype_4sage_9structure_11sage_object_SageObject)) __PYX_ERR(3, 9, __pyx_L1_error)
15327
__pyx_ptype_4sage_9structure_15category_object_CategoryObject = __Pyx_ImportType("sage.structure.category_object", "CategoryObject", sizeof(struct __pyx_obj_4sage_9structure_15category_object_CategoryObject), 1); if (unlikely(!__pyx_ptype_4sage_9structure_15category_object_CategoryObject)) __PYX_ERR(9, 15, __pyx_L1_error)
15328
__pyx_vtabptr_4sage_9structure_15category_object_CategoryObject = (struct __pyx_vtabstruct_4sage_9structure_15category_object_CategoryObject*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_15category_object_CategoryObject->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_15category_object_CategoryObject)) __PYX_ERR(9, 15, __pyx_L1_error)
15329
__pyx_ptype_4sage_9structure_11coerce_dict_MonoDict = __Pyx_ImportType("sage.structure.coerce_dict", "MonoDict", sizeof(struct __pyx_obj_4sage_9structure_11coerce_dict_MonoDict), 1); if (unlikely(!__pyx_ptype_4sage_9structure_11coerce_dict_MonoDict)) __PYX_ERR(10, 7, __pyx_L1_error)
15330
__pyx_vtabptr_4sage_9structure_11coerce_dict_MonoDict = (struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_MonoDict*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_11coerce_dict_MonoDict->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_11coerce_dict_MonoDict)) __PYX_ERR(10, 7, __pyx_L1_error)
15331
__pyx_ptype_4sage_9structure_11coerce_dict_TripleDict = __Pyx_ImportType("sage.structure.coerce_dict", "TripleDict", sizeof(struct __pyx_obj_4sage_9structure_11coerce_dict_TripleDict), 1); if (unlikely(!__pyx_ptype_4sage_9structure_11coerce_dict_TripleDict)) __PYX_ERR(10, 23, __pyx_L1_error)
15332
__pyx_vtabptr_4sage_9structure_11coerce_dict_TripleDict = (struct __pyx_vtabstruct_4sage_9structure_11coerce_dict_TripleDict*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_11coerce_dict_TripleDict->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_11coerce_dict_TripleDict)) __PYX_ERR(10, 23, __pyx_L1_error)
15333
__pyx_ptype_4sage_9structure_6parent_Parent = __Pyx_ImportType("sage.structure.parent", "Parent", sizeof(struct __pyx_obj_4sage_9structure_6parent_Parent), 1); if (unlikely(!__pyx_ptype_4sage_9structure_6parent_Parent)) __PYX_ERR(11, 12, __pyx_L1_error)
15334
__pyx_vtabptr_4sage_9structure_6parent_Parent = (struct __pyx_vtabstruct_4sage_9structure_6parent_Parent*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_6parent_Parent->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_6parent_Parent)) __PYX_ERR(11, 12, __pyx_L1_error)
15335
__pyx_ptype_4sage_4misc_18inherit_comparison_InheritComparisonMetaclass = __Pyx_ImportType("sage.misc.inherit_comparison", "InheritComparisonMetaclass", sizeof(struct __pyx_obj_4sage_4misc_18inherit_comparison_InheritComparisonMetaclass), 1); if (unlikely(!__pyx_ptype_4sage_4misc_18inherit_comparison_InheritComparisonMetaclass)) __PYX_ERR(12, 3, __pyx_L1_error)
15336
__pyx_ptype_4sage_9structure_7element_Element = __Pyx_ImportType("sage.structure.element", "Element", sizeof(struct __pyx_obj_4sage_9structure_7element_Element), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_Element)) __PYX_ERR(1, 169, __pyx_L1_error)
15337
__pyx_vtabptr_4sage_9structure_7element_Element = (struct __pyx_vtabstruct_4sage_9structure_7element_Element*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_Element->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_Element)) __PYX_ERR(1, 169, __pyx_L1_error)
15338
__pyx_ptype_4sage_9structure_7element_ElementWithCachedMethod = __Pyx_ImportType("sage.structure.element", "ElementWithCachedMethod", sizeof(struct __pyx_obj_4sage_9structure_7element_ElementWithCachedMethod), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_ElementWithCachedMethod)) __PYX_ERR(1, 192, __pyx_L1_error)
15339
__pyx_vtabptr_4sage_9structure_7element_ElementWithCachedMethod = (struct __pyx_vtabstruct_4sage_9structure_7element_ElementWithCachedMethod*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_ElementWithCachedMethod->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_ElementWithCachedMethod)) __PYX_ERR(1, 192, __pyx_L1_error)
15340
__pyx_ptype_4sage_9structure_7element_ModuleElement = __Pyx_ImportType("sage.structure.element", "ModuleElement", sizeof(struct __pyx_obj_4sage_9structure_7element_ModuleElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_ModuleElement)) __PYX_ERR(1, 195, __pyx_L1_error)
15341
__pyx_vtabptr_4sage_9structure_7element_ModuleElement = (struct __pyx_vtabstruct_4sage_9structure_7element_ModuleElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_ModuleElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_ModuleElement)) __PYX_ERR(1, 195, __pyx_L1_error)
15342
__pyx_ptype_4sage_9structure_7element_RingElement = __Pyx_ImportType("sage.structure.element", "RingElement", sizeof(struct __pyx_obj_4sage_9structure_7element_RingElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_RingElement)) __PYX_ERR(1, 197, __pyx_L1_error)
15343
__pyx_vtabptr_4sage_9structure_7element_RingElement = (struct __pyx_vtabstruct_4sage_9structure_7element_RingElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_RingElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_RingElement)) __PYX_ERR(1, 197, __pyx_L1_error)
15344
__pyx_ptype_4sage_9structure_7element_MonoidElement = __Pyx_ImportType("sage.structure.element", "MonoidElement", sizeof(struct __pyx_obj_4sage_9structure_7element_MonoidElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_MonoidElement)) __PYX_ERR(1, 208, __pyx_L1_error)
15345
__pyx_vtabptr_4sage_9structure_7element_MonoidElement = (struct __pyx_vtabstruct_4sage_9structure_7element_MonoidElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_MonoidElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_MonoidElement)) __PYX_ERR(1, 208, __pyx_L1_error)
15346
__pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement = __Pyx_ImportType("sage.structure.element", "MultiplicativeGroupElement", sizeof(struct __pyx_obj_4sage_9structure_7element_MultiplicativeGroupElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement)) __PYX_ERR(1, 211, __pyx_L1_error)
15347
__pyx_vtabptr_4sage_9structure_7element_MultiplicativeGroupElement = (struct __pyx_vtabstruct_4sage_9structure_7element_MultiplicativeGroupElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_MultiplicativeGroupElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_MultiplicativeGroupElement)) __PYX_ERR(1, 211, __pyx_L1_error)
15348
__pyx_ptype_4sage_9structure_7element_AdditiveGroupElement = __Pyx_ImportType("sage.structure.element", "AdditiveGroupElement", sizeof(struct __pyx_obj_4sage_9structure_7element_AdditiveGroupElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_AdditiveGroupElement)) __PYX_ERR(1, 214, __pyx_L1_error)
15349
__pyx_vtabptr_4sage_9structure_7element_AdditiveGroupElement = (struct __pyx_vtabstruct_4sage_9structure_7element_AdditiveGroupElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_AdditiveGroupElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_AdditiveGroupElement)) __PYX_ERR(1, 214, __pyx_L1_error)
15350
__pyx_ptype_4sage_9structure_7element_CommutativeRingElement = __Pyx_ImportType("sage.structure.element", "CommutativeRingElement", sizeof(struct __pyx_obj_4sage_9structure_7element_CommutativeRingElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_CommutativeRingElement)) __PYX_ERR(1, 220, __pyx_L1_error)
15351
__pyx_vtabptr_4sage_9structure_7element_CommutativeRingElement = (struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeRingElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_CommutativeRingElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_CommutativeRingElement)) __PYX_ERR(1, 220, __pyx_L1_error)
15352
__pyx_ptype_4sage_9structure_7element_IntegralDomainElement = __Pyx_ImportType("sage.structure.element", "IntegralDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_IntegralDomainElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_IntegralDomainElement)) __PYX_ERR(1, 223, __pyx_L1_error)
15353
__pyx_vtabptr_4sage_9structure_7element_IntegralDomainElement = (struct __pyx_vtabstruct_4sage_9structure_7element_IntegralDomainElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_IntegralDomainElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_IntegralDomainElement)) __PYX_ERR(1, 223, __pyx_L1_error)
15354
__pyx_ptype_4sage_9structure_7element_DedekindDomainElement = __Pyx_ImportType("sage.structure.element", "DedekindDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_DedekindDomainElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_DedekindDomainElement)) __PYX_ERR(1, 226, __pyx_L1_error)
15355
__pyx_vtabptr_4sage_9structure_7element_DedekindDomainElement = (struct __pyx_vtabstruct_4sage_9structure_7element_DedekindDomainElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_DedekindDomainElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_DedekindDomainElement)) __PYX_ERR(1, 226, __pyx_L1_error)
15356
__pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement = __Pyx_ImportType("sage.structure.element", "PrincipalIdealDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_PrincipalIdealDomainElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement)) __PYX_ERR(1, 229, __pyx_L1_error)
15357
__pyx_vtabptr_4sage_9structure_7element_PrincipalIdealDomainElement = (struct __pyx_vtabstruct_4sage_9structure_7element_PrincipalIdealDomainElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_PrincipalIdealDomainElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_PrincipalIdealDomainElement)) __PYX_ERR(1, 229, __pyx_L1_error)
15358
__pyx_ptype_4sage_9structure_7element_EuclideanDomainElement = __Pyx_ImportType("sage.structure.element", "EuclideanDomainElement", sizeof(struct __pyx_obj_4sage_9structure_7element_EuclideanDomainElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_EuclideanDomainElement)) __PYX_ERR(1, 232, __pyx_L1_error)
15359
__pyx_vtabptr_4sage_9structure_7element_EuclideanDomainElement = (struct __pyx_vtabstruct_4sage_9structure_7element_EuclideanDomainElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_EuclideanDomainElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_EuclideanDomainElement)) __PYX_ERR(1, 232, __pyx_L1_error)
15360
__pyx_ptype_4sage_9structure_7element_FieldElement = __Pyx_ImportType("sage.structure.element", "FieldElement", sizeof(struct __pyx_obj_4sage_9structure_7element_FieldElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_FieldElement)) __PYX_ERR(1, 236, __pyx_L1_error)
15361
__pyx_vtabptr_4sage_9structure_7element_FieldElement = (struct __pyx_vtabstruct_4sage_9structure_7element_FieldElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_FieldElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_FieldElement)) __PYX_ERR(1, 236, __pyx_L1_error)
15362
__pyx_ptype_4sage_9structure_7element_AlgebraElement = __Pyx_ImportType("sage.structure.element", "AlgebraElement", sizeof(struct __pyx_obj_4sage_9structure_7element_AlgebraElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_AlgebraElement)) __PYX_ERR(1, 239, __pyx_L1_error)
15363
__pyx_vtabptr_4sage_9structure_7element_AlgebraElement = (struct __pyx_vtabstruct_4sage_9structure_7element_AlgebraElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_AlgebraElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_AlgebraElement)) __PYX_ERR(1, 239, __pyx_L1_error)
15364
__pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement = __Pyx_ImportType("sage.structure.element", "CommutativeAlgebraElement", sizeof(struct __pyx_obj_4sage_9structure_7element_CommutativeAlgebraElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement)) __PYX_ERR(1, 242, __pyx_L1_error)
15365
__pyx_vtabptr_4sage_9structure_7element_CommutativeAlgebraElement = (struct __pyx_vtabstruct_4sage_9structure_7element_CommutativeAlgebraElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_CommutativeAlgebraElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_CommutativeAlgebraElement)) __PYX_ERR(1, 242, __pyx_L1_error)
15366
__pyx_ptype_4sage_9structure_7element_InfinityElement = __Pyx_ImportType("sage.structure.element", "InfinityElement", sizeof(struct __pyx_obj_4sage_9structure_7element_InfinityElement), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_InfinityElement)) __PYX_ERR(1, 245, __pyx_L1_error)
15367
__pyx_vtabptr_4sage_9structure_7element_InfinityElement = (struct __pyx_vtabstruct_4sage_9structure_7element_InfinityElement*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_InfinityElement->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_InfinityElement)) __PYX_ERR(1, 245, __pyx_L1_error)
15368
__pyx_ptype_4sage_9structure_7element_Vector = __Pyx_ImportType("sage.structure.element", "Vector", sizeof(struct __pyx_obj_4sage_9structure_7element_Vector), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_Vector)) __PYX_ERR(1, 249, __pyx_L1_error)
15369
__pyx_vtabptr_4sage_9structure_7element_Vector = (struct __pyx_vtabstruct_4sage_9structure_7element_Vector*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_Vector->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_Vector)) __PYX_ERR(1, 249, __pyx_L1_error)
15370
__pyx_ptype_4sage_9structure_7element_Matrix = __Pyx_ImportType("sage.structure.element", "Matrix", sizeof(struct __pyx_obj_4sage_9structure_7element_Matrix), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_Matrix)) __PYX_ERR(1, 264, __pyx_L1_error)
15371
__pyx_vtabptr_4sage_9structure_7element_Matrix = (struct __pyx_vtabstruct_4sage_9structure_7element_Matrix*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_Matrix->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_Matrix)) __PYX_ERR(1, 264, __pyx_L1_error)
15372
__pyx_ptype_4sage_9structure_7element_CoercionModel = __Pyx_ImportType("sage.structure.element", "CoercionModel", sizeof(struct __pyx_obj_4sage_9structure_7element_CoercionModel), 1); if (unlikely(!__pyx_ptype_4sage_9structure_7element_CoercionModel)) __PYX_ERR(1, 277, __pyx_L1_error)
15373
__pyx_vtabptr_4sage_9structure_7element_CoercionModel = (struct __pyx_vtabstruct_4sage_9structure_7element_CoercionModel*)__Pyx_GetVtable(__pyx_ptype_4sage_9structure_7element_CoercionModel->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_9structure_7element_CoercionModel)) __PYX_ERR(1, 277, __pyx_L1_error)
15374
__pyx_ptype_4sage_10categories_3map_Map = __Pyx_ImportType("sage.categories.map", "Map", sizeof(struct __pyx_obj_4sage_10categories_3map_Map), 1); if (unlikely(!__pyx_ptype_4sage_10categories_3map_Map)) __PYX_ERR(13, 4, __pyx_L1_error)
15375
__pyx_vtabptr_4sage_10categories_3map_Map = (struct __pyx_vtabstruct_4sage_10categories_3map_Map*)__Pyx_GetVtable(__pyx_ptype_4sage_10categories_3map_Map->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_10categories_3map_Map)) __PYX_ERR(13, 4, __pyx_L1_error)
15376
__pyx_ptype_4sage_10categories_3map_Section = __Pyx_ImportType("sage.categories.map", "Section", sizeof(struct __pyx_obj_4sage_10categories_3map_Section), 1); if (unlikely(!__pyx_ptype_4sage_10categories_3map_Section)) __PYX_ERR(13, 25, __pyx_L1_error)
15377
__pyx_vtabptr_4sage_10categories_3map_Section = (struct __pyx_vtabstruct_4sage_10categories_3map_Section*)__Pyx_GetVtable(__pyx_ptype_4sage_10categories_3map_Section->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_10categories_3map_Section)) __PYX_ERR(13, 25, __pyx_L1_error)
15378
__pyx_ptype_4sage_10categories_3map_FormalCompositeMap = __Pyx_ImportType("sage.categories.map", "FormalCompositeMap", sizeof(struct __pyx_obj_4sage_10categories_3map_FormalCompositeMap), 1); if (unlikely(!__pyx_ptype_4sage_10categories_3map_FormalCompositeMap)) __PYX_ERR(13, 28, __pyx_L1_error)
15379
__pyx_vtabptr_4sage_10categories_3map_FormalCompositeMap = (struct __pyx_vtabstruct_4sage_10categories_3map_FormalCompositeMap*)__Pyx_GetVtable(__pyx_ptype_4sage_10categories_3map_FormalCompositeMap->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_10categories_3map_FormalCompositeMap)) __PYX_ERR(13, 28, __pyx_L1_error)
15380
__pyx_ptype_4sage_10categories_8morphism_Morphism = __Pyx_ImportType("sage.categories.morphism", "Morphism", sizeof(struct __pyx_obj_4sage_10categories_8morphism_Morphism), 1); if (unlikely(!__pyx_ptype_4sage_10categories_8morphism_Morphism)) __PYX_ERR(14, 5, __pyx_L1_error)
15381
__pyx_vtabptr_4sage_10categories_8morphism_Morphism = (struct __pyx_vtabstruct_4sage_10categories_8morphism_Morphism*)__Pyx_GetVtable(__pyx_ptype_4sage_10categories_8morphism_Morphism->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_10categories_8morphism_Morphism)) __PYX_ERR(14, 5, __pyx_L1_error)
15382
__pyx_ptype_4sage_10categories_8morphism_SetMorphism = __Pyx_ImportType("sage.categories.morphism", "SetMorphism", sizeof(struct __pyx_obj_4sage_10categories_8morphism_SetMorphism), 1); if (unlikely(!__pyx_ptype_4sage_10categories_8morphism_SetMorphism)) __PYX_ERR(14, 8, __pyx_L1_error)
15383
__pyx_vtabptr_4sage_10categories_8morphism_SetMorphism = (struct __pyx_vtabstruct_4sage_10categories_8morphism_SetMorphism*)__Pyx_GetVtable(__pyx_ptype_4sage_10categories_8morphism_SetMorphism->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_10categories_8morphism_SetMorphism)) __PYX_ERR(14, 8, __pyx_L1_error)
15384
__pyx_ptype_4sage_5rings_7integer_Integer = __Pyx_ImportType("sage.rings.integer", "Integer", sizeof(struct __pyx_obj_4sage_5rings_7integer_Integer), 1); if (unlikely(!__pyx_ptype_4sage_5rings_7integer_Integer)) __PYX_ERR(15, 7, __pyx_L1_error)
15385
__pyx_vtabptr_4sage_5rings_7integer_Integer = (struct __pyx_vtabstruct_4sage_5rings_7integer_Integer*)__Pyx_GetVtable(__pyx_ptype_4sage_5rings_7integer_Integer->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_5rings_7integer_Integer)) __PYX_ERR(15, 7, __pyx_L1_error)
15386
__pyx_ptype_4sage_5rings_7integer_int_to_Z = __Pyx_ImportType("sage.rings.integer", "int_to_Z", sizeof(struct __pyx_obj_4sage_5rings_7integer_int_to_Z), 1); if (unlikely(!__pyx_ptype_4sage_5rings_7integer_int_to_Z)) __PYX_ERR(15, 37, __pyx_L1_error)
15387
__pyx_vtabptr_4sage_5rings_7integer_int_to_Z = (struct __pyx_vtabstruct_4sage_5rings_7integer_int_to_Z*)__Pyx_GetVtable(__pyx_ptype_4sage_5rings_7integer_int_to_Z->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_5rings_7integer_int_to_Z)) __PYX_ERR(15, 37, __pyx_L1_error)
15388
__pyx_ptype_4sage_7modular_6modsym_6p1list_export = __Pyx_ImportType("sage.modular.modsym.p1list", "export", sizeof(struct __pyx_obj_4sage_7modular_6modsym_6p1list_export), 1); if (unlikely(!__pyx_ptype_4sage_7modular_6modsym_6p1list_export)) __PYX_ERR(16, 3, __pyx_L1_error)
15389
__pyx_vtabptr_4sage_7modular_6modsym_6p1list_export = (struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_export*)__Pyx_GetVtable(__pyx_ptype_4sage_7modular_6modsym_6p1list_export->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_7modular_6modsym_6p1list_export)) __PYX_ERR(16, 3, __pyx_L1_error)
15390
__pyx_ptype_4sage_7modular_6modsym_6p1list_P1List = __Pyx_ImportType("sage.modular.modsym.p1list", "P1List", sizeof(struct __pyx_obj_4sage_7modular_6modsym_6p1list_P1List), 1); if (unlikely(!__pyx_ptype_4sage_7modular_6modsym_6p1list_P1List)) __PYX_ERR(16, 13, __pyx_L1_error)
15391
__pyx_vtabptr_4sage_7modular_6modsym_6p1list_P1List = (struct __pyx_vtabstruct_4sage_7modular_6modsym_6p1list_P1List*)__Pyx_GetVtable(__pyx_ptype_4sage_7modular_6modsym_6p1list_P1List->tp_dict); if (unlikely(!__pyx_vtabptr_4sage_7modular_6modsym_6p1list_P1List)) __PYX_ERR(16, 13, __pyx_L1_error)
15392
__pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap = __Pyx_ImportType("psage.modform.rational.modular_symbol_map", "ModularSymbolMap", sizeof(struct __pyx_obj_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap), 1); if (unlikely(!__pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap)) __PYX_ERR(17, 28, __pyx_L1_error)
15393
__pyx_vtabptr_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap = (struct __pyx_vtabstruct_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap*)__Pyx_GetVtable(__pyx_ptype_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap->tp_dict); if (unlikely(!__pyx_vtabptr_5psage_7modform_8rational_18modular_symbol_map_ModularSymbolMap)) __PYX_ERR(17, 28, __pyx_L1_error)
15394
/*--- Variable import code ---*/
15395
__pyx_t_1 = __Pyx_ImportModule("cysignals.signals"); if (!__pyx_t_1) __PYX_ERR(0, 1, __pyx_L1_error)
15396
if (__Pyx_ImportVoidPtr(__pyx_t_1, "cysigs", (void **)&__pyx_vp_9cysignals_7signals_cysigs, "cysigs_t") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15397
Py_DECREF(__pyx_t_1); __pyx_t_1 = 0;
15398
__pyx_t_2 = __Pyx_ImportModule("sage.structure.element"); if (!__pyx_t_2) __PYX_ERR(0, 1, __pyx_L1_error)
15399
if (__Pyx_ImportVoidPtr(__pyx_t_2, "coercion_model", (void **)&__pyx_vp_4sage_9structure_7element_coercion_model, "struct __pyx_obj_4sage_9structure_7element_CoercionModel *") < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15400
Py_DECREF(__pyx_t_2); __pyx_t_2 = 0;
15401
/*--- Function import code ---*/
15402
/*--- Execution code ---*/
15403
#if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
15404
if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15405
#endif
15406
15407
/* "../../../../../../../sage/sage-7.5/local/lib/python2.7/site-packages/cysignals/signals.pxi":24
15408
* # This *must* be done for every module using interrupt functions
15409
* # otherwise you will get segmentation faults.
15410
* import_cysignals__signals() # <<<<<<<<<<<<<<
15411
*/
15412
__pyx_t_3 = import_cysignals__signals(); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(18, 24, __pyx_L1_error)
15413
15414
/* "../../../../../../../sage/sage-7.5/src/sage/ext/stdsage.pxi":24
15415
*
15416
* from sage.ext.stdsage cimport PY_NEW, HAS_DICTIONARY
15417
* from sage.ext.memory import init_memory_functions # <<<<<<<<<<<<<<
15418
*/
15419
__pyx_t_4 = PyList_New(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 24, __pyx_L1_error)
15420
__Pyx_GOTREF(__pyx_t_4);
15421
__Pyx_INCREF(__pyx_n_s_init_memory_functions);
15422
__Pyx_GIVEREF(__pyx_n_s_init_memory_functions);
15423
PyList_SET_ITEM(__pyx_t_4, 0, __pyx_n_s_init_memory_functions);
15424
__pyx_t_5 = __Pyx_Import(__pyx_n_s_sage_ext_memory, __pyx_t_4, -1); if (unlikely(!__pyx_t_5)) __PYX_ERR(19, 24, __pyx_L1_error)
15425
__Pyx_GOTREF(__pyx_t_5);
15426
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15427
__pyx_t_4 = __Pyx_ImportFrom(__pyx_t_5, __pyx_n_s_init_memory_functions); if (unlikely(!__pyx_t_4)) __PYX_ERR(19, 24, __pyx_L1_error)
15428
__Pyx_GOTREF(__pyx_t_4);
15429
if (PyDict_SetItem(__pyx_d, __pyx_n_s_init_memory_functions, __pyx_t_4) < 0) __PYX_ERR(19, 24, __pyx_L1_error)
15430
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15431
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15432
15433
/* "../../../../../../../sage/sage-7.5/src/sage/ext/interrupt.pxi":1
15434
* from sage.misc.superseded import deprecation # <<<<<<<<<<<<<<
15435
* deprecation(20002, '''import "cysignals/signals.pxi" instead of "sage/ext/interrupt.pxi"''')
15436
*
15437
*/
15438
__pyx_t_5 = PyList_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 1, __pyx_L1_error)
15439
__Pyx_GOTREF(__pyx_t_5);
15440
__Pyx_INCREF(__pyx_n_s_deprecation);
15441
__Pyx_GIVEREF(__pyx_n_s_deprecation);
15442
PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_deprecation);
15443
__pyx_t_4 = __Pyx_Import(__pyx_n_s_sage_misc_superseded, __pyx_t_5, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 1, __pyx_L1_error)
15444
__Pyx_GOTREF(__pyx_t_4);
15445
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15446
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_deprecation); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 1, __pyx_L1_error)
15447
__Pyx_GOTREF(__pyx_t_5);
15448
if (PyDict_SetItem(__pyx_d, __pyx_n_s_deprecation, __pyx_t_5) < 0) __PYX_ERR(20, 1, __pyx_L1_error)
15449
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15450
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15451
15452
/* "../../../../../../../sage/sage-7.5/src/sage/ext/interrupt.pxi":2
15453
* from sage.misc.superseded import deprecation
15454
* deprecation(20002, '''import "cysignals/signals.pxi" instead of "sage/ext/interrupt.pxi"''') # <<<<<<<<<<<<<<
15455
*
15456
* include "cysignals/signals.pxi"
15457
*/
15458
__pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_deprecation); if (unlikely(!__pyx_t_4)) __PYX_ERR(20, 2, __pyx_L1_error)
15459
__Pyx_GOTREF(__pyx_t_4);
15460
__pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(20, 2, __pyx_L1_error)
15461
__Pyx_GOTREF(__pyx_t_5);
15462
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15463
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15464
15465
/* "../../../../../../../sage/sage-7.5/local/lib/python2.7/site-packages/cysignals/signals.pxi":24
15466
* # This *must* be done for every module using interrupt functions
15467
* # otherwise you will get segmentation faults.
15468
* import_cysignals__signals() # <<<<<<<<<<<<<<
15469
*/
15470
__pyx_t_3 = import_cysignals__signals(); if (unlikely(__pyx_t_3 == -1)) __PYX_ERR(18, 24, __pyx_L1_error)
15471
15472
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":26
15473
* include 'interrupt.pxi'
15474
*
15475
* from sage.rings.all import ZZ, Zp, Qp, Integers, infinity, binomial, Mod, O # <<<<<<<<<<<<<<
15476
*
15477
* from sage.rings.integer cimport Integer
15478
*/
15479
__pyx_t_5 = PyList_New(8); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15480
__Pyx_GOTREF(__pyx_t_5);
15481
__Pyx_INCREF(__pyx_n_s_ZZ);
15482
__Pyx_GIVEREF(__pyx_n_s_ZZ);
15483
PyList_SET_ITEM(__pyx_t_5, 0, __pyx_n_s_ZZ);
15484
__Pyx_INCREF(__pyx_n_s_Zp);
15485
__Pyx_GIVEREF(__pyx_n_s_Zp);
15486
PyList_SET_ITEM(__pyx_t_5, 1, __pyx_n_s_Zp);
15487
__Pyx_INCREF(__pyx_n_s_Qp);
15488
__Pyx_GIVEREF(__pyx_n_s_Qp);
15489
PyList_SET_ITEM(__pyx_t_5, 2, __pyx_n_s_Qp);
15490
__Pyx_INCREF(__pyx_n_s_Integers);
15491
__Pyx_GIVEREF(__pyx_n_s_Integers);
15492
PyList_SET_ITEM(__pyx_t_5, 3, __pyx_n_s_Integers);
15493
__Pyx_INCREF(__pyx_n_s_infinity);
15494
__Pyx_GIVEREF(__pyx_n_s_infinity);
15495
PyList_SET_ITEM(__pyx_t_5, 4, __pyx_n_s_infinity);
15496
__Pyx_INCREF(__pyx_n_s_binomial);
15497
__Pyx_GIVEREF(__pyx_n_s_binomial);
15498
PyList_SET_ITEM(__pyx_t_5, 5, __pyx_n_s_binomial);
15499
__Pyx_INCREF(__pyx_n_s_Mod);
15500
__Pyx_GIVEREF(__pyx_n_s_Mod);
15501
PyList_SET_ITEM(__pyx_t_5, 6, __pyx_n_s_Mod);
15502
__Pyx_INCREF(__pyx_n_s_O);
15503
__Pyx_GIVEREF(__pyx_n_s_O);
15504
PyList_SET_ITEM(__pyx_t_5, 7, __pyx_n_s_O);
15505
__pyx_t_4 = __Pyx_Import(__pyx_n_s_sage_rings_all, __pyx_t_5, -1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 26, __pyx_L1_error)
15506
__Pyx_GOTREF(__pyx_t_4);
15507
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15508
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_ZZ); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15509
__Pyx_GOTREF(__pyx_t_5);
15510
if (PyDict_SetItem(__pyx_d, __pyx_n_s_ZZ, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15511
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15512
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Zp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15513
__Pyx_GOTREF(__pyx_t_5);
15514
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Zp, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15515
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15516
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Qp); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15517
__Pyx_GOTREF(__pyx_t_5);
15518
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Qp, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15519
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15520
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Integers); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15521
__Pyx_GOTREF(__pyx_t_5);
15522
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Integers, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15523
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15524
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_infinity); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15525
__Pyx_GOTREF(__pyx_t_5);
15526
if (PyDict_SetItem(__pyx_d, __pyx_n_s_infinity, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15527
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15528
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_binomial); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15529
__Pyx_GOTREF(__pyx_t_5);
15530
if (PyDict_SetItem(__pyx_d, __pyx_n_s_binomial, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15531
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15532
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_Mod); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15533
__Pyx_GOTREF(__pyx_t_5);
15534
if (PyDict_SetItem(__pyx_d, __pyx_n_s_Mod, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15535
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15536
__pyx_t_5 = __Pyx_ImportFrom(__pyx_t_4, __pyx_n_s_O); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 26, __pyx_L1_error)
15537
__Pyx_GOTREF(__pyx_t_5);
15538
if (PyDict_SetItem(__pyx_d, __pyx_n_s_O, __pyx_t_5) < 0) __PYX_ERR(0, 26, __pyx_L1_error)
15539
__Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
15540
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15541
15542
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":33
15543
* # Global temps so we don't have to call mpz_init repeatedly in mulmod.
15544
* # Also, this way we ensure that we don't leak 3 gmp ints.
15545
* cdef Integer aa=Integer(0), bb=Integer(0), cc=Integer(0) # <<<<<<<<<<<<<<
15546
* # Necessary gmp imports for the mulmod function
15547
* from sage.libs.gmp.mpz cimport mpz_fdiv_ui, mpz_set_si, mpz_mul
15548
*/
15549
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4sage_5rings_7integer_Integer), __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error)
15550
__Pyx_GOTREF(__pyx_t_4);
15551
__Pyx_XGOTREF(((PyObject *)__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_aa));
15552
__Pyx_DECREF_SET(__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_aa, ((struct __pyx_obj_4sage_5rings_7integer_Integer *)__pyx_t_4));
15553
__Pyx_GIVEREF(__pyx_t_4);
15554
__pyx_t_4 = 0;
15555
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4sage_5rings_7integer_Integer), __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error)
15556
__Pyx_GOTREF(__pyx_t_4);
15557
__Pyx_XGOTREF(((PyObject *)__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_bb));
15558
__Pyx_DECREF_SET(__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_bb, ((struct __pyx_obj_4sage_5rings_7integer_Integer *)__pyx_t_4));
15559
__Pyx_GIVEREF(__pyx_t_4);
15560
__pyx_t_4 = 0;
15561
__pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_ptype_4sage_5rings_7integer_Integer), __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 33, __pyx_L1_error)
15562
__Pyx_GOTREF(__pyx_t_4);
15563
__Pyx_XGOTREF(((PyObject *)__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_cc));
15564
__Pyx_DECREF_SET(__pyx_v_5psage_7modform_8rational_27padic_elliptic_lseries_fast_cc, ((struct __pyx_obj_4sage_5rings_7integer_Integer *)__pyx_t_4));
15565
__Pyx_GIVEREF(__pyx_t_4);
15566
__pyx_t_4 = 0;
15567
15568
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":467
15569
* return sha, L, reg
15570
*
15571
* def series_parallel(L, n, prec, ser_prec=5, verb=False, force_mulmod=False, ncpus=None): # <<<<<<<<<<<<<<
15572
* # Use @parallel to do this computation by dividing it up into
15573
* # p separate tasks, doing those in separate processes,
15574
*/
15575
__pyx_t_4 = PyCFunction_NewEx(&__pyx_mdef_5psage_7modform_8rational_27padic_elliptic_lseries_fast_1series_parallel, NULL, __pyx_n_s_psage_modform_rational_padic_ell); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 467, __pyx_L1_error)
15576
__Pyx_GOTREF(__pyx_t_4);
15577
if (PyDict_SetItem(__pyx_d, __pyx_n_s_series_parallel, __pyx_t_4) < 0) __PYX_ERR(0, 467, __pyx_L1_error)
15578
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15579
15580
/* "psage/modform/rational/padic_elliptic_lseries_fast.pyx":1
15581
* ################################################################################# # <<<<<<<<<<<<<<
15582
* #
15583
* # (c) Copyright 2010 William Stein
15584
*/
15585
__pyx_t_4 = PyDict_New(); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1, __pyx_L1_error)
15586
__Pyx_GOTREF(__pyx_t_4);
15587
if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
15588
__Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
15589
15590
/* "cfunc.to_py":64
15591
*
15592
* @cname("__Pyx_CFunc_object____object____object____int___to_py")
15593
* cdef object __Pyx_CFunc_object____object____object____int___to_py(object (*f)(object, object, int) ): # <<<<<<<<<<<<<<
15594
* def wrap(object arg0, object arg1, int arg2):
15595
* """wrap(arg0, arg1, arg2: 'int')"""
15596
*/
15597
15598
/*--- Wrapped vars code ---*/
15599
15600
goto __pyx_L0;
15601
__pyx_L1_error:;
15602
__Pyx_XDECREF(__pyx_t_1);
15603
__Pyx_XDECREF(__pyx_t_2);
15604
__Pyx_XDECREF(__pyx_t_4);
15605
__Pyx_XDECREF(__pyx_t_5);
15606
if (__pyx_m) {
15607
if (__pyx_d) {
15608
__Pyx_AddTraceback("init psage.modform.rational.padic_elliptic_lseries_fast", __pyx_clineno, __pyx_lineno, __pyx_filename);
15609
}
15610
Py_DECREF(__pyx_m); __pyx_m = 0;
15611
} else if (!PyErr_Occurred()) {
15612
PyErr_SetString(PyExc_ImportError, "init psage.modform.rational.padic_elliptic_lseries_fast");
15613
}
15614
__pyx_L0:;
15615
__Pyx_RefNannyFinishContext();
15616
#if PY_MAJOR_VERSION < 3
15617
return;
15618
#else
15619
return __pyx_m;
15620
#endif
15621
}
15622
15623
/* --- Runtime support code --- */
15624
/* Refnanny */
15625
#if CYTHON_REFNANNY
15626
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
15627
PyObject *m = NULL, *p = NULL;
15628
void *r = NULL;
15629
m = PyImport_ImportModule((char *)modname);
15630
if (!m) goto end;
15631
p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
15632
if (!p) goto end;
15633
r = PyLong_AsVoidPtr(p);
15634
end:
15635
Py_XDECREF(p);
15636
Py_XDECREF(m);
15637
return (__Pyx_RefNannyAPIStruct *)r;
15638
}
15639
#endif
15640
15641
/* GetBuiltinName */
15642
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
15643
PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
15644
if (unlikely(!result)) {
15645
PyErr_Format(PyExc_NameError,
15646
#if PY_MAJOR_VERSION >= 3
15647
"name '%U' is not defined", name);
15648
#else
15649
"name '%.200s' is not defined", PyString_AS_STRING(name));
15650
#endif
15651
}
15652
return result;
15653
}
15654
15655
/* RaiseArgTupleInvalid */
15656
static void __Pyx_RaiseArgtupleInvalid(
15657
const char* func_name,
15658
int exact,
15659
Py_ssize_t num_min,
15660
Py_ssize_t num_max,
15661
Py_ssize_t num_found)
15662
{
15663
Py_ssize_t num_expected;
15664
const char *more_or_less;
15665
if (num_found < num_min) {
15666
num_expected = num_min;
15667
more_or_less = "at least";
15668
} else {
15669
num_expected = num_max;
15670
more_or_less = "at most";
15671
}
15672
if (exact) {
15673
more_or_less = "exactly";
15674
}
15675
PyErr_Format(PyExc_TypeError,
15676
"%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
15677
func_name, more_or_less, num_expected,
15678
(num_expected == 1) ? "" : "s", num_found);
15679
}
15680
15681
/* KeywordStringCheck */
15682
static CYTHON_INLINE int __Pyx_CheckKeywordStrings(
15683
PyObject *kwdict,
15684
const char* function_name,
15685
int kw_allowed)
15686
{
15687
PyObject* key = 0;
15688
Py_ssize_t pos = 0;
15689
#if CYTHON_COMPILING_IN_PYPY
15690
if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
15691
goto invalid_keyword;
15692
return 1;
15693
#else
15694
while (PyDict_Next(kwdict, &pos, &key, 0)) {
15695
#if PY_MAJOR_VERSION < 3
15696
if (unlikely(!PyString_CheckExact(key)) && unlikely(!PyString_Check(key)))
15697
#endif
15698
if (unlikely(!PyUnicode_Check(key)))
15699
goto invalid_keyword_type;
15700
}
15701
if ((!kw_allowed) && unlikely(key))
15702
goto invalid_keyword;
15703
return 1;
15704
invalid_keyword_type:
15705
PyErr_Format(PyExc_TypeError,
15706
"%.200s() keywords must be strings", function_name);
15707
return 0;
15708
#endif
15709
invalid_keyword:
15710
PyErr_Format(PyExc_TypeError,
15711
#if PY_MAJOR_VERSION < 3
15712
"%.200s() got an unexpected keyword argument '%.200s'",
15713
function_name, PyString_AsString(key));
15714
#else
15715
"%s() got an unexpected keyword argument '%U'",
15716
function_name, key);
15717
#endif
15718
return 0;
15719
}
15720
15721
/* RaiseDoubleKeywords */
15722
static void __Pyx_RaiseDoubleKeywordsError(
15723
const char* func_name,
15724
PyObject* kw_name)
15725
{
15726
PyErr_Format(PyExc_TypeError,
15727
#if PY_MAJOR_VERSION >= 3
15728
"%s() got multiple values for keyword argument '%U'", func_name, kw_name);
15729
#else
15730
"%s() got multiple values for keyword argument '%s'", func_name,
15731
PyString_AsString(kw_name));
15732
#endif
15733
}
15734
15735
/* ParseKeywords */
15736
static int __Pyx_ParseOptionalKeywords(
15737
PyObject *kwds,
15738
PyObject **argnames[],
15739
PyObject *kwds2,
15740
PyObject *values[],
15741
Py_ssize_t num_pos_args,
15742
const char* function_name)
15743
{
15744
PyObject *key = 0, *value = 0;
15745
Py_ssize_t pos = 0;
15746
PyObject*** name;
15747
PyObject*** first_kw_arg = argnames + num_pos_args;
15748
while (PyDict_Next(kwds, &pos, &key, &value)) {
15749
name = first_kw_arg;
15750
while (*name && (**name != key)) name++;
15751
if (*name) {
15752
values[name-argnames] = value;
15753
continue;
15754
}
15755
name = first_kw_arg;
15756
#if PY_MAJOR_VERSION < 3
15757
if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
15758
while (*name) {
15759
if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
15760
&& _PyString_Eq(**name, key)) {
15761
values[name-argnames] = value;
15762
break;
15763
}
15764
name++;
15765
}
15766
if (*name) continue;
15767
else {
15768
PyObject*** argname = argnames;
15769
while (argname != first_kw_arg) {
15770
if ((**argname == key) || (
15771
(CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
15772
&& _PyString_Eq(**argname, key))) {
15773
goto arg_passed_twice;
15774
}
15775
argname++;
15776
}
15777
}
15778
} else
15779
#endif
15780
if (likely(PyUnicode_Check(key))) {
15781
while (*name) {
15782
int cmp = (**name == key) ? 0 :
15783
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
15784
(PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
15785
#endif
15786
PyUnicode_Compare(**name, key);
15787
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
15788
if (cmp == 0) {
15789
values[name-argnames] = value;
15790
break;
15791
}
15792
name++;
15793
}
15794
if (*name) continue;
15795
else {
15796
PyObject*** argname = argnames;
15797
while (argname != first_kw_arg) {
15798
int cmp = (**argname == key) ? 0 :
15799
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
15800
(PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
15801
#endif
15802
PyUnicode_Compare(**argname, key);
15803
if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
15804
if (cmp == 0) goto arg_passed_twice;
15805
argname++;
15806
}
15807
}
15808
} else
15809
goto invalid_keyword_type;
15810
if (kwds2) {
15811
if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
15812
} else {
15813
goto invalid_keyword;
15814
}
15815
}
15816
return 0;
15817
arg_passed_twice:
15818
__Pyx_RaiseDoubleKeywordsError(function_name, key);
15819
goto bad;
15820
invalid_keyword_type:
15821
PyErr_Format(PyExc_TypeError,
15822
"%.200s() keywords must be strings", function_name);
15823
goto bad;
15824
invalid_keyword:
15825
PyErr_Format(PyExc_TypeError,
15826
#if PY_MAJOR_VERSION < 3
15827
"%.200s() got an unexpected keyword argument '%.200s'",
15828
function_name, PyString_AsString(key));
15829
#else
15830
"%s() got an unexpected keyword argument '%U'",
15831
function_name, key);
15832
#endif
15833
bad:
15834
return -1;
15835
}
15836
15837
/* GetModuleGlobalName */
15838
static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
15839
PyObject *result;
15840
#if !CYTHON_AVOID_BORROWED_REFS
15841
result = PyDict_GetItem(__pyx_d, name);
15842
if (likely(result)) {
15843
Py_INCREF(result);
15844
} else {
15845
#else
15846
result = PyObject_GetItem(__pyx_d, name);
15847
if (!result) {
15848
PyErr_Clear();
15849
#endif
15850
result = __Pyx_GetBuiltinName(name);
15851
}
15852
return result;
15853
}
15854
15855
/* PyObjectCall */
15856
#if CYTHON_COMPILING_IN_CPYTHON
15857
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
15858
PyObject *result;
15859
ternaryfunc call = func->ob_type->tp_call;
15860
if (unlikely(!call))
15861
return PyObject_Call(func, arg, kw);
15862
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
15863
return NULL;
15864
result = (*call)(func, arg, kw);
15865
Py_LeaveRecursiveCall();
15866
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
15867
PyErr_SetString(
15868
PyExc_SystemError,
15869
"NULL result without error in PyObject_Call");
15870
}
15871
return result;
15872
}
15873
#endif
15874
15875
/* PyCFunctionFastCall */
15876
#if CYTHON_FAST_PYCCALL
15877
static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
15878
PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
15879
PyCFunction meth = PyCFunction_GET_FUNCTION(func);
15880
PyObject *self = PyCFunction_GET_SELF(func);
15881
assert(PyCFunction_Check(func));
15882
assert(METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST)));
15883
assert(nargs >= 0);
15884
assert(nargs == 0 || args != NULL);
15885
/* _PyCFunction_FastCallDict() must not be called with an exception set,
15886
because it may clear it (directly or indirectly) and so the
15887
caller loses its exception */
15888
assert(!PyErr_Occurred());
15889
return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs, NULL);
15890
}
15891
#endif // CYTHON_FAST_PYCCALL
15892
15893
/* PyFunctionFastCall */
15894
#if CYTHON_FAST_PYCALL
15895
#include "frameobject.h"
15896
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
15897
PyObject *globals) {
15898
PyFrameObject *f;
15899
PyThreadState *tstate = PyThreadState_GET();
15900
PyObject **fastlocals;
15901
Py_ssize_t i;
15902
PyObject *result;
15903
assert(globals != NULL);
15904
/* XXX Perhaps we should create a specialized
15905
PyFrame_New() that doesn't take locals, but does
15906
take builtins without sanity checking them.
15907
*/
15908
assert(tstate != NULL);
15909
f = PyFrame_New(tstate, co, globals, NULL);
15910
if (f == NULL) {
15911
return NULL;
15912
}
15913
fastlocals = f->f_localsplus;
15914
for (i = 0; i < na; i++) {
15915
Py_INCREF(*args);
15916
fastlocals[i] = *args++;
15917
}
15918
result = PyEval_EvalFrameEx(f,0);
15919
++tstate->recursion_depth;
15920
Py_DECREF(f);
15921
--tstate->recursion_depth;
15922
return result;
15923
}
15924
#if 1 || PY_VERSION_HEX < 0x030600B1
15925
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
15926
PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
15927
PyObject *globals = PyFunction_GET_GLOBALS(func);
15928
PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
15929
PyObject *closure;
15930
#if PY_MAJOR_VERSION >= 3
15931
PyObject *kwdefs;
15932
#endif
15933
PyObject *kwtuple, **k;
15934
PyObject **d;
15935
Py_ssize_t nd;
15936
Py_ssize_t nk;
15937
PyObject *result;
15938
assert(kwargs == NULL || PyDict_Check(kwargs));
15939
nk = kwargs ? PyDict_Size(kwargs) : 0;
15940
if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
15941
return NULL;
15942
}
15943
if (
15944
#if PY_MAJOR_VERSION >= 3
15945
co->co_kwonlyargcount == 0 &&
15946
#endif
15947
likely(kwargs == NULL || nk == 0) &&
15948
co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
15949
if (argdefs == NULL && co->co_argcount == nargs) {
15950
result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
15951
goto done;
15952
}
15953
else if (nargs == 0 && argdefs != NULL
15954
&& co->co_argcount == Py_SIZE(argdefs)) {
15955
/* function called with no arguments, but all parameters have
15956
a default value: use default values as arguments .*/
15957
args = &PyTuple_GET_ITEM(argdefs, 0);
15958
result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
15959
goto done;
15960
}
15961
}
15962
if (kwargs != NULL) {
15963
Py_ssize_t pos, i;
15964
kwtuple = PyTuple_New(2 * nk);
15965
if (kwtuple == NULL) {
15966
result = NULL;
15967
goto done;
15968
}
15969
k = &PyTuple_GET_ITEM(kwtuple, 0);
15970
pos = i = 0;
15971
while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
15972
Py_INCREF(k[i]);
15973
Py_INCREF(k[i+1]);
15974
i += 2;
15975
}
15976
nk = i / 2;
15977
}
15978
else {
15979
kwtuple = NULL;
15980
k = NULL;
15981
}
15982
closure = PyFunction_GET_CLOSURE(func);
15983
#if PY_MAJOR_VERSION >= 3
15984
kwdefs = PyFunction_GET_KW_DEFAULTS(func);
15985
#endif
15986
if (argdefs != NULL) {
15987
d = &PyTuple_GET_ITEM(argdefs, 0);
15988
nd = Py_SIZE(argdefs);
15989
}
15990
else {
15991
d = NULL;
15992
nd = 0;
15993
}
15994
#if PY_MAJOR_VERSION >= 3
15995
result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
15996
args, nargs,
15997
k, (int)nk,
15998
d, (int)nd, kwdefs, closure);
15999
#else
16000
result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
16001
args, nargs,
16002
k, (int)nk,
16003
d, (int)nd, closure);
16004
#endif
16005
Py_XDECREF(kwtuple);
16006
done:
16007
Py_LeaveRecursiveCall();
16008
return result;
16009
}
16010
#endif // CPython < 3.6
16011
#endif // CYTHON_FAST_PYCALL
16012
16013
/* PyObjectCallMethO */
16014
#if CYTHON_COMPILING_IN_CPYTHON
16015
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
16016
PyObject *self, *result;
16017
PyCFunction cfunc;
16018
cfunc = PyCFunction_GET_FUNCTION(func);
16019
self = PyCFunction_GET_SELF(func);
16020
if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
16021
return NULL;
16022
result = cfunc(self, arg);
16023
Py_LeaveRecursiveCall();
16024
if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
16025
PyErr_SetString(
16026
PyExc_SystemError,
16027
"NULL result without error in PyObject_Call");
16028
}
16029
return result;
16030
}
16031
#endif
16032
16033
/* PyObjectCallOneArg */
16034
#if CYTHON_COMPILING_IN_CPYTHON
16035
static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
16036
PyObject *result;
16037
PyObject *args = PyTuple_New(1);
16038
if (unlikely(!args)) return NULL;
16039
Py_INCREF(arg);
16040
PyTuple_SET_ITEM(args, 0, arg);
16041
result = __Pyx_PyObject_Call(func, args, NULL);
16042
Py_DECREF(args);
16043
return result;
16044
}
16045
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
16046
#if CYTHON_FAST_PYCALL
16047
if (PyFunction_Check(func)) {
16048
return __Pyx_PyFunction_FastCall(func, &arg, 1);
16049
}
16050
#endif
16051
#ifdef __Pyx_CyFunction_USED
16052
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
16053
#else
16054
if (likely(PyCFunction_Check(func))) {
16055
#endif
16056
if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
16057
return __Pyx_PyObject_CallMethO(func, arg);
16058
#if CYTHON_FAST_PYCCALL
16059
} else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
16060
return __Pyx_PyCFunction_FastCall(func, &arg, 1);
16061
#endif
16062
}
16063
}
16064
return __Pyx__PyObject_CallOneArg(func, arg);
16065
}
16066
#else
16067
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
16068
PyObject *result;
16069
PyObject *args = PyTuple_Pack(1, arg);
16070
if (unlikely(!args)) return NULL;
16071
result = __Pyx_PyObject_Call(func, args, NULL);
16072
Py_DECREF(args);
16073
return result;
16074
}
16075
#endif
16076
16077
/* PyObjectCallNoArg */
16078
#if CYTHON_COMPILING_IN_CPYTHON
16079
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
16080
#if CYTHON_FAST_PYCALL
16081
if (PyFunction_Check(func)) {
16082
return __Pyx_PyFunction_FastCall(func, NULL, 0);
16083
}
16084
#endif
16085
#ifdef __Pyx_CyFunction_USED
16086
if (likely(PyCFunction_Check(func) || PyObject_TypeCheck(func, __pyx_CyFunctionType))) {
16087
#else
16088
if (likely(PyCFunction_Check(func))) {
16089
#endif
16090
if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
16091
return __Pyx_PyObject_CallMethO(func, NULL);
16092
}
16093
}
16094
return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
16095
}
16096
#endif
16097
16098
/* BytesEquals */
16099
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
16100
#if CYTHON_COMPILING_IN_PYPY
16101
return PyObject_RichCompareBool(s1, s2, equals);
16102
#else
16103
if (s1 == s2) {
16104
return (equals == Py_EQ);
16105
} else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
16106
const char *ps1, *ps2;
16107
Py_ssize_t length = PyBytes_GET_SIZE(s1);
16108
if (length != PyBytes_GET_SIZE(s2))
16109
return (equals == Py_NE);
16110
ps1 = PyBytes_AS_STRING(s1);
16111
ps2 = PyBytes_AS_STRING(s2);
16112
if (ps1[0] != ps2[0]) {
16113
return (equals == Py_NE);
16114
} else if (length == 1) {
16115
return (equals == Py_EQ);
16116
} else {
16117
int result = memcmp(ps1, ps2, (size_t)length);
16118
return (equals == Py_EQ) ? (result == 0) : (result != 0);
16119
}
16120
} else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
16121
return (equals == Py_NE);
16122
} else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
16123
return (equals == Py_NE);
16124
} else {
16125
int result;
16126
PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
16127
if (!py_result)
16128
return -1;
16129
result = __Pyx_PyObject_IsTrue(py_result);
16130
Py_DECREF(py_result);
16131
return result;
16132
}
16133
#endif
16134
}
16135
16136
/* UnicodeEquals */
16137
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
16138
#if CYTHON_COMPILING_IN_PYPY
16139
return PyObject_RichCompareBool(s1, s2, equals);
16140
#else
16141
#if PY_MAJOR_VERSION < 3
16142
PyObject* owned_ref = NULL;
16143
#endif
16144
int s1_is_unicode, s2_is_unicode;
16145
if (s1 == s2) {
16146
goto return_eq;
16147
}
16148
s1_is_unicode = PyUnicode_CheckExact(s1);
16149
s2_is_unicode = PyUnicode_CheckExact(s2);
16150
#if PY_MAJOR_VERSION < 3
16151
if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
16152
owned_ref = PyUnicode_FromObject(s2);
16153
if (unlikely(!owned_ref))
16154
return -1;
16155
s2 = owned_ref;
16156
s2_is_unicode = 1;
16157
} else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
16158
owned_ref = PyUnicode_FromObject(s1);
16159
if (unlikely(!owned_ref))
16160
return -1;
16161
s1 = owned_ref;
16162
s1_is_unicode = 1;
16163
} else if (((!s2_is_unicode) & (!s1_is_unicode))) {
16164
return __Pyx_PyBytes_Equals(s1, s2, equals);
16165
}
16166
#endif
16167
if (s1_is_unicode & s2_is_unicode) {
16168
Py_ssize_t length;
16169
int kind;
16170
void *data1, *data2;
16171
if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
16172
return -1;
16173
length = __Pyx_PyUnicode_GET_LENGTH(s1);
16174
if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
16175
goto return_ne;
16176
}
16177
kind = __Pyx_PyUnicode_KIND(s1);
16178
if (kind != __Pyx_PyUnicode_KIND(s2)) {
16179
goto return_ne;
16180
}
16181
data1 = __Pyx_PyUnicode_DATA(s1);
16182
data2 = __Pyx_PyUnicode_DATA(s2);
16183
if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
16184
goto return_ne;
16185
} else if (length == 1) {
16186
goto return_eq;
16187
} else {
16188
int result = memcmp(data1, data2, (size_t)(length * kind));
16189
#if PY_MAJOR_VERSION < 3
16190
Py_XDECREF(owned_ref);
16191
#endif
16192
return (equals == Py_EQ) ? (result == 0) : (result != 0);
16193
}
16194
} else if ((s1 == Py_None) & s2_is_unicode) {
16195
goto return_ne;
16196
} else if ((s2 == Py_None) & s1_is_unicode) {
16197
goto return_ne;
16198
} else {
16199
int result;
16200
PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
16201
if (!py_result)
16202
return -1;
16203
result = __Pyx_PyObject_IsTrue(py_result);
16204
Py_DECREF(py_result);
16205
return result;
16206
}
16207
return_eq:
16208
#if PY_MAJOR_VERSION < 3
16209
Py_XDECREF(owned_ref);
16210
#endif
16211
return (equals == Py_EQ);
16212
return_ne:
16213
#if PY_MAJOR_VERSION < 3
16214
Py_XDECREF(owned_ref);
16215
#endif
16216
return (equals == Py_NE);
16217
#endif
16218
}
16219
16220
/* PyErrFetchRestore */
16221
#if CYTHON_FAST_THREAD_STATE
16222
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
16223
PyObject *tmp_type, *tmp_value, *tmp_tb;
16224
tmp_type = tstate->curexc_type;
16225
tmp_value = tstate->curexc_value;
16226
tmp_tb = tstate->curexc_traceback;
16227
tstate->curexc_type = type;
16228
tstate->curexc_value = value;
16229
tstate->curexc_traceback = tb;
16230
Py_XDECREF(tmp_type);
16231
Py_XDECREF(tmp_value);
16232
Py_XDECREF(tmp_tb);
16233
}
16234
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
16235
*type = tstate->curexc_type;
16236
*value = tstate->curexc_value;
16237
*tb = tstate->curexc_traceback;
16238
tstate->curexc_type = 0;
16239
tstate->curexc_value = 0;
16240
tstate->curexc_traceback = 0;
16241
}
16242
#endif
16243
16244
/* RaiseException */
16245
#if PY_MAJOR_VERSION < 3
16246
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
16247
CYTHON_UNUSED PyObject *cause) {
16248
__Pyx_PyThreadState_declare
16249
Py_XINCREF(type);
16250
if (!value || value == Py_None)
16251
value = NULL;
16252
else
16253
Py_INCREF(value);
16254
if (!tb || tb == Py_None)
16255
tb = NULL;
16256
else {
16257
Py_INCREF(tb);
16258
if (!PyTraceBack_Check(tb)) {
16259
PyErr_SetString(PyExc_TypeError,
16260
"raise: arg 3 must be a traceback or None");
16261
goto raise_error;
16262
}
16263
}
16264
if (PyType_Check(type)) {
16265
#if CYTHON_COMPILING_IN_PYPY
16266
if (!value) {
16267
Py_INCREF(Py_None);
16268
value = Py_None;
16269
}
16270
#endif
16271
PyErr_NormalizeException(&type, &value, &tb);
16272
} else {
16273
if (value) {
16274
PyErr_SetString(PyExc_TypeError,
16275
"instance exception may not have a separate value");
16276
goto raise_error;
16277
}
16278
value = type;
16279
type = (PyObject*) Py_TYPE(type);
16280
Py_INCREF(type);
16281
if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
16282
PyErr_SetString(PyExc_TypeError,
16283
"raise: exception class must be a subclass of BaseException");
16284
goto raise_error;
16285
}
16286
}
16287
__Pyx_PyThreadState_assign
16288
__Pyx_ErrRestore(type, value, tb);
16289
return;
16290
raise_error:
16291
Py_XDECREF(value);
16292
Py_XDECREF(type);
16293
Py_XDECREF(tb);
16294
return;
16295
}
16296
#else
16297
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
16298
PyObject* owned_instance = NULL;
16299
if (tb == Py_None) {
16300
tb = 0;
16301
} else if (tb && !PyTraceBack_Check(tb)) {
16302
PyErr_SetString(PyExc_TypeError,
16303
"raise: arg 3 must be a traceback or None");
16304
goto bad;
16305
}
16306
if (value == Py_None)
16307
value = 0;
16308
if (PyExceptionInstance_Check(type)) {
16309
if (value) {
16310
PyErr_SetString(PyExc_TypeError,
16311
"instance exception may not have a separate value");
16312
goto bad;
16313
}
16314
value = type;
16315
type = (PyObject*) Py_TYPE(value);
16316
} else if (PyExceptionClass_Check(type)) {
16317
PyObject *instance_class = NULL;
16318
if (value && PyExceptionInstance_Check(value)) {
16319
instance_class = (PyObject*) Py_TYPE(value);
16320
if (instance_class != type) {
16321
int is_subclass = PyObject_IsSubclass(instance_class, type);
16322
if (!is_subclass) {
16323
instance_class = NULL;
16324
} else if (unlikely(is_subclass == -1)) {
16325
goto bad;
16326
} else {
16327
type = instance_class;
16328
}
16329
}
16330
}
16331
if (!instance_class) {
16332
PyObject *args;
16333
if (!value)
16334
args = PyTuple_New(0);
16335
else if (PyTuple_Check(value)) {
16336
Py_INCREF(value);
16337
args = value;
16338
} else
16339
args = PyTuple_Pack(1, value);
16340
if (!args)
16341
goto bad;
16342
owned_instance = PyObject_Call(type, args, NULL);
16343
Py_DECREF(args);
16344
if (!owned_instance)
16345
goto bad;
16346
value = owned_instance;
16347
if (!PyExceptionInstance_Check(value)) {
16348
PyErr_Format(PyExc_TypeError,
16349
"calling %R should have returned an instance of "
16350
"BaseException, not %R",
16351
type, Py_TYPE(value));
16352
goto bad;
16353
}
16354
}
16355
} else {
16356
PyErr_SetString(PyExc_TypeError,
16357
"raise: exception class must be a subclass of BaseException");
16358
goto bad;
16359
}
16360
#if PY_VERSION_HEX >= 0x03030000
16361
if (cause) {
16362
#else
16363
if (cause && cause != Py_None) {
16364
#endif
16365
PyObject *fixed_cause;
16366
if (cause == Py_None) {
16367
fixed_cause = NULL;
16368
} else if (PyExceptionClass_Check(cause)) {
16369
fixed_cause = PyObject_CallObject(cause, NULL);
16370
if (fixed_cause == NULL)
16371
goto bad;
16372
} else if (PyExceptionInstance_Check(cause)) {
16373
fixed_cause = cause;
16374
Py_INCREF(fixed_cause);
16375
} else {
16376
PyErr_SetString(PyExc_TypeError,
16377
"exception causes must derive from "
16378
"BaseException");
16379
goto bad;
16380
}
16381
PyException_SetCause(value, fixed_cause);
16382
}
16383
PyErr_SetObject(type, value);
16384
if (tb) {
16385
#if CYTHON_COMPILING_IN_PYPY
16386
PyObject *tmp_type, *tmp_value, *tmp_tb;
16387
PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
16388
Py_INCREF(tb);
16389
PyErr_Restore(tmp_type, tmp_value, tb);
16390
Py_XDECREF(tmp_tb);
16391
#else
16392
PyThreadState *tstate = PyThreadState_GET();
16393
PyObject* tmp_tb = tstate->curexc_traceback;
16394
if (tb != tmp_tb) {
16395
Py_INCREF(tb);
16396
tstate->curexc_traceback = tb;
16397
Py_XDECREF(tmp_tb);
16398
}
16399
#endif
16400
}
16401
bad:
16402
Py_XDECREF(owned_instance);
16403
return;
16404
}
16405
#endif
16406
16407
/* RaiseTooManyValuesToUnpack */
16408
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
16409
PyErr_Format(PyExc_ValueError,
16410
"too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
16411
}
16412
16413
/* RaiseNeedMoreValuesToUnpack */
16414
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
16415
PyErr_Format(PyExc_ValueError,
16416
"need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
16417
index, (index == 1) ? "" : "s");
16418
}
16419
16420
/* IterFinish */
16421
static CYTHON_INLINE int __Pyx_IterFinish(void) {
16422
#if CYTHON_FAST_THREAD_STATE
16423
PyThreadState *tstate = PyThreadState_GET();
16424
PyObject* exc_type = tstate->curexc_type;
16425
if (unlikely(exc_type)) {
16426
if (likely(exc_type == PyExc_StopIteration) || PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration)) {
16427
PyObject *exc_value, *exc_tb;
16428
exc_value = tstate->curexc_value;
16429
exc_tb = tstate->curexc_traceback;
16430
tstate->curexc_type = 0;
16431
tstate->curexc_value = 0;
16432
tstate->curexc_traceback = 0;
16433
Py_DECREF(exc_type);
16434
Py_XDECREF(exc_value);
16435
Py_XDECREF(exc_tb);
16436
return 0;
16437
} else {
16438
return -1;
16439
}
16440
}
16441
return 0;
16442
#else
16443
if (unlikely(PyErr_Occurred())) {
16444
if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
16445
PyErr_Clear();
16446
return 0;
16447
} else {
16448
return -1;
16449
}
16450
}
16451
return 0;
16452
#endif
16453
}
16454
16455
/* UnpackItemEndCheck */
16456
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
16457
if (unlikely(retval)) {
16458
Py_DECREF(retval);
16459
__Pyx_RaiseTooManyValuesError(expected);
16460
return -1;
16461
} else {
16462
return __Pyx_IterFinish();
16463
}
16464
return 0;
16465
}
16466
16467
/* GetItemInt */
16468
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
16469
PyObject *r;
16470
if (!j) return NULL;
16471
r = PyObject_GetItem(o, j);
16472
Py_DECREF(j);
16473
return r;
16474
}
16475
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
16476
CYTHON_NCP_UNUSED int wraparound,
16477
CYTHON_NCP_UNUSED int boundscheck) {
16478
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16479
if (wraparound & unlikely(i < 0)) i += PyList_GET_SIZE(o);
16480
if ((!boundscheck) || likely((0 <= i) & (i < PyList_GET_SIZE(o)))) {
16481
PyObject *r = PyList_GET_ITEM(o, i);
16482
Py_INCREF(r);
16483
return r;
16484
}
16485
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
16486
#else
16487
return PySequence_GetItem(o, i);
16488
#endif
16489
}
16490
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
16491
CYTHON_NCP_UNUSED int wraparound,
16492
CYTHON_NCP_UNUSED int boundscheck) {
16493
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
16494
if (wraparound & unlikely(i < 0)) i += PyTuple_GET_SIZE(o);
16495
if ((!boundscheck) || likely((0 <= i) & (i < PyTuple_GET_SIZE(o)))) {
16496
PyObject *r = PyTuple_GET_ITEM(o, i);
16497
Py_INCREF(r);
16498
return r;
16499
}
16500
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
16501
#else
16502
return PySequence_GetItem(o, i);
16503
#endif
16504
}
16505
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
16506
CYTHON_NCP_UNUSED int wraparound,
16507
CYTHON_NCP_UNUSED int boundscheck) {
16508
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
16509
if (is_list || PyList_CheckExact(o)) {
16510
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
16511
if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
16512
PyObject *r = PyList_GET_ITEM(o, n);
16513
Py_INCREF(r);
16514
return r;
16515
}
16516
}
16517
else if (PyTuple_CheckExact(o)) {
16518
Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
16519
if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
16520
PyObject *r = PyTuple_GET_ITEM(o, n);
16521
Py_INCREF(r);
16522
return r;
16523
}
16524
} else {
16525
PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
16526
if (likely(m && m->sq_item)) {
16527
if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
16528
Py_ssize_t l = m->sq_length(o);
16529
if (likely(l >= 0)) {
16530
i += l;
16531
} else {
16532
if (!PyErr_ExceptionMatches(PyExc_OverflowError))
16533
return NULL;
16534
PyErr_Clear();
16535
}
16536
}
16537
return m->sq_item(o, i);
16538
}
16539
}
16540
#else
16541
if (is_list || PySequence_Check(o)) {
16542
return PySequence_GetItem(o, i);
16543
}
16544
#endif
16545
return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
16546
}
16547
16548
/* None */
16549
static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
16550
long q = a / b;
16551
long r = a - q*b;
16552
q -= ((r != 0) & ((r ^ b) < 0));
16553
return q;
16554
}
16555
16556
/* None */
16557
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
16558
PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
16559
}
16560
16561
/* WriteUnraisableException */
16562
static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
16563
CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
16564
int full_traceback, CYTHON_UNUSED int nogil) {
16565
PyObject *old_exc, *old_val, *old_tb;
16566
PyObject *ctx;
16567
__Pyx_PyThreadState_declare
16568
#ifdef WITH_THREAD
16569
PyGILState_STATE state;
16570
if (nogil)
16571
state = PyGILState_Ensure();
16572
#ifdef _MSC_VER
16573
else state = (PyGILState_STATE)-1;
16574
#endif
16575
#endif
16576
__Pyx_PyThreadState_assign
16577
__Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
16578
if (full_traceback) {
16579
Py_XINCREF(old_exc);
16580
Py_XINCREF(old_val);
16581
Py_XINCREF(old_tb);
16582
__Pyx_ErrRestore(old_exc, old_val, old_tb);
16583
PyErr_PrintEx(1);
16584
}
16585
#if PY_MAJOR_VERSION < 3
16586
ctx = PyString_FromString(name);
16587
#else
16588
ctx = PyUnicode_FromString(name);
16589
#endif
16590
__Pyx_ErrRestore(old_exc, old_val, old_tb);
16591
if (!ctx) {
16592
PyErr_WriteUnraisable(Py_None);
16593
} else {
16594
PyErr_WriteUnraisable(ctx);
16595
Py_DECREF(ctx);
16596
}
16597
#ifdef WITH_THREAD
16598
if (nogil)
16599
PyGILState_Release(state);
16600
#endif
16601
}
16602
16603
/* PyIntBinop */
16604
#if !CYTHON_COMPILING_IN_PYPY
16605
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
16606
#if PY_MAJOR_VERSION < 3
16607
if (likely(PyInt_CheckExact(op2))) {
16608
const long a = intval;
16609
long x;
16610
long b = PyInt_AS_LONG(op2);
16611
x = (long)((unsigned long)a + b);
16612
if (likely((x^a) >= 0 || (x^b) >= 0))
16613
return PyInt_FromLong(x);
16614
return PyLong_Type.tp_as_number->nb_add(op1, op2);
16615
}
16616
#endif
16617
#if CYTHON_USE_PYLONG_INTERNALS
16618
if (likely(PyLong_CheckExact(op2))) {
16619
const long a = intval;
16620
long b, x;
16621
#ifdef HAVE_LONG_LONG
16622
const PY_LONG_LONG lla = intval;
16623
PY_LONG_LONG llb, llx;
16624
#endif
16625
const digit* digits = ((PyLongObject*)op2)->ob_digit;
16626
const Py_ssize_t size = Py_SIZE(op2);
16627
if (likely(__Pyx_sst_abs(size) <= 1)) {
16628
b = likely(size) ? digits[0] : 0;
16629
if (size == -1) b = -b;
16630
} else {
16631
switch (size) {
16632
case -2:
16633
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16634
b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16635
break;
16636
#ifdef HAVE_LONG_LONG
16637
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
16638
llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16639
goto long_long;
16640
#endif
16641
}
16642
case 2:
16643
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16644
b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16645
break;
16646
#ifdef HAVE_LONG_LONG
16647
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
16648
llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16649
goto long_long;
16650
#endif
16651
}
16652
case -3:
16653
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16654
b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16655
break;
16656
#ifdef HAVE_LONG_LONG
16657
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
16658
llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16659
goto long_long;
16660
#endif
16661
}
16662
case 3:
16663
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16664
b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16665
break;
16666
#ifdef HAVE_LONG_LONG
16667
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
16668
llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16669
goto long_long;
16670
#endif
16671
}
16672
case -4:
16673
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
16674
b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16675
break;
16676
#ifdef HAVE_LONG_LONG
16677
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
16678
llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16679
goto long_long;
16680
#endif
16681
}
16682
case 4:
16683
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
16684
b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16685
break;
16686
#ifdef HAVE_LONG_LONG
16687
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
16688
llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16689
goto long_long;
16690
#endif
16691
}
16692
default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
16693
}
16694
}
16695
x = a + b;
16696
return PyLong_FromLong(x);
16697
#ifdef HAVE_LONG_LONG
16698
long_long:
16699
llx = lla + llb;
16700
return PyLong_FromLongLong(llx);
16701
#endif
16702
16703
16704
}
16705
#endif
16706
if (PyFloat_CheckExact(op2)) {
16707
const long a = intval;
16708
double b = PyFloat_AS_DOUBLE(op2);
16709
double result;
16710
PyFPE_START_PROTECT("add", return NULL)
16711
result = ((double)a) + (double)b;
16712
PyFPE_END_PROTECT(result)
16713
return PyFloat_FromDouble(result);
16714
}
16715
return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
16716
}
16717
#endif
16718
16719
/* None */
16720
static CYTHON_INLINE long __Pyx_mod_long(long a, long b) {
16721
long r = a % b;
16722
r += ((r != 0) & ((r ^ b) < 0)) * b;
16723
return r;
16724
}
16725
16726
/* PyIntBinop */
16727
#if !CYTHON_COMPILING_IN_PYPY
16728
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
16729
#if PY_MAJOR_VERSION < 3
16730
if (likely(PyInt_CheckExact(op1))) {
16731
const long b = intval;
16732
long x;
16733
long a = PyInt_AS_LONG(op1);
16734
x = (long)((unsigned long)a - b);
16735
if (likely((x^a) >= 0 || (x^~b) >= 0))
16736
return PyInt_FromLong(x);
16737
return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
16738
}
16739
#endif
16740
#if CYTHON_USE_PYLONG_INTERNALS
16741
if (likely(PyLong_CheckExact(op1))) {
16742
const long b = intval;
16743
long a, x;
16744
#ifdef HAVE_LONG_LONG
16745
const PY_LONG_LONG llb = intval;
16746
PY_LONG_LONG lla, llx;
16747
#endif
16748
const digit* digits = ((PyLongObject*)op1)->ob_digit;
16749
const Py_ssize_t size = Py_SIZE(op1);
16750
if (likely(__Pyx_sst_abs(size) <= 1)) {
16751
a = likely(size) ? digits[0] : 0;
16752
if (size == -1) a = -a;
16753
} else {
16754
switch (size) {
16755
case -2:
16756
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16757
a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16758
break;
16759
#ifdef HAVE_LONG_LONG
16760
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
16761
lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16762
goto long_long;
16763
#endif
16764
}
16765
case 2:
16766
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16767
a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16768
break;
16769
#ifdef HAVE_LONG_LONG
16770
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
16771
lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16772
goto long_long;
16773
#endif
16774
}
16775
case -3:
16776
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16777
a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16778
break;
16779
#ifdef HAVE_LONG_LONG
16780
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
16781
lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16782
goto long_long;
16783
#endif
16784
}
16785
case 3:
16786
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16787
a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16788
break;
16789
#ifdef HAVE_LONG_LONG
16790
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
16791
lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16792
goto long_long;
16793
#endif
16794
}
16795
case -4:
16796
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
16797
a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16798
break;
16799
#ifdef HAVE_LONG_LONG
16800
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
16801
lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16802
goto long_long;
16803
#endif
16804
}
16805
case 4:
16806
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
16807
a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16808
break;
16809
#ifdef HAVE_LONG_LONG
16810
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
16811
lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16812
goto long_long;
16813
#endif
16814
}
16815
default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
16816
}
16817
}
16818
x = a - b;
16819
return PyLong_FromLong(x);
16820
#ifdef HAVE_LONG_LONG
16821
long_long:
16822
llx = lla - llb;
16823
return PyLong_FromLongLong(llx);
16824
#endif
16825
16826
16827
}
16828
#endif
16829
if (PyFloat_CheckExact(op1)) {
16830
const long b = intval;
16831
double a = PyFloat_AS_DOUBLE(op1);
16832
double result;
16833
PyFPE_START_PROTECT("subtract", return NULL)
16834
result = ((double)a) - (double)b;
16835
PyFPE_END_PROTECT(result)
16836
return PyFloat_FromDouble(result);
16837
}
16838
return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
16839
}
16840
#endif
16841
16842
/* PyIntBinop */
16843
#if !CYTHON_COMPILING_IN_PYPY
16844
static PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
16845
if (op1 == op2) {
16846
Py_RETURN_TRUE;
16847
}
16848
#if PY_MAJOR_VERSION < 3
16849
if (likely(PyInt_CheckExact(op1))) {
16850
const long b = intval;
16851
long a = PyInt_AS_LONG(op1);
16852
if (a == b) {
16853
Py_RETURN_TRUE;
16854
} else {
16855
Py_RETURN_FALSE;
16856
}
16857
}
16858
#endif
16859
#if CYTHON_USE_PYLONG_INTERNALS
16860
if (likely(PyLong_CheckExact(op1))) {
16861
const long b = intval;
16862
long a;
16863
const digit* digits = ((PyLongObject*)op1)->ob_digit;
16864
const Py_ssize_t size = Py_SIZE(op1);
16865
if (likely(__Pyx_sst_abs(size) <= 1)) {
16866
a = likely(size) ? digits[0] : 0;
16867
if (size == -1) a = -a;
16868
} else {
16869
switch (size) {
16870
case -2:
16871
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16872
a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16873
break;
16874
}
16875
case 2:
16876
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16877
a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16878
break;
16879
}
16880
case -3:
16881
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16882
a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16883
break;
16884
}
16885
case 3:
16886
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16887
a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16888
break;
16889
}
16890
case -4:
16891
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
16892
a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16893
break;
16894
}
16895
case 4:
16896
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
16897
a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16898
break;
16899
}
16900
#if PyLong_SHIFT < 30 && PyLong_SHIFT != 15
16901
default: return PyLong_Type.tp_richcompare(op1, op2, Py_EQ);
16902
#else
16903
default: Py_RETURN_FALSE;
16904
#endif
16905
}
16906
}
16907
if (a == b) {
16908
Py_RETURN_TRUE;
16909
} else {
16910
Py_RETURN_FALSE;
16911
}
16912
}
16913
#endif
16914
if (PyFloat_CheckExact(op1)) {
16915
const long b = intval;
16916
double a = PyFloat_AS_DOUBLE(op1);
16917
if ((double)a == (double)b) {
16918
Py_RETURN_TRUE;
16919
} else {
16920
Py_RETURN_FALSE;
16921
}
16922
}
16923
return PyObject_RichCompare(op1, op2, Py_EQ);
16924
}
16925
#endif
16926
16927
/* PyIntBinop */
16928
#if !CYTHON_COMPILING_IN_PYPY
16929
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
16930
#if PY_MAJOR_VERSION < 3
16931
if (likely(PyInt_CheckExact(op1))) {
16932
const long b = intval;
16933
long x;
16934
long a = PyInt_AS_LONG(op1);
16935
x = (long)((unsigned long)a + b);
16936
if (likely((x^a) >= 0 || (x^b) >= 0))
16937
return PyInt_FromLong(x);
16938
return PyLong_Type.tp_as_number->nb_add(op1, op2);
16939
}
16940
#endif
16941
#if CYTHON_USE_PYLONG_INTERNALS
16942
if (likely(PyLong_CheckExact(op1))) {
16943
const long b = intval;
16944
long a, x;
16945
#ifdef HAVE_LONG_LONG
16946
const PY_LONG_LONG llb = intval;
16947
PY_LONG_LONG lla, llx;
16948
#endif
16949
const digit* digits = ((PyLongObject*)op1)->ob_digit;
16950
const Py_ssize_t size = Py_SIZE(op1);
16951
if (likely(__Pyx_sst_abs(size) <= 1)) {
16952
a = likely(size) ? digits[0] : 0;
16953
if (size == -1) a = -a;
16954
} else {
16955
switch (size) {
16956
case -2:
16957
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16958
a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16959
break;
16960
#ifdef HAVE_LONG_LONG
16961
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
16962
lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16963
goto long_long;
16964
#endif
16965
}
16966
case 2:
16967
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
16968
a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16969
break;
16970
#ifdef HAVE_LONG_LONG
16971
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
16972
lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16973
goto long_long;
16974
#endif
16975
}
16976
case -3:
16977
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16978
a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16979
break;
16980
#ifdef HAVE_LONG_LONG
16981
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
16982
lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16983
goto long_long;
16984
#endif
16985
}
16986
case 3:
16987
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
16988
a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16989
break;
16990
#ifdef HAVE_LONG_LONG
16991
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
16992
lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
16993
goto long_long;
16994
#endif
16995
}
16996
case -4:
16997
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
16998
a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
16999
break;
17000
#ifdef HAVE_LONG_LONG
17001
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
17002
lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17003
goto long_long;
17004
#endif
17005
}
17006
case 4:
17007
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
17008
a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
17009
break;
17010
#ifdef HAVE_LONG_LONG
17011
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
17012
lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17013
goto long_long;
17014
#endif
17015
}
17016
default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
17017
}
17018
}
17019
x = a + b;
17020
return PyLong_FromLong(x);
17021
#ifdef HAVE_LONG_LONG
17022
long_long:
17023
llx = lla + llb;
17024
return PyLong_FromLongLong(llx);
17025
#endif
17026
17027
17028
}
17029
#endif
17030
if (PyFloat_CheckExact(op1)) {
17031
const long b = intval;
17032
double a = PyFloat_AS_DOUBLE(op1);
17033
double result;
17034
PyFPE_START_PROTECT("add", return NULL)
17035
result = ((double)a) + (double)b;
17036
PyFPE_END_PROTECT(result)
17037
return PyFloat_FromDouble(result);
17038
}
17039
return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
17040
}
17041
#endif
17042
17043
/* PyIntBinop */
17044
#if !CYTHON_COMPILING_IN_PYPY
17045
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
17046
#if PY_MAJOR_VERSION < 3
17047
if (likely(PyInt_CheckExact(op2))) {
17048
const long a = intval;
17049
long x;
17050
long b = PyInt_AS_LONG(op2);
17051
x = (long)((unsigned long)a - b);
17052
if (likely((x^a) >= 0 || (x^~b) >= 0))
17053
return PyInt_FromLong(x);
17054
return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
17055
}
17056
#endif
17057
#if CYTHON_USE_PYLONG_INTERNALS
17058
if (likely(PyLong_CheckExact(op2))) {
17059
const long a = intval;
17060
long b, x;
17061
#ifdef HAVE_LONG_LONG
17062
const PY_LONG_LONG lla = intval;
17063
PY_LONG_LONG llb, llx;
17064
#endif
17065
const digit* digits = ((PyLongObject*)op2)->ob_digit;
17066
const Py_ssize_t size = Py_SIZE(op2);
17067
if (likely(__Pyx_sst_abs(size) <= 1)) {
17068
b = likely(size) ? digits[0] : 0;
17069
if (size == -1) b = -b;
17070
} else {
17071
switch (size) {
17072
case -2:
17073
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
17074
b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
17075
break;
17076
#ifdef HAVE_LONG_LONG
17077
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
17078
llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17079
goto long_long;
17080
#endif
17081
}
17082
case 2:
17083
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
17084
b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
17085
break;
17086
#ifdef HAVE_LONG_LONG
17087
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
17088
llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17089
goto long_long;
17090
#endif
17091
}
17092
case -3:
17093
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
17094
b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
17095
break;
17096
#ifdef HAVE_LONG_LONG
17097
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
17098
llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17099
goto long_long;
17100
#endif
17101
}
17102
case 3:
17103
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
17104
b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
17105
break;
17106
#ifdef HAVE_LONG_LONG
17107
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
17108
llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17109
goto long_long;
17110
#endif
17111
}
17112
case -4:
17113
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
17114
b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
17115
break;
17116
#ifdef HAVE_LONG_LONG
17117
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
17118
llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17119
goto long_long;
17120
#endif
17121
}
17122
case 4:
17123
if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
17124
b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
17125
break;
17126
#ifdef HAVE_LONG_LONG
17127
} else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
17128
llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
17129
goto long_long;
17130
#endif
17131
}
17132
default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
17133
}
17134
}
17135
x = a - b;
17136
return PyLong_FromLong(x);
17137
#ifdef HAVE_LONG_LONG
17138
long_long:
17139
llx = lla - llb;
17140
return PyLong_FromLongLong(llx);
17141
#endif
17142
17143
17144
}
17145
#endif
17146
if (PyFloat_CheckExact(op2)) {
17147
const long a = intval;
17148
double b = PyFloat_AS_DOUBLE(op2);
17149
double result;
17150
PyFPE_START_PROTECT("subtract", return NULL)
17151
result = ((double)a) - (double)b;
17152
PyFPE_END_PROTECT(result)
17153
return PyFloat_FromDouble(result);
17154
}
17155
return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
17156
}
17157
#endif
17158
17159
/* ExtTypeTest */
17160
static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
17161
if (unlikely(!type)) {
17162
PyErr_SetString(PyExc_SystemError, "Missing type object");
17163
return 0;
17164
}
17165
if (likely(PyObject_TypeCheck(obj, type)))
17166
return 1;
17167
PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
17168
Py_TYPE(obj)->tp_name, type->tp_name);
17169
return 0;
17170
}
17171
17172
/* None */
17173
static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
17174
PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
17175
}
17176
17177
/* Import */
17178
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
17179
PyObject *empty_list = 0;
17180
PyObject *module = 0;
17181
PyObject *global_dict = 0;
17182
PyObject *empty_dict = 0;
17183
PyObject *list;
17184
#if PY_VERSION_HEX < 0x03030000
17185
PyObject *py_import;
17186
py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
17187
if (!py_import)
17188
goto bad;
17189
#endif
17190
if (from_list)
17191
list = from_list;
17192
else {
17193
empty_list = PyList_New(0);
17194
if (!empty_list)
17195
goto bad;
17196
list = empty_list;
17197
}
17198
global_dict = PyModule_GetDict(__pyx_m);
17199
if (!global_dict)
17200
goto bad;
17201
empty_dict = PyDict_New();
17202
if (!empty_dict)
17203
goto bad;
17204
{
17205
#if PY_MAJOR_VERSION >= 3
17206
if (level == -1) {
17207
if (strchr(__Pyx_MODULE_NAME, '.')) {
17208
#if PY_VERSION_HEX < 0x03030000
17209
PyObject *py_level = PyInt_FromLong(1);
17210
if (!py_level)
17211
goto bad;
17212
module = PyObject_CallFunctionObjArgs(py_import,
17213
name, global_dict, empty_dict, list, py_level, NULL);
17214
Py_DECREF(py_level);
17215
#else
17216
module = PyImport_ImportModuleLevelObject(
17217
name, global_dict, empty_dict, list, 1);
17218
#endif
17219
if (!module) {
17220
if (!PyErr_ExceptionMatches(PyExc_ImportError))
17221
goto bad;
17222
PyErr_Clear();
17223
}
17224
}
17225
level = 0;
17226
}
17227
#endif
17228
if (!module) {
17229
#if PY_VERSION_HEX < 0x03030000
17230
PyObject *py_level = PyInt_FromLong(level);
17231
if (!py_level)
17232
goto bad;
17233
module = PyObject_CallFunctionObjArgs(py_import,
17234
name, global_dict, empty_dict, list, py_level, NULL);
17235
Py_DECREF(py_level);
17236
#else
17237
module = PyImport_ImportModuleLevelObject(
17238
name, global_dict, empty_dict, list, level);
17239
#endif
17240
}
17241
}
17242
bad:
17243
#if PY_VERSION_HEX < 0x03030000
17244
Py_XDECREF(py_import);
17245
#endif
17246
Py_XDECREF(empty_list);
17247
Py_XDECREF(empty_dict);
17248
return module;
17249
}
17250
17251
/* ImportFrom */
17252
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
17253
PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
17254
if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
17255
PyErr_Format(PyExc_ImportError,
17256
#if PY_MAJOR_VERSION < 3
17257
"cannot import name %.230s", PyString_AS_STRING(name));
17258
#else
17259
"cannot import name %S", name);
17260
#endif
17261
}
17262
return value;
17263
}
17264
17265
/* FetchCommonType */
17266
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
17267
PyObject* fake_module;
17268
PyTypeObject* cached_type = NULL;
17269
fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
17270
if (!fake_module) return NULL;
17271
Py_INCREF(fake_module);
17272
cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
17273
if (cached_type) {
17274
if (!PyType_Check((PyObject*)cached_type)) {
17275
PyErr_Format(PyExc_TypeError,
17276
"Shared Cython type %.200s is not a type object",
17277
type->tp_name);
17278
goto bad;
17279
}
17280
if (cached_type->tp_basicsize != type->tp_basicsize) {
17281
PyErr_Format(PyExc_TypeError,
17282
"Shared Cython type %.200s has the wrong size, try recompiling",
17283
type->tp_name);
17284
goto bad;
17285
}
17286
} else {
17287
if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
17288
PyErr_Clear();
17289
if (PyType_Ready(type) < 0) goto bad;
17290
if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
17291
goto bad;
17292
Py_INCREF(type);
17293
cached_type = type;
17294
}
17295
done:
17296
Py_DECREF(fake_module);
17297
return cached_type;
17298
bad:
17299
Py_XDECREF(cached_type);
17300
cached_type = NULL;
17301
goto done;
17302
}
17303
17304
/* CythonFunction */
17305
static PyObject *
17306
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
17307
{
17308
if (unlikely(op->func_doc == NULL)) {
17309
if (op->func.m_ml->ml_doc) {
17310
#if PY_MAJOR_VERSION >= 3
17311
op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
17312
#else
17313
op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
17314
#endif
17315
if (unlikely(op->func_doc == NULL))
17316
return NULL;
17317
} else {
17318
Py_INCREF(Py_None);
17319
return Py_None;
17320
}
17321
}
17322
Py_INCREF(op->func_doc);
17323
return op->func_doc;
17324
}
17325
static int
17326
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
17327
{
17328
PyObject *tmp = op->func_doc;
17329
if (value == NULL) {
17330
value = Py_None;
17331
}
17332
Py_INCREF(value);
17333
op->func_doc = value;
17334
Py_XDECREF(tmp);
17335
return 0;
17336
}
17337
static PyObject *
17338
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
17339
{
17340
if (unlikely(op->func_name == NULL)) {
17341
#if PY_MAJOR_VERSION >= 3
17342
op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
17343
#else
17344
op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
17345
#endif
17346
if (unlikely(op->func_name == NULL))
17347
return NULL;
17348
}
17349
Py_INCREF(op->func_name);
17350
return op->func_name;
17351
}
17352
static int
17353
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
17354
{
17355
PyObject *tmp;
17356
#if PY_MAJOR_VERSION >= 3
17357
if (unlikely(value == NULL || !PyUnicode_Check(value))) {
17358
#else
17359
if (unlikely(value == NULL || !PyString_Check(value))) {
17360
#endif
17361
PyErr_SetString(PyExc_TypeError,
17362
"__name__ must be set to a string object");
17363
return -1;
17364
}
17365
tmp = op->func_name;
17366
Py_INCREF(value);
17367
op->func_name = value;
17368
Py_XDECREF(tmp);
17369
return 0;
17370
}
17371
static PyObject *
17372
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
17373
{
17374
Py_INCREF(op->func_qualname);
17375
return op->func_qualname;
17376
}
17377
static int
17378
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
17379
{
17380
PyObject *tmp;
17381
#if PY_MAJOR_VERSION >= 3
17382
if (unlikely(value == NULL || !PyUnicode_Check(value))) {
17383
#else
17384
if (unlikely(value == NULL || !PyString_Check(value))) {
17385
#endif
17386
PyErr_SetString(PyExc_TypeError,
17387
"__qualname__ must be set to a string object");
17388
return -1;
17389
}
17390
tmp = op->func_qualname;
17391
Py_INCREF(value);
17392
op->func_qualname = value;
17393
Py_XDECREF(tmp);
17394
return 0;
17395
}
17396
static PyObject *
17397
__Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
17398
{
17399
PyObject *self;
17400
self = m->func_closure;
17401
if (self == NULL)
17402
self = Py_None;
17403
Py_INCREF(self);
17404
return self;
17405
}
17406
static PyObject *
17407
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
17408
{
17409
if (unlikely(op->func_dict == NULL)) {
17410
op->func_dict = PyDict_New();
17411
if (unlikely(op->func_dict == NULL))
17412
return NULL;
17413
}
17414
Py_INCREF(op->func_dict);
17415
return op->func_dict;
17416
}
17417
static int
17418
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
17419
{
17420
PyObject *tmp;
17421
if (unlikely(value == NULL)) {
17422
PyErr_SetString(PyExc_TypeError,
17423
"function's dictionary may not be deleted");
17424
return -1;
17425
}
17426
if (unlikely(!PyDict_Check(value))) {
17427
PyErr_SetString(PyExc_TypeError,
17428
"setting function's dictionary to a non-dict");
17429
return -1;
17430
}
17431
tmp = op->func_dict;
17432
Py_INCREF(value);
17433
op->func_dict = value;
17434
Py_XDECREF(tmp);
17435
return 0;
17436
}
17437
static PyObject *
17438
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
17439
{
17440
Py_INCREF(op->func_globals);
17441
return op->func_globals;
17442
}
17443
static PyObject *
17444
__Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
17445
{
17446
Py_INCREF(Py_None);
17447
return Py_None;
17448
}
17449
static PyObject *
17450
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
17451
{
17452
PyObject* result = (op->func_code) ? op->func_code : Py_None;
17453
Py_INCREF(result);
17454
return result;
17455
}
17456
static int
17457
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
17458
int result = 0;
17459
PyObject *res = op->defaults_getter((PyObject *) op);
17460
if (unlikely(!res))
17461
return -1;
17462
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
17463
op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
17464
Py_INCREF(op->defaults_tuple);
17465
op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
17466
Py_INCREF(op->defaults_kwdict);
17467
#else
17468
op->defaults_tuple = PySequence_ITEM(res, 0);
17469
if (unlikely(!op->defaults_tuple)) result = -1;
17470
else {
17471
op->defaults_kwdict = PySequence_ITEM(res, 1);
17472
if (unlikely(!op->defaults_kwdict)) result = -1;
17473
}
17474
#endif
17475
Py_DECREF(res);
17476
return result;
17477
}
17478
static int
17479
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
17480
PyObject* tmp;
17481
if (!value) {
17482
value = Py_None;
17483
} else if (value != Py_None && !PyTuple_Check(value)) {
17484
PyErr_SetString(PyExc_TypeError,
17485
"__defaults__ must be set to a tuple object");
17486
return -1;
17487
}
17488
Py_INCREF(value);
17489
tmp = op->defaults_tuple;
17490
op->defaults_tuple = value;
17491
Py_XDECREF(tmp);
17492
return 0;
17493
}
17494
static PyObject *
17495
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
17496
PyObject* result = op->defaults_tuple;
17497
if (unlikely(!result)) {
17498
if (op->defaults_getter) {
17499
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
17500
result = op->defaults_tuple;
17501
} else {
17502
result = Py_None;
17503
}
17504
}
17505
Py_INCREF(result);
17506
return result;
17507
}
17508
static int
17509
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
17510
PyObject* tmp;
17511
if (!value) {
17512
value = Py_None;
17513
} else if (value != Py_None && !PyDict_Check(value)) {
17514
PyErr_SetString(PyExc_TypeError,
17515
"__kwdefaults__ must be set to a dict object");
17516
return -1;
17517
}
17518
Py_INCREF(value);
17519
tmp = op->defaults_kwdict;
17520
op->defaults_kwdict = value;
17521
Py_XDECREF(tmp);
17522
return 0;
17523
}
17524
static PyObject *
17525
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
17526
PyObject* result = op->defaults_kwdict;
17527
if (unlikely(!result)) {
17528
if (op->defaults_getter) {
17529
if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
17530
result = op->defaults_kwdict;
17531
} else {
17532
result = Py_None;
17533
}
17534
}
17535
Py_INCREF(result);
17536
return result;
17537
}
17538
static int
17539
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
17540
PyObject* tmp;
17541
if (!value || value == Py_None) {
17542
value = NULL;
17543
} else if (!PyDict_Check(value)) {
17544
PyErr_SetString(PyExc_TypeError,
17545
"__annotations__ must be set to a dict object");
17546
return -1;
17547
}
17548
Py_XINCREF(value);
17549
tmp = op->func_annotations;
17550
op->func_annotations = value;
17551
Py_XDECREF(tmp);
17552
return 0;
17553
}
17554
static PyObject *
17555
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
17556
PyObject* result = op->func_annotations;
17557
if (unlikely(!result)) {
17558
result = PyDict_New();
17559
if (unlikely(!result)) return NULL;
17560
op->func_annotations = result;
17561
}
17562
Py_INCREF(result);
17563
return result;
17564
}
17565
static PyGetSetDef __pyx_CyFunction_getsets[] = {
17566
{(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
17567
{(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
17568
{(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
17569
{(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
17570
{(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
17571
{(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
17572
{(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
17573
{(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
17574
{(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
17575
{(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
17576
{(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
17577
{(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
17578
{(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
17579
{(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
17580
{(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
17581
{(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
17582
{(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
17583
{(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
17584
{0, 0, 0, 0, 0}
17585
};
17586
static PyMemberDef __pyx_CyFunction_members[] = {
17587
{(char *) "__module__", T_OBJECT, offsetof(__pyx_CyFunctionObject, func.m_module), PY_WRITE_RESTRICTED, 0},
17588
{0, 0, 0, 0, 0}
17589
};
17590
static PyObject *
17591
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
17592
{
17593
#if PY_MAJOR_VERSION >= 3
17594
return PyUnicode_FromString(m->func.m_ml->ml_name);
17595
#else
17596
return PyString_FromString(m->func.m_ml->ml_name);
17597
#endif
17598
}
17599
static PyMethodDef __pyx_CyFunction_methods[] = {
17600
{"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
17601
{0, 0, 0, 0}
17602
};
17603
#if PY_VERSION_HEX < 0x030500A0
17604
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
17605
#else
17606
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
17607
#endif
17608
static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
17609
PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
17610
__pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
17611
if (op == NULL)
17612
return NULL;
17613
op->flags = flags;
17614
__Pyx_CyFunction_weakreflist(op) = NULL;
17615
op->func.m_ml = ml;
17616
op->func.m_self = (PyObject *) op;
17617
Py_XINCREF(closure);
17618
op->func_closure = closure;
17619
Py_XINCREF(module);
17620
op->func.m_module = module;
17621
op->func_dict = NULL;
17622
op->func_name = NULL;
17623
Py_INCREF(qualname);
17624
op->func_qualname = qualname;
17625
op->func_doc = NULL;
17626
op->func_classobj = NULL;
17627
op->func_globals = globals;
17628
Py_INCREF(op->func_globals);
17629
Py_XINCREF(code);
17630
op->func_code = code;
17631
op->defaults_pyobjects = 0;
17632
op->defaults = NULL;
17633
op->defaults_tuple = NULL;
17634
op->defaults_kwdict = NULL;
17635
op->defaults_getter = NULL;
17636
op->func_annotations = NULL;
17637
PyObject_GC_Track(op);
17638
return (PyObject *) op;
17639
}
17640
static int
17641
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
17642
{
17643
Py_CLEAR(m->func_closure);
17644
Py_CLEAR(m->func.m_module);
17645
Py_CLEAR(m->func_dict);
17646
Py_CLEAR(m->func_name);
17647
Py_CLEAR(m->func_qualname);
17648
Py_CLEAR(m->func_doc);
17649
Py_CLEAR(m->func_globals);
17650
Py_CLEAR(m->func_code);
17651
Py_CLEAR(m->func_classobj);
17652
Py_CLEAR(m->defaults_tuple);
17653
Py_CLEAR(m->defaults_kwdict);
17654
Py_CLEAR(m->func_annotations);
17655
if (m->defaults) {
17656
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
17657
int i;
17658
for (i = 0; i < m->defaults_pyobjects; i++)
17659
Py_XDECREF(pydefaults[i]);
17660
PyObject_Free(m->defaults);
17661
m->defaults = NULL;
17662
}
17663
return 0;
17664
}
17665
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
17666
{
17667
PyObject_GC_UnTrack(m);
17668
if (__Pyx_CyFunction_weakreflist(m) != NULL)
17669
PyObject_ClearWeakRefs((PyObject *) m);
17670
__Pyx_CyFunction_clear(m);
17671
PyObject_GC_Del(m);
17672
}
17673
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
17674
{
17675
Py_VISIT(m->func_closure);
17676
Py_VISIT(m->func.m_module);
17677
Py_VISIT(m->func_dict);
17678
Py_VISIT(m->func_name);
17679
Py_VISIT(m->func_qualname);
17680
Py_VISIT(m->func_doc);
17681
Py_VISIT(m->func_globals);
17682
Py_VISIT(m->func_code);
17683
Py_VISIT(m->func_classobj);
17684
Py_VISIT(m->defaults_tuple);
17685
Py_VISIT(m->defaults_kwdict);
17686
if (m->defaults) {
17687
PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
17688
int i;
17689
for (i = 0; i < m->defaults_pyobjects; i++)
17690
Py_VISIT(pydefaults[i]);
17691
}
17692
return 0;
17693
}
17694
static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
17695
{
17696
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
17697
if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
17698
Py_INCREF(func);
17699
return func;
17700
}
17701
if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
17702
if (type == NULL)
17703
type = (PyObject *)(Py_TYPE(obj));
17704
return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
17705
}
17706
if (obj == Py_None)
17707
obj = NULL;
17708
return __Pyx_PyMethod_New(func, obj, type);
17709
}
17710
static PyObject*
17711
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
17712
{
17713
#if PY_MAJOR_VERSION >= 3
17714
return PyUnicode_FromFormat("<cyfunction %U at %p>",
17715
op->func_qualname, (void *)op);
17716
#else
17717
return PyString_FromFormat("<cyfunction %s at %p>",
17718
PyString_AsString(op->func_qualname), (void *)op);
17719
#endif
17720
}
17721
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
17722
PyCFunctionObject* f = (PyCFunctionObject*)func;
17723
PyCFunction meth = f->m_ml->ml_meth;
17724
Py_ssize_t size;
17725
switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
17726
case METH_VARARGS:
17727
if (likely(kw == NULL || PyDict_Size(kw) == 0))
17728
return (*meth)(self, arg);
17729
break;
17730
case METH_VARARGS | METH_KEYWORDS:
17731
return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
17732
case METH_NOARGS:
17733
if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
17734
size = PyTuple_GET_SIZE(arg);
17735
if (likely(size == 0))
17736
return (*meth)(self, NULL);
17737
PyErr_Format(PyExc_TypeError,
17738
"%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
17739
f->m_ml->ml_name, size);
17740
return NULL;
17741
}
17742
break;
17743
case METH_O:
17744
if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
17745
size = PyTuple_GET_SIZE(arg);
17746
if (likely(size == 1)) {
17747
PyObject *result, *arg0 = PySequence_ITEM(arg, 0);
17748
if (unlikely(!arg0)) return NULL;
17749
result = (*meth)(self, arg0);
17750
Py_DECREF(arg0);
17751
return result;
17752
}
17753
PyErr_Format(PyExc_TypeError,
17754
"%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
17755
f->m_ml->ml_name, size);
17756
return NULL;
17757
}
17758
break;
17759
default:
17760
PyErr_SetString(PyExc_SystemError, "Bad call flags in "
17761
"__Pyx_CyFunction_Call. METH_OLDARGS is no "
17762
"longer supported!");
17763
return NULL;
17764
}
17765
PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
17766
f->m_ml->ml_name);
17767
return NULL;
17768
}
17769
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
17770
return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
17771
}
17772
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
17773
PyObject *result;
17774
__pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
17775
if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
17776
Py_ssize_t argc;
17777
PyObject *new_args;
17778
PyObject *self;
17779
argc = PyTuple_GET_SIZE(args);
17780
new_args = PyTuple_GetSlice(args, 1, argc);
17781
if (unlikely(!new_args))
17782
return NULL;
17783
self = PyTuple_GetItem(args, 0);
17784
if (unlikely(!self)) {
17785
Py_DECREF(new_args);
17786
return NULL;
17787
}
17788
result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
17789
Py_DECREF(new_args);
17790
} else {
17791
result = __Pyx_CyFunction_Call(func, args, kw);
17792
}
17793
return result;
17794
}
17795
static PyTypeObject __pyx_CyFunctionType_type = {
17796
PyVarObject_HEAD_INIT(0, 0)
17797
"cython_function_or_method",
17798
sizeof(__pyx_CyFunctionObject),
17799
0,
17800
(destructor) __Pyx_CyFunction_dealloc,
17801
0,
17802
0,
17803
0,
17804
#if PY_MAJOR_VERSION < 3
17805
0,
17806
#else
17807
0,
17808
#endif
17809
(reprfunc) __Pyx_CyFunction_repr,
17810
0,
17811
0,
17812
0,
17813
0,
17814
__Pyx_CyFunction_CallAsMethod,
17815
0,
17816
0,
17817
0,
17818
0,
17819
Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
17820
0,
17821
(traverseproc) __Pyx_CyFunction_traverse,
17822
(inquiry) __Pyx_CyFunction_clear,
17823
0,
17824
#if PY_VERSION_HEX < 0x030500A0
17825
offsetof(__pyx_CyFunctionObject, func_weakreflist),
17826
#else
17827
offsetof(PyCFunctionObject, m_weakreflist),
17828
#endif
17829
0,
17830
0,
17831
__pyx_CyFunction_methods,
17832
__pyx_CyFunction_members,
17833
__pyx_CyFunction_getsets,
17834
0,
17835
0,
17836
__Pyx_CyFunction_descr_get,
17837
0,
17838
offsetof(__pyx_CyFunctionObject, func_dict),
17839
0,
17840
0,
17841
0,
17842
0,
17843
0,
17844
0,
17845
0,
17846
0,
17847
0,
17848
0,
17849
0,
17850
0,
17851
#if PY_VERSION_HEX >= 0x030400a1
17852
0,
17853
#endif
17854
};
17855
static int __pyx_CyFunction_init(void) {
17856
__pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
17857
if (__pyx_CyFunctionType == NULL) {
17858
return -1;
17859
}
17860
return 0;
17861
}
17862
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
17863
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
17864
m->defaults = PyObject_Malloc(size);
17865
if (!m->defaults)
17866
return PyErr_NoMemory();
17867
memset(m->defaults, 0, size);
17868
m->defaults_pyobjects = pyobjects;
17869
return m->defaults;
17870
}
17871
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
17872
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
17873
m->defaults_tuple = tuple;
17874
Py_INCREF(tuple);
17875
}
17876
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
17877
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
17878
m->defaults_kwdict = dict;
17879
Py_INCREF(dict);
17880
}
17881
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
17882
__pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
17883
m->func_annotations = dict;
17884
Py_INCREF(dict);
17885
}
17886
17887
/* SaveResetException */
17888
#if CYTHON_FAST_THREAD_STATE
17889
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
17890
*type = tstate->exc_type;
17891
*value = tstate->exc_value;
17892
*tb = tstate->exc_traceback;
17893
Py_XINCREF(*type);
17894
Py_XINCREF(*value);
17895
Py_XINCREF(*tb);
17896
}
17897
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
17898
PyObject *tmp_type, *tmp_value, *tmp_tb;
17899
tmp_type = tstate->exc_type;
17900
tmp_value = tstate->exc_value;
17901
tmp_tb = tstate->exc_traceback;
17902
tstate->exc_type = type;
17903
tstate->exc_value = value;
17904
tstate->exc_traceback = tb;
17905
Py_XDECREF(tmp_type);
17906
Py_XDECREF(tmp_value);
17907
Py_XDECREF(tmp_tb);
17908
}
17909
#endif
17910
17911
/* PyErrExceptionMatches */
17912
#if CYTHON_FAST_THREAD_STATE
17913
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
17914
PyObject *exc_type = tstate->curexc_type;
17915
if (exc_type == err) return 1;
17916
if (unlikely(!exc_type)) return 0;
17917
return PyErr_GivenExceptionMatches(exc_type, err);
17918
}
17919
#endif
17920
17921
/* GetException */
17922
#if CYTHON_FAST_THREAD_STATE
17923
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
17924
#else
17925
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
17926
#endif
17927
PyObject *local_type, *local_value, *local_tb;
17928
#if CYTHON_FAST_THREAD_STATE
17929
PyObject *tmp_type, *tmp_value, *tmp_tb;
17930
local_type = tstate->curexc_type;
17931
local_value = tstate->curexc_value;
17932
local_tb = tstate->curexc_traceback;
17933
tstate->curexc_type = 0;
17934
tstate->curexc_value = 0;
17935
tstate->curexc_traceback = 0;
17936
#else
17937
PyErr_Fetch(&local_type, &local_value, &local_tb);
17938
#endif
17939
PyErr_NormalizeException(&local_type, &local_value, &local_tb);
17940
#if CYTHON_FAST_THREAD_STATE
17941
if (unlikely(tstate->curexc_type))
17942
#else
17943
if (unlikely(PyErr_Occurred()))
17944
#endif
17945
goto bad;
17946
#if PY_MAJOR_VERSION >= 3
17947
if (local_tb) {
17948
if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
17949
goto bad;
17950
}
17951
#endif
17952
Py_XINCREF(local_tb);
17953
Py_XINCREF(local_type);
17954
Py_XINCREF(local_value);
17955
*type = local_type;
17956
*value = local_value;
17957
*tb = local_tb;
17958
#if CYTHON_FAST_THREAD_STATE
17959
tmp_type = tstate->exc_type;
17960
tmp_value = tstate->exc_value;
17961
tmp_tb = tstate->exc_traceback;
17962
tstate->exc_type = local_type;
17963
tstate->exc_value = local_value;
17964
tstate->exc_traceback = local_tb;
17965
Py_XDECREF(tmp_type);
17966
Py_XDECREF(tmp_value);
17967
Py_XDECREF(tmp_tb);
17968
#else
17969
PyErr_SetExcInfo(local_type, local_value, local_tb);
17970
#endif
17971
return 0;
17972
bad:
17973
*type = 0;
17974
*value = 0;
17975
*tb = 0;
17976
Py_XDECREF(local_type);
17977
Py_XDECREF(local_value);
17978
Py_XDECREF(local_tb);
17979
return -1;
17980
}
17981
17982
/* SetVTable */
17983
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
17984
#if PY_VERSION_HEX >= 0x02070000
17985
PyObject *ob = PyCapsule_New(vtable, 0, 0);
17986
#else
17987
PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
17988
#endif
17989
if (!ob)
17990
goto bad;
17991
if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
17992
goto bad;
17993
Py_DECREF(ob);
17994
return 0;
17995
bad:
17996
Py_XDECREF(ob);
17997
return -1;
17998
}
17999
18000
/* GetVTable */
18001
static void* __Pyx_GetVtable(PyObject *dict) {
18002
void* ptr;
18003
PyObject *ob = PyObject_GetItem(dict, __pyx_n_s_pyx_vtable);
18004
if (!ob)
18005
goto bad;
18006
#if PY_VERSION_HEX >= 0x02070000
18007
ptr = PyCapsule_GetPointer(ob, 0);
18008
#else
18009
ptr = PyCObject_AsVoidPtr(ob);
18010
#endif
18011
if (!ptr && !PyErr_Occurred())
18012
PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
18013
Py_DECREF(ob);
18014
return ptr;
18015
bad:
18016
Py_XDECREF(ob);
18017
return NULL;
18018
}
18019
18020
/* CodeObjectCache */
18021
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
18022
int start = 0, mid = 0, end = count - 1;
18023
if (end >= 0 && code_line > entries[end].code_line) {
18024
return count;
18025
}
18026
while (start < end) {
18027
mid = start + (end - start) / 2;
18028
if (code_line < entries[mid].code_line) {
18029
end = mid;
18030
} else if (code_line > entries[mid].code_line) {
18031
start = mid + 1;
18032
} else {
18033
return mid;
18034
}
18035
}
18036
if (code_line <= entries[mid].code_line) {
18037
return mid;
18038
} else {
18039
return mid + 1;
18040
}
18041
}
18042
static PyCodeObject *__pyx_find_code_object(int code_line) {
18043
PyCodeObject* code_object;
18044
int pos;
18045
if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
18046
return NULL;
18047
}
18048
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
18049
if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
18050
return NULL;
18051
}
18052
code_object = __pyx_code_cache.entries[pos].code_object;
18053
Py_INCREF(code_object);
18054
return code_object;
18055
}
18056
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
18057
int pos, i;
18058
__Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
18059
if (unlikely(!code_line)) {
18060
return;
18061
}
18062
if (unlikely(!entries)) {
18063
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
18064
if (likely(entries)) {
18065
__pyx_code_cache.entries = entries;
18066
__pyx_code_cache.max_count = 64;
18067
__pyx_code_cache.count = 1;
18068
entries[0].code_line = code_line;
18069
entries[0].code_object = code_object;
18070
Py_INCREF(code_object);
18071
}
18072
return;
18073
}
18074
pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
18075
if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
18076
PyCodeObject* tmp = entries[pos].code_object;
18077
entries[pos].code_object = code_object;
18078
Py_DECREF(tmp);
18079
return;
18080
}
18081
if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
18082
int new_max = __pyx_code_cache.max_count + 64;
18083
entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
18084
__pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
18085
if (unlikely(!entries)) {
18086
return;
18087
}
18088
__pyx_code_cache.entries = entries;
18089
__pyx_code_cache.max_count = new_max;
18090
}
18091
for (i=__pyx_code_cache.count; i>pos; i--) {
18092
entries[i] = entries[i-1];
18093
}
18094
entries[pos].code_line = code_line;
18095
entries[pos].code_object = code_object;
18096
__pyx_code_cache.count++;
18097
Py_INCREF(code_object);
18098
}
18099
18100
/* AddTraceback */
18101
#include "compile.h"
18102
#include "frameobject.h"
18103
#include "traceback.h"
18104
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
18105
const char *funcname, int c_line,
18106
int py_line, const char *filename) {
18107
PyCodeObject *py_code = 0;
18108
PyObject *py_srcfile = 0;
18109
PyObject *py_funcname = 0;
18110
#if PY_MAJOR_VERSION < 3
18111
py_srcfile = PyString_FromString(filename);
18112
#else
18113
py_srcfile = PyUnicode_FromString(filename);
18114
#endif
18115
if (!py_srcfile) goto bad;
18116
if (c_line) {
18117
#if PY_MAJOR_VERSION < 3
18118
py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
18119
#else
18120
py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
18121
#endif
18122
}
18123
else {
18124
#if PY_MAJOR_VERSION < 3
18125
py_funcname = PyString_FromString(funcname);
18126
#else
18127
py_funcname = PyUnicode_FromString(funcname);
18128
#endif
18129
}
18130
if (!py_funcname) goto bad;
18131
py_code = __Pyx_PyCode_New(
18132
0,
18133
0,
18134
0,
18135
0,
18136
0,
18137
__pyx_empty_bytes, /*PyObject *code,*/
18138
__pyx_empty_tuple, /*PyObject *consts,*/
18139
__pyx_empty_tuple, /*PyObject *names,*/
18140
__pyx_empty_tuple, /*PyObject *varnames,*/
18141
__pyx_empty_tuple, /*PyObject *freevars,*/
18142
__pyx_empty_tuple, /*PyObject *cellvars,*/
18143
py_srcfile, /*PyObject *filename,*/
18144
py_funcname, /*PyObject *name,*/
18145
py_line,
18146
__pyx_empty_bytes /*PyObject *lnotab*/
18147
);
18148
Py_DECREF(py_srcfile);
18149
Py_DECREF(py_funcname);
18150
return py_code;
18151
bad:
18152
Py_XDECREF(py_srcfile);
18153
Py_XDECREF(py_funcname);
18154
return NULL;
18155
}
18156
static void __Pyx_AddTraceback(const char *funcname, int c_line,
18157
int py_line, const char *filename) {
18158
PyCodeObject *py_code = 0;
18159
PyFrameObject *py_frame = 0;
18160
py_code = __pyx_find_code_object(c_line ? c_line : py_line);
18161
if (!py_code) {
18162
py_code = __Pyx_CreateCodeObjectForTraceback(
18163
funcname, c_line, py_line, filename);
18164
if (!py_code) goto bad;
18165
__pyx_insert_code_object(c_line ? c_line : py_line, py_code);
18166
}
18167
py_frame = PyFrame_New(
18168
PyThreadState_GET(), /*PyThreadState *tstate,*/
18169
py_code, /*PyCodeObject *code,*/
18170
__pyx_d, /*PyObject *globals,*/
18171
0 /*PyObject *locals*/
18172
);
18173
if (!py_frame) goto bad;
18174
__Pyx_PyFrame_SetLineNumber(py_frame, py_line);
18175
PyTraceBack_Here(py_frame);
18176
bad:
18177
Py_XDECREF(py_code);
18178
Py_XDECREF(py_frame);
18179
}
18180
18181
/* CIntFromPyVerify */
18182
#define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
18183
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
18184
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
18185
__PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
18186
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
18187
{\
18188
func_type value = func_value;\
18189
if (sizeof(target_type) < sizeof(func_type)) {\
18190
if (unlikely(value != (func_type) (target_type) value)) {\
18191
func_type zero = 0;\
18192
if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
18193
return (target_type) -1;\
18194
if (is_unsigned && unlikely(value < zero))\
18195
goto raise_neg_overflow;\
18196
else\
18197
goto raise_overflow;\
18198
}\
18199
}\
18200
return (target_type) value;\
18201
}
18202
18203
/* CIntToPy */
18204
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
18205
const long neg_one = (long) -1, const_zero = (long) 0;
18206
const int is_unsigned = neg_one > const_zero;
18207
if (is_unsigned) {
18208
if (sizeof(long) < sizeof(long)) {
18209
return PyInt_FromLong((long) value);
18210
} else if (sizeof(long) <= sizeof(unsigned long)) {
18211
return PyLong_FromUnsignedLong((unsigned long) value);
18212
#ifdef HAVE_LONG_LONG
18213
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
18214
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
18215
#endif
18216
}
18217
} else {
18218
if (sizeof(long) <= sizeof(long)) {
18219
return PyInt_FromLong((long) value);
18220
#ifdef HAVE_LONG_LONG
18221
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
18222
return PyLong_FromLongLong((PY_LONG_LONG) value);
18223
#endif
18224
}
18225
}
18226
{
18227
int one = 1; int little = (int)*(unsigned char *)&one;
18228
unsigned char *bytes = (unsigned char *)&value;
18229
return _PyLong_FromByteArray(bytes, sizeof(long),
18230
little, !is_unsigned);
18231
}
18232
}
18233
18234
/* CIntToPy */
18235
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
18236
const int neg_one = (int) -1, const_zero = (int) 0;
18237
const int is_unsigned = neg_one > const_zero;
18238
if (is_unsigned) {
18239
if (sizeof(int) < sizeof(long)) {
18240
return PyInt_FromLong((long) value);
18241
} else if (sizeof(int) <= sizeof(unsigned long)) {
18242
return PyLong_FromUnsignedLong((unsigned long) value);
18243
#ifdef HAVE_LONG_LONG
18244
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
18245
return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
18246
#endif
18247
}
18248
} else {
18249
if (sizeof(int) <= sizeof(long)) {
18250
return PyInt_FromLong((long) value);
18251
#ifdef HAVE_LONG_LONG
18252
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
18253
return PyLong_FromLongLong((PY_LONG_LONG) value);
18254
#endif
18255
}
18256
}
18257
{
18258
int one = 1; int little = (int)*(unsigned char *)&one;
18259
unsigned char *bytes = (unsigned char *)&value;
18260
return _PyLong_FromByteArray(bytes, sizeof(int),
18261
little, !is_unsigned);
18262
}
18263
}
18264
18265
/* Print */
18266
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
18267
static PyObject *__Pyx_GetStdout(void) {
18268
PyObject *f = PySys_GetObject((char *)"stdout");
18269
if (!f) {
18270
PyErr_SetString(PyExc_RuntimeError, "lost sys.stdout");
18271
}
18272
return f;
18273
}
18274
static int __Pyx_Print(PyObject* f, PyObject *arg_tuple, int newline) {
18275
int i;
18276
if (!f) {
18277
if (!(f = __Pyx_GetStdout()))
18278
return -1;
18279
}
18280
Py_INCREF(f);
18281
for (i=0; i < PyTuple_GET_SIZE(arg_tuple); i++) {
18282
PyObject* v;
18283
if (PyFile_SoftSpace(f, 1)) {
18284
if (PyFile_WriteString(" ", f) < 0)
18285
goto error;
18286
}
18287
v = PyTuple_GET_ITEM(arg_tuple, i);
18288
if (PyFile_WriteObject(v, f, Py_PRINT_RAW) < 0)
18289
goto error;
18290
if (PyString_Check(v)) {
18291
char *s = PyString_AsString(v);
18292
Py_ssize_t len = PyString_Size(v);
18293
if (len > 0) {
18294
switch (s[len-1]) {
18295
case ' ': break;
18296
case '\f': case '\r': case '\n': case '\t': case '\v':
18297
PyFile_SoftSpace(f, 0);
18298
break;
18299
default: break;
18300
}
18301
}
18302
}
18303
}
18304
if (newline) {
18305
if (PyFile_WriteString("\n", f) < 0)
18306
goto error;
18307
PyFile_SoftSpace(f, 0);
18308
}
18309
Py_DECREF(f);
18310
return 0;
18311
error:
18312
Py_DECREF(f);
18313
return -1;
18314
}
18315
#else
18316
static int __Pyx_Print(PyObject* stream, PyObject *arg_tuple, int newline) {
18317
PyObject* kwargs = 0;
18318
PyObject* result = 0;
18319
PyObject* end_string;
18320
if (unlikely(!__pyx_print)) {
18321
__pyx_print = PyObject_GetAttr(__pyx_b, __pyx_n_s_print);
18322
if (!__pyx_print)
18323
return -1;
18324
}
18325
if (stream) {
18326
kwargs = PyDict_New();
18327
if (unlikely(!kwargs))
18328
return -1;
18329
if (unlikely(PyDict_SetItem(kwargs, __pyx_n_s_file, stream) < 0))
18330
goto bad;
18331
if (!newline) {
18332
end_string = PyUnicode_FromStringAndSize(" ", 1);
18333
if (unlikely(!end_string))
18334
goto bad;
18335
if (PyDict_SetItem(kwargs, __pyx_n_s_end, end_string) < 0) {
18336
Py_DECREF(end_string);
18337
goto bad;
18338
}
18339
Py_DECREF(end_string);
18340
}
18341
} else if (!newline) {
18342
if (unlikely(!__pyx_print_kwargs)) {
18343
__pyx_print_kwargs = PyDict_New();
18344
if (unlikely(!__pyx_print_kwargs))
18345
return -1;
18346
end_string = PyUnicode_FromStringAndSize(" ", 1);
18347
if (unlikely(!end_string))
18348
return -1;
18349
if (PyDict_SetItem(__pyx_print_kwargs, __pyx_n_s_end, end_string) < 0) {
18350
Py_DECREF(end_string);
18351
return -1;
18352
}
18353
Py_DECREF(end_string);
18354
}
18355
kwargs = __pyx_print_kwargs;
18356
}
18357
result = PyObject_Call(__pyx_print, arg_tuple, kwargs);
18358
if (unlikely(kwargs) && (kwargs != __pyx_print_kwargs))
18359
Py_DECREF(kwargs);
18360
if (!result)
18361
return -1;
18362
Py_DECREF(result);
18363
return 0;
18364
bad:
18365
if (kwargs != __pyx_print_kwargs)
18366
Py_XDECREF(kwargs);
18367
return -1;
18368
}
18369
#endif
18370
18371
/* CIntFromPy */
18372
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
18373
const long neg_one = (long) -1, const_zero = (long) 0;
18374
const int is_unsigned = neg_one > const_zero;
18375
#if PY_MAJOR_VERSION < 3
18376
if (likely(PyInt_Check(x))) {
18377
if (sizeof(long) < sizeof(long)) {
18378
__PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
18379
} else {
18380
long val = PyInt_AS_LONG(x);
18381
if (is_unsigned && unlikely(val < 0)) {
18382
goto raise_neg_overflow;
18383
}
18384
return (long) val;
18385
}
18386
} else
18387
#endif
18388
if (likely(PyLong_Check(x))) {
18389
if (is_unsigned) {
18390
#if CYTHON_USE_PYLONG_INTERNALS
18391
const digit* digits = ((PyLongObject*)x)->ob_digit;
18392
switch (Py_SIZE(x)) {
18393
case 0: return (long) 0;
18394
case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
18395
case 2:
18396
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
18397
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18398
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18399
} else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
18400
return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
18401
}
18402
}
18403
break;
18404
case 3:
18405
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
18406
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18407
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18408
} else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
18409
return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
18410
}
18411
}
18412
break;
18413
case 4:
18414
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
18415
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18416
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18417
} else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
18418
return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
18419
}
18420
}
18421
break;
18422
}
18423
#endif
18424
#if CYTHON_COMPILING_IN_CPYTHON
18425
if (unlikely(Py_SIZE(x) < 0)) {
18426
goto raise_neg_overflow;
18427
}
18428
#else
18429
{
18430
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
18431
if (unlikely(result < 0))
18432
return (long) -1;
18433
if (unlikely(result == 1))
18434
goto raise_neg_overflow;
18435
}
18436
#endif
18437
if (sizeof(long) <= sizeof(unsigned long)) {
18438
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
18439
#ifdef HAVE_LONG_LONG
18440
} else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
18441
__PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
18442
#endif
18443
}
18444
} else {
18445
#if CYTHON_USE_PYLONG_INTERNALS
18446
const digit* digits = ((PyLongObject*)x)->ob_digit;
18447
switch (Py_SIZE(x)) {
18448
case 0: return (long) 0;
18449
case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
18450
case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
18451
case -2:
18452
if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
18453
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18454
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18455
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
18456
return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
18457
}
18458
}
18459
break;
18460
case 2:
18461
if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
18462
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18463
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18464
} else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
18465
return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
18466
}
18467
}
18468
break;
18469
case -3:
18470
if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
18471
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18472
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18473
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
18474
return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
18475
}
18476
}
18477
break;
18478
case 3:
18479
if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
18480
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18481
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18482
} else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
18483
return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
18484
}
18485
}
18486
break;
18487
case -4:
18488
if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
18489
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18490
__PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18491
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
18492
return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
18493
}
18494
}
18495
break;
18496
case 4:
18497
if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
18498
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18499
__PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18500
} else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
18501
return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
18502
}
18503
}
18504
break;
18505
}
18506
#endif
18507
if (sizeof(long) <= sizeof(long)) {
18508
__PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
18509
#ifdef HAVE_LONG_LONG
18510
} else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
18511
__PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
18512
#endif
18513
}
18514
}
18515
{
18516
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
18517
PyErr_SetString(PyExc_RuntimeError,
18518
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
18519
#else
18520
long val;
18521
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
18522
#if PY_MAJOR_VERSION < 3
18523
if (likely(v) && !PyLong_Check(v)) {
18524
PyObject *tmp = v;
18525
v = PyNumber_Long(tmp);
18526
Py_DECREF(tmp);
18527
}
18528
#endif
18529
if (likely(v)) {
18530
int one = 1; int is_little = (int)*(unsigned char *)&one;
18531
unsigned char *bytes = (unsigned char *)&val;
18532
int ret = _PyLong_AsByteArray((PyLongObject *)v,
18533
bytes, sizeof(val),
18534
is_little, !is_unsigned);
18535
Py_DECREF(v);
18536
if (likely(!ret))
18537
return val;
18538
}
18539
#endif
18540
return (long) -1;
18541
}
18542
} else {
18543
long val;
18544
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
18545
if (!tmp) return (long) -1;
18546
val = __Pyx_PyInt_As_long(tmp);
18547
Py_DECREF(tmp);
18548
return val;
18549
}
18550
raise_overflow:
18551
PyErr_SetString(PyExc_OverflowError,
18552
"value too large to convert to long");
18553
return (long) -1;
18554
raise_neg_overflow:
18555
PyErr_SetString(PyExc_OverflowError,
18556
"can't convert negative value to long");
18557
return (long) -1;
18558
}
18559
18560
/* CIntFromPy */
18561
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
18562
const int neg_one = (int) -1, const_zero = (int) 0;
18563
const int is_unsigned = neg_one > const_zero;
18564
#if PY_MAJOR_VERSION < 3
18565
if (likely(PyInt_Check(x))) {
18566
if (sizeof(int) < sizeof(long)) {
18567
__PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
18568
} else {
18569
long val = PyInt_AS_LONG(x);
18570
if (is_unsigned && unlikely(val < 0)) {
18571
goto raise_neg_overflow;
18572
}
18573
return (int) val;
18574
}
18575
} else
18576
#endif
18577
if (likely(PyLong_Check(x))) {
18578
if (is_unsigned) {
18579
#if CYTHON_USE_PYLONG_INTERNALS
18580
const digit* digits = ((PyLongObject*)x)->ob_digit;
18581
switch (Py_SIZE(x)) {
18582
case 0: return (int) 0;
18583
case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
18584
case 2:
18585
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
18586
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18587
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18588
} else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
18589
return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
18590
}
18591
}
18592
break;
18593
case 3:
18594
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
18595
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18596
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18597
} else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
18598
return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
18599
}
18600
}
18601
break;
18602
case 4:
18603
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
18604
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18605
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18606
} else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
18607
return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
18608
}
18609
}
18610
break;
18611
}
18612
#endif
18613
#if CYTHON_COMPILING_IN_CPYTHON
18614
if (unlikely(Py_SIZE(x) < 0)) {
18615
goto raise_neg_overflow;
18616
}
18617
#else
18618
{
18619
int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
18620
if (unlikely(result < 0))
18621
return (int) -1;
18622
if (unlikely(result == 1))
18623
goto raise_neg_overflow;
18624
}
18625
#endif
18626
if (sizeof(int) <= sizeof(unsigned long)) {
18627
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
18628
#ifdef HAVE_LONG_LONG
18629
} else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
18630
__PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
18631
#endif
18632
}
18633
} else {
18634
#if CYTHON_USE_PYLONG_INTERNALS
18635
const digit* digits = ((PyLongObject*)x)->ob_digit;
18636
switch (Py_SIZE(x)) {
18637
case 0: return (int) 0;
18638
case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
18639
case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
18640
case -2:
18641
if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
18642
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18643
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18644
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
18645
return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18646
}
18647
}
18648
break;
18649
case 2:
18650
if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
18651
if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
18652
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18653
} else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
18654
return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18655
}
18656
}
18657
break;
18658
case -3:
18659
if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
18660
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18661
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18662
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
18663
return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18664
}
18665
}
18666
break;
18667
case 3:
18668
if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
18669
if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
18670
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18671
} else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
18672
return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18673
}
18674
}
18675
break;
18676
case -4:
18677
if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
18678
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18679
__PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18680
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
18681
return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18682
}
18683
}
18684
break;
18685
case 4:
18686
if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
18687
if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
18688
__PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
18689
} else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
18690
return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
18691
}
18692
}
18693
break;
18694
}
18695
#endif
18696
if (sizeof(int) <= sizeof(long)) {
18697
__PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
18698
#ifdef HAVE_LONG_LONG
18699
} else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
18700
__PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
18701
#endif
18702
}
18703
}
18704
{
18705
#if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
18706
PyErr_SetString(PyExc_RuntimeError,
18707
"_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
18708
#else
18709
int val;
18710
PyObject *v = __Pyx_PyNumber_IntOrLong(x);
18711
#if PY_MAJOR_VERSION < 3
18712
if (likely(v) && !PyLong_Check(v)) {
18713
PyObject *tmp = v;
18714
v = PyNumber_Long(tmp);
18715
Py_DECREF(tmp);
18716
}
18717
#endif
18718
if (likely(v)) {
18719
int one = 1; int is_little = (int)*(unsigned char *)&one;
18720
unsigned char *bytes = (unsigned char *)&val;
18721
int ret = _PyLong_AsByteArray((PyLongObject *)v,
18722
bytes, sizeof(val),
18723
is_little, !is_unsigned);
18724
Py_DECREF(v);
18725
if (likely(!ret))
18726
return val;
18727
}
18728
#endif
18729
return (int) -1;
18730
}
18731
} else {
18732
int val;
18733
PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
18734
if (!tmp) return (int) -1;
18735
val = __Pyx_PyInt_As_int(tmp);
18736
Py_DECREF(tmp);
18737
return val;
18738
}
18739
raise_overflow:
18740
PyErr_SetString(PyExc_OverflowError,
18741
"value too large to convert to int");
18742
return (int) -1;
18743
raise_neg_overflow:
18744
PyErr_SetString(PyExc_OverflowError,
18745
"can't convert negative value to int");
18746
return (int) -1;
18747
}
18748
18749
/* PrintOne */
18750
#if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION < 3
18751
static int __Pyx_PrintOne(PyObject* f, PyObject *o) {
18752
if (!f) {
18753
if (!(f = __Pyx_GetStdout()))
18754
return -1;
18755
}
18756
Py_INCREF(f);
18757
if (PyFile_SoftSpace(f, 0)) {
18758
if (PyFile_WriteString(" ", f) < 0)
18759
goto error;
18760
}
18761
if (PyFile_WriteObject(o, f, Py_PRINT_RAW) < 0)
18762
goto error;
18763
if (PyFile_WriteString("\n", f) < 0)
18764
goto error;
18765
Py_DECREF(f);
18766
return 0;
18767
error:
18768
Py_DECREF(f);
18769
return -1;
18770
/* the line below is just to avoid C compiler
18771
* warnings about unused functions */
18772
return __Pyx_Print(f, NULL, 0);
18773
}
18774
#else
18775
static int __Pyx_PrintOne(PyObject* stream, PyObject *o) {
18776
int res;
18777
PyObject* arg_tuple = PyTuple_Pack(1, o);
18778
if (unlikely(!arg_tuple))
18779
return -1;
18780
res = __Pyx_Print(stream, arg_tuple, 1);
18781
Py_DECREF(arg_tuple);
18782
return res;
18783
}
18784
#endif
18785
18786
/* CheckBinaryVersion */
18787
static int __Pyx_check_binary_version(void) {
18788
char ctversion[4], rtversion[4];
18789
PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
18790
PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
18791
if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
18792
char message[200];
18793
PyOS_snprintf(message, sizeof(message),
18794
"compiletime version %s of module '%.100s' "
18795
"does not match runtime version %s",
18796
ctversion, __Pyx_MODULE_NAME, rtversion);
18797
return PyErr_WarnEx(NULL, message, 1);
18798
}
18799
return 0;
18800
}
18801
18802
/* ModuleImport */
18803
#ifndef __PYX_HAVE_RT_ImportModule
18804
#define __PYX_HAVE_RT_ImportModule
18805
static PyObject *__Pyx_ImportModule(const char *name) {
18806
PyObject *py_name = 0;
18807
PyObject *py_module = 0;
18808
py_name = __Pyx_PyIdentifier_FromString(name);
18809
if (!py_name)
18810
goto bad;
18811
py_module = PyImport_Import(py_name);
18812
Py_DECREF(py_name);
18813
return py_module;
18814
bad:
18815
Py_XDECREF(py_name);
18816
return 0;
18817
}
18818
#endif
18819
18820
/* TypeImport */
18821
#ifndef __PYX_HAVE_RT_ImportType
18822
#define __PYX_HAVE_RT_ImportType
18823
static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
18824
size_t size, int strict)
18825
{
18826
PyObject *py_module = 0;
18827
PyObject *result = 0;
18828
PyObject *py_name = 0;
18829
char warning[200];
18830
Py_ssize_t basicsize;
18831
#ifdef Py_LIMITED_API
18832
PyObject *py_basicsize;
18833
#endif
18834
py_module = __Pyx_ImportModule(module_name);
18835
if (!py_module)
18836
goto bad;
18837
py_name = __Pyx_PyIdentifier_FromString(class_name);
18838
if (!py_name)
18839
goto bad;
18840
result = PyObject_GetAttr(py_module, py_name);
18841
Py_DECREF(py_name);
18842
py_name = 0;
18843
Py_DECREF(py_module);
18844
py_module = 0;
18845
if (!result)
18846
goto bad;
18847
if (!PyType_Check(result)) {
18848
PyErr_Format(PyExc_TypeError,
18849
"%.200s.%.200s is not a type object",
18850
module_name, class_name);
18851
goto bad;
18852
}
18853
#ifndef Py_LIMITED_API
18854
basicsize = ((PyTypeObject *)result)->tp_basicsize;
18855
#else
18856
py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
18857
if (!py_basicsize)
18858
goto bad;
18859
basicsize = PyLong_AsSsize_t(py_basicsize);
18860
Py_DECREF(py_basicsize);
18861
py_basicsize = 0;
18862
if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
18863
goto bad;
18864
#endif
18865
if (!strict && (size_t)basicsize > size) {
18866
PyOS_snprintf(warning, sizeof(warning),
18867
"%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
18868
module_name, class_name, basicsize, size);
18869
if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
18870
}
18871
else if ((size_t)basicsize != size) {
18872
PyErr_Format(PyExc_ValueError,
18873
"%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
18874
module_name, class_name, basicsize, size);
18875
goto bad;
18876
}
18877
return (PyTypeObject *)result;
18878
bad:
18879
Py_XDECREF(py_module);
18880
Py_XDECREF(result);
18881
return NULL;
18882
}
18883
#endif
18884
18885
/* VoidPtrImport */
18886
#ifndef __PYX_HAVE_RT_ImportVoidPtr
18887
#define __PYX_HAVE_RT_ImportVoidPtr
18888
static int __Pyx_ImportVoidPtr(PyObject *module, const char *name, void **p, const char *sig) {
18889
PyObject *d = 0;
18890
PyObject *cobj = 0;
18891
d = PyObject_GetAttrString(module, (char *)"__pyx_capi__");
18892
if (!d)
18893
goto bad;
18894
cobj = PyDict_GetItemString(d, name);
18895
if (!cobj) {
18896
PyErr_Format(PyExc_ImportError,
18897
"%.200s does not export expected C variable %.200s",
18898
PyModule_GetName(module), name);
18899
goto bad;
18900
}
18901
#if PY_VERSION_HEX >= 0x02070000
18902
if (!PyCapsule_IsValid(cobj, sig)) {
18903
PyErr_Format(PyExc_TypeError,
18904
"C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
18905
PyModule_GetName(module), name, sig, PyCapsule_GetName(cobj));
18906
goto bad;
18907
}
18908
*p = PyCapsule_GetPointer(cobj, sig);
18909
#else
18910
{const char *desc, *s1, *s2;
18911
desc = (const char *)PyCObject_GetDesc(cobj);
18912
if (!desc)
18913
goto bad;
18914
s1 = desc; s2 = sig;
18915
while (*s1 != '\0' && *s1 == *s2) { s1++; s2++; }
18916
if (*s1 != *s2) {
18917
PyErr_Format(PyExc_TypeError,
18918
"C variable %.200s.%.200s has wrong signature (expected %.500s, got %.500s)",
18919
PyModule_GetName(module), name, sig, desc);
18920
goto bad;
18921
}
18922
*p = PyCObject_AsVoidPtr(cobj);}
18923
#endif
18924
if (!(*p))
18925
goto bad;
18926
Py_DECREF(d);
18927
return 0;
18928
bad:
18929
Py_XDECREF(d);
18930
return -1;
18931
}
18932
#endif
18933
18934
/* InitStrings */
18935
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
18936
while (t->p) {
18937
#if PY_MAJOR_VERSION < 3
18938
if (t->is_unicode) {
18939
*t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
18940
} else if (t->intern) {
18941
*t->p = PyString_InternFromString(t->s);
18942
} else {
18943
*t->p = PyString_FromStringAndSize(t->s, t->n - 1);
18944
}
18945
#else
18946
if (t->is_unicode | t->is_str) {
18947
if (t->intern) {
18948
*t->p = PyUnicode_InternFromString(t->s);
18949
} else if (t->encoding) {
18950
*t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
18951
} else {
18952
*t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
18953
}
18954
} else {
18955
*t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
18956
}
18957
#endif
18958
if (!*t->p)
18959
return -1;
18960
++t;
18961
}
18962
return 0;
18963
}
18964
18965
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
18966
return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
18967
}
18968
static CYTHON_INLINE char* __Pyx_PyObject_AsString(PyObject* o) {
18969
Py_ssize_t ignore;
18970
return __Pyx_PyObject_AsStringAndSize(o, &ignore);
18971
}
18972
static CYTHON_INLINE char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
18973
#if CYTHON_COMPILING_IN_CPYTHON && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
18974
if (
18975
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
18976
__Pyx_sys_getdefaultencoding_not_ascii &&
18977
#endif
18978
PyUnicode_Check(o)) {
18979
#if PY_VERSION_HEX < 0x03030000
18980
char* defenc_c;
18981
PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
18982
if (!defenc) return NULL;
18983
defenc_c = PyBytes_AS_STRING(defenc);
18984
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
18985
{
18986
char* end = defenc_c + PyBytes_GET_SIZE(defenc);
18987
char* c;
18988
for (c = defenc_c; c < end; c++) {
18989
if ((unsigned char) (*c) >= 128) {
18990
PyUnicode_AsASCIIString(o);
18991
return NULL;
18992
}
18993
}
18994
}
18995
#endif
18996
*length = PyBytes_GET_SIZE(defenc);
18997
return defenc_c;
18998
#else
18999
if (__Pyx_PyUnicode_READY(o) == -1) return NULL;
19000
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
19001
if (PyUnicode_IS_ASCII(o)) {
19002
*length = PyUnicode_GET_LENGTH(o);
19003
return PyUnicode_AsUTF8(o);
19004
} else {
19005
PyUnicode_AsASCIIString(o);
19006
return NULL;
19007
}
19008
#else
19009
return PyUnicode_AsUTF8AndSize(o, length);
19010
#endif
19011
#endif
19012
} else
19013
#endif
19014
#if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
19015
if (PyByteArray_Check(o)) {
19016
*length = PyByteArray_GET_SIZE(o);
19017
return PyByteArray_AS_STRING(o);
19018
} else
19019
#endif
19020
{
19021
char* result;
19022
int r = PyBytes_AsStringAndSize(o, &result, length);
19023
if (unlikely(r < 0)) {
19024
return NULL;
19025
} else {
19026
return result;
19027
}
19028
}
19029
}
19030
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
19031
int is_true = x == Py_True;
19032
if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
19033
else return PyObject_IsTrue(x);
19034
}
19035
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
19036
#if CYTHON_USE_TYPE_SLOTS
19037
PyNumberMethods *m;
19038
#endif
19039
const char *name = NULL;
19040
PyObject *res = NULL;
19041
#if PY_MAJOR_VERSION < 3
19042
if (PyInt_Check(x) || PyLong_Check(x))
19043
#else
19044
if (PyLong_Check(x))
19045
#endif
19046
return __Pyx_NewRef(x);
19047
#if CYTHON_USE_TYPE_SLOTS
19048
m = Py_TYPE(x)->tp_as_number;
19049
#if PY_MAJOR_VERSION < 3
19050
if (m && m->nb_int) {
19051
name = "int";
19052
res = PyNumber_Int(x);
19053
}
19054
else if (m && m->nb_long) {
19055
name = "long";
19056
res = PyNumber_Long(x);
19057
}
19058
#else
19059
if (m && m->nb_int) {
19060
name = "int";
19061
res = PyNumber_Long(x);
19062
}
19063
#endif
19064
#else
19065
res = PyNumber_Int(x);
19066
#endif
19067
if (res) {
19068
#if PY_MAJOR_VERSION < 3
19069
if (!PyInt_Check(res) && !PyLong_Check(res)) {
19070
#else
19071
if (!PyLong_Check(res)) {
19072
#endif
19073
PyErr_Format(PyExc_TypeError,
19074
"__%.4s__ returned non-%.4s (type %.200s)",
19075
name, name, Py_TYPE(res)->tp_name);
19076
Py_DECREF(res);
19077
return NULL;
19078
}
19079
}
19080
else if (!PyErr_Occurred()) {
19081
PyErr_SetString(PyExc_TypeError,
19082
"an integer is required");
19083
}
19084
return res;
19085
}
19086
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
19087
Py_ssize_t ival;
19088
PyObject *x;
19089
#if PY_MAJOR_VERSION < 3
19090
if (likely(PyInt_CheckExact(b))) {
19091
if (sizeof(Py_ssize_t) >= sizeof(long))
19092
return PyInt_AS_LONG(b);
19093
else
19094
return PyInt_AsSsize_t(x);
19095
}
19096
#endif
19097
if (likely(PyLong_CheckExact(b))) {
19098
#if CYTHON_USE_PYLONG_INTERNALS
19099
const digit* digits = ((PyLongObject*)b)->ob_digit;
19100
const Py_ssize_t size = Py_SIZE(b);
19101
if (likely(__Pyx_sst_abs(size) <= 1)) {
19102
ival = likely(size) ? digits[0] : 0;
19103
if (size == -1) ival = -ival;
19104
return ival;
19105
} else {
19106
switch (size) {
19107
case 2:
19108
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
19109
return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
19110
}
19111
break;
19112
case -2:
19113
if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
19114
return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
19115
}
19116
break;
19117
case 3:
19118
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
19119
return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
19120
}
19121
break;
19122
case -3:
19123
if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
19124
return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
19125
}
19126
break;
19127
case 4:
19128
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
19129
return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
19130
}
19131
break;
19132
case -4:
19133
if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
19134
return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
19135
}
19136
break;
19137
}
19138
}
19139
#endif
19140
return PyLong_AsSsize_t(b);
19141
}
19142
x = PyNumber_Index(b);
19143
if (!x) return -1;
19144
ival = PyInt_AsSsize_t(x);
19145
Py_DECREF(x);
19146
return ival;
19147
}
19148
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
19149
return PyInt_FromSize_t(ival);
19150
}
19151
19152
19153
#endif /* Py_PYTHON_H */
19154
19155