[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

*Subject*: Re: intersection of 2 arrays*From*: Craig Markwardt <craigmnet(at)cow.physics.wisc.edu>*Date*: 10 Apr 2000 10:49:02 -0500*Newsgroups*: comp.lang.idl-pvwave*Organization*: U. Wisc. Madison Physics -- Compact Objects*References*: <Fst1Bt.7Hy.A.ebony@news.trentu.ca>*Reply-To*: craigmnet(at)cow.physics.wisc.edu*Xref*: news.doit.wisc.edu comp.lang.idl-pvwave:19190

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 --------------------------------------------------------------------------

**References**:**intersection of 2 arrays***From:*dmarshall

- Prev by Date:
**Re: botton size ?** - Next by Date:
**Re: botton size ?** - Prev by thread:
**Re: intersection of 2 arrays** - Next by thread:
**botton size ?** - Index(es):