[0.5.2] element-wise multiplication (missing implicit operator)

129 views
Skip to first unread message

Nathan Murthy

unread,
Oct 30, 2013, 4:55:22 PM10/30/13
to scala-...@googlegroups.com
Hi David, et al.-

Do you see something wrong with how I'm expressing element-wise multiplication:

scala> import breeze.linalg._
import breeze.linalg._

scala> val m=DenseMatrix.rand(5,5);
m: breeze.linalg.DenseMatrix[Double] = 
0.24395858378801394  0.8354351130929839   0.05721813398970854  ... (5 total)
0.16046192824759975  0.54572535556644     0.08009458959788163  ...
0.13265266067188985  0.46300840713797176  0.36120544029978274  ...
0.22215306459838802  0.9562013067067475   0.6623151362850127   ...
0.2782197377430293   0.6574073533001343   0.9185751338706425   ...

scala> m :* 2
<console>:12: error: could not find implicit value for parameter op: breeze.linalg.operators.BinaryOp[breeze.linalg.DenseMatrix[Double],Int,breeze.linalg.operators.OpMulScalar,That]
              m :* 2
                ^

Regards,
Nahan

David Hall

unread,
Oct 30, 2013, 4:56:34 PM10/30/13
to scala-...@googlegroups.com
You have to use matched types (for now):

m :* 2.0

One day I'll get to that, but for now...

-- David
> --
> 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...@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/744d83ce-8170-4986-8423-5264e5802295%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.

Nathan Murthy

unread,
Oct 30, 2013, 5:14:08 PM10/30/13
to scala-...@googlegroups.com, dl...@cs.berkeley.edu
Ahh ok. Thanks again.
Reply all
Reply to author
Forward
0 new messages