Skip to content

Commit

Permalink
[SPARK-4409] Incorporated mengxr's code
Browse files Browse the repository at this point in the history
  • Loading branch information
brkyvz committed Dec 24, 2014
1 parent 04c4829 commit b0354f6
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -448,11 +448,11 @@ object SparseMatrix {
// selection-rejection method
var idx = 0L
var numSelected = 0
var i = 0
var j = 0
val colPtrs = new Array[Int](numCols + 1)
val rowIndices = new Array[Int](nnz)
while (j < numCols && numSelected < nnz) {
var i = 0
while (i < numRows && numSelected < nnz) {
if (rng.nextDouble() < 1.0 * (nnz - numSelected) / (size - idx)) {
rowIndices(numSelected) = i
Expand Down

0 comments on commit b0354f6

Please sign in to comment.