RosettaCodeData/Task/Matrix-multiplication/J/matrix-multiplication-2.j

4 lines
246 B
Plaintext

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