x=1..6$2:3;
y=1 2 3;
x dot y;
x=1..6$2:3;
y=6..1$3:2;
x**y;
y**x;
| #0 |
#1 |
#2 |
| 12 |
30 |
48 |
| 9 |
23 |
37 |
| 6 |
16 |
26 |
a=1 2 3;
shape a;
// output
3:1
x**a;
b=1 2;
shape b;
// output
2:1
b**x;
// for a matrix multiplication between a matrix and a vector, the system may rotate the dimension of the vector for the multiplication to go through.
x=1 2 3;
y=4 5 6;
x ** y;
// output
32
// inner product of two vectors. Equivalent to 1*4 + 2*5 + 3*6
x ** 2;
// output
[2,4,6]
x=1..6$2:3
x ** 2;
// output
Use * rather than ** for scalar and matrix multiplication.