Skip to content

Commit 6e67020

Browse files
committed
TST: Test using Array conversion instead of equals
1 parent 7fa7a2c commit 6e67020

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

mllib/src/main/scala/org/apache/spark/mllib/linalg/Matrices.scala

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -519,13 +519,6 @@ class SparseMatrix(
519519
}
520520
}
521521

522-
override def equals(o: Any) = o match {
523-
case m: SparseMatrix =>
524-
(m.numRows == numRows && m.numCols == numCols && Arrays.equals(colPtrs, m.colPtrs)
525-
&& Arrays.equals(rowIndices, m.rowIndices) && Arrays.equals(values, m.values))
526-
case _ => false
527-
}
528-
529522
override def copy = new SparseMatrix(numRows, numCols, colPtrs, rowIndices, values.clone())
530523

531524
private[mllib] def map(f: Double => Double) =

mllib/src/test/scala/org/apache/spark/mllib/linalg/MatricesSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -432,7 +432,7 @@ class MatricesSuite extends FunSuite {
432432
val sm2 = dm2.toSparse
433433
val mUDT = new MatrixUDT()
434434
Seq(dm1, dm2, sm1, sm2).foreach {
435-
mat => assert(mat === mUDT.deserialize(mUDT.serialize(mat)))
435+
mat => assert(mat.toArray === mUDT.deserialize(mUDT.serialize(mat)).toArray)
436436
}
437437
}
438438
}

0 commit comments

Comments
 (0)