Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/ipc/utils/eigen_ext.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ project_to_pd(
double eps)
{
assert(eps > 0);
assert(A == A.transpose() && "A must be symmetric");
assert(A.isApprox(A.transpose()) && "A must be symmetric");

// https://math.stackexchange.com/q/2776803
Eigen::SelfAdjointEigenSolver<
Expand Down Expand Up @@ -63,7 +63,7 @@ Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>
project_to_psd(
const Eigen::Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols>& A)
{
assert(A == A.transpose() && "A must be symmetric");
assert(A.isApprox(A.transpose()) && "A must be symmetric");

// https://math.stackexchange.com/q/2776803
Eigen::SelfAdjointEigenSolver<
Expand Down
4 changes: 2 additions & 2 deletions tests/ccd/test_ccd_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ void run_benchmark(
if (result < expected_result) {
fmt::print("\n");
}
CHECK(result >= expected_result); // false positive is ok
CHECK((result || !expected_result)); // false positive is ok
}
}
}
Expand Down Expand Up @@ -256,7 +256,7 @@ TEST_CASE(
// V.row(0), V.row(1), V.row(2), V.row(3), V.row(4), V.row(5),
// V.row(6), V.row(7), toi);
// // }
// CHECK(result >= expected_result); // false positive is ok
// CHECK(result || !expected_result); // false positive is ok
// }
// }
// }
Expand Down
6 changes: 3 additions & 3 deletions tests/ccd/test_edge_edge_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ TEST_CASE("Edge-Edge CCD", "[ccd][3D][edge-edge][!mayfail]")
eb1_t1 = eb1_t0 + Eigen::Vector3d(-scale, -dy, -scale);

// this ternary operator is to force MSVC to use 1 or 0
is_collision_expected = dy >= d0 / 2 ? true : false;
is_collision_expected = dy >= d0 / 2;
conservative_check = false;
}
CAPTURE(int(is_collision_expected));
Expand All @@ -146,7 +146,7 @@ TEST_CASE("Edge-Edge CCD", "[ccd][3D][edge-edge][!mayfail]")
ea0_t0, ea1_t0, eb0_t0, eb1_t0, ea0_t1, ea1_t1, eb0_t1, eb1_t1, toi,
/*min_distance=*/0.0, tmax, tol, max_iter);
if (conservative_check) {
CHECK(is_colliding >= is_collision_expected);
CHECK((is_colliding || !is_collision_expected));
} else {
CHECK(is_colliding == is_collision_expected);
}
Expand All @@ -155,7 +155,7 @@ TEST_CASE("Edge-Edge CCD", "[ccd][3D][edge-edge][!mayfail]")
ea0_t0, ea1_t0, eb0_t0, eb1_t0, ea0_t1, ea1_t1, eb0_t1, eb1_t1, toi,
/*min_distance=*/0.0, tmax);
if (conservative_check) {
CHECK(is_colliding >= is_collision_expected);
CHECK((is_colliding || !is_collision_expected));
} else {
CHECK(is_colliding == is_collision_expected);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/ccd/test_point_triangle_ccd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,15 +97,15 @@ TEST_CASE("Point-Triangle CCD", "[ccd][3D][point-triangle][!mayfail]")
p_t0, t0_t0, t1_t0, t2_t0, p_t1, t0_t1, t1_t1, t2_t1, toi);

if (conservative_check) {
CHECK(is_colliding >= is_collision_expected);
CHECK((is_colliding || !is_collision_expected));
} else {
CHECK(is_colliding == is_collision_expected);
}

is_colliding = additive_ccd::point_triangle_ccd(
p_t0, t0_t0, t1_t0, t2_t0, p_t1, t0_t1, t1_t1, t2_t1, toi);
if (conservative_check) {
CHECK(is_colliding >= is_collision_expected);
CHECK((is_colliding || !is_collision_expected));
} else {
CHECK(is_colliding == is_collision_expected);
}
Expand Down