Skip to content

Commit 6b445d9

Browse files
committed
Test Eigenvector::qrAlgorithm
1 parent 51a36e9 commit 6b445d9

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

tests/LinearAlgebra/Eigen/EigenvectorTest.php

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -234,4 +234,25 @@ public function testMatrixEigenvectorInvalidMethodException()
234234
// When
235235
$A->eigenvectors($invalidMethod);
236236
}
237+
238+
/**
239+
* @test qrAlgorithm
240+
* @dataProvider dataProviderForEigenvector
241+
* @param array $A
242+
* @param array $B
243+
*/
244+
public function testQRAlgorithm(array $A, array $S): void
245+
{
246+
// Given
247+
$A = MatrixFactory::create($A);
248+
$S = MatrixFactory::create($S);
249+
250+
// When
251+
$eigenvectors = Eigenvector::qrAlgorithm($A);
252+
253+
// Then
254+
$this->assertEqualsWithDelta($S, $eigenvectors, 0.0001, sprintf(
255+
"Eigenvectors unequal:\nExpected:\n" . (string) $S . "\nActual:\n" . (string) $eigenvectors
256+
));
257+
}
237258
}

0 commit comments

Comments
 (0)