protected function setUp()
 {
     $this->object = new stubTraitAssertMatrixIsRational();
     $this->mRational = MatrixFactory::createRational([[[1, 1], '2/3', 3.786]]);
     $this->mNumeric = MatrixFactory::createNumeric([[1]]);
     $this->mComplex = MatrixFactory::createComplex([['1+2i', '14-4i', '4-3i']]);
 }
 public function testCreateFromComplexReturnsRationalMatrix()
 {
     $c = CF::fromString('2+4i');
     $mA = MatrixFactory::createFromComplex($c);
     $test = MatrixFactory::createRational([['2/1', '-4/1'], ['4/1', '2/1']]);
     $this->assertEquals($test, $mA);
 }
Example #3
0
 public function testRationalNumberNonIdentityMatrixIsRecognised()
 {
     $test = [['0/1', '0/1', '0/1'], ['0/1', '1/1', '0/1'], ['0/1', '0/1', '1/1']];
     $mA = MatrixFactory::createRational($test);
     $this->assertFalse($this->object->is($mA));
 }