passagemath-ntl 10.6.33__cp314-cp314t-manylinux_2_24_aarch64.manylinux_2_28_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of passagemath-ntl might be problematic. Click here for more details.
- passagemath_ntl-10.6.33.dist-info/METADATA +122 -0
- passagemath_ntl-10.6.33.dist-info/RECORD +161 -0
- passagemath_ntl-10.6.33.dist-info/WHEEL +6 -0
- passagemath_ntl-10.6.33.dist-info/top_level.txt +2 -0
- passagemath_ntl.libs/libgf2x-fbd36f80.so.3.0.0 +0 -0
- passagemath_ntl.libs/libgmp-93ebf16a.so.10.5.0 +0 -0
- passagemath_ntl.libs/libmpfi-ad12a86d.so.0.0.0 +0 -0
- passagemath_ntl.libs/libmpfr-e0f11cf3.so.6.2.1 +0 -0
- passagemath_ntl.libs/libntl-0043a3a2.so.44.0.1 +0 -0
- sage/all__sagemath_ntl.py +7 -0
- sage/libs/all__sagemath_ntl.py +3 -0
- sage/libs/mpfi/__init__.pxd +287 -0
- sage/libs/mpfi/types.pxd +10 -0
- sage/libs/ntl/GF2.pxd +18 -0
- sage/libs/ntl/GF2E.pxd +28 -0
- sage/libs/ntl/GF2EX.pxd +12 -0
- sage/libs/ntl/GF2X.pxd +81 -0
- sage/libs/ntl/ZZ.pxd +93 -0
- sage/libs/ntl/ZZX.pxd +85 -0
- sage/libs/ntl/ZZ_p.pxd +28 -0
- sage/libs/ntl/ZZ_pE.pxd +37 -0
- sage/libs/ntl/ZZ_pEX.pxd +106 -0
- sage/libs/ntl/ZZ_pX.pxd +122 -0
- sage/libs/ntl/__init__.py +4 -0
- sage/libs/ntl/all.py +72 -0
- sage/libs/ntl/conversion.pxd +106 -0
- sage/libs/ntl/convert.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/convert.pxd +7 -0
- sage/libs/ntl/convert.pyx +38 -0
- sage/libs/ntl/decl.pxi +18 -0
- sage/libs/ntl/error.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/error.pyx +63 -0
- sage/libs/ntl/lzz_p.pxd +20 -0
- sage/libs/ntl/lzz_pX.pxd +59 -0
- sage/libs/ntl/mat_GF2.pxd +30 -0
- sage/libs/ntl/mat_GF2E.pxd +30 -0
- sage/libs/ntl/mat_ZZ.pxd +59 -0
- sage/libs/ntl/misc.pxi +33 -0
- sage/libs/ntl/ntl_GF2.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_GF2.pxd +5 -0
- sage/libs/ntl/ntl_GF2.pyx +281 -0
- sage/libs/ntl/ntl_GF2E.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_GF2E.pxd +8 -0
- sage/libs/ntl/ntl_GF2E.pyx +488 -0
- sage/libs/ntl/ntl_GF2EContext.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_GF2EContext.pxd +9 -0
- sage/libs/ntl/ntl_GF2EContext.pyx +134 -0
- sage/libs/ntl/ntl_GF2EX.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_GF2EX.pxd +10 -0
- sage/libs/ntl/ntl_GF2EX.pyx +251 -0
- sage/libs/ntl/ntl_GF2X.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_GF2X.pxd +5 -0
- sage/libs/ntl/ntl_GF2X.pyx +771 -0
- sage/libs/ntl/ntl_GF2X_linkage.pxi +404 -0
- sage/libs/ntl/ntl_ZZ.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZ.pxd +7 -0
- sage/libs/ntl/ntl_ZZ.pyx +541 -0
- sage/libs/ntl/ntl_ZZX.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZX.pxd +7 -0
- sage/libs/ntl/ntl_ZZX.pyx +1206 -0
- sage/libs/ntl/ntl_ZZ_p.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZ_p.pxd +10 -0
- sage/libs/ntl/ntl_ZZ_p.pyx +509 -0
- sage/libs/ntl/ntl_ZZ_pContext.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZ_pContext.pxd +22 -0
- sage/libs/ntl/ntl_ZZ_pContext.pyx +201 -0
- sage/libs/ntl/ntl_ZZ_pE.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZ_pE.pxd +11 -0
- sage/libs/ntl/ntl_ZZ_pE.pyx +349 -0
- sage/libs/ntl/ntl_ZZ_pEContext.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZ_pEContext.pxd +23 -0
- sage/libs/ntl/ntl_ZZ_pEContext.pyx +226 -0
- sage/libs/ntl/ntl_ZZ_pEX.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZ_pEX.pxd +10 -0
- sage/libs/ntl/ntl_ZZ_pEX.pyx +1255 -0
- sage/libs/ntl/ntl_ZZ_pEX_linkage.pxi +420 -0
- sage/libs/ntl/ntl_ZZ_pX.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_ZZ_pX.pxd +17 -0
- sage/libs/ntl/ntl_ZZ_pX.pyx +1532 -0
- sage/libs/ntl/ntl_lzz_p.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_lzz_p.pxd +8 -0
- sage/libs/ntl/ntl_lzz_p.pyx +440 -0
- sage/libs/ntl/ntl_lzz_pContext.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_lzz_pContext.pxd +7 -0
- sage/libs/ntl/ntl_lzz_pContext.pyx +137 -0
- sage/libs/ntl/ntl_lzz_pX.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_lzz_pX.pxd +10 -0
- sage/libs/ntl/ntl_lzz_pX.pyx +902 -0
- sage/libs/ntl/ntl_mat_GF2.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_mat_GF2.pxd +8 -0
- sage/libs/ntl/ntl_mat_GF2.pyx +612 -0
- sage/libs/ntl/ntl_mat_GF2E.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_mat_GF2E.pxd +10 -0
- sage/libs/ntl/ntl_mat_GF2E.pyx +752 -0
- sage/libs/ntl/ntl_mat_ZZ.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/libs/ntl/ntl_mat_ZZ.pxd +6 -0
- sage/libs/ntl/ntl_mat_ZZ.pyx +1523 -0
- sage/libs/ntl/ntl_tools.pxd +3 -0
- sage/libs/ntl/ntlwrap.h +53 -0
- sage/libs/ntl/ntlwrap_impl.h +743 -0
- sage/libs/ntl/types.pxd +157 -0
- sage/libs/ntl/vec_GF2.pxd +26 -0
- sage/libs/ntl/vec_GF2E.pxd +2 -0
- sage/matrix/all__sagemath_ntl.py +1 -0
- sage/matrix/matrix_modn_dense_double.pxd +10 -0
- sage/matrix/matrix_modn_dense_float.pxd +9 -0
- sage/matrix/matrix_modn_dense_template.pxi +3257 -0
- sage/matrix/matrix_modn_dense_template_header.pxi +15 -0
- sage/matrix/matrix_modn_sparse.pxd +8 -0
- sage/misc/all__sagemath_ntl.py +1 -0
- sage/rings/all__sagemath_ntl.py +7 -0
- sage/rings/bernmm.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/bernmm.pyx +161 -0
- sage/rings/bernoulli_mod_p.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/bernoulli_mod_p.pyx +313 -0
- sage/rings/finite_rings/all__sagemath_ntl.py +1 -0
- sage/rings/finite_rings/finite_field_ntl_gf2e.py +305 -0
- sage/rings/finite_rings/residue_field_ntl_gf2e.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/finite_rings/residue_field_ntl_gf2e.pyx +140 -0
- sage/rings/padics/all__sagemath_ntl.py +5 -0
- sage/rings/padics/padic_ZZ_pX_CA_element.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/padics/padic_ZZ_pX_CA_element.pxd +25 -0
- sage/rings/padics/padic_ZZ_pX_CA_element.pyx +2368 -0
- sage/rings/padics/padic_ZZ_pX_CR_element.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/padics/padic_ZZ_pX_CR_element.pxd +33 -0
- sage/rings/padics/padic_ZZ_pX_CR_element.pyx +3277 -0
- sage/rings/padics/padic_ZZ_pX_FM_element.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/padics/padic_ZZ_pX_FM_element.pxd +12 -0
- sage/rings/padics/padic_ZZ_pX_FM_element.pyx +1739 -0
- sage/rings/padics/padic_ZZ_pX_element.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/padics/padic_ZZ_pX_element.pxd +6 -0
- sage/rings/padics/padic_ZZ_pX_element.pyx +919 -0
- sage/rings/padics/padic_ext_element.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/padics/padic_ext_element.pxd +38 -0
- sage/rings/padics/padic_ext_element.pyx +512 -0
- sage/rings/padics/pow_computer_ext.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/padics/pow_computer_ext.pxd +107 -0
- sage/rings/padics/pow_computer_ext.pyx +2401 -0
- sage/rings/polynomial/all__sagemath_ntl.py +1 -0
- sage/rings/polynomial/evaluation_ntl.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/evaluation_ntl.pxd +7 -0
- sage/rings/polynomial/evaluation_ntl.pyx +70 -0
- sage/rings/polynomial/polynomial_gf2x.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/polynomial_gf2x.pxd +10 -0
- sage/rings/polynomial/polynomial_gf2x.pyx +364 -0
- sage/rings/polynomial/polynomial_integer_dense_ntl.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/polynomial_integer_dense_ntl.pxd +8 -0
- sage/rings/polynomial/polynomial_integer_dense_ntl.pyx +1128 -0
- sage/rings/polynomial/polynomial_modn_dense_ntl.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/polynomial_modn_dense_ntl.pxd +36 -0
- sage/rings/polynomial/polynomial_modn_dense_ntl.pyx +2049 -0
- sage/rings/polynomial/polynomial_template.pxi +842 -0
- sage/rings/polynomial/polynomial_template_header.pxi +11 -0
- sage/rings/polynomial/polynomial_zz_pex.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/rings/polynomial/polynomial_zz_pex.pxd +12 -0
- sage/rings/polynomial/polynomial_zz_pex.pyx +778 -0
- sage/rings/real_mpfi.pxd +50 -0
- sage/schemes/all__sagemath_ntl.py +1 -0
- sage/schemes/hyperelliptic_curves/all__sagemath_ntl.py +1 -0
- sage/schemes/hyperelliptic_curves/hypellfrob.cpython-314t-aarch64-linux-gnu.so +0 -0
- sage/schemes/hyperelliptic_curves/hypellfrob.pyx +252 -0
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-ntl
|
|
2
|
+
# distutils: libraries = NTL_LIBRARIES gmp M_LIBRARIES
|
|
3
|
+
# distutils: extra_compile_args = NTL_CFLAGS
|
|
4
|
+
# distutils: include_dirs = NTL_INCDIR
|
|
5
|
+
# distutils: library_dirs = NTL_LIBDIR
|
|
6
|
+
# distutils: extra_link_args = NTL_LIBEXTRA
|
|
7
|
+
# distutils: language = c++
|
|
8
|
+
|
|
9
|
+
#*****************************************************************************
|
|
10
|
+
# Copyright (C) 2005 William Stein <wstein@gmail.com>
|
|
11
|
+
#
|
|
12
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
13
|
+
#
|
|
14
|
+
# This code is distributed in the hope that it will be useful,
|
|
15
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
16
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
17
|
+
# General Public License for more details.
|
|
18
|
+
#
|
|
19
|
+
# The full text of the GPL is available at:
|
|
20
|
+
#
|
|
21
|
+
# https://www.gnu.org/licenses/
|
|
22
|
+
#*****************************************************************************
|
|
23
|
+
|
|
24
|
+
include 'misc.pxi'
|
|
25
|
+
include 'decl.pxi'
|
|
26
|
+
|
|
27
|
+
from sage.ext.cplusplus cimport ccrepr
|
|
28
|
+
from sage.libs.ntl.ntl_ZZ_pX cimport ntl_ZZ_pX
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
ZZ_pEContextDict = {}
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
cdef class ntl_ZZ_pEContext_class():
|
|
35
|
+
def __init__(self, ntl_ZZ_pX f):
|
|
36
|
+
"""
|
|
37
|
+
EXAMPLES:
|
|
38
|
+
|
|
39
|
+
You can construct contexts manually::
|
|
40
|
+
|
|
41
|
+
sage: c=ntl.ZZ_pEContext(ntl.ZZ_pX([4,1,6],25))
|
|
42
|
+
sage: n1=c.ZZ_pE([10,17,12])
|
|
43
|
+
sage: n1
|
|
44
|
+
[2 15]
|
|
45
|
+
|
|
46
|
+
Or you can construct contexts implicitly::
|
|
47
|
+
|
|
48
|
+
sage: n2=ntl.ZZ_pE(12, ntl.ZZ_pX([1,1,1],7))
|
|
49
|
+
sage: n2
|
|
50
|
+
[5]
|
|
51
|
+
sage: n2+n1 # Mismatched moduli: It will go BOOM!
|
|
52
|
+
Traceback (most recent call last):
|
|
53
|
+
...
|
|
54
|
+
ValueError: You cannot perform arithmetic with elements of different moduli.
|
|
55
|
+
"""
|
|
56
|
+
pass
|
|
57
|
+
|
|
58
|
+
def __cinit__(self, ntl_ZZ_pX f):
|
|
59
|
+
self.pc = f.c
|
|
60
|
+
self.pc.restore_c()
|
|
61
|
+
self.x = ZZ_pEContext_c(f.x)
|
|
62
|
+
ZZ_pEContextDict[(repr(f), repr(f.c.p))] = self
|
|
63
|
+
self.f = f
|
|
64
|
+
self.ptrs.zzpc = &(self.pc.x)
|
|
65
|
+
self.ptrs.zzpec = &(self.x)
|
|
66
|
+
|
|
67
|
+
def __reduce__(self):
|
|
68
|
+
"""
|
|
69
|
+
EXAMPLES::
|
|
70
|
+
|
|
71
|
+
sage: c=ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1],7))
|
|
72
|
+
sage: loads(dumps(c)) is c
|
|
73
|
+
True
|
|
74
|
+
"""
|
|
75
|
+
return ntl_ZZ_pEContext, (self.f,)
|
|
76
|
+
|
|
77
|
+
def __repr__(self) -> str:
|
|
78
|
+
"""
|
|
79
|
+
Return a string representation of ``self``.
|
|
80
|
+
|
|
81
|
+
EXAMPLES::
|
|
82
|
+
|
|
83
|
+
sage: c = ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1], 7)); c
|
|
84
|
+
NTL modulus [1 1 1] (mod 7)
|
|
85
|
+
"""
|
|
86
|
+
return "NTL modulus %s (mod %s)" % (self.f, self.pc.p)
|
|
87
|
+
|
|
88
|
+
def get_pc(self):
|
|
89
|
+
"""
|
|
90
|
+
Return the ZZ_pContext contained within ``self``.
|
|
91
|
+
|
|
92
|
+
EXAMPLES::
|
|
93
|
+
|
|
94
|
+
sage: c = ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1], 7)); c
|
|
95
|
+
NTL modulus [1 1 1] (mod 7)
|
|
96
|
+
sage: c.get_pc()
|
|
97
|
+
NTL modulus 7
|
|
98
|
+
"""
|
|
99
|
+
return self.pc
|
|
100
|
+
|
|
101
|
+
def polynomial(self):
|
|
102
|
+
"""
|
|
103
|
+
Return the ZZ_pX polynomial defining ``self``.
|
|
104
|
+
|
|
105
|
+
EXAMPLES::
|
|
106
|
+
|
|
107
|
+
sage: c = ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1], 7))
|
|
108
|
+
sage: c.polynomial()
|
|
109
|
+
[1 1 1]
|
|
110
|
+
"""
|
|
111
|
+
return self.f
|
|
112
|
+
|
|
113
|
+
def restore(self):
|
|
114
|
+
"""
|
|
115
|
+
Manually set the global NTL modulus to be ``self``.
|
|
116
|
+
|
|
117
|
+
This should be done automatically by all of the NTL wrapper classes.
|
|
118
|
+
|
|
119
|
+
CRUCIAL: If you are writing your own classes that use ZZ_p_c, ZZ_pX_c, ZZ_pE_c, ZZ_pEX_c
|
|
120
|
+
then you MUST restore the context before calling off to NTL for anything. If the context has been
|
|
121
|
+
switched by other code then behavior of operations is undefined. See the NTL documentation for
|
|
122
|
+
more details (or the wrappers in sage.libs.ntl)
|
|
123
|
+
"""
|
|
124
|
+
self.restore_c()
|
|
125
|
+
|
|
126
|
+
cdef void restore_c(self) noexcept:
|
|
127
|
+
"""
|
|
128
|
+
Set the global NTL modulus to be ``self``.
|
|
129
|
+
|
|
130
|
+
CRUCIAL: If you are writing your own classes that use ZZ_p_c, ZZ_pX_c, ZZ_pE_c, ZZ_pEX_c
|
|
131
|
+
then you MUST restore the context before calling off to NTL for anything. If the context has been
|
|
132
|
+
switched by other code then behavior of operations is undefined. See the NTL documentation for
|
|
133
|
+
more details (or the wrappers in sage.libs.ntl)
|
|
134
|
+
"""
|
|
135
|
+
self.pc.restore_c()
|
|
136
|
+
self.x.restore()
|
|
137
|
+
|
|
138
|
+
#def ZZ_pX(self, v=None):
|
|
139
|
+
# from ntl_ZZ_pX import ntl_ZZ_pX
|
|
140
|
+
# return ntl_ZZ_pX(v,modulus=self)
|
|
141
|
+
|
|
142
|
+
def ZZ_pE(self, v=None):
|
|
143
|
+
"""
|
|
144
|
+
Return a ZZ_pE object with modulus ``self`` out of the data v.
|
|
145
|
+
|
|
146
|
+
EXAMPLES::
|
|
147
|
+
|
|
148
|
+
sage: c = ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1], 7))
|
|
149
|
+
sage: c.ZZ_pE([4,3])
|
|
150
|
+
[4 3]
|
|
151
|
+
"""
|
|
152
|
+
from sage.libs.ntl.ntl_ZZ_pE import ntl_ZZ_pE
|
|
153
|
+
return ntl_ZZ_pE(v,modulus=self)
|
|
154
|
+
|
|
155
|
+
def ZZ_pEX(self, v=None):
|
|
156
|
+
"""
|
|
157
|
+
Return a ZZ_pE object with modulus ``self`` out of the data v.
|
|
158
|
+
|
|
159
|
+
EXAMPLES::
|
|
160
|
+
|
|
161
|
+
sage: c = ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1], 7))
|
|
162
|
+
sage: c.ZZ_pEX([4,3])
|
|
163
|
+
[[4] [3]]
|
|
164
|
+
"""
|
|
165
|
+
from sage.libs.ntl.ntl_ZZ_pEX import ntl_ZZ_pEX
|
|
166
|
+
return ntl_ZZ_pEX(v, modulus=self)
|
|
167
|
+
|
|
168
|
+
cpdef void _assert_is_current_modulus(self) except *:
|
|
169
|
+
"""
|
|
170
|
+
Assert that this is currently-set NTL modulus.
|
|
171
|
+
|
|
172
|
+
Mostly for debugging purposes. If false, an assertion is raised. This method
|
|
173
|
+
segfaults if the NTL modulus has never been set before.
|
|
174
|
+
|
|
175
|
+
EXAMPLES::
|
|
176
|
+
|
|
177
|
+
sage: c1 = ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1], 5))
|
|
178
|
+
sage: c2 = ntl.ZZ_pEContext(ntl.ZZ_pX([1,2,1], 5))
|
|
179
|
+
sage: c1.restore()
|
|
180
|
+
sage: c1._assert_is_current_modulus()
|
|
181
|
+
sage: c2._assert_is_current_modulus()
|
|
182
|
+
Traceback (most recent call last):
|
|
183
|
+
...
|
|
184
|
+
AssertionError: modulus mismatch: [1 2 1] != [1 1 1]
|
|
185
|
+
sage: c2.restore()
|
|
186
|
+
sage: c1._assert_is_current_modulus()
|
|
187
|
+
Traceback (most recent call last):
|
|
188
|
+
...
|
|
189
|
+
AssertionError: modulus mismatch: [1 1 1] != [1 2 1]
|
|
190
|
+
sage: c2._assert_is_current_modulus()
|
|
191
|
+
sage: ntl.ZZ_pContext(3).restore()
|
|
192
|
+
sage: c1._assert_is_current_modulus()
|
|
193
|
+
Traceback (most recent call last):
|
|
194
|
+
...
|
|
195
|
+
AssertionError: modulus mismatch: 5 != 3
|
|
196
|
+
sage: c2._assert_is_current_modulus()
|
|
197
|
+
Traceback (most recent call last):
|
|
198
|
+
...
|
|
199
|
+
AssertionError: modulus mismatch: 5 != 3
|
|
200
|
+
"""
|
|
201
|
+
self.pc._assert_is_current_modulus()
|
|
202
|
+
if self.f.x == ZZ_pE_current_modulus().val():
|
|
203
|
+
return
|
|
204
|
+
raise AssertionError('modulus mismatch: {} != {}'.format(
|
|
205
|
+
ccrepr(self.f.x),
|
|
206
|
+
ccrepr(ZZ_pE_current_modulus().val())))
|
|
207
|
+
|
|
208
|
+
|
|
209
|
+
def ntl_ZZ_pEContext( ntl_ZZ_pX f):
|
|
210
|
+
"""
|
|
211
|
+
Create an ntl_ZZ_pEContext.
|
|
212
|
+
|
|
213
|
+
Such an object must be created before any ZZ_pE or ZZ_pEX objects can be used.
|
|
214
|
+
|
|
215
|
+
The context handling should be taken care of by the wrapper classes.
|
|
216
|
+
|
|
217
|
+
EXAMPLES::
|
|
218
|
+
|
|
219
|
+
sage: c = ntl.ZZ_pEContext(ntl.ZZ_pX([1,1,1], 7)); c
|
|
220
|
+
NTL modulus [1 1 1] (mod 7)
|
|
221
|
+
"""
|
|
222
|
+
try:
|
|
223
|
+
return ZZ_pEContextDict[repr(f), repr(f.c.p)]
|
|
224
|
+
except KeyError:
|
|
225
|
+
# Creating the following object caches it.
|
|
226
|
+
return ntl_ZZ_pEContext_class(f)
|
|
Binary file
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
# sage_setup: distribution = sagemath-ntl
|
|
2
|
+
from sage.libs.ntl.types cimport ZZ_pEX_c
|
|
3
|
+
from sage.libs.ntl.ntl_ZZ_pEContext cimport ntl_ZZ_pEContext_class
|
|
4
|
+
|
|
5
|
+
cdef class ntl_ZZ_pEX():
|
|
6
|
+
cdef ZZ_pEX_c x
|
|
7
|
+
cdef ntl_ZZ_pEContext_class c
|
|
8
|
+
#cdef void setitem_from_int(ntl_ZZ_pX self, long i, int value)
|
|
9
|
+
#cdef int getitem_as_int(ntl_ZZ_pX self, long i)
|
|
10
|
+
cdef ntl_ZZ_pEX _new(self)
|