Skip to content

Commit feb32a7

Browse files
committed
update tests
1 parent e1d3ee8 commit feb32a7

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

mllib/src/test/scala/org/apache/spark/mllib/linalg/distributed/BlockMatrixSuite.scala

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,19 +33,18 @@ class BlockMatrixSuite extends FunSuite with MLlibTestSparkContext {
3333
val colPerPart = 2
3434
val numPartitions = 3
3535
var gridBasedMat: BlockMatrix = _
36-
type SubMatrix = ((Int, Int), Matrix)
3736

3837
override def beforeAll() {
3938
super.beforeAll()
4039

41-
val entries: Seq[SubMatrix] = Seq(
42-
new SubMatrix((0, 0), new DenseMatrix(2, 2, Array(1.0, 0.0, 0.0, 2.0))),
43-
new SubMatrix((0, 1), new DenseMatrix(2, 2, Array(0.0, 1.0, 0.0, 0.0))),
44-
new SubMatrix((1, 0), new DenseMatrix(2, 2, Array(3.0, 0.0, 1.0, 1.0))),
45-
new SubMatrix((1, 1), new DenseMatrix(2, 2, Array(1.0, 2.0, 0.0, 1.0))),
46-
new SubMatrix((2, 1), new DenseMatrix(1, 2, Array(1.0, 5.0))))
40+
val blocks: Seq[((Int, Int), Matrix)] = Seq(
41+
((0, 0), new DenseMatrix(2, 2, Array(1.0, 0.0, 0.0, 2.0))),
42+
((0, 1), new DenseMatrix(2, 2, Array(0.0, 1.0, 0.0, 0.0))),
43+
((1, 0), new DenseMatrix(2, 2, Array(3.0, 0.0, 1.0, 1.0))),
44+
((1, 1), new DenseMatrix(2, 2, Array(1.0, 2.0, 0.0, 1.0))),
45+
((2, 1), new DenseMatrix(1, 2, Array(1.0, 5.0))))
4746

48-
gridBasedMat = new BlockMatrix(sc.parallelize(entries, numPartitions), rowPerPart, colPerPart)
47+
gridBasedMat = new BlockMatrix(sc.parallelize(blocks, numPartitions), rowPerPart, colPerPart)
4948
}
5049

5150
test("size") {

0 commit comments

Comments
 (0)