passagemath-ntl 10.6.38__cp314-cp314-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/__init__.py +3 -0
- passagemath_ntl-10.6.38.dist-info/METADATA +122 -0
- passagemath_ntl-10.6.38.dist-info/RECORD +162 -0
- passagemath_ntl-10.6.38.dist-info/WHEEL +6 -0
- passagemath_ntl-10.6.38.dist-info/top_level.txt +3 -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-9d41ebf1.so.6.2.1 +0 -0
- passagemath_ntl.libs/libntl-1bc30f7e.so.45.0.0 +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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-aarch64-linux-gnu.so +0 -0
- sage/rings/bernmm.pyx +161 -0
- sage/rings/bernoulli_mod_p.cpython-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-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-314-aarch64-linux-gnu.so +0 -0
- sage/schemes/hyperelliptic_curves/hypellfrob.pyx +252 -0
|
@@ -0,0 +1,251 @@
|
|
|
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
|
+
# sage.doctest: needs sage.libs.pari
|
|
9
|
+
|
|
10
|
+
#*****************************************************************************
|
|
11
|
+
# Copyright (C) 2005 William Stein <wstein@gmail.com>
|
|
12
|
+
#
|
|
13
|
+
# Distributed under the terms of the GNU General Public License (GPL)
|
|
14
|
+
#
|
|
15
|
+
# This code is distributed in the hope that it will be useful,
|
|
16
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
17
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
18
|
+
# General Public License for more details.
|
|
19
|
+
#
|
|
20
|
+
# The full text of the GPL is available at:
|
|
21
|
+
#
|
|
22
|
+
# http://www.gnu.org/licenses/
|
|
23
|
+
#*****************************************************************************
|
|
24
|
+
|
|
25
|
+
from cysignals.signals cimport sig_on, sig_off
|
|
26
|
+
from sage.ext.cplusplus cimport ccrepr, ccreadstr
|
|
27
|
+
|
|
28
|
+
include 'misc.pxi'
|
|
29
|
+
include 'decl.pxi'
|
|
30
|
+
|
|
31
|
+
from cpython.object cimport Py_EQ, Py_NE
|
|
32
|
+
from sage.libs.ntl.ntl_ZZ import unpickle_class_args
|
|
33
|
+
from sage.libs.ntl.ntl_GF2EContext import ntl_GF2EContext
|
|
34
|
+
from sage.libs.ntl.ntl_GF2EContext cimport ntl_GF2EContext_class
|
|
35
|
+
from sage.libs.ntl.ntl_GF2E cimport ntl_GF2E
|
|
36
|
+
|
|
37
|
+
##############################################################################
|
|
38
|
+
#
|
|
39
|
+
# ntl_GF2EX: Polynomials over GF(2) via NTL
|
|
40
|
+
#
|
|
41
|
+
# AUTHORS:
|
|
42
|
+
# - Martin Albrecht <malb@informatik.uni-bremen.de> 2006-01: initial version
|
|
43
|
+
#
|
|
44
|
+
##############################################################################
|
|
45
|
+
|
|
46
|
+
cdef class ntl_GF2EX():
|
|
47
|
+
r"""
|
|
48
|
+
Minimal wrapper of NTL's GF2EX class.
|
|
49
|
+
"""
|
|
50
|
+
def __init__(self, modulus=None, x=[]):
|
|
51
|
+
"""
|
|
52
|
+
Minimal wrapper of NTL's GF2EX class.
|
|
53
|
+
|
|
54
|
+
EXAMPLES::
|
|
55
|
+
|
|
56
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
57
|
+
sage: ntl.GF2EX(ctx, '[[1 0] [2 1]]')
|
|
58
|
+
[[1] [0 1]]
|
|
59
|
+
"""
|
|
60
|
+
if modulus is None:
|
|
61
|
+
raise ValueError("You must specify a modulus when creating a GF2E.")
|
|
62
|
+
|
|
63
|
+
str_x = str(x) # can cause modulus to change; Issue #25790
|
|
64
|
+
self.c.restore_c()
|
|
65
|
+
ccreadstr(self.x, str_x)
|
|
66
|
+
|
|
67
|
+
def __cinit__(self, modulus=None, x=[]):
|
|
68
|
+
#################### WARNING ###################
|
|
69
|
+
## Before creating a GF2E, you must create a ##
|
|
70
|
+
## GF2EContext, and restore it. In Python, ##
|
|
71
|
+
## the error checking in __init__ will prevent##
|
|
72
|
+
## you from constructing an ntl_GF2E ##
|
|
73
|
+
## inappropriately. However, from Cython, you##
|
|
74
|
+
## could do r = ntl_GF2E.__new__(ntl_GF2E) without
|
|
75
|
+
## first restoring a GF2EContext, which could ##
|
|
76
|
+
## have unfortunate consequences. See _new ##
|
|
77
|
+
## defined below for an example of the right ##
|
|
78
|
+
## way to short-circuit __init__ (or just call##
|
|
79
|
+
## _new in your own code). ##
|
|
80
|
+
################################################
|
|
81
|
+
if modulus is None:
|
|
82
|
+
return
|
|
83
|
+
if isinstance(modulus, ntl_GF2EContext_class):
|
|
84
|
+
self.c = <ntl_GF2EContext_class>modulus
|
|
85
|
+
self.c.restore_c()
|
|
86
|
+
else:
|
|
87
|
+
self.c = <ntl_GF2EContext_class>ntl_GF2EContext(modulus)
|
|
88
|
+
self.c.restore_c()
|
|
89
|
+
|
|
90
|
+
cdef ntl_GF2E _new_element(self):
|
|
91
|
+
cdef ntl_GF2E r
|
|
92
|
+
self.c.restore_c()
|
|
93
|
+
r = ntl_GF2E.__new__(ntl_GF2E)
|
|
94
|
+
r.c = self.c
|
|
95
|
+
return r
|
|
96
|
+
|
|
97
|
+
cdef ntl_GF2EX _new(self):
|
|
98
|
+
cdef ntl_GF2EX r
|
|
99
|
+
self.c.restore_c()
|
|
100
|
+
r = ntl_GF2EX.__new__(ntl_GF2EX)
|
|
101
|
+
r.c = self.c
|
|
102
|
+
return r
|
|
103
|
+
|
|
104
|
+
def modulus_context(self):
|
|
105
|
+
return self.c
|
|
106
|
+
|
|
107
|
+
def __dealloc__(self):
|
|
108
|
+
if <object>self.c is not None:
|
|
109
|
+
self.c.restore_c()
|
|
110
|
+
|
|
111
|
+
def __reduce__(self):
|
|
112
|
+
"""
|
|
113
|
+
EXAMPLES::
|
|
114
|
+
|
|
115
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
116
|
+
sage: f = ntl.GF2EX(ctx, '[[1 0 1] [1 0 0 1] [1]]')
|
|
117
|
+
sage: f == loads(dumps(f))
|
|
118
|
+
True
|
|
119
|
+
"""
|
|
120
|
+
return unpickle_class_args, (ntl_GF2EX, (self.c, self.__repr__()))
|
|
121
|
+
|
|
122
|
+
def __richcmp__(ntl_GF2EX self, other, int op):
|
|
123
|
+
"""
|
|
124
|
+
Compare ``self`` to ``other``.
|
|
125
|
+
|
|
126
|
+
EXAMPLES::
|
|
127
|
+
|
|
128
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
129
|
+
sage: f = ntl.GF2EX(ctx, '[[1 0 1] [1 0 0 1] [1]]')
|
|
130
|
+
sage: g = ntl.GF2EX(ctx, '[[1 0 1] [1 1] [1] [0 0 1]]')
|
|
131
|
+
sage: f == f
|
|
132
|
+
True
|
|
133
|
+
sage: f == g
|
|
134
|
+
False
|
|
135
|
+
sage: f == "??"
|
|
136
|
+
False
|
|
137
|
+
"""
|
|
138
|
+
self.c.restore_c()
|
|
139
|
+
|
|
140
|
+
if op != Py_EQ and op != Py_NE:
|
|
141
|
+
raise TypeError("elements of GF(2^e)[X] are not ordered")
|
|
142
|
+
|
|
143
|
+
cdef ntl_GF2EX b
|
|
144
|
+
try:
|
|
145
|
+
b = <ntl_GF2EX?>other
|
|
146
|
+
except TypeError:
|
|
147
|
+
return NotImplemented
|
|
148
|
+
|
|
149
|
+
return (op == Py_EQ) == (self.x == b.x)
|
|
150
|
+
|
|
151
|
+
def __repr__(self):
|
|
152
|
+
"""
|
|
153
|
+
Return the string representation of ``self``.
|
|
154
|
+
|
|
155
|
+
EXAMPLES::
|
|
156
|
+
|
|
157
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
158
|
+
sage: ntl.GF2EX(ctx, '[[1 0] [2 1]]').__repr__()
|
|
159
|
+
'[[1] [0 1]]'
|
|
160
|
+
"""
|
|
161
|
+
return ccrepr(self.x)
|
|
162
|
+
|
|
163
|
+
def __mul__(ntl_GF2EX self, other):
|
|
164
|
+
"""
|
|
165
|
+
EXAMPLES::
|
|
166
|
+
|
|
167
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
168
|
+
sage: f = ntl.GF2EX(ctx, '[[1 0] [2 1]]')
|
|
169
|
+
sage: g = ntl.GF2EX(ctx, '[[1 0 1 1] [0 1 1 0 1] [1 0 1]]')
|
|
170
|
+
sage: f*g ## indirect doctest
|
|
171
|
+
[[1 0 1 1] [0 0 1 1] [1 0 0 1 0 1] [0 1 0 1]]
|
|
172
|
+
"""
|
|
173
|
+
cdef ntl_GF2EX y
|
|
174
|
+
cdef ntl_GF2EX r = self._new()
|
|
175
|
+
if not isinstance(other, ntl_GF2EX):
|
|
176
|
+
other = ntl_GF2EX(self.c, other)
|
|
177
|
+
y = other
|
|
178
|
+
sig_on()
|
|
179
|
+
GF2EX_mul(r.x, self.x, y.x)
|
|
180
|
+
sig_off()
|
|
181
|
+
return r
|
|
182
|
+
|
|
183
|
+
def __sub__(ntl_GF2EX self, other):
|
|
184
|
+
"""
|
|
185
|
+
EXAMPLES::
|
|
186
|
+
|
|
187
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
188
|
+
sage: f = ntl.GF2EX(ctx, '[[1 0] [2 1]]')
|
|
189
|
+
sage: g = ntl.GF2EX(ctx, '[[1 0 1 1] [0 1 1 0 1] [1 0 1]]')
|
|
190
|
+
sage: f-g ## indirect doctest
|
|
191
|
+
[[0 0 1 1] [0 0 1 0 1] [1 0 1]]
|
|
192
|
+
"""
|
|
193
|
+
cdef ntl_GF2EX y
|
|
194
|
+
cdef ntl_GF2EX r = self._new()
|
|
195
|
+
if not isinstance(other, ntl_GF2EX):
|
|
196
|
+
other = ntl_GF2EX(self.c, other)
|
|
197
|
+
y = other
|
|
198
|
+
sig_on()
|
|
199
|
+
GF2EX_sub(r.x, self.x, y.x)
|
|
200
|
+
sig_off()
|
|
201
|
+
return r
|
|
202
|
+
|
|
203
|
+
def __add__(ntl_GF2EX self, other):
|
|
204
|
+
"""
|
|
205
|
+
EXAMPLES::
|
|
206
|
+
|
|
207
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
208
|
+
sage: f = ntl.GF2EX(ctx, '[[1 0] [2 1]]')
|
|
209
|
+
sage: g = ntl.GF2EX(ctx, '[[1 0 1 1] [0 1 1 0 1] [1 0 1]]')
|
|
210
|
+
sage: f+g ## indirect doctest
|
|
211
|
+
[[0 0 1 1] [0 0 1 0 1] [1 0 1]]
|
|
212
|
+
"""
|
|
213
|
+
cdef ntl_GF2EX y
|
|
214
|
+
cdef ntl_GF2EX r = self._new()
|
|
215
|
+
if not isinstance(other, ntl_GF2EX):
|
|
216
|
+
other = ntl_GF2EX(self.c, other)
|
|
217
|
+
y = other
|
|
218
|
+
sig_on()
|
|
219
|
+
GF2EX_add(r.x, self.x, y.x)
|
|
220
|
+
sig_off()
|
|
221
|
+
return r
|
|
222
|
+
|
|
223
|
+
def __neg__(ntl_GF2EX self):
|
|
224
|
+
"""
|
|
225
|
+
EXAMPLES::
|
|
226
|
+
|
|
227
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
228
|
+
sage: f = ntl.GF2EX(ctx, '[[1 0] [2 1]]')
|
|
229
|
+
sage: -f ## indirect doctest
|
|
230
|
+
[[1] [0 1]]
|
|
231
|
+
"""
|
|
232
|
+
cdef ntl_GF2EX r = self._new()
|
|
233
|
+
sig_on()
|
|
234
|
+
GF2EX_negate(r.x, self.x)
|
|
235
|
+
sig_off()
|
|
236
|
+
return r
|
|
237
|
+
|
|
238
|
+
def __pow__(ntl_GF2EX self, long e, ignored):
|
|
239
|
+
"""
|
|
240
|
+
EXAMPLES::
|
|
241
|
+
|
|
242
|
+
sage: ctx = ntl.GF2EContext(ntl.GF2X([1,1,0,1,1,0,1]))
|
|
243
|
+
sage: f = ntl.GF2EX(ctx, '[[1 0] [2 1]]')
|
|
244
|
+
sage: f**2 ## indirect doctest
|
|
245
|
+
[[1] [] [0 0 1]]
|
|
246
|
+
"""
|
|
247
|
+
cdef ntl_GF2EX r = self._new()
|
|
248
|
+
sig_on()
|
|
249
|
+
GF2EX_power(r.x, self.x, e)
|
|
250
|
+
sig_off()
|
|
251
|
+
return r
|
|
Binary file
|