Skip to content

Commit

Permalink
Test Eigenvector::qrAlgorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
Aweptimum committed Nov 6, 2023
1 parent 51a36e9 commit 6b445d9
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/LinearAlgebra/Eigen/EigenvectorTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -234,4 +234,25 @@ public function testMatrixEigenvectorInvalidMethodException()
// When
$A->eigenvectors($invalidMethod);
}

/**
* @test qrAlgorithm
* @dataProvider dataProviderForEigenvector
* @param array $A
* @param array $B
*/
public function testQRAlgorithm(array $A, array $S): void
{
// Given
$A = MatrixFactory::create($A);
$S = MatrixFactory::create($S);

// When
$eigenvectors = Eigenvector::qrAlgorithm($A);

// Then
$this->assertEqualsWithDelta($S, $eigenvectors, 0.0001, sprintf(
"Eigenvectors unequal:\nExpected:\n" . (string) $S . "\nActual:\n" . (string) $eigenvectors
));
}
}

0 comments on commit 6b445d9

Please sign in to comment.