Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/4109#discussion_r23566429
--- Diff: mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala
---
@@ -92,6 +84,16 @@ sealed trait Matrix extends Serializable {
* backing array. For example, an operation such as addition or
subtraction will only be
* performed on the non-zero values in a `SparseMatrix`. */
private[mllib] def update(f: Double => Double): Matrix
+
+ /**
+ * Applies a function `f` to all the active elements of dense and sparse
matrix.
+ *
+ * @param f the function takes three parameters where the first two
parameters are the row
+ * and column indices respectively with the type `Int`, the
third parameter is
+ * the corresponding array index, and the final parameter is
the corresponding
--- End diff --
Why do we need the third argument? Should (row, col, value) be sufficient?
The meaning of the "array index" is not clear without exposing the underlying
storage. It might be better is the array index can be handled inside `f`.
---
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]