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

Home » Public Forums » archive » Interesting property of sort
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: Interesting property of sort [message #54085 is a reply to message #53994] Wed, 16 May 2007 07:37 Go to previous messageGo to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
cmancone@ufl.edu writes:

> Ahhh... Bsort = bubble sort (duh!). I glanced at the code for bsort
> real fast, but I didn't look in depth. I thought it used the built in
> IDL sort routine and then added some code to force it to keep stuff in
> the proper order. I didn't realize it's a whole new implementation of
> a bubble sort. Do you happen to know what type of sort the built in
> idl sort routine implements?

Humm. Well, I haven't looked at it in a long time.
Looks to me like BSORT uses the IDL SORT command to
get the initial cut. (And I have NO idea what algorithm
is used for that. It is the standard OS SORT routine,
I'm sure.) Then, the equal "clumps" are processed to
put the values in the right order.

It looks like it uses a WHERE and SHIFT to find the
clumps of equal values. So there would be *some*
additional overhead. I guess it will depend on how
many overlaps you have.

If you were sorting integers, it might be faster to
use some kind of HISTOGRAM method, but this looks fine
to me as a general purpose sort of any data type.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: why I can't use the max memory available?
Next Topic: embedded formatting hell: x-bar meaning "mean of x"

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

Current Time: Fri Oct 10 05:44:25 PDT 2025

Total time taken to generate the page: 0.56203 seconds