We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04c4829 commit b0354f6Copy full SHA for b0354f6
mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala
@@ -448,11 +448,11 @@ object SparseMatrix {
448
// selection-rejection method
449
var idx = 0L
450
var numSelected = 0
451
- var i = 0
452
var j = 0
453
val colPtrs = new Array[Int](numCols + 1)
454
val rowIndices = new Array[Int](nnz)
455
while (j < numCols && numSelected < nnz) {
+ var i = 0
456
while (i < numRows && numSelected < nnz) {
457
if (rng.nextDouble() < 1.0 * (nnz - numSelected) / (size - idx)) {
458
rowIndices(numSelected) = i
0 commit comments