[SciPy-User] get best few of many: argsort( few= ) using std::partial_sort ?
Charles R Harris
charlesr.harris at gmail.com
Fri Jul 9 11:46:37 EDT 2010
On Fri, Jul 9, 2010 at 8:33 AM, denis <denis-bz-gg at t-online.de> wrote:
> Folks,
> you've probably seen http://www.sgi.com/tech/stl/partial_sort.html
> --
> sort uses the introsort algorithm and partial_sort uses heapsort
> introsort is usually faster by a factor of 2 to 5
>
>
Sounds like partial_sort just sets up the heap and then pulls off the needed
elements. That would make it about twice as fast as the normal heapsort for
a small number of values, or about the same as a full quicksort.
> Heapsort fans: the normal pivot selector (without medians) is blind;
> trying for a pivot near a small k/n percentile is fun.
>
>
You mean quicksort?
> Any comments on argsort( few= ) vs a separate partial_sort() ?
>
>
Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.scipy.org/pipermail/scipy-user/attachments/20100709/9dd31335/attachment.html>
More information about the SciPy-User
mailing list