help-octave
[Top][All Lists]
Advanced

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

Re: tril/triu not preserving sparseness


From: Martijn van Oosterhout
Subject: Re: tril/triu not preserving sparseness
Date: Fri, 25 Jan 2008 13:11:13 +0100

On Jan 25, 2008 12:28 PM, David Bateman <address@hidden> wrote:
> Fixed in a later version of Octave... The relevant changelog entry is
>
> 2006-04-02  David Bateman  <address@hidden>
>
>         * general/tril.m, general.triu.m:
>         Use resize (resize (x, 0), nr, nc) rather than zeros (nr, nc)
>         to allow user types to work correctly.

That commit added the resize, which is the cause of my problems. It
only goes wrong for complex matrices. You're saying that something
else changed in octave so that the above works? Because on my machine
I get this:

octave:1> S=speye(1000); issparse(S)
ans =  1
octave:2> issparse( resize( resize(S,0),1000, 1000 ))
ans =  1
octave:3> S=speye(1000)*I; issparse(S)
ans =  1
octave:4> issparse( resize( resize(S,0),1000, 1000 ))
ans = 0

Anyway, I found another way of solving the problem. If I get around to
upgrading I'll try it out there... Thanks anyway.

Have a nice day,
-- 
Martijn van Oosterhout <address@hidden> http://svana.org/kleptog/


reply via email to

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