We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 5255f2a commit 6fb01a3Copy full SHA for 6fb01a3
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala
@@ -214,7 +214,13 @@ class RowMatrix(
214
seqOp = (U, r) => {
215
val rBrz = r.toBreeze
216
val a = rBrz.dot(vbr.value)
217
- brzAxpy(a, rBrz, U.asInstanceOf[BV[Double]])
+ rBrz match {
218
+ // use specialized axpy for better performance
219
+ case _: BDV[_] => brzAxpy(a, rBrz.asInstanceOf[BDV[Double]], U)
220
+ case _: BSV[_] => brzAxpy(a, rBrz.asInstanceOf[BSV[Double]], U)
221
+ case _ => throw new UnsupportedOperationException(
222
+ s"Do not support vector operation from type ${rBrz.getClass.getName}.")
223
+ }
224
U
225
},
226
combOp = (U1, U2) => U1 += U2
0 commit comments