Do you avoid monadic #: for some reason?

   a=: 1e6 ?@$ 256

   ts '2 2 2 2 2 2 2 2 #: a'
0.241633 6.71107e7
   ts '#: a'
0.0183598 8.38989e6





On Wed, Sep 11, 2013 at 6:56 PM, Pascal Jasmin <[email protected]>wrote:

> I noticed that there is no special code for any of the following: (J7-64)
>
>    a =. ? 1e6 # 256
>    ts '2 2 2 2 2 2 2 2 #: a'
>
> 0.124369 6.71107e7
>    ts '4 2 4 2 4 2 #: a'
> 0.0943141 6.71105e7
>    a2 =.? 1e6 # 256^2
>    ts '8 8 4 2 4 2 4 2 #: a2'
> 0.144685 6.71107e7
>    a3 =.? 1e6 # 1-~256^4
>    a2 =.? 1e6 # 1-~256^2
>    ts '8 8 4 2 4 2 4 2 #: a2'
> 0.141351 6.71107e7
>    ts '256 256 8 8 4 2 4 2 4 2 #: a3'
> 0.247149 1.3422e8
>
>    ts '512 512 128 128 #: a3'
> 0.0837122 3.35561e7
>    ts '256 256 256 256 #: a3'
> 0.0805493 3.35561e7
>
> Is there a way to do bit unpacking more efficiently (space wise)?  I
> notice the huffman encoding lab is faster and smaller even though it seems
> to be doing much more work.
>
>  t=: 'the quick brown fox jumps over the lazy dog '
>
>  x=: 1e6 $ t
>
>
>    ts 'HA hencode x'
> 0.0267345 1.67822e7
>    ts 'SB hdecode y'
> 0.0491284 1.78308e7
> ----------------------------------------------------------------------
> 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