A-M baby
This commit is contained in:
parent
764da6cbbb
commit
db842d013d
19005 changed files with 197040 additions and 7 deletions
20
Task/Matrix-multiplication/Frink/matrix-multiplication.frink
Normal file
20
Task/Matrix-multiplication/Frink/matrix-multiplication.frink
Normal file
|
|
@ -0,0 +1,20 @@
|
|||
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
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue