Skip to content

Commit

Permalink
use specialized axpy in RowMatrix
Browse files Browse the repository at this point in the history
  • Loading branch information
Li Pu committed Jul 11, 2014
1 parent 5255f2a commit 6fb01a3
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,13 @@ class RowMatrix(
seqOp = (U, r) => {
val rBrz = r.toBreeze
val a = rBrz.dot(vbr.value)
brzAxpy(a, rBrz, U.asInstanceOf[BV[Double]])
rBrz match {
// use specialized axpy for better performance
case _: BDV[_] => brzAxpy(a, rBrz.asInstanceOf[BDV[Double]], U)
case _: BSV[_] => brzAxpy(a, rBrz.asInstanceOf[BSV[Double]], U)
case _ => throw new UnsupportedOperationException(
s"Do not support vector operation from type ${rBrz.getClass.getName}.")
}
U
},
combOp = (U1, U2) => U1 += U2
Expand Down

0 comments on commit 6fb01a3

Please sign in to comment.