Help / Release / J 5.01 / ,\ Improved

From J Wiki
Jump to navigation Jump to search


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



,\ Improved

initial writing: 2002-01-09
last updated: 2004-10-21


The dyad ,\ is now implemented by special code, resulting in time/space savings. For example:

   ] x=: 7 3$'abcdefghijklmnopqrstu'
abc
def
ghi
jkl
mno
pqr
stu
   4 <\ x
+---+---+---+---+
|abc|def|ghi|jkl|
|def|ghi|jkl|mno|
|ghi|jkl|mno|pqr|
|jkl|mno|pqr|stu|
+---+---+---+---+
   4 ,\ x
abcdefghijkl
defghijklmno
ghijklmnopqr
jklmnopqrstu

   ts=: 6!:2 , 7!:2@]
   ts 'm ,\x' [ x=: a.{~?(n,2 5)$#a.


m  n  J 5.01    J 4.06    Ratio
 
11  1e4    0.0060206   2.09798e6  0.0312325   2.36122e6  5.19   1.13
11  2e4  0.0124971   4.19514e6  0.0640936   4.72051e6  5.13   1.13
11  4e4  0.0241411   8.38944e6  0.1231724   9.43910e6  5.10   1.13
11  8e4  0.0484810   1.67780e7  0.2504760   1.88763e7  5.17   1.13
 
_11  1e5  0.0084807   1.04941e6  0.0768173   5.70387e6  9.06   5.44
_11  2e5  0.0177570   2.09798e6  0.1439705   1.14145e7  8.11   5.44
_11  4e5  0.0375444   4.19514e6  0.2959686   2.28273e7  7.88   5.44
_11  8e5  0.0752040   8.38944e6  0.6209876   4.56533e7  8.26   5.44




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