I have the following code two multiply two random matrices of type DenseMatrix.
import breeze.linalg._
object multiply {
def main(args: Array[String]) {
var size = 128
var i = 0
var temp =0
var normal01 = breeze.stats.distributions.Gaussian(0, 1)
var mat1 = DenseMatrix.rand(size,size,normal01)
var mat2 = DenseMatrix.rand(size,size,normal01)
var start = System.currentTimeMillis()
var mat3 = mat1*mat2
var end = System.currentTimeMillis()
var duration = end-start
println("Duration: "+duration)
}
}
Which gives me the following result
Duration: 234
However when I append the same code after above 4 times to see the next durations on different input matrices, it turned out to be
Duration: 188
Duration: 0
Duration: 0
Duration: 16
Kindly let me know, what is the reason behind this?
--
You received this message because you are subscribed to the Google Groups "Scala Breeze" group.
To unsubscribe from this group and stop receiving emails from it, send an email to scala-breeze+unsubscribe@googlegroups.com.
To post to this group, send email to scala-...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/scala-breeze/cda91cfb-c339-45d6-81dc-ab1e93462142%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.