| 37 | namespace { |
| 38 | |
| 39 | TEST(DecomposeMatrixRQ, Nominal) { |
| 40 | for (int i = 0; i < 10; ++i) { |
| 41 | const Eigen::Matrix4d A = Eigen::Matrix4d::Random(); |
| 42 | |
| 43 | Eigen::Matrix4d R, Q; |
| 44 | DecomposeMatrixRQ(A, &R, &Q); |
| 45 | |
| 46 | EXPECT_TRUE(R.bottomRows(4).isUpperTriangular()); |
| 47 | EXPECT_TRUE(Q.isUnitary()); |
| 48 | EXPECT_NEAR(Q.determinant(), 1.0, 1e-6); |
| 49 | EXPECT_THAT(A, EigenMatrixNear(Eigen::Matrix4d(R * Q), 1e-6)); |
| 50 | } |
| 51 | } |
| 52 | |
| 53 | } // namespace |
| 54 | } // namespace colmap |
nothing calls this directly
no test coverage detected