diff --git a/tests/ColumnVectorTest.php b/tests/ColumnVectorTest.php index b98c7d5..659fd45 100644 --- a/tests/ColumnVectorTest.php +++ b/tests/ColumnVectorTest.php @@ -3,7 +3,6 @@ namespace Tensor\Tests; use Tensor\Tensor; -use Tensor\Vector; use Tensor\Matrix; use Tensor\Special; use Tensor\ArrayLike; diff --git a/tests/MatrixTest.php b/tests/MatrixTest.php index 1bf635d..3eede24 100644 --- a/tests/MatrixTest.php +++ b/tests/MatrixTest.php @@ -735,11 +735,10 @@ public function cholesky() : void * @requires extension tensor * @dataProvider eigProvider * - * @param \Tensor\Matrix $a - * @param \Tensor\Tensor|float $b - * @param \Tensor\Tensor|float $expected + * @param \Tensor\Matrix $matrix + * @param \Tensor\Decompositions\Eigen $expected */ - public function eig(Matrix $matrix, $expected) : void + public function eig(Matrix $matrix, Eigen $expected) : void { $eig = $matrix->eig(false); @@ -757,9 +756,11 @@ public function eigProvider() : Generator [4.0, 11.0, -2.0], [20.0, -6.0, -9.0], ]), - new Eigen([ + new Eigen( + [ -15.096331148319537, 25.108706520450326, 13.9876246278692, - ], Matrix::quick([ + ], + Matrix::quick([ [0.25848694820886425, -0.11314537870318066, -0.9593657388523845], [-0.8622719261400653, -0.17721179605718698, -0.47442924101375483], [-0.6684472200177011, -0.6126879076802705, -0.42165369894378907], @@ -994,7 +995,7 @@ public function multiplyProvider() : Generator /** * @test * @dataProvider divideProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1075,7 +1076,7 @@ public function divideProvider() : Generator /** * @test * @dataProvider addProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1156,7 +1157,7 @@ public function addProvider() : Generator /** * @test * @dataProvider subtractProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1237,7 +1238,7 @@ public function subtractProvider() : Generator /** * @test * @dataProvider powProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1304,7 +1305,7 @@ public function powProvider() : Generator /** * @test * @dataProvider modProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1385,7 +1386,7 @@ public function modProvider() : Generator /** * @test * @dataProvider equalProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1466,7 +1467,7 @@ public function equalProvider() : Generator /** * @test * @dataProvider notEqualProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1547,7 +1548,7 @@ public function notEqualProvider() : Generator /** * @test * @dataProvider greaterProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1628,7 +1629,7 @@ public function greaterProvider() : Generator /** * @test * @dataProvider greaterEqualProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1709,7 +1710,7 @@ public function greaterEqualProvider() : Generator /** * @test * @dataProvider lessProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1790,7 +1791,7 @@ public function lessProvider() : Generator /** * @test * @dataProvider lessEqualProvider - * + * * @param \Tensor\Matrix $a * @param \Tensor\Tensor|float $b * @param \Tensor\Tensor|float $expected @@ -1953,7 +1954,6 @@ public function exp() : void [8103.08392757538], ]); - $this->assertEqualsWithDelta($expected, $b, 1e-8); } @@ -2099,7 +2099,7 @@ public function acos() : void [-0.5], [0.01], ]); - + $b = $a->acos(); $expected = Matrix::quick([ diff --git a/tests/VectorTest.php b/tests/VectorTest.php index f17ef5f..4237335 100644 --- a/tests/VectorTest.php +++ b/tests/VectorTest.php @@ -147,7 +147,7 @@ public function linspace() : void * @dataProvider shapeProvider * * @param \Tensor\Vector $vector - * @param array $expected + * @param array $expected */ public function shape(Vector $vector, array $expected) : void { @@ -545,7 +545,7 @@ public function addProvider() : Generator yield [ Vector::quick([-15.0, 25.0, 35.0, -36.0, -72.0, 89.0, 106.0, 45.0]), - 10.0, + 10.0, Vector::quick([-5.0, 35.0, 45.0, -26.0, -62.0, 99.0, 116.0, 55.0]), ]; } @@ -913,7 +913,7 @@ public function lessEqualProvider() : Generator [0, 0, 0, 1, 0, 0], [0, 0, 0, 1, 0, 1], ]), - + ]; yield [ @@ -982,7 +982,7 @@ public function abs() : void public function square() : void { $a = Vector::quick([-15.0, 25.0, 35.0, -36.0, -72.0, 89.0, 106.0, 45.0]); - + $b = $a->square(); $expected = Vector::quick([225, 625, 1225, 1296, 5184, 7921, 11236, 2025]);