Esempio n. 1
0
 /**
  * Axiom: 0A = 0
  * Multiplying (scaling) by 0 gives the zero vector
  * @dataProvider dataProviderForSingleVector
  */
 public function testScalarMultiplyZeroIdentity(array $A)
 {
     $A = new Vector($A);
     $0A = $A->scalarMultiply(0);
     $zero = new Vector(array_fill(0, $A->getN(), 0));
     $this->assertEquals($zero, $0A);
     $this->assertEquals($zero->getVector(), $0A->getVector());
 }
Esempio n. 2
0
 /**
  * @dataProvider dataProviderForGetN
  */
 public function testGetN(array $A, int $n)
 {
     $vector = new Vector($A);
     $this->assertEquals($n, $vector->getN());
 }