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

    https://github.com/apache/spark/pull/245#discussion_r11148578
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Vectors.scala 
---
    @@ -54,6 +54,12 @@ trait Vector extends Serializable {
        * Converts the instance to a breeze vector.
        */
       private[mllib] def toBreeze: BV[Double]
    +
    +  /**
    +   * Gets the value of the ith element.
    +   * @param i index
    +   */
    +  private[mllib] def apply(i: Int): Double = toBreeze(i)
    --- End diff --
    
    This seems like it may be too slow by default in SparseVector, maybe we 
want to override it there. (Actually even in DenseVector there's little point 
in allocating a new object). The question is whether this gets used a lot in 
inner loops, but it's the kind of method that might.


---
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