scalala/Scalala — Issue #41: Ambigious implicit BinaryUpdateOp
Author: afwlehmann
Created: 2012-01-01 18:49:19+00:00
State: open

Hi,

when updating matrix elements by means of scalar multiplication with Double (not with Int etc.), a slight hickup occurs:

```
scala> val foo = DenseMatrix.eye[Double](3)
foo: scalala.tensor.dense.DenseMatrix[Double] =
1.00000 0.00000 0.00000
0.00000 1.00000 0.00000
0.00000 0.00000 1.00000

scala> foo(1,::) *= 5.0
:37: error: ambiguous implicit values:
both object DenseVectorDMulDInto in object DenseVector of type object scalala.tensor.dense.DenseVector.DenseVectorDMulDInto
and method opUpdateTensorScalar in trait TensorImplicitsLevel1 of type [K, V1, V2, Op <: scalala.operators.OpType](implicit op: scalala.operators.BinaryOp[V1,V2,Op,V1], implicit s: scalala.scalar.Scalar[V2])scalala.operators.BinaryUpdateOp[scalala.tensor.mutable.Tensor[K,V1],V2,Op]
match expected type scalala.operators.BinaryUpdateOp[scalala.tensor.dense.DenseVectorRow[Double],Double,scalala.operators.OpMul]
foo(1,::) *= 5.0
```

whereas

```
scala> foo(1,::) *= 5
res3: scalala.tensor.dense.DenseVectorRow[Double] =
0.00000 5.00000 0.00000
```