/** * 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()); }
/** * @dataProvider dataProviderForGetN */ public function testGetN(array $A, int $n) { $vector = new Vector($A); $this->assertEquals($n, $vector->getN()); }