Skip to content

Commit ce8c59b

Browse files
committed
Disable use of linbox charpoly/minpoly on 64-bit computers.
1 parent fc87eaa commit ce8c59b

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/sage/matrix/matrix_integer_dense.pyx

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,9 @@ from sage.libs.linbox.linbox cimport Linbox_integer_dense
6666
cdef Linbox_integer_dense linbox
6767
linbox = Linbox_integer_dense()
6868

69+
import sage.misc.misc
70+
USE_LINBOX_POLY = not sage.misc.misc.is_64bit()
71+
6972
cdef class Matrix_integer_dense(matrix_dense.Matrix_dense): # dense or sparse
7073
r"""
7174
Matrix over the integers.
@@ -661,7 +664,8 @@ cdef class Matrix_integer_dense(matrix_dense.Matrix_dense): # dense or sparse
661664
algorithm -- 'linbox' (default)
662665
'generic'
663666
664-
NOTE: Linbox only used on Darwin OS X right now.
667+
NOTE: Linbox charpoly disabled on 64-bit machines, since it
668+
hangs in many cases.
665669
666670
EXAMPLES:
667671
sage: A = matrix(ZZ,6, range(36))
@@ -679,6 +683,9 @@ cdef class Matrix_integer_dense(matrix_dense.Matrix_dense): # dense or sparse
679683
x = self.fetch(key)
680684
if x: return x
681685

686+
if algorithm == 'linbox' and not USE_LINBOX_POLY:
687+
algorithm = 'generic'
688+
682689
if algorithm == 'linbox':
683690
g = self._charpoly_linbox(var)
684691
elif algorithm == 'generic':
@@ -696,7 +703,8 @@ cdef class Matrix_integer_dense(matrix_dense.Matrix_dense): # dense or sparse
696703
algorithm -- 'linbox' (default)
697704
'generic'
698705
699-
NOTE: Linbox only used on Darwin OS X right now.
706+
NOTE: Linbox charpoly disabled on 64-bit machines, since it
707+
hangs in many cases.
700708
701709
EXAMPLES:
702710
sage: A = matrix(ZZ,6, range(36))
@@ -710,6 +718,9 @@ cdef class Matrix_integer_dense(matrix_dense.Matrix_dense): # dense or sparse
710718
x = self.fetch(key)
711719
if x: return x
712720

721+
if algorithm == 'linbox' and not USE_LINBOX_POLY:
722+
algorithm = 'generic'
723+
713724
if algorithm == 'linbox':
714725
g = self._minpoly_linbox(var)
715726
elif algorithm == 'generic':

0 commit comments

Comments
 (0)