On sage-support  (http://groups.google.com/group/sage-support/
browse_frm/thread/f62e4f521d732b60) I pointed out that mat.rank()
failed for a certain sparse matrix, whereas mat.dense_matrix().rank()
worked just fine, and similarly for mat.elementary_divisors().

On Jan 31, 12:12 pm, mabshoff <[email protected]
dortmund.de> wrote:
> On Jan 31, 11:56 am, John H Palmieri <[email protected]> wrote:

[snip]

> > 1. for anyone familiar with the code, do these observations make
> > sense?  Is it sensible to convert sparse integer matrices to dense
> > ones before doing anything else?
>
> Well, if you have a truly large sparse matrix the conversion will
> fail.

You're probably right, but right now the rank and elementary_divisors
functions fail on smaller matrices. So at the moment, the choice is
between having rank fail for some matrices, or doing the conversion
and then computing the rank, which will fail for some other matrices.
I can't tell if the failing matrices from the first batch is strictly
larger than that for the second batch.

> > 2. Are there any guidelines about how large a matrix Sage (or Pari)
> > can handle without barfing?  For example, if I'm using a Mac with 2GB
> > of memory, or if I'm using sage.math?
>
> Pari seems rather inefficient when the above sparse matrix requires
> more than 2GB Ram to compute. The sparse matrix code needs a good
> cleanup anyway.

I agree, and I absolutely do not volunteer to do this.  (I don't know
anything about sparse linear algebra, and I have no desire to learn
about it.)  The dense code needs work, too.  For example, the
docstring for elementary_divisors in matrix_integer_sparse says

        IMPLEMENTATION: Uses linbox, except sometimes linbox doesn't
        work (errors about pre-conditioning), in which case PARI is
        used.

[snip]

        'linbox' -- use linbox (currently off, broken)

> I think generally using dense representations to compute operations
> like rank is a mistake even though it is substantially faster in the
> cases you see. But I also think this discussion should happen on sage-
> devel anyway.

And here it is...

  John


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to