Set Intersection Code [message #68473] |
Mon, 02 November 2009 05:54 |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
Folks,
I have often made use of the set operation code that was
originally supplied by RSI engineers to this newsgroup and
made available on this web page:
http://www.dfanning.com/tips/set_operations.html
Over the weekend I decided to formalize the SetIntersection
code because I find myself using it over and over again,
and because the original code lacked error handling and
parameter checking.
So, of course, my first e-mail this morning is from Maatin
Sneep pointing out the obvious bug in the program: it doesn't
work when both sets of integers are negative. Well, sure
enough. And the error was in the original code and missed
all these years, probably because I always obtained my
integer sets from the WHERE function.
In any case, I have now corrected both my new SetIntersection
code and the code on the original web page. If any of you,
like me, have used this code in the past, you might want to
get the update.
http://www.dfanning.com/programs/setintersection.pro
Cheers,
David
P.S. Craig Markwardt has code that does something like this, too.
I haven't checked, but think I can say with 100% confidence that
that code *never* had any bugs in it. ;-)
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|