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 #32385 is a reply to message #32380] Fri, 04 October 2002 10:21 Go to previous messageGo to previous message
tam is currently offline  tam
Messages: 48
Registered: February 2000
Member
Dick Jackson wrote:
> "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.
>

I guess I just assumed that "without splitting A" meant
without divvying things up in some kind of for loop.
Perhaps the original poster could be more explicit...
Always good to know the rules of the game!

Tom McGlynn
[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 05:47:46 PDT 2025

Total time taken to generate the page: 0.07790 seconds