Hi all! Bitmap version of comb. Unfortunately handles sets of max 63 items.
I tried to make a general version, but hit the problem with #: . ts'5 combbit 10' 3.37831e_5 20864 ts'5 combbool 10' 3.89148e_5 22400 ts'5 combREBoss 10' 5.51649e_5 44416 ts'5 comb 10' 3.76319e_5 50944 ts'13 combbit 26' 0.44835 8.03039e8 ts'13 combbool 26' 0.880373 1.4314e9 ts'13 combREBoss 26' 2.39319 4.22297e9 ts'13 comb 26' 2.59969 4.41693e9 ts'60 combbit 63' 0.00416474 5.26221e6 ts'60 combbool 63' 0.0534253 1.73281e7 ts'60 combREBoss 63' 0.0344776 6.81943e7 ts'60 comb 63' 0.310994 1.38554e8 combbit=: 4 : 0 assert y<:<:##:_1 (32 b.) 1 lshift=.33 b. or=.23 b. k=.<"0 (y->:i.>:d=:y-x)lshift 1 z=. (d$<i.0),<0 for. i.x do. z=. k (or)&.> ,&.>/\. (_1&lshift)&.> z end. #: ;z ) Cheers, Erling Hellenäs ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
