4 ms·
It keeps going! 3 3 3 ⍴ ⍳10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7 8 9 10 1 2 3 4 5 6 7
by icen 7y ago
It keeps going!
3 3 3 ⍴ ⍳10
1 2 3
4 5 6
7 8 9
10 1 2
3 4 5
6 7 8
9 10 1
2 3 4
5 6 7
M ← 3 3 3 ⍴ ⍳10
M*M
1.00000E0 4.00000E0 2.70000E1
2.56000E2 3.12500E3 4.66560E4
8.23543E5 1.67772E7 3.87420E8
1.00000E10 1.00000E0 4.00000E0
2.70000E1 2.56000E2 3.12500E3
4.66560E4 8.23543E5 1.67772E7
3.87420E8 1.00000E10 1.00000E0
4.00000E0 2.70000E1 2.56000E2
3.12500E3 4.66560E4 8.23543E5
That's 3 nested 3x3 matrices, and we take the pointwise product of each of them with just the usual multiplication operator.
How many maps did you want?
- RodgerTheGreat 7y agoIncidentally this property is why most of the "translations" of APL expressions into another language you'll see online are cheating- they assume a specific rank for arguments and "bake in" an appropriate degree of mapping.
- bonzini 7y agoIsn't that a pointwise exponentiation (1^1, 2^2, 3^3, ...)?
- jodrellblank 7y agoYes it is; APL uses × for multiplication.