[Numpy-discussion] A faster median (Wirth's method)

Charles R Harris charlesr.harris@gmail....
Thu Sep 3 08:34:29 CDT 2009


On Thu, Sep 3, 2009 at 12:14 AM, Sturla Molden <sturla@molden.no> wrote:

> Chad Netzer skrev:
> > That's right, Robert. Basically, I meant doing a median on a square
> > (or rectangle) "view" of an array, without first having to ravel(),
> > thus generally saving a copy.  But actually, since my selection based
> > median overwrites the source array, it may not save a copy anyway.
> >
> Avoiding copies of timy buffers is futile optimization.
>
> QuickSelect is overkill for tiny buffers like common filter kernels.
> Insertion sort is fine.
>
>
Shell sort is nice for sizes in the awkward range.

Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.scipy.org/pipermail/numpy-discussion/attachments/20090903/28bb08d0/attachment.html 


More information about the NumPy-Discussion mailing list