Preliminary benchmark:

f=: 256&|@>:&.(a.&i.)
g=: 256&|@:>:&.(a.&i.)
h=: 123&(22 b.)&.(a.&i.)

x=: a.{~1e6 [EMAIL PROTECTED] 256

ts=: 6!:2 , 7!:[EMAIL PROTECTED]

ts 'Expression'

Expression       J6.02                  J6.01             Ratio
f x         0.004869 1.05344e6     0.634145 9.43834e6   130.25  8.96
g x         0.004700 1.05344e6     0.061089 1.25841e7    13.01 11.95
h x         0.005483 1.05344e6     0.030379 9.43834e6     5.54  8.96



----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Wednesday, October 17, 2007 7:45
Subject: Re: [Jprogramming] extension to m b.
To: Programming forum <[email protected]>

> Special code for   u&.(a.&i.)   should prove 
> fruitful.  For example:
> 
>    a=: a.{~x=: 1e5 [EMAIL PROTECTED] 256
>    b=: a.{~y=: 1e5 [EMAIL PROTECTED] 256
> 
>    ts 'a 256&|@:+&.(a.&i.) b'
> 0.00533559 2.10118e6
>    ts 'x+y'
> 0.00140465 524864
> 
> I should have seen it when I did the special code 
> for   p {~ q i. ]   ,
> compared to which   u&.(a.&i.)   has the 
> advantage of being usable 
> for monads or dyads.
> 
> 
> 
> ----- Original Message -----
> From: Roger Hui <[EMAIL PROTECTED]>
> Date: Wednesday, October 3, 2007 9:45
> Subject: [Jprogramming] extension to m b.
> To: Programming forum <[email protected]>
> 
> > I propose to extend the bitwise operations   m 
> > b.   for   m e. 16+i.19
> > to work on character (8-bit or 16-bit) arguments. e.g.
> > 
> >    'abc' 23 b. '321'
> > srs
> >    ] x=:'dazlious','chthonic',:'patriots'
> > dazlious
> > chthonic
> > patriots
> >    22 b./ x
> > whzvonhc
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm

Reply via email to