Github user mengxr commented on a diff in the pull request: https://github.com/apache/spark/pull/2294#discussion_r17255363 --- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala --- @@ -83,16 +263,36 @@ object Matrices { } /** + * Creates a column-majored sparse matrix in Compressed Column Storage (CCS) format. + * + * @param numRows number of rows + * @param numCols number of columns + * @param colPointers the index corresponding to the start of a new column + * @param rowIndices the row index of the entry + * @param values non-zero matrix entries in column major + */ + def sparse( + numRows: Int, + numCols: Int, + colPointers: Array[Int], + rowIndices: Array[Int], + values: Array[Double]): Matrix = { + new SparseMatrix(numRows, numCols, colPointers, rowIndices, values) + } + + /** * Creates a Matrix instance from a breeze matrix. * @param breeze a breeze matrix * @return a Matrix instance */ - private[mllib] def fromBreeze(breeze: BM[Double]): Matrix = { + private [mllib] def fromBreeze(breeze: BM[Double]): Matrix = { --- End diff -- remove the space
--- 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 infrastruct...@apache.org or file a JIRA ticket with INFRA. --- --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org