octave-maintainers
[Top][All Lists]
Advanced

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

Re: About diagonal matrices


From: Søren Hauberg
Subject: Re: About diagonal matrices
Date: Sat, 21 Feb 2009 22:59:42 +0100

lor, 21 02 2009 kl. 16:46 -0500, skrev John W. Eaton:
> Yes, I understand that it is convenient for many uses for diagonal
> and sparse matrices to have the properties you want.  But I'm also
> don't like having things like
> 
>   full_matrix == diag_matrix
> 
> yet
> 
>   diag_matrix * scalar != full_matrix * scalar
> 
> for some values of scalar.

I don't like this either. But I must say that I really like the reduced
memory usage that comes with the diagonal matrix type (this has already
saved me a couple of times). I guess I'm missing the obvious here, but
couldn't the diagonal matrix class be extended to have a variable that
holds the value of the non-diagonal elements of the matrix? Usually this
would be zero, but when the matrix is multiplied with NaN or divided
with zero, this value would change.

Soren



reply via email to

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