Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Upgrade eclib to version 20241112 #38962

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion build/pkgs/eclib/SPKG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,5 @@ Upstream Contact
- Author: John Cremona
- Email: [email protected]
- 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
4 changes: 2 additions & 2 deletions build/pkgs/eclib/checksums.ini
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion build/pkgs/eclib/package-version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
20231212
20241112
2 changes: 1 addition & 1 deletion build/pkgs/eclib/spkg-configure.m4
Original file line number Diff line number Diff line change
@@ -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], [
Expand Down
2 changes: 0 additions & 2 deletions src/sage/libs/eclib/__init__.pxd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ cdef extern from "eclib/matrix.h":
cdef cppclass mat:
mat()
mat(mat m)
scalar* get_entries()
scalar sub(long, long)
long nrows()
long ncols()
Expand All @@ -67,7 +66,6 @@ cdef extern from "eclib/smatrix.h":
cdef cppclass smat:
smat()
smat(smat m)
scalar* get_entries()
scalar sub(long, long)
long nrows()
long ncols()
Expand Down
18 changes: 7 additions & 11 deletions src/sage/libs/eclib/mat.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ 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


cdef class Matrix:
"""
A Cremona Matrix.
Expand Down Expand Up @@ -212,30 +211,27 @@ cdef class Matrix:
<class 'sage.matrix.matrix_integer_dense.Matrix_integer_dense'>
"""
cdef long n = self.nrows()
cdef long i, j, k
cdef scalar* v = <scalar*> self.M.get_entries() # coercion needed to deal with const
cdef long i, j

cdef Matrix_integer_dense Td
cdef Matrix_integer_sparse Ts

# 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


Expand Down
Loading