Skip to content

Commit

Permalink
Appease the linters
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewdalpino committed Sep 19, 2023
1 parent 373844f commit d8f283f
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 24 deletions.
1 change: 0 additions & 1 deletion tests/ColumnVectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Tensor\Tests;

use Tensor\Tensor;
use Tensor\Vector;
use Tensor\Matrix;
use Tensor\Special;
use Tensor\ArrayLike;
Expand Down
38 changes: 19 additions & 19 deletions tests/MatrixTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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],
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -1953,7 +1954,6 @@ public function exp() : void
[8103.08392757538],
]);


$this->assertEqualsWithDelta($expected, $b, 1e-8);
}

Expand Down Expand Up @@ -2099,7 +2099,7 @@ public function acos() : void
[-0.5],
[0.01],
]);

$b = $a->acos();

$expected = Matrix::quick([
Expand Down
8 changes: 4 additions & 4 deletions tests/VectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ public function linspace() : void
* @dataProvider shapeProvider
*
* @param \Tensor\Vector $vector
* @param array $expected
* @param array<int> $expected
*/
public function shape(Vector $vector, array $expected) : void
{
Expand Down Expand Up @@ -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]),
];
}
Expand Down Expand Up @@ -913,7 +913,7 @@ public function lessEqualProvider() : Generator
[0, 0, 0, 1, 0, 0],
[0, 0, 0, 1, 0, 1],
]),

];

yield [
Expand Down Expand Up @@ -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]);
Expand Down

0 comments on commit d8f283f

Please sign in to comment.