help-octave
[Top][All Lists]
Advanced

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

Re: Applying function to vector by index


From: Andy Adler
Subject: Re: Applying function to vector by index
Date: Thu, 12 Dec 2002 14:10:14 -0500 (EST)

On Thu, 12 Dec 2002, Paul Kienzle wrote:
>
> Personally I would rather not have functions spontaneously converting
> sparse matrices to full since really small sparse matrices can form
> really big full matrices, but I also would not want to introduce
> needless incompatibilities.
>

Converting to full can save memory. Consider your cos(sparse) example.
It takes less memory to encode it as full than in a big sparse (BS)
matrix.

> BTW, I notice that
>               sparse(1,1,0)
> returns the following:
>       Compressed Column Sparse (rows=1, cols=1, nnz=1)
>         (1 , 1) -> 0
> and
>       [i,j,v] = spfind(sparse(1,1,0))
> returns
>       i = 1
>       j = 1
>       v = 0

I have code which goes through the matrices generated to
remove zeros introduces this (and in other subtle) ways.
I guess I forgot to apply it in this case.

My current opinion is that I'll try to stay Matlab compatible
unless it is really non-sensical.

Andy




-------------------------------------------------------------
Octave is freely available under the terms of the GNU GPL.

Octave's home on the web:  http://www.octave.org
How to fund new projects:  http://www.octave.org/funding.html
Subscription information:  http://www.octave.org/archive.html
-------------------------------------------------------------



reply via email to

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