On 6/8/05, David Bateman <address@hidden> wrote:
Keith Goodman wrote:
Understood. But a "which -all" is still very useful if anyone feels
like making one.
Its not that difficult to implement a simple version of "which -all".
One of the advantages of octave over its close source competitors is
that with the source being open, the users can propose a patch for the
feature they want, and in all likelihood see this patch included in a
very short delay. That's how open source programs become more feature
rich...
As for "which -all" there is one complication. The octave dispatch
function allows function overloading in a manner similar but different
to matlab classes. Strictly speaking "which -all <fun>" should also
return all of the overloaded functions of <fun> as well with an
indication of the type they are used for. Consider
octave:1> dispatch("inv")
Overloaded function inv
inv(galois,...)->ginv(galois,...)
inv(sparse bool matrix,...)->spinv(sparse bool matrix,...)
inv(sparse complex matrix,...)->spinv(sparse complex matrix,...)
inv(sparse matrix,...)->spinv(sparse matrix,...)
Therefore "which -all inv" for me should return
/opt/octave-2.9/libexec/octave/2.9.3/site/oct/i686-pc-linux-gnu/octave-forge/ginv.oct
# galois
/opt/octave-2.9/libexec/octave/2.9.3/oct/i686-pc-linux-gnu/spinv.oct #
sparse bool matrix
/opt/octave-2.9/libexec/octave/2.9.3/oct/i686-pc-linux-gnu/spinv.oct #
sparse complex matrix
/opt/octave-2.9/libexec/octave/2.9.3/oct/i686-pc-linux-gnu/spinv.oct #
sparse matrix
inv is a built-in function
Its not clear to me the best way to treat that case....
I don't understand the subtleties, but unfortunately that doesn't stop
me from clogging up the mailing list with my comments:
To my way of thinking there are only three functions: ginv, spinv, and
inv. So I'd only output three lines:
/opt/octave-2.9/libexec/octave/2.9.3/site/oct/i686-pc-linux-gnu/octave-forge/ginv.oct
# galois
/opt/octave-2.9/libexec/octave/2.9.3/oct/i686-pc-linux-gnu/spinv.oct # sparse
inv is a built-in function # Shadowed
Here's the patented, copyrighted, and trademarked output of Matlab:
which -all inv
/usr/local/matlab/toolbox/matlab/matfun/@single/inv.bi % single method
/usr/local/matlab/toolbox/matlab/matfun/@double/inv.bi % double method
/usr/local/matlab/toolbox/matlab/matfun/inv.m % Shadowed
(on my screen the %'s are lined up)