Skip to content

Commit

Permalink
update test case
Browse files Browse the repository at this point in the history
  • Loading branch information
funes committed May 8, 2014
1 parent d129a66 commit 75dced3
Showing 1 changed file with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,15 +56,12 @@ class BreezeVectorConversionSuite extends FunSuite {
assert(vec.values.eq(values), "should not copy data")
}

test("sparse breeze by vector builder to vector") {
val builder = new BVB[Double](n)
for (i <- 0 until indices.length) {
builder.add(indices(i), values(i))
}
val breeze = builder.toSparseVector
test("sparse breeze with partially-used arrays to vector") {
val activeSize = 3
val breeze = new BSV[Double](indices, values, activeSize, n)
val vec = Vectors.fromBreeze(breeze).asInstanceOf[SparseVector]
assert(vec.size === n)
assert(vec.indices === indices)
assert(vec.values === values)
assert(vec.indices === indices.slice(0, activeSize))
assert(vec.values === values.slice(0, activeSize))
}
}

0 comments on commit 75dced3

Please sign in to comment.