Combinations don't have to be in the Same  order.

(3 combbitub 5)-:|.3 bitcomb 5
1

Linda

Get Outlook for Android<https://aka.ms/ghei36>




From: Programming <[email protected]> on behalf of Raul 
Miller <[email protected]>
Sent: Saturday, November 11, 2017 11:31:32 AM
To: [email protected]
Subject: Re: [Jprogramming] K-sets - bitmap representation of sets. WAS: 
Partitions

No,

That would be comb, not combbool, nor combbit.

Thanks,

--
Raul

On Saturday, November 11, 2017, Arie Groeneveld <[email protected]>
wrote:

>    (comb -: combbit)/60 63
> 0
>
>    (comb -: combbool)/60 63
> 0
>
> To make the output of combbit (and combbool) comparable with the other
> combination verbs I advise a small addition in your code:
>
> e.g. (see last line):
>
> 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.
> I. #: ;z
> )
>
> regards,
>
> Arie
>
>
> Op 10-11-17 om 12:46 schreef Erling Hellenäs:
>
>> 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
>>
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to