1

Adendo: This seems to be a scala IDE bug because everythong compiles and run smoothly by using the command line sbt. I'd close the question, but StackOverflow won't allow

I am unable to sum or multiply a matrix by a scalar in Breeze
If I try:

val z = DenseMatrix.zeros[Double](5,3)
z + 2.0

I get two errors:

could not find implicit value for parameter op: breeze.linalg.operators.OpAdd.Impl2[breeze.linalg.DenseMatrix[Double],Double,That]
not enough arguments for method +: (implicit op: breeze.linalg.operators.OpAdd.Impl2[breeze.linalg.DenseMatrix[Double],Double,That])That. Unspecified value parameter op.

The same thing happens if I try * , :* , *: , :+ and +: with slightly different errors.
Things work if it is a DenseVector and not a DenseMatrix and I use :+ .
If I try it in scala IDE worksheet, it produces the error but correctly prints the resulting matrix. I'm using Scala IDE 4.4.1 , breeze 0.12 , scala 2.11.8

user2759511
  • 640
  • 7
  • 16
  • Hmm, works for me. What does your import statement look like? Are you using the `2.11` version of breeze? – evan.oman May 27 '16 at 21:30
  • I'm using import breeze.linalg._ in order to import and breeze 0.12. However your comment made me try to compile bypassing eclipse and it seems that it is a bug (I edited my question) , so the question is pointless – user2759511 May 30 '16 at 14:33
  • It is more likely that it is a configuration error rather than a Scala IDE bug. I would check your `build.sbt` file and make sure your project is setup properly. – evan.oman May 30 '16 at 19:01
  • Same problem. Scala 2.12. Works on SBT, won't work on Scala IDE. I don't know if is a configuration problem or a bug, but is annoying. – rsan Feb 14 '18 at 05:43

1 Answers1

0

If someone faces this problem. The solution is quite simple.

Step 1 Close the project or Scala IDE

Step 2 From SBT execute, clean and later on eclipse command.

Step 3 Open eclipse again.

Eclipse should resolve the implicit conversions.

rsan
  • 1,887
  • 2
  • 17
  • 23