octave-maintainers
[Top][All Lists]
Advanced

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

Re: Dot product full-sparse


From: Jaroslav Hajek
Subject: Re: Dot product full-sparse
Date: Wed, 18 Aug 2010 14:22:43 +0200

On Wed, Aug 18, 2010 at 9:10 AM, Marco Caliari <address@hidden> wrote:

>> Thanks, Marco. Two more questions, please: What happens for:
>>
>> Inf * speye (3)
>> speye(3) / NaN
>
>>> Inf * speye (3)
>
> ans =
>   (1,1)      Inf
>   (2,1)      NaN
>   (3,1)      NaN
>   (1,2)      NaN
>   (2,2)      Inf
>   (3,2)      NaN
>   (1,3)      NaN
>   (2,3)      NaN
>   (3,3)      Inf
>>>
>>> speye(3) / NaN
>
> ans =
>   (1,1)      NaN
>   (2,1)      NaN
>   (3,1)      NaN
>   (1,2)      NaN
>   (2,2)      NaN
>   (3,2)      NaN
>   (1,3)      NaN
>   (2,3)      NaN
>   (3,3)      NaN
>
> Marco
>

Aha, I see. Now I recall that this was the kind of idiotic behavior
that has been discussed before and I was against copying it.
Staring at the sparse ops code for a while I thought it was a
candidate for a complete rewrite. After more staring I realized that
I'm really not into such a project in the advent of 3.4 release, so I
made just a couple of hacks:
http://hg.savannah.gnu.org/hgweb/octave/rev/b64803a8be4e

using your benchmark with the patched sources, I get on my machine:

octave:5> tic, A .* B;,toc
Elapsed time is 0.005126 seconds.
octave:6> tic, SA .* B;, toc
Elapsed time is 0.0018189 seconds.
octave:7> tic, SA .* sparse (B);, toc
Elapsed time is 0.0107691 seconds.

enjoy

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
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]