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

Home » Public Forums » archive » Re: Array comparison part 2
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: Array comparison part 2 [message #32390 is a reply to message #32385] Fri, 04 October 2002 08:46 Go to previous messageGo to previous message
Dick Jackson is currently offline  Dick Jackson
Messages: 347
Registered: August 1998
Senior Member
"Tom McGlynn" <tam@lheapop.gsfc.nasa.gov> wrote in message
news:3D9D9E8B.8060401@lheapop.gsfc.nasa.gov...
>
>
> Sean Raffuse wrote:
>> Thanks for all the help on my first question. I now have a related
>> question.
>>
>> What is the best (read: fastest) way to do the following:
>>
>> I have an array of coordinates, A = intarr(2,25)
>> and I have another array of a specific location, B = [125,1043]
>>
>> I would like to determine if location B is one of the coordinates in
A. I
>> need to know if A[*,?] = 125, 1043
>>
>> Is it possible to do this without splitting A?
>
> Just try
>
> w = where(b[0] eq a[0,*] and b[1] eq a[1,*])
>
> No need for anything complex here.
> Or perhaps it's too early in the morning and I'm missing something...

Of course, I was just solving the puzzle as given "without splitting A".
Yours is certainly a better solution overall.

Cheers,
--
-Dick

Dick Jackson / dick@d-jackson.com
D-Jackson Software Consulting / http://www.d-jackson.com
Calgary, Alberta, Canada / +1-403-242-7398 / Fax: 241-7392
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: IDL curve fitting program (correction)
Next Topic: Array Subscripting Memory Usage (watch out!)

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

Current Time: Sat Oct 11 14:11:22 PDT 2025

Total time taken to generate the page: 0.24189 seconds