Merge pull request #91 from pklimai/more-tests

Fix tests
This commit is contained in:
Alexander Nozik 2020-05-06 20:02:59 +03:00 committed by GitHub
commit 7e31a98dc5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -126,10 +126,10 @@ class RealMatrixTest {
assertEquals(matrix1.appendColumn { it[0] }, matrix2) assertEquals(matrix1.appendColumn { it[0] }, matrix2)
assertEquals(matrix1.extractColumn(1), col1) assertEquals(matrix1.extractColumn(1), col1)
assertEquals(matrix1.extractColumns(1..2), cols1to2) assertEquals(matrix1.extractColumns(1..2), cols1to2)
assertEquals(matrix1.sumByColumn(), Matrix.build<Double>(4, 1)(3.0, -6.0, 10.0, 4.0)) assertEquals(matrix1.sumByColumn(), Matrix.build<Double>(1, 4)(3.0, -6.0, 10.0, 4.0))
assertEquals(matrix1.minByColumn(), Matrix.build<Double>(4, 1)(-1.0, -6.0, 3.0, -11.0)) assertEquals(matrix1.minByColumn(), Matrix.build<Double>(1, 4)(-1.0, -6.0, 3.0, -11.0))
assertEquals(matrix1.maxByColumn(), Matrix.build<Double>(4, 1)(4.0, 0.0, 7.0, 15.0)) assertEquals(matrix1.maxByColumn(), Matrix.build<Double>(1, 4)(4.0, 0.0, 7.0, 15.0))
assertEquals(matrix1.averageByColumn(), Matrix.build<Double>(4, 1)(1.5, -3.0, 5.0, 2.0)) assertEquals(matrix1.averageByColumn(), Matrix.build<Double>(1, 4)(1.5, -3.0, 5.0, 2.0))
} }
@Test @Test