Skip to content

Commit

Permalink
fix SparseVector.toArray
Browse files Browse the repository at this point in the history
  • Loading branch information
mengxr committed Mar 23, 2014
1 parent 5eda0de commit 67b368d
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ class SparseVector(val n: Int, val indices: Array[Int], val values: Array[Double
override def toArray: Array[Double] = {
val data = new Array[Double](n)
var i = 0
while (i < n) {
val nnz = indices.length
while (i < nnz) {
data(indices(i)) = values(i)
i += 1
}
Expand Down

0 comments on commit 67b368d

Please sign in to comment.