Skip to content

Commit 4f5cdc0

Browse files
authored
Merge pull request #413 from fabinsch/topic/inf-to-max
replace `std::numeric_limits<T>::infinity()` by `max()`
2 parents f88cb35 + cb4950f commit 4f5cdc0

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
99
### Changed
1010
- Change the default branch to `devel` ([#395](https://github.com/Simple-Robotics/proxsuite/pull/395))
1111
- Change `dual_feasibility` test threshold in `sparse_maros_meszaros` unit test ([#403](https://github.com/Simple-Robotics/proxsuite/pull/403))
12+
- replace `std::numeric_limits<T>::infinity()` by `std::numeric_limits<T>::max()` ([#413](https://github.com/Simple-Robotics/proxsuite/pull/413))
1213

1314
### Fixed
1415
- Use the right table to store `configure-args` cmeel argument ([#403](https://github.com/Simple-Robotics/proxsuite/pull/403))

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)