public function testDeterminant() { $matrix = new LL_Matrix(array(array(5, 7), array(2, -3))); $result = $matrix->determinant(); $this->assertEquals($result, -29); $matrix = new LL_Matrix(array(array(7, 4, 2, 0), array(6, 3, -1, 2), array(4, 6, 2, 5), array(8, 2, -7, 1))); // this tests a series of subdeterminants (and cofactor matrices) $result = $matrix->determinant(); $this->assertEquals($result, -279); $matrix = new LL_Matrix(array(array(-2, 3), array(5, 0.5))); $result = $matrix->determinant(); $this->assertEquals($result, -16); $matrix = new LL_Matrix(array(array(2, -2, 0), array(-1, 5, 1), array(3, 4, 5))); $result = $matrix->determinant(); $this->assertEquals($result, 26); }