diff --git a/unit-tests/matrix-tests.cpp b/unit-tests/matrix-tests.cpp index d9d67d4..0242916 100644 --- a/unit-tests/matrix-tests.cpp +++ b/unit-tests/matrix-tests.cpp @@ -615,7 +615,6 @@ TEST_CASE("Eigenvalues and Vectors", "Matrix") { } SECTION("3x3 Rank Defficient Eigen") { - SKIP("Skipping this because QR decomposition isn't ready for it"); // this symmetrix tridiagonal matrix is well behaved for testing Matrix<3, 3> A{1, 2, 3, 4, 5, 6, 7, 8, 9}; @@ -630,11 +629,13 @@ TEST_CASE("Eigenvalues and Vectors", "Matrix") { values.ToString(strBuf1); std::cout << "Values:\n" << strBuf1 << std::endl; + // EigenQR emits eigenvalues largest-magnitude first, so column 0 of the + // vectors is the eigenvector for the largest eigenvalue (16.1168). REQUIRE_THAT(vectors[0][0], Catch::Matchers::WithinRel(0.23197f, 1e-4f)); REQUIRE_THAT(vectors[1][0], Catch::Matchers::WithinRel(0.525322f, 1e-4f)); REQUIRE_THAT(vectors[2][0], Catch::Matchers::WithinRel(0.81867f, 1e-4f)); - REQUIRE_THAT(values[0][0], Catch::Matchers::WithinRel(-1.11684f, 1e-4f)); - REQUIRE_THAT(values[1][0], Catch::Matchers::WithinRel(0.0f, 1e-4f)); - REQUIRE_THAT(values[2][0], Catch::Matchers::WithinRel(16.1168f, 1e-4f)); + REQUIRE_THAT(values[0][0], Catch::Matchers::WithinRel(16.1168f, 1e-4f)); + REQUIRE_THAT(values[1][0], Catch::Matchers::WithinRel(-1.11684f, 1e-4f)); + REQUIRE_THAT(values[2][0], Catch::Matchers::WithinAbs(0.0f, 1e-6f)); } } \ No newline at end of file