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

Home » Public Forums » archive » Re: how to sort data based on other sorted data
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: how to sort data based on other sorted data [message #57973] Thu, 10 January 2008 12:51 Go to previous message
placebo is currently offline  placebo
Messages: 3
Registered: January 2008
Junior Member
> try Craig Markwardt's multisort
>
> http://astrog.physics.wisc.edu/~craigm/idl/arrays.html#MULTI SORT

Brian,

The multisort method works quite well.

I compared my "nested FOR loop method" to the MULTISORT method and
here are some comments:

As it stands now, my FOR loop procedure works with 3 columns, no more
no less. The MULTISORT method can take 1 to 9 columns. MULTISORT is
more robust, flexible, and user friendly. So, MULTISORT wins in this
category.

As far as runtime is concerned, I used SYSTIME at the beginning and
end of each routine to benchmark. I ran the program a couple of times
for each sorting routine. The benchmarks are listed below:

FOR loop runtimes (seconds):
0.078000069
0.077999830
0.062999964
0.078000069

MULTISORT runtimes (seconds):
0.094000101
0.092999935
0.108999970
0.094000101

As you can see, the FOR loop method is "slightly" faster than the
MULTISORT method.
Both routines sorted the same data set containing 931 lines of x,y,z
coordinates.
I performed the calculation on my HP WinXP (SP2) laptop with an Intel
T2050 and 1 gig ram.
As far as I am concerned, the robustness of MULTISORT definitely
outweighs the few milliseconds of lost time.

It would be interesting, however, to compare the benchmarks of larger
files and also files with more columns. My guess is MULTISORT would
eventually outperform my FOR loop if calculations involved 4 or more
columns, since each column requires you to nest an additional FOR loop
in my code.

If anyone is interested in pursuing this task, I'd be happy to post my
FOR loop for you guys to play with.

Thanks wlandsman for the MULTISORT tip!
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: How to Auto Insert IDL 7 Template
Next Topic: IDL Workbench Nits

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

Current Time: Fri Oct 10 13:37:22 PDT 2025

Total time taken to generate the page: 1.52057 seconds