Matrix multiplication: Difference between revisions
m
→{{header|J}}: lang tags, use mp instead of x to prevent confusion with x used as argument later
m (alphabetize TI-*) |
m (→{{header|J}}: lang tags, use mp instead of x to prevent confusion with x used as argument later) |
||
Line 609:
=={{header|J}}==
Matrix multiply in J is just <
<lang j>
A =: ^/~>:i. 4 NB. Same A as in other examples (1 1 1 1, 2 4 8 16, 3 9 27 81,:4 16 64 256)▼
B =: %.A NB. Matrix inverse of A▼
'6.2' 8!:2 A x B▼
1.00 0.00 0.00 0.00▼
0.00 1.00 0.00 0.00▼
0.00 0.00 1.00 0.00▼
0.00 0.00 0.00 1.00▼
</lang>
The notation is for a generalized inner product so that
<lang j>
x + / .= y NB. number of places where each row of x equals vector y
</lang>
etc.
|