2

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?

Ward
  • 17,793
  • 4
  • 37
  • 53

2 Answers2

3

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

dlwh
  • 2,257
  • 11
  • 23
1

Looks like breeze documentation is out of date.

doing

a dot b

didn't worked for me. But doing

a * b

did it.