Help / Release / J 5.03 / I. Implements Indices

From J Wiki
Jump to navigation Jump to search


>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release



I. Implements Indices

initial writing: 2003-07-19
last updated: 2004-10-21


The monad I. Indices has been implemented. See the dictionary for details.

The dyads I.@E. and I.@:comp and [: I. comp where comp is one of = ~: < <: > >: E. , are supported by special code, as are the monads I.@~:  I.@:~:  [: I. ~: . The following benchmarks demonstrate the improvements in time and space.

b =: 1e6  ?@$ 2
b6=: 1e6 6?@$ 2
c =: a.{~ 1e6   ?@$ 256
c6=: a.{~ 1e6 6 ?@$ 256
i =: 1e6   ?@$ 1e6
i2=: 1e6 2 ?@$ 1e6
j =: 1e6   ?@$ 1e6

I=: # i.@#          NB. simulation of I. in J 5.02

ts=: 6!:2 , 7!:2@]  NB. time and space
ts 'Expression'
Expression   J 5.03   J 5.02   Ratio
I.@~: b  0.0305983   8.960000e2 0.1150610   9.438208e6 3.7610533.71
I.@~: b6  0.2763175   1.258374e7 0.3406972   1.258419e7 1.23 1.00
I.@~: c  0.0307492   3.328000e3 0.1171241   9.440192e6 3.81 2836.60
I.@~: c6  0.5655238   1.258374e7 0.6674142   1.363270e7 1.18 1.08
I.@~: i  0.1818460   5.243648e6 0.3791596   1.363270e7 2.09 2.60
I.@~: i2  0.7648014   1.258381e7 0.8564440   1.363270e7 1.12 1.08
i I.@:> j 0.0605817   3.670976e6 0.0709286   3.147008e6 1.17 0.86



>> << Pri JfC LJ Phr Dic Voc !: Rel NuVoc wd Help Release