Skip to content

Instantly share code, notes, and snippets.

@FRosner
Created April 14, 2018 18:19
Show Gist options
  • Save FRosner/726310b78d8f409c794421eb478450ae to your computer and use it in GitHub Desktop.
Save FRosner/726310b78d8f409c794421eb478450ae to your computer and use it in GitHub Desktop.
def mult1(m1: Array[Array[Double]],
m2: Array[Array[Double]],
size: Int): Array[Array[Double]] = {
var res = Array.fill(size)(new Array[Double](size))
var i = 0
while (i < size) {
var j = 0
while (j < size) {
var k = 0
while (k < size) {
res(i)(j) += m1(i)(k) * m2(k)(j)
k += 1
}
j += 1
}
i += 1
}
res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment