help-octave
[Top][All Lists]
Advanced

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

manipulating sparse matrices


From: Mike Miller
Subject: manipulating sparse matrices
Date: Fri, 14 Oct 2005 18:27:36 -0500 (CDT)

I'm using Octave 2.1.71 on Linux with Octave-Forge 2005.06.13.

I have two questions about sparse matrices...

If I do this...

a = speye(1000);
a(1,1) = 2;

...the resulting 'a' matrix is no longer of class "sparse" and it takes up 8 MB of RAM. That's not good for me. Is there a way to reassign an element of a sparse matrix without changing its class? I believe this just works in 2.9, but is there a way to do it in 2.1.71?

How can I find out how much memory is being used by a sparse matrix? If I do this...

octave:33> a=speye(1000);
octave:34> whos a

...I am told "Total is 1000000 elements using 0 bytes," but is it really zero bytes? That's an impressive feat. There seems to be a function called nzmax that will tell me the memory allocation, but I can't figure out how to get that function...

http://octave.sourceforge.net/index/f/nzmax.html

Best,

Mike



-------------------------------------------------------------
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]