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

Home » Public Forums » archive » Re: Vector comparison.
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: Vector comparison. [message #37064 is a reply to message #37063] Thu, 20 November 2003 02:19 Go to previous messageGo to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
Reimar Bauer <R.Bauer@fz-juelich.de> writes:
>>
>> Alas, Reimar, none of these gives the answer of [2,3,4,6]
>> that Mr. Hunter was looking for. :-)
>>
>> Cheers,
>>
>> David
>>
>> P.S. I know we are all busy, but maybe we should make
>> it a new rule that we all have to take a deep breath and
>> a stretch, then read the question TWICE before
>> posting an answer. :-)
>>
>
> Oh, yes you are right, I missed to post the right thing. As I started
> writing I thought I give a complete answer to all related topics.
>
>
>
> IDL> A=[0,1,3,3,3,6,7,9,9]
> IDL> B=[3,7]
> IDL> print,which_indices(a,b)

OK, now it's my turn to be nit-picky. The WHICH_INDICES routine uses
a brute force loop approach which was what the original poster was
trying to avoid.

I think that getting *all* matches without loops is a rather difficult
problem. The approach that I recommended separately involves a "fast"
intersection and then a "slow" rebuilding of a duplicates list. That
falls over too if the intersection result is large, but it should
always be about as fast as the brute force approach.

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: IDLWAVE takes over
Next Topic: Byte Swapping

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

Current Time: Wed Oct 08 19:57:13 PDT 2025

Total time taken to generate the page: 0.00460 seconds