deprecated functions
Jason Riedy
jason at acm.org
Wed Mar 4 16:16:02 CST 2009
And John W. Eaton writes:
> Maybe I'm slow, but what is the large impact of having diag x sparse
> operations convert to full? What does it break? I guess I could use
> some examples.
A typical use (for me) of diag * sparse is to rescale the matrix before
solving a system with it. Many sparse matrices from automatic systems
(e.g. optimization problem builders) are horribly ill-scaled and appear
to be ill-conditioned. Rescaling the problem can greatly improve the
solution. The rescaling should have negligible cost.
For a direct method, if diag * sparse is full, you're lead to a full
factorization and needlessly slow performance. For an iterative method,
making A dense makes A*x far, far more expensive than it should be.
Yes, code *could* contain an if sparse(...) test, but why? What is the
benefit of forcing code to care about structure when it's otherwise
agnostic?
Jason
More information about the Octave-maintainers
mailing list