Skip to content

Commit

Permalink
Relax eigen22f test criteria by defining the threshold on the matrix …
Browse files Browse the repository at this point in the history
…individual components.
  • Loading branch information
SergioRAgostinho committed Oct 1, 2018
1 parent 561d2d9 commit b840192
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions test/common/test_eigen.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -556,25 +556,25 @@ TEST (PCL, eigen22f)
// test if U * V * U^T = M
r_result = r_vectors * r_eigenvalues.asDiagonal () * r_vectors.transpose ();
r_error = r_result - r_matrix;
diff = r_error.cwiseAbs (). sum ();
diff = r_error.cwiseAbs ().maxCoeff ();
EXPECT_LE (diff, epsilon);

// test if the eigenvalues are orthonormal
g_result = r_vectors * r_vectors.transpose ();
g_error = g_result - RMatrix::Identity ();
diff = g_error.cwiseAbs (). sum ();
diff = g_error.cwiseAbs ().maxCoeff ();
EXPECT_LE (diff, epsilon);

// test if column major matrices are also calculated correctly
eigen22 (c_matrix, c_vectors, c_eigenvalues);
c_result = c_vectors * c_eigenvalues.asDiagonal () * c_vectors.transpose ();
c_error = c_result - c_matrix;
diff = c_error.cwiseAbs (). sum ();
diff = c_error.cwiseAbs ().maxCoeff ();
EXPECT_LE (diff, epsilon);

g_result = c_vectors * c_vectors.transpose ();
g_error = g_result - CMatrix::Identity ();
diff = g_error.cwiseAbs (). sum ();
diff = g_error.cwiseAbs ().maxCoeff ();
EXPECT_LE (diff, epsilon);
}
}
Expand Down

0 comments on commit b840192

Please sign in to comment.