octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: compound operators - what next?


From: Jaroslav Hajek
Subject: Re: compound operators - what next?
Date: Tue, 20 May 2008 07:31:48 +0200

On Mon, May 19, 2008 at 11:09 PM, dbateman <address@hidden> wrote:
>
>
>
> Jaroslav Hajek-2 wrote:
>>
>> Other possibility is to flag even dense matrix with MatrixType
>> "diagonal" and make diag and eye return such a matrix; in such case,
>> diag(v)*A would be time-efficient but not memory-efficient (because
>> the matrix would still get constructed).
>>
>
> Ok for the flag coming from diag but not that diagonal matrices are probed
>

No, probing on every multiplication, that would be a waste.

>
>
>>>
>>> This would pretty much implement the third option with little work and
>>> only
>>> require the user to use sparse diagonal matrices instead for the scaling.
>>> Its also not using tricks in the parser to get the wanted behavior and so
>>> can't be fooled by d=diag(v);d*A as your other technique will be.
>>>
>>
>> exactly, exactly ...
>> I hope I did not misunderstood you; it seems to me that you are OK
>> with diag and eye
>> returning sparse matrices, right?
>>
>
> I said diags and not diag, but I meant spdiags. I don't thinks its a great
> idea to have eye and diag return sparse matrices. Rather that the the
> acceleration you are after might already be there or easy to achieve if the
> user replaced diag with spdiags.
>

You're right, after all. I can just use spdiags and speye for my
purposes. It's no good breaking backward compatibility just to save a
couple of letters.

I'll implement special multiplication for sparse matrices marked as
diagonal and permuted diagonal.

> D.
>
>


-- 
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz


reply via email to

[Prev in Thread] Current Thread [Next in Thread]