[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH] Double-prec diag and permutation matrices fall back to spar
From: |
Jaroslav Hajek |
Subject: |
Re: [PATCH] Double-prec diag and permutation matrices fall back to sparse matrices. |
Date: |
Thu, 5 Mar 2009 21:22:15 +0100 |
On Thu, Mar 5, 2009 at 9:05 PM, John W. Eaton <address@hidden> wrote:
> On 5-Mar-2009, Jaroslav Hajek wrote:
>
> | On Thu, Mar 5, 2009 at 7:55 PM, Jason Riedy <address@hidden> wrote:
> | > With this change, diag ([1;2;3]) * sprand (3, 3, .5) will produce a
> | > scaled sparse matrix. Single-precision sparse matrices are not yet
> | > supported in Octave, so the single-precision diagonal matrices still
> | > fall back to dense.
> |
> | This is, IMHO, an important catch that didn't occur to me before. I
> | can't say I like it much, although it's logical (given the absence of
> | single precision sparse matrices). It's no problem for the operations,
> | actually; (single) full * (double) sparse does not work anyway. But
> | for other stuff (like assigning to a diag matrix), it seems
> | potentially confusing.
> | John, what do you think?
>
> Shouldn't something like
>
> single (diag ([1,2,3])) * speye (3)
>
> just fail if single * sparse is not implemented?
>
Yes, it should (and fails now). My point is this:
a = eye(3); a(1,2) = 1; --> a is double sparse
a = single (eye(3)); a(1,2) = 1; --> a is single dense
Is that OK?
--
RNDr. Jaroslav Hajek
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz