Scala Breeze DenseVector Implicit failure

落花浮王杯 提交于 2019-12-25 03:24:24

问题


I've started getting this strange error; completely not sure what caused it - maybe a Maven rebuild. I can't explain this behavior... sometimes it works in IntelliJ, sometimes it doesn't, and it is failing when I run it from a jar file.

This is the runtime error:

java.lang.NoSuchMethodError: breeze.linalg.DenseVector$.canScaleD()Lbreeze/linalg/operators/BinaryOp

and it occurs in this code:

import breeze.linalg._
import breeze.linalg.DenseVector._
var planeNormal = DenseVector.zeros[Double](39)
weights.zip(vectors).foreach case(w: Double, vector: DenseVector[Double]) =>
    planeNormal :+= (vector :* w)
}

in the vector :* w function call.

Anyone have any ideas about what might be wrong?

I suspect its some version mismatch but no clue where to look to fix it; I'm using this breeze-math package

<groupId>org.scalanlp</groupId>
<artifactId>breeze-math_2.10</artifactId>
<version>0.4</version>

and scala

<groupId>org.scala-lang</groupId>
<artifactId>scala-library</artifactId>
<version>2.10.3</version>

回答1:


You're using a really, really old version of Breeze. Please use 0.8.1 (Artifact id is just breeze_2.10 now)



来源:https://stackoverflow.com/questions/24517203/scala-breeze-densevector-implicit-failure

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!