Compare commits
1 Commits
c099dfe760
...
4704b8a688
| Author | SHA1 | Date | |
|---|---|---|---|
| 4704b8a688 |
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user