hi all,

I'm thinking about taking over the maintenance of the miscellaneous
package. Scanning through the functions, I found several of them that
seem more or less redundant and I'm thinking of removing them. A list
follows. I also grepped for all usages of each function throughout
OctaveForge.

inz:
Trivial wrapper over find(). Contrary to the name (indices of
non-zeros), the indices are not actually returned as the first
argument.
used: nowhere.

nze:
Likewise trivial. Basically this is an equivalent of inz.
used: vrml

grep:
Likewise. Exact equivalent to nze.
used: nowhere

I think we should either remove "grep" and "inz" and leave just nze,
or remove all three.

slurp_file:
Superseded by fileread in Octave core, combined with file_in_loadpath.
slurp_file is also very inefficient, launching an external process for
the operation.
used: vrml

apply:
Can be replaced by cellfun or just cs-list call. Slightly more wordy,
more efficient (sometimes much more).

apply (@func, arglist)       -->         func (arglist{:})
apply (func_list, arglist)    -->         cellfun (@feval, func_list,
arglist{:})

used: miscellaneous/map

map:
Can be replaced by vectorized operations or arrayfun. Much more efficient.

map (@vectorized_func, arg1, arg2, ...)    --> vectorized_func (arg1, arg2, ...)
map (@func, arg1, arg2, ...)    --> arrayfun (@func, arg1, arg2, ...)

map is also only working for 2D arguments.

used: nowhere

match:
Usually replaceable by cellfun or simple logical indexing. More
efficient, sometimes much more. More wordy only in the most general
cases.

match (@(x) x > 0, x)                                      -->  x(x > 0)
match (@(x) strcmp (x, 'Octave'), strlist)         -->  strlist
(strcmp (strlist, 'Octave')))
match (@func, array)                                      -->
array(cellfun (@func, array))

the difference is that match can convert nonscalar values to
true/false (like if statement), but that doesn't seem to be much use
to me.

csv2latex, xmlwrite:
OK, but probably could be in io.
used: nowhere

rotv, rotparams:
OK, but probably should be in linear-algebra or elsewhere.
used: vrml

what do you think?

-- 
RNDr. Jaroslav Hajek, PhD
computing expert & GNU Octave developer
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz

------------------------------------------------------------------------------
Download Intel® Parallel Studio Eval
Try the new software tools for yourself. Speed compiling, find bugs
proactively, and fine-tune applications for parallel performance.
See why Intel Parallel Studio got high marks during beta.
http://p.sf.net/sfu/intel-sw-dev
_______________________________________________
Octave-dev mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/octave-dev

Reply via email to