How much of an improvement can be expected
from having special code for [EMAIL PROTECTED] f/. ] ?
x=: 1+1e4 [EMAIL PROTECTED] 100
y=: t {~ (+/x) [EMAIL PROTECTED] #t=. 'barack obama'
b=: (i.#y) e. +/\0,x
(b <;.1 y) -: (I.x) </. y
1
ts=: 6!:2 , 7!:[EMAIL PROTECTED]
ts '(I.x) </.y'
0.0742407 1.09751e7
ts 'b <;.1 y'
0.00322862 1.47226e6
0.0742407 1.09751e7 % 0.00322862 1.47226e6
22.9946 7.45459
Factor of 23 in time; factor of 7 in space.
Pretty clear cut.
----- Original Message -----
From: Roger Hui <[EMAIL PROTECTED]>
Date: Wednesday, November 5, 2008 7:20
Subject: Re: [Jprogramming] cut on length
To: Programming forum <[email protected]>
> I believe Dan Bron had previously proposed that I.
> should be invertible. Founders on exactly the
> problem that you described.
>
> One way to speed up (I.x) </.y is to have special
> code for [EMAIL PROTECTED] f/. ] .
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm