Github user vrilleup commented on a diff in the pull request:

    https://github.com/apache/spark/pull/964#discussion_r13418117
  
    --- Diff: 
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala 
---
    @@ -201,6 +201,19 @@ class RowMatrix(
       }
     
       /**
    +   * Multiply the Gramian matrix `A^T A` by a Vector on the right.
    +   *
    +   * @param v a local vector whose length must match the number of columns 
of this matrix
    +   * @return a local DenseVector representing the product
    +   */
    +  private[mllib] def multiplyGramianMatrix(v: Vector): Vector = {
    +    val bv = rows.map{
    +      row => row.toBreeze * row.toBreeze.dot(v.toBreeze)
    --- End diff --
    
    changed to use aggregrate and axpy (from breeze). There are still some 
boxing/unboxing overhead from/to breeze objects. I can further improve if 
needed. 


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---

Reply via email to