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

16 lines
312 B
Text
Raw Permalink Normal View History

2013-04-10 21:29:02 -07:00
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)
2014-04-02 16:56:35 +00:00
2013-04-10 21:29:02 -07:00
return c
}