Opened 9 years ago

Last modified 5 years ago

#10765 needs_work task

Obliterate sage/matrix/misc.pyx

Reported by: rbeezer Owned by: jason, was
Priority: major Milestone: sage-6.4
Component: linear algebra Keywords:
Cc: was, robertwb Merged in:
Authors: Rob Beezer Reviewers:
Report Upstream: N/A Work issues:
Branch: Commit:
Dependencies: Stopgaps:

Description

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_pivots
    Existing duplicate already existed in matrix/matrix2.pyx.
  • hadamard_row_bound_mpfr
    Moved to matrix/matrix2.pyx near 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_reconstruction
    Moved into content of sage.matrix.matrix_integer_sparse.Matrix_integer_sparse.rational_reconstruction which was just a one-line stub calling the function from sage/matrix/misc.pyx.
  • matrix_integer_dense_rational_reconstruction
    Moved into content of sage.matrix.matrix_integer_dense.Matrix_integer_dense.rational_reconstruction which was just a one-line stub calling the function from sage/matrix/misc.pyx. Adjusted a call in matrix_cyclo_dense to 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.

Attachments (1)

trac_10765-matrix-misc-routines.patch (47.5 KB) - added by rbeezer 9 years ago.

Download all attachments as: .zip

Change History (7)

Changed 9 years ago by rbeezer

comment:1 Changed 9 years ago by rbeezer

  • Authors set to Rob Beezer
  • Cc was robertwb added
  • Status changed from new to needs_info

Two questions for veterans of the matrix code:

  1. Should the new _echelon_form_multimodular_rational in matrix2.py be an underscore method (which is what was done)?
  1. Header of misc.py still has a stanza about mod_int and MOD_INT_OVERFLOW. I'm guessing it should follow the multimodular echelon form into the top of matrix2.pyx but am not certain. Advice?

comment:2 Changed 9 years ago by rbeezer

  • Status changed from needs_info to needs_work

This will not apply on 4.7.alpha1, and will rot further after #10752 goes in, so I'm going to orphan it for now.

comment:3 Changed 6 years ago by jdemeyer

  • Milestone changed from sage-5.11 to sage-5.12

comment:4 Changed 6 years ago by vbraun_spam

  • Milestone changed from sage-6.1 to sage-6.2

comment:5 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.2 to sage-6.3

comment:6 Changed 5 years ago by vbraun_spam

  • Milestone changed from sage-6.3 to sage-6.4
Note: See TracTickets for help on using tickets.