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

Home » Public Forums » archive » Re: intersection of 2 arrays
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: intersection of 2 arrays [message #19647] Mon, 10 April 2000 00:00 Go to previous message
Craig Markwardt is currently offline  Craig Markwardt
Messages: 1869
Registered: November 1996
Senior Member
dmarshall@ivory.trentu.ca writes:
> I never seem to have the problem at the time when it is being discussed
> here since I remember something about this in the past.
>
> I have 2 arrays and would like a 3rd that contains the set intersection of
> the 2. Each element in each is unique.
>
> This seems like a basic function but after searching in help, etc. I didn't
> come up with an elegant solution. Maybe its too basic and I should know it?

There was an extensive discussion here on this newsgroup a week or two
ago that you should be able to find on www.deja.com. It got pretty
technical if that's what you want.

For integers with small dynamic range, then the SET_OPERATIONS that
David refers to should be fine.

If you want a canned solution, you might consider using the CMSET_OP
from here:

http://cow.physics.wisc.edu/~craigm/idl/idl.html

It handles other data types, including FLOAT and STRING. It performs
set union, intersect, and exclusive-or, and also negation (e.g. NOT A
AND B)

Craig

--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@cow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
[Message index]
 
Read Message
Read Message
Previous Topic: Re: botton size ?
Next Topic: botton size ?

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

Current Time: Fri Oct 10 20:57:05 PDT 2025

Total time taken to generate the page: 0.48351 seconds