Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
11
Task/Matrix-multiplication/F-Sharp/matrix-multiplication.fs
Normal file
11
Task/Matrix-multiplication/F-Sharp/matrix-multiplication.fs
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
let MatrixMultiply (matrix1 : _[,] , matrix2 : _[,]) =
|
||||
let result_row = (matrix1.GetLength 0)
|
||||
let result_column = (matrix2.GetLength 1)
|
||||
let ret = Array2D.create result_row result_column 0
|
||||
for x in 0 .. result_row - 1 do
|
||||
for y in 0 .. result_column - 1 do
|
||||
let mutable acc = 0
|
||||
for z in 0 .. (matrix1.GetLength 1) - 1 do
|
||||
acc <- acc + matrix1.[x,z] * matrix2.[z,y]
|
||||
ret.[x,y] <- acc
|
||||
ret
|
||||
Loading…
Add table
Add a link
Reference in a new issue