Created DoubleMatrix

This commit is contained in:
2022-02-07 22:32:31 +00:00
parent c02f2415c3
commit a4d419c1ab

View File

@@ -115,7 +115,7 @@ public class TestIntegerMatrix{
@Test
public void testEquals(){
//1x1;
//1x1
IntegerMatrix matrix = new IntegerMatrix(grid1);
assertTrue("IntegerMatrix 1x1 failed equals IntegerMatrix", matrix.equals(matrix));
@SuppressWarnings("unlikely-arg-type")
@@ -232,9 +232,8 @@ public class TestIntegerMatrix{
//1x1
//Set
IntegerMatrix matrix = new IntegerMatrix(grid1);
IntegerMatrix correctMatrix = null;
matrix.set(0, 0, 2);
correctMatrix = new IntegerMatrix(new int[][]{{2}});
IntegerMatrix correctMatrix = new IntegerMatrix(new int[][]{{2}});
assertEquals("IntegerMatrix 1x1 failed set", correctMatrix, matrix);
//SetRow
matrix.setRow(0, new int[]{0});
@@ -381,9 +380,8 @@ public class TestIntegerMatrix{
//1x1
//AddRow
IntegerMatrix matrix = new IntegerMatrix(grid1);
IntegerMatrix correctMatrix = null;
matrix.addRow(new int[]{1});
correctMatrix = new IntegerMatrix(new int[][]{{1}, {1}});
IntegerMatrix correctMatrix = new IntegerMatrix(new int[][]{{1}, {1}});
assertEquals("IntegerMatrix 1x1 failed addRow", correctMatrix, matrix);
//AddColumn
matrix = new IntegerMatrix(grid1);
@@ -400,7 +398,7 @@ public class TestIntegerMatrix{
{1, 2},
{1, 2}
});
assertEquals("IntegerMatrix 2x2 failed set row", correctMatrix, matrix);
assertEquals("IntegerMatrix 2x2 failed addRow", correctMatrix, matrix);
//AddColumn
matrix = new IntegerMatrix(grid2);
matrix.addCol(new int[]{3, 3});
@@ -408,7 +406,7 @@ public class TestIntegerMatrix{
{1, 2, 3},
{1, 2, 3}
});
assertEquals("IntegerMatrix 2x2 failed set row", correctMatrix, matrix);
assertEquals("IntegerMatrix 2x2 failed addCol", correctMatrix, matrix);
//3x3
//AddRow