Obliterate sage/matrix/misc.pyx
Closed this issue · 3 comments
Header of sage/matrix/misc.py says:
NOTE: The whole problem of avoiding circular imports -- the reason for
existence of this file -- is now a non-issue, since some bugs in
Cython were fixed. Probably all this code should be moved into the
relevant classes and this file deleted.
So I did. After a suitable deprecation period, the file can be obliterated. Here's the overview:
Functions leaving sage/matrix/misc.py. Originals have all been deprecated.
-
cmp_pivotsExisting duplicate already existed in
matrix/matrix2.pyx. -
hadamard_row_bound_mpfrMoved to
matrix/matrix2.pyxnear where it was called, right by another similar helper function. Converted to an underscore method, therefore. Already has protection on base ring of the matrix (RR). -
matrix_integer_sparse_rational_reconstructionMoved into content of
sage.matrix.matrix_integer_sparse.Matrix_integer_sparse.rational_reconstructionwhich was just a one-line stub calling the function fromsage/matrix/misc.pyx. -
matrix_integer_dense_rational_reconstructionMoved into content of
sage.matrix.matrix_integer_dense.Matrix_integer_dense.rational_reconstructionwhich was just a one-line stub calling the function fromsage/matrix/misc.pyx. Adjusted a call inmatrix_cyclo_denseto call this new method. -
matrix_rational_echelon_form_multimodular"Works" for sparse and dense matrices (see MAX_MODULUS) so added this to matrix2.pyx class as
sage.matrix.matrix2.Matrix._echelon_form_multimodular_rational. Added protection to ensure base ring is rationals.
Almost all code changes are just to fit into new locations. A bit of documentation clean-up where needed.
This passes all tests, but should be reviewed by somebody with significant Cython and/or sage/matrix experience.
Component: linear algebra
Author: Rob Beezer
Issue created by migration from https://trac.sagemath.org/ticket/10765
Attachment: trac_10765-matrix-misc-routines.patch.gz
Two questions for veterans of the matrix code:
-
Should the new
_echelon_form_multimodular_rationalinmatrix2.pybe an underscore method (which is what was done)? -
Header of
misc.pystill has a stanza aboutmod_intandMOD_INT_OVERFLOW. I'm guessing it should follow the multimodular echelon form into the top ofmatrix2.pyxbut am not certain. Advice?
Author: Rob Beezer