Skip to content

Commit 8df77ca

Browse files
committed
replace std::numeric_limits<T>::infinity() by std::numeric_limits<T>::max()
- to allow usage of `-ffast-math`
1 parent f88cb35 commit 8df77ca

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

include/proxsuite/proxqp/dense/linesearch.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ primal_dual_ls(const Model<T>& qpmodel,
418418
return;
419419
}
420420
////////// STEP 2 ///////////
421-
auto infty = std::numeric_limits<T>::infinity();
421+
auto infty = std::numeric_limits<T>::max();
422422

423423
T last_neg_grad = 0;
424424
T alpha_last_neg = 0;

include/proxsuite/proxqp/sparse/solver.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ ldl_iter_solve_noalias(
117117

118118
LDLT_TEMP_VEC_UNINIT(T, err, n_tot, stack);
119119

120-
T prev_err_norm = std::numeric_limits<T>::infinity();
120+
T prev_err_norm = std::numeric_limits<T>::max();
121121

122122
for (isize solve_iter = 0; solve_iter < settings.nb_iterative_refinement;
123123
++solve_iter) {
@@ -1209,7 +1209,7 @@ qp_solve(Results<T>& results,
12091209
std::unique(alphas.data(), alphas.data() + alphas_count) -
12101210
alphas.data();
12111211
if (alphas_count > 0) { //&& alphas[0] <= 1
1212-
auto infty = std::numeric_limits<T>::infinity();
1212+
auto infty = std::numeric_limits<T>::max();
12131213

12141214
T last_neg_grad = 0;
12151215
T alpha_last_neg = 0;

0 commit comments

Comments
 (0)