Ticket #12370 (closed enhancement: fixed)

Opened 16 months ago

Last modified 16 months ago

Change is_singular to use rank instead of determinant

Reported by: jlopez Owned by: jason, was
Priority: major Milestone: sage-5.0
Component: linear algebra Keywords: matrices is_singular
Cc: Work issues:
Report Upstream: N/A Reviewers: Keshav Kini
Authors: Javier López Peña Merged in: sage-5.0.beta3
Dependencies: Stopgaps:

Description

The matrix method is_singular for matrices currently returns

    self.det() == 0

It would be faster to check for full rank instead.

Attachments

trac_12370_improve_is_singular.patch Download (1.6 KB) - added by jlopez 16 months ago.

Change History

Changed 16 months ago by jlopez

comment:1 Changed 16 months ago by jlopez

  • Status changed from new to needs_review

Changed is_singular method to use rank instead of determinant, which is much faster for generic matrices (particularly over ZZ). Fixed also an inconsistency in the error raised by determinant for nonsquare matrices, as it returns different error messages over the rationals.

Change is fairly minimal, and tests pass on my machine (Mac OS 10.6.8). Ready for review.

comment:2 Changed 16 months ago by jlopez

Apply trac_12370_improve_is_singular.patch

comment:3 Changed 16 months ago by kini

  • Keywords matrices added; matrices, removed
  • Reviewers set to Keshav Kini
  • Status changed from needs_review to positive_review
  • Authors set to Javier López Peña

Nice! Positive review.

comment:4 Changed 16 months ago by jdemeyer

  • Status changed from positive_review to closed
  • Resolution set to fixed
  • Merged in set to sage-5.0.beta3
Note: See TracTickets for help on using tickets.