expectException(OutOfBoundsException::class); // When $matrix = MatrixFactory::givens($m, $n, $angle, $size); } /** * @test Test that the function returns a properly formatted Matrix * @dataProvider dataProviderForTestGivensMatrix * @param int $m * @param int $n * @param float $angle * @param int $size * @param array $expected * @throws \Exception */ public function testGivensMatrix(int $m, int $n, float $angle, int $size, array $expected) { // When $G = MatrixFactory::givens($m, $n, $angle, $size); // Then $this->assertEqualsWithDelta($expected, $G->getMatrix(), 0.00001); } /** * @return array */ public function dataProviderForTestGivensMatrix(): array { return [ [ 0, 1, \M_PI, 2, [[-1, 0], [0, -1]] ], [ 0, 2, \M_PI / 4, 3, [[\M_SQRT1_2, 0, -1 * \M_SQRT1_2], [0, 1, 0], [\M_SQRT1_2, 0, \M_SQRT1_2]], ], ]; } }