binary lookup
Jaroslav Hajek
highegg at gmail.com
Thu Mar 13 09:24:05 CDT 2008
hello,
please consider applying the attached changeset. It implements a
generic sequential binary lookup (optimized for dense downsampling)
in liboctave/oct-lookup.h and wraps it in src/DLD-FUNCTIONS/lookup.cc
instead of the current scripts/general/lookup.m which is implemented
using sort. Also, the new lookup can search cell arrays of strings.
At least one more DEFUN can benefit from including the algorithm in
liboctave: DLD-FUNCTIONS/__lin_interpn__.cc. This is not part of this
changeset - I'll create it later if this one is accepted.
Also attached is the benchmark script I've used last time. With the
improved sort the results are less impressive; still, in the optimized
"dense downsampling" case there is an order of magnitude performance
improvement (at least on my system).
--
RNDr. Jaroslav Hajek
computing expert
Aeronautical Research and Test Institute (VZLU)
Prague, Czech Republic
url: www.highegg.matfyz.cz
-------------- next part --------------
A non-text attachment was scrubbed...
Name: seqlookup.diff
Type: text/x-patch
Size: 23529 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080313/0d6f0887/attachment-0002.bin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: bench_lookup.m
Type: text/x-objcsrc
Size: 474 bytes
Desc: not available
Url : https://www.cae.wisc.edu/pipermail/octave-maintainers/attachments/20080313/0d6f0887/attachment-0003.bin
More information about the Octave-maintainers
mailing list