[SciPy-dev] Numerical Recipes (was tagging 0.7rc1 this weekend?)
Thouis (Ray) Jones
Tue Dec 16 14:41:43 CST 2008
On Tue, Dec 16, 2008 at 01:59, Jarrod Millman <firstname.lastname@example.org> wrote:
> 2. quickselect in scipy/signal/medianfilter.c
I looked at the NR code for select (2nd ed, page 342). It was perhaps
a little too close for comfort, but someone else might disagree.
I rewrote the select algorithm(s) from scratch, referring to the
Wikipedia page describing quickselect, and tested it against the
existing functions on a large number of random cases (small and large
buffers, all the same values, etc.). It is perhaps a little faster
than the current version. It's also written as a single macro that
expands for the float/double/byte cases, rather than replicating the
Someone should review this code, and if it looks good, I'll submit a
patch for medianfilter.c.
For 0.8, perhaps scipy should use a variant of constant time median
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
More information about the Scipy-dev