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

    https://github.com/apache/spark/pull/3319#discussion_r22063271
  
    --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala 
---
    @@ -256,72 +524,297 @@ object Matrices {
        * Generate a `DenseMatrix` consisting of zeros.
        * @param numRows number of rows of the matrix
        * @param numCols number of columns of the matrix
    -   * @return `DenseMatrix` with size `numRows` x `numCols` and values of 
zeros
    +   * @return `Matrix` with size `numRows` x `numCols` and values of zeros
        */
    -  def zeros(numRows: Int, numCols: Int): Matrix =
    -    new DenseMatrix(numRows, numCols, new Array[Double](numRows * numCols))
    +  def zeros(numRows: Int, numCols: Int): Matrix = 
DenseMatrix.zeros(numRows, numCols)
    --- End diff --
    
    I see your point. The reason we didn't return the exact type in `Vectors` 
and `Matrices` was because RDD is not covariant. But maybe we should return the 
exact types that and let algorithms take a generic `RDD[T]` with `T` extending 
`Vector`.


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

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to