public function testDecomposeCanSolveLinearEquation()
 {
     //solve
     //x + y + z = 5
     //2x + 3y + 5z = 8
     //4x + 5z = 2
     $mA = new NumericMatrix([[1, 1, 1], [2, 3, 5], [4, 0, 5]]);
     $mB = new NumericMatrix([[5], [8], [2]]);
     $ret = $this->object->decompose($mA, $mB);
     $expected = new NumericMatrix([[3], [4], [-2]]);
     //z
     $this->assertTrue($expected->equality($ret->right, false));
 }
Ejemplo n.º 2
0
 public function testEqualityWithLooseSettingReturnsFalseForDifferentClassAndDifferentContent()
 {
     $mN = new NumericMatrix([[2]]);
     $mR = new RationalMatrix([[12]]);
     $this->assertFalse($mN->equality($mR, false));
 }