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

Home » Public Forums » archive » Using value_locate with a non-monotonic vector! And it's working!??!
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Using value_locate with a non-monotonic vector! And it's working!??! [message #52076] Sat, 30 December 2006 22:03
cgguido is currently offline  cgguido
Messages: 195
Registered: August 2005
Senior Member
Hi all,

I am using value_locate on a unsorted vector and I am a little worried
because the IDL manual does not really say what happens in that case. I
would greatly appreciate your opinion and suggestions...

Say I have an unsorted vector of non-unique sparsely distributed
numbers a:

a=[4.3, 4.3, 2.1, 10000,2.1]

and I want to create a 1 to 1 map to a list of consecutive numbers that
indicate ranking...
What I do is:

b=a[uniq(a,sort(a))]
c=value_locate(b,a)
print, c
1 1 0 2 0

the variable c is exactly what I want in this case.

The arrays I am going to deal with are much longer (10x1e6 elements) so
i can't really check them...

I am just worried that by not using value_locate as the RSI/ITTVIS
people intended I might be getting my self into trouble.

Any advice?

Thanks,
Gianguido
[Message index]
 
Read Message
Previous Topic: Re: ENVI: procedure to get X, Y of pixel in displayed image
Next Topic: Re: Color Bar without using color table

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

Current Time: Fri Oct 10 10:53:11 PDT 2025

Total time taken to generate the page: 1.10416 seconds