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 #32393 is a reply to message #32390] Fri, 04 October 2002 07:20 Go to previous messageGo to previous message
James Kuyper is currently offline  James Kuyper
Messages: 425
Registered: March 2000
Senior Member
Chia Chang wrote:
>
> "Dick Jackson" <dick@d-jackson.com> wrote in message news:<oj_m9.473388$f05.21183164@news1.calgary.shaw.ca>...
...
> I like the 'where' function, below is how I would
> implement it to solve your particular problem:
>
> ------------------start test.pro-------------------
> pro test
>
> time0 = systime(1)
>
> a = indgen(2,25)
> b = [4,5]
>
> ;########################################
> ; PERFORM COMPARISON
> ;########################################
> xloc = where (a(0,*) EQ b[0])
> yloc = where (a(1,*) EQ b[1])
>
> ;########################################
> ; RETURN RESULTS
> ;########################################
> if xloc EQ yloc then begin
> print, 2, xloc
> endif else begin
> print, "No Match"
> endelse

Unless I'm missing something, that doesn't handle correctly the
possibility that there might be multiple matches, much less the
possibility that there might be a different set of matches for xloc than
for yloc. Of course, that possibility doesn't arise in your test data,
but it doesn't seem to be ruled out by the original problem description.
[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 22:14:20 PDT 2025

Total time taken to generate the page: 0.80253 seconds