21 30 39
>
>5{.TST
>
> 0 1 2
>
> 3 4 5
>
> 6 7 8
>
> 9 10 11
>
> 12 13 14
>
>+/"1 5{.TST
>
> 3
>
>
>
> Linda
>
>
>
>
>
> -Original Message-
> From: [email protected]
21 30 39
>
>5{.TST
>
> 0 1 2
>
> 3 4 5
>
> 6 7 8
>
> 9 10 11
>
> 12 13 14
>
>+/"1 5{.TST
>
> 3
>
>
>
> Linda
>
>
>
>
>
> -Original Message-
> From: [email protected]
> [mailto:programm
9 10 11
12 13 14
+/"1 5{.TST
3
Linda
-Original Message-
From: [email protected]
[mailto:[email protected]] On Behalf Of Tikkanz
Sent: Friday, March 13, 2015 9:27 PM
To: Programming JForum
Subject: [Jprogramming] Perfor
> 10 timespacex '+/"1 TST'
> 0.0200154 1.67798e7
> 10 timespacex '+/@:|: TST'
> 0.0956639 8.38889e7
>
>
> ________
> From: Tikkanz
> To: Programming JForum
> Sent: Friday, March 13, 2015 9:26 PM
> Subject: [Jp
___
From: Tikkanz
To: Programming JForum
Sent: Friday, March 13, 2015 9:26 PM
Subject: [Jprogramming] Performance query
I noticed some interesting behaviour when trying to simplify a J sentence.
The simple J-like solution was slower than the more complex proscriptive
one.
Giv
Operations with + tend to be very heavily optimized. GCD does not share
many of these optimizations (although +. on binary arguments, e.g. "or",
does). I'm not surprised by the behavior you've shown, although I
wouldn't necessarily be able to predict it. The operation (+./"1) could
be sped up like
I noticed some interesting behaviour when trying to simplify a J sentence.
The simple J-like solution was slower than the more complex proscriptive
one.
Given an array:
TST=: i. 2e6 3
To sum the columns with each other (i.e. sum the rows), I can
a) extract each column and the lists together: