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

Home » Public Forums » archive » Re: 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 #53990] Wed, 16 May 2007 06:40 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
hradilv writes:

> To add the obvious(?) - be careful if you try this with repeated
> values.
>
> test = [5,4,4,1,3,2]
> sortindex = sort(test)
> lookup = sort(sortindex)
> print, lookup[4]
> ; prints "2" [hey what about "1"]...

Yeah, better use BSORT for this. :-)

http://www.dfanning.com/tips/sort.html

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
Previous Topic: Re: Thicker points
Next Topic: Re: how to write a K with a hat symbol above

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

Current Time: Sat Oct 11 07:28:48 PDT 2025

Total time taken to generate the page: 1.03664 seconds