help-octave
[Top][All Lists]
Advanced

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

sparse matrix operations


From: E. Joshua Rigler
Subject: sparse matrix operations
Date: Tue, 16 Nov 2004 11:32:28 -0700

It would be useful to have operations for sparse matrices (multiply,
add, etc.) that only bothered to do calculations to update those
non-zero elements of a sparse matrix on the left-hand side of an
equation.  

For example, suppose I only want the diagonal of the product of two
square matrices.  As it stands right now in Octave (with octave-forge),
C=A*B will result in a full C matrix, and may potentially use up more
memory than I wish to allow.  Since I only want the diagonal of C, I may
as well only perform those operations that place a vector product at
C(i,i), thereby saving CPU cycles and memory.

I have a simple .m file that does this, but of course it is very slow in
the Octave interpreter since it must loop over each of the desired
non-zero elements of C.  I was hoping somebody out there might have
something similar, but in a .oct format, or could show me a trick for
doing this with standard Octave operators, before I go and try to
reinvent this wheel.

Thanks.

-EJR



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