From 6dfc26b805d2fb0cafa60f0d778db3d68188b724 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Wed, 13 Nov 2024 14:46:51 +0000 Subject: [PATCH 1/4] #38960-eclib-upgrade-20241112 --- build/pkgs/eclib/SPKG.rst | 2 +- build/pkgs/eclib/checksums.ini | 4 ++-- build/pkgs/eclib/package-version.txt | 2 +- build/pkgs/eclib/spkg-configure.m4 | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/build/pkgs/eclib/SPKG.rst b/build/pkgs/eclib/SPKG.rst index 5627fdcb57c..ac8b27b3606 100644 --- a/build/pkgs/eclib/SPKG.rst +++ b/build/pkgs/eclib/SPKG.rst @@ -30,5 +30,5 @@ Upstream Contact - Author: John Cremona - Email: john.cremona@gmail.com - Website: - http://homepages.warwick.ac.uk/staff/J.E.Cremona/mwrank/index.html + https://johncremona.github.io/mwrank/index.html - Repository: https://github.com/JohnCremona/eclib diff --git a/build/pkgs/eclib/checksums.ini b/build/pkgs/eclib/checksums.ini index fde4faaee15..b046783341d 100644 --- a/build/pkgs/eclib/checksums.ini +++ b/build/pkgs/eclib/checksums.ini @@ -1,4 +1,4 @@ tarball=eclib-VERSION.tar.bz2 -sha1=3028ac95e1b76699f5f9e871ac706cda363ab842 -sha256=32d116a3e359b0de4f6486c2bb6188bb8b553c8b833f618cc2596484e8b6145a +sha1=749e4fda3660006a9459f129148d05ba482daa29 +sha256=30765c27ca1420141f83517897119d0185fea9b31132392170ddae40b060e46f upstream_url=https://github.com/JohnCremona/eclib/releases/download/vVERSION/eclib-VERSION.tar.bz2 diff --git a/build/pkgs/eclib/package-version.txt b/build/pkgs/eclib/package-version.txt index 190b92f716b..353869c3cba 100644 --- a/build/pkgs/eclib/package-version.txt +++ b/build/pkgs/eclib/package-version.txt @@ -1 +1 @@ -20231212 +20241112 diff --git a/build/pkgs/eclib/spkg-configure.m4 b/build/pkgs/eclib/spkg-configure.m4 index ba5c22fa090..23771dad1bd 100644 --- a/build/pkgs/eclib/spkg-configure.m4 +++ b/build/pkgs/eclib/spkg-configure.m4 @@ -1,7 +1,7 @@ SAGE_SPKG_CONFIGURE([eclib], [ SAGE_SPKG_DEPCHECK([ntl pari flint], [ dnl use existing eclib only if the version reported by pkg-config is recent enough - m4_pushdef([SAGE_ECLIB_VER],["20231212"]) + m4_pushdef([SAGE_ECLIB_VER],["20241112"]) PKG_CHECK_MODULES([ECLIB], [eclib >= SAGE_ECLIB_VER], [ AC_CACHE_CHECK([for mwrank version == SAGE_ECLIB_VER], [ac_cv_path_MWRANK], [ AC_PATH_PROGS_FEATURE_CHECK([MWRANK], [mwrank], [ From d38cb48c67c7565572064fd29748c1e8da3b3271 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Tue, 19 Nov 2024 13:51:49 +0000 Subject: [PATCH 2/4] #38960 fix eclib interface after upgrade --- src/sage/libs/eclib/__init__.pxd | 4 ++-- src/sage/libs/eclib/mat.pyx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/sage/libs/eclib/__init__.pxd b/src/sage/libs/eclib/__init__.pxd index d44d4fba865..84d1fc92275 100644 --- a/src/sage/libs/eclib/__init__.pxd +++ b/src/sage/libs/eclib/__init__.pxd @@ -55,7 +55,7 @@ cdef extern from "eclib/matrix.h": cdef cppclass mat: mat() mat(mat m) - scalar* get_entries() + vector[scalar] get_entries() scalar sub(long, long) long nrows() long ncols() @@ -67,7 +67,7 @@ cdef extern from "eclib/smatrix.h": cdef cppclass smat: smat() smat(smat m) - scalar* get_entries() + vector[scalar] get_entries() scalar sub(long, long) long nrows() long ncols() diff --git a/src/sage/libs/eclib/mat.pyx b/src/sage/libs/eclib/mat.pyx index bfdeb6ae5c1..e7abe369b2b 100644 --- a/src/sage/libs/eclib/mat.pyx +++ b/src/sage/libs/eclib/mat.pyx @@ -10,7 +10,7 @@ from sage.rings.integer_ring import ZZ from sage.matrix.matrix_integer_sparse cimport Matrix_integer_sparse from sage.matrix.matrix_integer_dense cimport Matrix_integer_dense from sage.rings.integer cimport Integer - +from libcpp.vector cimport vector cdef class Matrix: """ @@ -213,7 +213,7 @@ cdef class Matrix: """ cdef long n = self.nrows() cdef long i, j, k - cdef scalar* v = self.M.get_entries() # coercion needed to deal with const + cdef vector[scalar] v = self.M.get_entries() # coercion needed to deal with const cdef Matrix_integer_dense Td cdef Matrix_integer_sparse Ts From 4f2cb3f7a943aefd05d4baf7b5845a6fc3dba779 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Wed, 4 Dec 2024 08:35:58 +0000 Subject: [PATCH 3/4] #38960 simplify eclib interface --- src/sage/libs/eclib/__init__.pxd | 2 -- src/sage/libs/eclib/mat.pyx | 18 +++++++----------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/src/sage/libs/eclib/__init__.pxd b/src/sage/libs/eclib/__init__.pxd index 84d1fc92275..2673af0613f 100644 --- a/src/sage/libs/eclib/__init__.pxd +++ b/src/sage/libs/eclib/__init__.pxd @@ -55,7 +55,6 @@ cdef extern from "eclib/matrix.h": cdef cppclass mat: mat() mat(mat m) - vector[scalar] get_entries() scalar sub(long, long) long nrows() long ncols() @@ -67,7 +66,6 @@ cdef extern from "eclib/smatrix.h": cdef cppclass smat: smat() smat(smat m) - vector[scalar] get_entries() scalar sub(long, long) long nrows() long ncols() diff --git a/src/sage/libs/eclib/mat.pyx b/src/sage/libs/eclib/mat.pyx index e7abe369b2b..5dbb39faa0e 100644 --- a/src/sage/libs/eclib/mat.pyx +++ b/src/sage/libs/eclib/mat.pyx @@ -10,7 +10,6 @@ from sage.rings.integer_ring import ZZ from sage.matrix.matrix_integer_sparse cimport Matrix_integer_sparse from sage.matrix.matrix_integer_dense cimport Matrix_integer_dense from sage.rings.integer cimport Integer -from libcpp.vector cimport vector cdef class Matrix: """ @@ -212,8 +211,7 @@ cdef class Matrix: """ cdef long n = self.nrows() - cdef long i, j, k - cdef vector[scalar] v = self.M.get_entries() # coercion needed to deal with const + cdef long i, j cdef Matrix_integer_dense Td cdef Matrix_integer_sparse Ts @@ -221,21 +219,19 @@ cdef class Matrix: # Ugly code... if sparse: Ts = MatrixSpace(ZZ, n, sparse=sparse).zero_matrix().__copy__() - k = 0 for i from 0 <= i < n: for j from 0 <= j < n: - if v[k]: - Ts.set_unsafe(i, j, Integer(v[k])) - k += 1 + Mij = Integer(self.M.sub(i+1,j+1)); + if Mij: + Ts.set_unsafe(i, j, Mij) return Ts else: Td = MatrixSpace(ZZ, n, sparse=sparse).zero_matrix().__copy__() - k = 0 for i from 0 <= i < n: for j from 0 <= j < n: - if v[k]: - Td.set_unsafe(i, j, Integer(v[k])) - k += 1 + Mij = Integer(self.M.sub(i+1,j+1)); + if Mij: + Td.set_unsafe(i, j, Mij) return Td From 8754c7052084043209c8332d3d1154c26c25ae91 Mon Sep 17 00:00:00 2001 From: John Cremona Date: Wed, 4 Dec 2024 09:20:07 +0000 Subject: [PATCH 4/4] #38960: fix lint issue --- src/sage/libs/eclib/mat.pyx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/sage/libs/eclib/mat.pyx b/src/sage/libs/eclib/mat.pyx index 5dbb39faa0e..989d9d1a70c 100644 --- a/src/sage/libs/eclib/mat.pyx +++ b/src/sage/libs/eclib/mat.pyx @@ -221,7 +221,7 @@ cdef class Matrix: Ts = MatrixSpace(ZZ, n, sparse=sparse).zero_matrix().__copy__() for i from 0 <= i < n: for j from 0 <= j < n: - Mij = Integer(self.M.sub(i+1,j+1)); + Mij = Integer(self.M.sub(i+1,j+1)) if Mij: Ts.set_unsafe(i, j, Mij) return Ts @@ -229,7 +229,7 @@ cdef class Matrix: Td = MatrixSpace(ZZ, n, sparse=sparse).zero_matrix().__copy__() for i from 0 <= i < n: for j from 0 <= j < n: - Mij = Integer(self.M.sub(i+1,j+1)); + Mij = Integer(self.M.sub(i+1,j+1)) if Mij: Td.set_unsafe(i, j, Mij) return Td