Hi William, On Jan 25, 6:30 pm, William Stein <wst...@gmail.com> wrote: > I think is_singular should raise a ValueError if the input matrix is > not square.
Sure, that makes sense. My main point was arguing for the convenience of using rank rather than determinant. > That is probably a good idea over ZZ or QQ and probably many other > rings, especially since for a random matrix over ZZ or QQ, rank will > be full and Sage will quickly figure this out by reducing modulo one > small random prime. So, even if the coefficients of A are enormous, > the rank approach will usually be very fast, whereas computing the > determinant will be slowed down by the size of the entries. Certainly, for generic matrices in rings computing the rank should be much faster, particularly in the full-rank case. In the very degenerate case (over ZZ) my example shows similar (if slightly better) performance for rank. I am not sure on the difference of performance when working numerically, though. Should I open a ticket and change this, or does anybody have a strong argument for favoring the determinant use in some cases? > There was no cached_method when I wrote most of the matrix code. > Also, I think decorators weren't supported in Cython then (?). > > The matrix caching code is definitely more sophisticated than what > cached_method does though. It has to behave differently for mutable > and immutable matrices. I see, so touching this would mean opening a can of worms. Better leave it as it is for now, then. Cheers Javier -- To post to this group, send an email to sage-devel@googlegroups.com To unsubscribe from this group, send an email to sage-devel+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org