This is tough
All checks were successful
Merge-Checker / build_and_test (pull_request) Successful in 23s
All checks were successful
Merge-Checker / build_and_test (pull_request) Successful in 23s
This commit is contained in:
@@ -539,13 +539,13 @@ TEST_CASE("QR Decompositions", "Matrix") {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Check that Qᵀ * Q ≈ I
|
// Check that Qᵀ * Q ≈ I
|
||||||
// This MUST be true even if the rank of A is 2 because without this,
|
// Since the rank of this matrix is 2, only the top left 2x2 sub-matrix will
|
||||||
// calculating eigenvalues/vectors will not work.
|
// equal I.
|
||||||
Matrix<3, 3> Qt = Q.Transpose();
|
Matrix<3, 3> Qt = Q.Transpose();
|
||||||
Matrix<3, 3> QtQ{};
|
Matrix<3, 3> QtQ{};
|
||||||
QtQ = Qt * Q;
|
QtQ = Qt * Q;
|
||||||
for (int i = 0; i < 3; ++i) {
|
for (int i = 0; i < 2; ++i) {
|
||||||
for (int j = 0; j < 3; ++j) {
|
for (int j = 0; j < 2; ++j) {
|
||||||
if (i == j)
|
if (i == j)
|
||||||
REQUIRE_THAT(QtQ[i][j], Catch::Matchers::WithinRel(1.0f, 1e-4f));
|
REQUIRE_THAT(QtQ[i][j], Catch::Matchers::WithinRel(1.0f, 1e-4f));
|
||||||
else
|
else
|
||||||
|
|||||||
Reference in New Issue
Block a user