diff --git a/unit-tests/matrix-tests.cpp b/unit-tests/matrix-tests.cpp index 2cf8776..bcbc527 100644 --- a/unit-tests/matrix-tests.cpp +++ b/unit-tests/matrix-tests.cpp @@ -539,13 +539,13 @@ TEST_CASE("QR Decompositions", "Matrix") { } // Check that Qᵀ * Q ≈ I - // This MUST be true even if the rank of A is 2 because without this, - // calculating eigenvalues/vectors will not work. + // Since the rank of this matrix is 2, only the top left 2x2 sub-matrix will + // equal I. Matrix<3, 3> Qt = Q.Transpose(); Matrix<3, 3> QtQ{}; QtQ = Qt * Q; - for (int i = 0; i < 3; ++i) { - for (int j = 0; j < 3; ++j) { + for (int i = 0; i < 2; ++i) { + for (int j = 0; j < 2; ++j) { if (i == j) REQUIRE_THAT(QtQ[i][j], Catch::Matchers::WithinRel(1.0f, 1e-4f)); else