Skip to content

Commit

Permalink
sagemathgh-39533: build/pkgs: update eclib to version 20250122
Browse files Browse the repository at this point in the history
    
Update the version of eclib in sage-the-distro to 20250122 on top of
sagemath#38962

**Dependencies**:
* sagemath#38962
    
URL: sagemath#39533
Reported by: Michael Orlitzky
Reviewer(s): John Cremona
  • Loading branch information
Release Manager committed Feb 17, 2025
2 parents 0fbdb80 + 5d94a65 commit a987b8d
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 19 deletions.
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
6 changes: 3 additions & 3 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
upstream_url=https://github.com/JohnCremona/eclib/releases/download/vVERSION/eclib-VERSION.tar.bz2
sha1=ec8dd87df46ac5a54b548354681085d1da6e7e13
sha256=9f8c2b32e24a4f20d7cc2d336ea30c8ea03b5b0953c2d32adda0c496e7616899
upstream_url=https://github.com/JohnCremona/eclib/releases/download/VERSION/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
20250122
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

0 comments on commit a987b8d

Please sign in to comment.