Say I have the following Scala code. I am running Scala 2.11.8 and Breeze 0.13.
val a: DenseVector[Double] = DenseVector(1.1, 1.2, 1.3)
val b: DenseVector[Double] = DenseVector(1.1, 1.2, 1.3)
val v: DenseVector[Double] = zipValues(a, b) ((ai: Double, bi: Double) => ai + bi)
I get a type mismatch compilation error which gets translated to:
[error] /Users/luishreis/Documents/projects/scala/sbt/GA/src/main/scala/ga_class.scala:119: type mismatch;
[error] found : (Double, Double) => Double
[error] required: breeze.linalg.zipValues.Impl2[breeze.linalg.DenseVector[Double],breeze.linalg.DenseVector[Double],?]
[error] (which expands to) breeze.generic.UFunc.UImpl2[breeze.linalg.zipValues.type,breeze.linalg.DenseVector[Double],breeze.linalg.DenseVector[Double],?]
[error] val v: DenseVector[Double] = zipValues(a, b) ((ai: Double, bi: Double) => ai + bi)
I have tried with different types and such, but no success. Anyone care to shine a light on the inner workings of zipValue? Any help would be apreciated.