mirror of
https://src.fedoraproject.org/rpms/sagemath.git
synced 2025-04-22 11:45:56 -04:00
Add sagemath-m4rie.patch to adapt to m4rie 20130416.
Adapt to NTL 6.0.0 a little more.
This commit is contained in:
parent
0ce0009c63
commit
eac7c8fec1
3 changed files with 179 additions and 4 deletions
62
sagemath-m4rie.patch
Normal file
62
sagemath-m4rie.patch
Normal file
|
@ -0,0 +1,62 @@
|
|||
--- sage-5.8/spkg/build/sage-5.8/sage/libs/m4rie.pxd.orig 2013-05-07 08:12:27.137652862 -0600
|
||||
+++ sage-5.8/spkg/build/sage-5.8/sage/libs/m4rie.pxd 2013-05-07 11:45:12.067923724 -0600
|
||||
@@ -52,9 +52,9 @@ cdef extern from "m4rie/m4rie.h":
|
||||
|
||||
void mzed_add_elem(mzed_t *a, const_size_t row, const_size_t col, const_int elem)
|
||||
|
||||
- void mzed_add_multiple_of_row(mzed_t *A, size_t ar, mzed_t *B, size_t br, m4ri_word *X, size_t start_col)
|
||||
+ void mzed_add_multiple_of_row(mzed_t *A, size_t ar, mzed_t *B, size_t br, m4ri_word x, size_t start_col)
|
||||
|
||||
- void mzed_rescale_row(mzed_t *A, size_t r, size_t c, m4ri_word *X)
|
||||
+ void mzed_rescale_row(mzed_t *A, size_t r, size_t c, m4ri_word x)
|
||||
|
||||
void mzed_row_swap(mzed_t *M, const_size_t rowa, const_size_t rowb)
|
||||
|
||||
@@ -112,14 +112,12 @@ cdef extern from "m4rie/m4rie.h":
|
||||
|
||||
#cdef extern from "m4rie/mzd_slice.h":
|
||||
|
||||
- int __M4RIE_MAX_KARATSUBA_DEGREE
|
||||
-
|
||||
ctypedef struct mzd_slice_t:
|
||||
mzd_t *x[16]
|
||||
- gf2e *finite_field
|
||||
int nrows
|
||||
int ncols
|
||||
int depth
|
||||
+ gf2e *finite_field
|
||||
|
||||
mzd_slice_t *mzd_slice_init(gf2e *ff, size_t m, size_t n)
|
||||
|
||||
--- sage-5.8/spkg/build/sage-5.8/sage/matrix/matrix_mod2e_dense.pyx.orig 2013-05-07 08:12:27.139652859 -0600
|
||||
+++ sage-5.8/spkg/build/sage-5.8/sage/matrix/matrix_mod2e_dense.pyx 2013-05-07 11:21:05.095668016 -0600
|
||||
@@ -561,9 +561,6 @@ cdef class Matrix_mod2e_dense(matrix_den
|
||||
if self._ncols != right._nrows:
|
||||
raise ArithmeticError("left ncols must match right nrows")
|
||||
|
||||
- if self._entries.finite_field.degree > __M4RIE_MAX_KARATSUBA_DEGREE:
|
||||
- raise NotImplementedError("Karatsuba multiplication is only implemented for matrices over GF(2^e) with e <= %d."%__M4RIE_MAX_KARATSUBA_DEGREE)
|
||||
-
|
||||
cdef Matrix_mod2e_dense ans
|
||||
|
||||
ans = self.new_matrix(nrows = self.nrows(), ncols = right.ncols())
|
||||
@@ -1047,8 +1044,7 @@ cdef class Matrix_mod2e_dense(matrix_den
|
||||
[ a a^2 + 1 a + 1]
|
||||
"""
|
||||
cdef m4ri_word x = <m4ri_word>(<M4RIE__FiniteField*>self.cc.objectptr).log2pol((<FiniteField_givaroElement>multiple).element)
|
||||
- cdef m4ri_word *X = self._entries.finite_field.mul[x]
|
||||
- mzed_rescale_row(self._entries, row, start_col, X)
|
||||
+ mzed_rescale_row(self._entries, row, start_col, x)
|
||||
|
||||
|
||||
cdef add_multiple_of_row_c(self, Py_ssize_t row_to, Py_ssize_t row_from, multiple, Py_ssize_t start_col):
|
||||
@@ -1077,8 +1073,7 @@ cdef class Matrix_mod2e_dense(matrix_den
|
||||
"""
|
||||
|
||||
cdef m4ri_word x = <m4ri_word>(<M4RIE__FiniteField*>self.cc.objectptr).log2pol((<FiniteField_givaroElement>multiple).element)
|
||||
- cdef m4ri_word *X = self._entries.finite_field.mul[x]
|
||||
- mzed_add_multiple_of_row(self._entries, row_to, self._entries, row_from, X, start_col)
|
||||
+ mzed_add_multiple_of_row(self._entries, row_to, self._entries, row_from, x, start_col)
|
||||
|
||||
|
||||
cdef swap_rows_c(self, Py_ssize_t row1, Py_ssize_t row2):
|
Loading…
Add table
Add a link
Reference in a new issue