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

Home » Public Forums » archive » set difference, with duplicates
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
set difference, with duplicates [message #92702] Wed, 10 February 2016 12:03 Go to previous message
Russell[1] is currently offline  Russell[1]
Messages: 101
Registered: August 2011
Senior Member
Hi everyone...

I have two long-integer arrays, one of which contains duplicate entries, and I'd like to find the elements in a but not in b. For example:

a=[2,3,4,5,2,3,5,2,4,3,10,100]
b=[2,10]


I'd like set operator that computes a dif b, but preserves the duplicate entries (and order if possible) for a. For example,

c = set_difference(a,b)

and I would want

c=[3,4,5,3,5,4,3,100]

I'm aware of the Coyote's cgsetdifference, but that does not preserve duplicates (or I didn't realize the right set of options).

Any ideas? If it helps, the a-array may be very long 10^5 elements and the b array will be 10^3 elements. I also expect the values to be very high, but I can compress them to the lowest possible integer arrays.

Thanks for any advice,
Russell
[Message index]
 
Read Message
Read Message
Previous Topic: make_dll
Next Topic: Plot window from Function keeps changing

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

Current Time: Fri Oct 10 02:04:50 PDT 2025

Total time taken to generate the page: 0.16307 seconds