[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
binary lookup
From: |
Jaroslav Hajek |
Subject: |
binary lookup |
Date: |
Thu, 13 Mar 2008 15:24:05 +0100 |
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
seqlookup.diff
Description: Text Data
bench_lookup.m
Description: Text Data
- binary lookup,
Jaroslav Hajek <=