Github user sethah commented on a diff in the pull request:
https://github.com/apache/spark/pull/15628#discussion_r86358529
--- Diff:
mllib-local/src/main/scala/org/apache/spark/ml/linalg/Matrices.scala ---
@@ -1076,4 +1240,15 @@ object Matrices {
SparseMatrix.fromCOO(numRows, numCols, entries)
}
}
+
+ private[ml] def getSparseSize(numActives: Long, numPtrs: Long): Long = {
+ // 8 * values.length + 4 * rowIndices.length + 4 * colPtrs.length + 8
+ 8 + 1
+ 12L * numActives + 4L * numPtrs + 17L
--- End diff --
I wondered how confusing this comment might be. Since `values.length ==
rowIndices.length == numActives`:
`8 * values.length + 4 * rowIndices.length = 8 * numActives + 4 *
numActives = 12 * numActives`
The comment is meant to show where each number comes from and the
implementation is meant to just be a condensed computation. But please let me
know if you think it's too confusing.
---
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]