A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
10
Task/Matrix-multiplication/J/matrix-multiplication-1.j
Normal file
10
Task/Matrix-multiplication/J/matrix-multiplication-1.j
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
mp =: +/ .* NB. Matrix product
|
||||
|
||||
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 mp 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
|
||||
3
Task/Matrix-multiplication/J/matrix-multiplication-2.j
Normal file
3
Task/Matrix-multiplication/J/matrix-multiplication-2.j
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
x ~:/ .*. y NB. boolean inner product ( ~: is "not equal" (exclusive or) and *. is "and")
|
||||
x *./ .= y NB. which rows of x are the same as vector y?
|
||||
x + / .= y NB. number of places where a value in row x equals the corresponding value in y
|
||||
Loading…
Add table
Add a link
Reference in a new issue