octave-maintainers
[Top][All Lists]
Advanced

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

Re: deprecated functions


From: Jason Riedy
Subject: Re: deprecated functions
Date: Wed, 04 Mar 2009 15:33:43 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.91 (gnu/linux)

And Jaroslav Hajek writes:
> diag(sparse(vector)) * sparse matrix, obviously. It will be less
> efficient than with dense matrices, but will work.

But then all code that *might* be called with sparse matrices must use
diag(sparse(vector)).  If it doesn't, it might suddenly blow out memory
when called with a sparse matrix.  Why is that preferable to making diag
* sparse * diag work?

Matlab(TM) made yet another stupid, stupid decision.  Why is Octave
bound to all of them?  It Matlab(TM) were to change (incompatibly,
again), they'd trumpet it as an improvement.

It's better if *more* code can work transparently with sparse matrices,
not less.

Yes, there are odd problems with elementwise exceptional operations, but
similar problems exist with complex numbers in many programming
environments, too.  You don't even want to know how long we spent
arguing what max(NaN, Inf) should be for IEEE-754r.  It's not worth
bothering too much over those without driving examples.

> I believe the sparse scaling of dmult was an unintended side effect,
> because constructing a temporary dense matrix of the same size is
> certainly a *very* inefficient way to do the scaling.

For whatever reason, it wasn't blowing memory, but now something is.
Using dmult to scale a sparse matrix isn't in the expensive part of my
tests, so I never noticed.  I had never even noticed it was a function
file and not compiled...  Older code had dmult(vector, matrix); I just
tried dmult(matrix, vector), and it worked.

But really I don't care about dmult.  It was a short, relatively clear
way to say what I meant.  Having diag * sparse be sparse is much, much
better.

(Hey, I bit my tongue over using ... for comments.  I know people who
use that, but the main one still uses Matlab(TM) 5 on his 68030 Mac.)

Jason, still waiting on a compile...


reply via email to

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