Skip to content

Instantly share code, notes, and snippets.

@piotrga
Created December 26, 2011 00:42
Show Gist options
  • Save piotrga/1520151 to your computer and use it in GitHub Desktop.
Save piotrga/1520151 to your computer and use it in GitHub Desktop.
singleThreadedMultiplication2
def singleThreadedMultiplication2(m1:Seq[Array[Double]], m2:Array[Array[Double]] ) ={
val res = Array.fill(m1.length, m2(0).length)(0.0)
for(row <- 0 until m1.length;
col <- 0 until m2(0).length;
i <- 0 until m1(0).length){
res(row)(col) += m1(row)(i) * m2(i)(col)
}
res
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment