Re: cmset_op question (Craig) [message #38320] |
Thu, 04 March 2004 01:57  |
Craig Markwardt
Messages: 1869 Registered: November 1996
|
Senior Member |
|
|
jbattat@cfa.harvard.edu (James) writes:
> IDL> print, cmset_op(b, 'and' b)
> 1 1
>
> cmset_op returns unique values in the case of an integer array but not
> in the case of a string array.
James, this is a bug. But it's only tickled when you use AND, and
each set has only one unique value, and when those values are equal
between sets. (I complain about RSI, but this is my own dog food
problem). And yes, some integer cases do not tickle the bug.
The fix is to find the following line:
if NOT keyword_set(not1) AND NOT keyword_set(not2) then begin
and add the following code just after it:
;; Special case: if there are one in each set, and
;; they are equal, then the SHIFT() technique below
;; fails. Do this one by hand.
if na EQ 1 AND nb EQ 1 AND uu(0) EQ uu(1) then begin
count = 1L
if kind then return, 0L
return, [uu(0)]
endif
Craig
--
------------------------------------------------------------ --------------
Craig B. Markwardt, Ph.D. EMAIL: craigmnet@REMOVEcow.physics.wisc.edu
Astrophysics, IDL, Finance, Derivatives | Remove "net" for better response
------------------------------------------------------------ --------------
|
|
|