Skip to content

Commit a9c77ac

Browse files
author
Release Manager
committed
gh-40975: Workaround for linbox charpoly/minpoly issues, take 2
Fix #40974 by checking the charpoly has the correct degree. we unfortunately cannot do the same thing for minpoly, since we don't a priori know its degree. ### 📝 Checklist <!-- Put an `x` in all the boxes that apply. --> - [ ] The title is concise and informative. - [ ] The description explains in detail what this PR is about. - [ ] I have linked a relevant issue or discussion. - [ ] I have created tests covering the changes. - [ ] I have updated the documentation and checked the documentation preview. ### ⌛ Dependencies <!-- List all open PRs that this PR logically depends on. For example, --> <!-- - #12345: short description why this is a dependency --> <!-- - #34567: ... --> URL: #40975 Reported by: user202729 Reviewer(s):
2 parents 6db086d + 1f4d2ac commit a9c77ac

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

build/pkgs/configure/checksums.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
tarball=configure-VERSION.tar.gz
2-
sha1=b36924b2391937313f3b2037eb1ffa4e3a9b2d81
3-
sha256=ec9a7a235593430352081443b1089403452ec349a202b2ca5cd73ceb63bbe26c
2+
sha1=85ea590bfb3ee849ba157ae43bf2ad0536d830a8
3+
sha256=90bd69bd4d7c5968b50a113abced92fe1f8250e5bc2ddfc64f7a48b729ffa199
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
0ef31d1493e6873bbdb7e14f91c57275ba3b20ee
1+
e7455996d0dc9114d649bdd5567394729cee799f

src/sage/matrix/matrix_integer_dense.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1416,7 +1416,7 @@ cdef class Matrix_integer_dense(Matrix_dense):
14161416
sig_on()
14171417
linbox_fmpz_mat_charpoly(g._poly, self._matrix)
14181418
sig_off()
1419-
if g.lc() == 1:
1419+
if g.lc() == 1 and g.degree() == self._nrows:
14201420
break
14211421
elif algorithm == 'generic':
14221422
g = Matrix_dense.charpoly(self, var)

src/sage/matrix/matrix_integer_sparse.pyx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,7 @@ cdef class Matrix_integer_sparse(Matrix_sparse):
912912
fmpz_poly_set_coeff_mpz(g._poly, i, tmp)
913913
_fmpz_poly_set_length(g._poly, p.size())
914914

915-
if g.lc() == 1:
915+
if g.lc() == 1 and g.degree() == self._nrows:
916916
break
917917

918918
del M

0 commit comments

Comments
 (0)