Skip to content

Commit f0134ab

Browse files
committed
model/is_valid: replace 0.0 by numerical limit eps
1 parent 06554a7 commit f0134ab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/proxsuite/proxqp/dense/model.hpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -120,9 +120,12 @@ struct Model
120120
H.rows(), dim, "H has not the expected number of rows.");
121121
PROXSUITE_CHECK_ARGUMENT_SIZE(
122122
H.cols(), dim, "H has not the expected number of cols.");
123-
PROXSUITE_THROW_PRETTY((!H.isApprox(H.transpose(), 0.0)),
124-
std::invalid_argument,
125-
"H is not symmetric.");
123+
PROXSUITE_THROW_PRETTY(
124+
(!H.isApprox(
125+
H.transpose(),
126+
std::numeric_limits<typename decltype(H)::Scalar>::epsilon())),
127+
std::invalid_argument,
128+
"H is not symmetric.");
126129
}
127130
if (A.size()) {
128131
PROXSUITE_CHECK_ARGUMENT_SIZE(

0 commit comments

Comments
 (0)