RosettaCodeData/Task/Matrix-multiplication/Frink/matrix-multiplication.frink

16 lines
312 B
Plaintext

matprod[a is array, b is array] :=
{
c = makeArray[[length[a], length[b@0]], 0]
a_row = length[a]-1
a_col = length[a@0]-1
b_col = length[b]-1
for row = 0 to a_row
for col = 0 to b_col
for inc = 0 to a_col
c@row@col = c@row@col + (a@row@inc * b@inc@col)
return c
}