Github user brkyvz commented on a diff in the pull request:
https://github.com/apache/spark/pull/3319#discussion_r22026283
--- 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 specifically don't want to mark them private, otherwise the user will
have to always write `.asInstanceOf[SparseMatrix]`. We could mark it
`private[mllib]` and still use them, but not having `.asInstanceOf` everywhere,
especially while writing tests on spark-shell is a very nice convenience.
---
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]