About diagonal matrices
Daniel J Sebald
daniel.sebald at ieee.org
Sun Mar 1 13:23:44 CST 2009
dbateman wrote:
> Well I'm finally somewhere I can write an e-mail from easily, though I
> haven't had the time to reread the thread. The issue I considered in the
> past like this was operations like "speye(n) .^ 0" or "speye(n) ./ 0" where
> the 0.^0 and 0./0 terms of the matrix should create a NaN in the resulting
> matrix I hadn't considered the "speye(n) OP NaN" but didn't and don't yet
> see why it should be different if the NaN is pre-existing rather than
> created by the binary operation, otherwise the NaN values won't propagate
> and in fact might very likely disappear. You seem to think, and have
> convince John that disappearing NaN's are a good thing so I'll try to reread
> the thread and respond again later on.
I think a "default sparse value" solves this, no matter what one thinks the defined behavior should be. Call the indeces assigned the default value the "sparse set". The sparse set could be NaN, while assigned values could also happen to be NaN.
The value of the sparse matrix is when it comes time to use it in operations where a full matrix would consume the CPU. So it does make sense to keep track of the sparse set.
Dan
More information about the Octave-maintainers
mailing list