Github user mengxr commented on a diff in the pull request:
https://github.com/apache/spark/pull/5909#discussion_r35710508
--- Diff:
mllib/src/main/scala/org/apache/spark/mllib/linalg/distributed/RowMatrix.scala
---
@@ -498,6 +498,65 @@ class RowMatrix(
}
/**
+ * Compute QR decomposition for rowMatrix. The implementation is
designed to optimize the QR
+ * decomposition (factorizations) for the RowMatrix of a tall and skinny
shape, yet it applies
+ * to RowMatrix in general.
+ *
+ * Reference:
+ * Austin R. Benson, David F. Gleich, James Demmel. "Direct QR
factorizations for tall-and
+ * -skinny matrices in MapReduce architectures", 2013 IEEE
International Conference on Big Data
+ * @param computeQ: whether to computeQ, which is quite expensive.
+ * @return the decomposition result as (Option[Q], R), where Q is a
RowMatrix and R is Matrix.
+ */
+ def TSQR(computeQ: Boolean = false): (Option[RowMatrix], Matrix) = {
+ val col = numCols().toInt
+
+ // split rows horizontally into smaller matrices, and compute QR for
each of them
+ val blockQRs = rows.mapPartitions(rowsIterator =>{
--- End diff --
~~~scala
rows.glom().map { partRows =>
...
}
---
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]