Question

I can't get the dot function to compile with Breeze in Scala.

The following code :

val test = DenseMatrix((1.0,2.0))
val test2 = DenseMatrix((3.0),(4.0))
val test3 = test dot test2

gives me the following error :

could not find implicit value for parameter op: breeze.linalg.operators.BinaryOp[breeze.linalg.DenseMatrix[Double],breeze.linalg.DenseMatrix[Double],breeze.linalg.operators.OpMulInner,That]
val test3 = test dot test2
                 ^

I am using IntelliJ IDEA 13.0.2, scala-compiler:2.10.2, Breeze "0.7-SNAPSHOT"

Any idea on how to get the dot product working?

Was it helpful?

Solution

This is as intended. Dot product is for the inner product of two vectors. * is for shaped matrix multiplication, :* is for scalar multiplication.

OTHER TIPS

Looks like breeze documentation is out of date.

doing

a dot b

didn't worked for me. But doing

a * b

did it.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top