comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: What is the algorithms of sort function and where function?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: What is the algorithms of sort function and where function? [message #48161] Thu, 30 March 2006 17:14 Go to previous message
Michael Galloy is currently offline  Michael Galloy
Messages: 1114
Registered: April 2006
Senior Member
kuyper@wizard.net wrote:
> Daegal wrote:
>> Hi, IDLers~
>>
>> I want to know the algorithm which is used in sort and where.
>> How much fast is that functions comparing with C and Fortran functions
>> if there are similar functions in C and Fortran even if I don't know
>> that language at all.
>
> I can't answer your main question, nor the implied side issue about
> Fortran. However, I can tell you about C. The C standard library does
> contain a sorting function, called qsort(). It's name is derived from
> the QuickSort algorithm. but the standard does not require that it
> actually use that algorithm. QuickSort is not an especially
> sophisticated algorithm, but there are algorithms that are a lot
> slower, and in theory you have no guarantee that qsort() doesn't use
> one of those slower algorithms. In practice, of course, you can
> reasonably expect that it does used the QuickSort algorithm.
>
> I gather that much of IDL's source code is written in C; the SORT
> routine might use qsort().
>

Remember there isn't much "algorithm" to WHERE -- it just finds the
indices of the elements which aren't zero.

SORT uses underlying system sorting routine and can be slightly
different on the various platforms.

-Mike
[Message index]
 
Read Message
Read Message
Previous Topic: CONTOUR & TRIGRID/TRIANGULATE
Next Topic: Optimization help

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 10:53:19 PDT 2025

Total time taken to generate the page: 0.72081 seconds