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

Home » Public Forums » archive » Re: Sorting (big) int array: Eliminate for loop
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: Sorting (big) int array: Eliminate for loop [message #68059 is a reply to message #68047] Mon, 21 September 2009 08:37 Go to previous messageGo to previous message
greg.addr is currently offline  greg.addr
Messages: 160
Registered: May 2007
Senior Member
How about this...

pro test
a=['I','E','F','D','A','J','C','B','G','H']
b=['E','B','I','J','D','A','C','H','F','G']

qa=sort(a)
qb=sort(b)
qa2=sort(qa)
elements=qb[qa2]

print,b[elements]
end

IDL> test
I E F D A J C B G H

Sorting the sorted indices is the trick. I think it's right, but it
makes my head hurt anyway.

regards,
Greg
[Message index]
 
Read Message
Read Message
Read Message
Previous Topic: Re: passing parameters to .sav file in IDL VM
Next Topic: Re: HDF: accessing VData in VGroup

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

Current Time: Fri Oct 10 05:46:16 PDT 2025

Total time taken to generate the page: 1.20186 seconds