Making sure matrices looks like matrices

This commit is contained in:
Alexander Liljengård 2016-05-31 09:28:04 +02:00
parent c898353497
commit 92648f3eaa

@ -35,6 +35,7 @@ class MatrixTest extends TestCase
$a = new SquareMatrix(1, 2, 3, $a = new SquareMatrix(1, 2, 3,
4, 5, 6, 4, 5, 6,
7, 8, 9); 7, 8, 9);
$this->assertEquals(0, $a->getDeterminant()); $this->assertEquals(0, $a->getDeterminant());
$pi = new SquareMatrix(3, 1, 4, $pi = new SquareMatrix(3, 1, 4,
@ -47,7 +48,7 @@ class MatrixTest extends TestCase
public function testFourByFourDeterminant() public function testFourByFourDeterminant()
{ {
$a = new SquareMatrix(1, 2, 3, 4, $a = new SquareMatrix( 1, 2, 3, 4,
5, 6, 7, 8, 5, 6, 7, 8,
9, 10, 11, 12, 9, 10, 11, 12,
13, 14, 15, 16); 13, 14, 15, 16);
@ -65,7 +66,7 @@ class MatrixTest extends TestCase
public function testEightByEightDeterminant() public function testEightByEightDeterminant()
{ {
$a = new SquareMatrix(1, 2, 3, 4, 5, 6, 7, 8, $a = new SquareMatrix( 1, 2, 3, 4, 5, 6, 7, 8,
9, 10, 11, 12, 13, 14, 15, 16, 9, 10, 11, 12, 13, 14, 15, 16,
17, 18, 19, 20, 21, 22, 23, 24, 17, 18, 19, 20, 21, 22, 23, 24,
25, 26, 27, 28, 29, 30, 31, 32, 25, 26, 27, 28, 29, 30, 31, 32,
@ -133,7 +134,7 @@ class MatrixTest extends TestCase
$a = new SquareMatrix(1, 2, $a = new SquareMatrix(1, 2,
3, 4); 3, 4);
$b = new SquareMatrix(4, -2, $b = new SquareMatrix( 4, -2,
-3, 1); -3, 1);
$this->assertTrue($b->equals($a->getAdjugate())); $this->assertTrue($b->equals($a->getAdjugate()));