From 259ddc8253bdbd191e49e97f8ee160ad4f86c3b7 Mon Sep 17 00:00:00 2001 From: Apostolos Chalkis Date: Sun, 7 Jul 2024 11:21:35 -0600 Subject: [PATCH] remove NT typename from max_step() --- include/preprocess/barrier_center_ellipsoid.hpp | 2 +- include/preprocess/rounding_util_functions.hpp | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/include/preprocess/barrier_center_ellipsoid.hpp b/include/preprocess/barrier_center_ellipsoid.hpp index ecab24d40..0ab8c0457 100644 --- a/include/preprocess/barrier_center_ellipsoid.hpp +++ b/include/preprocess/barrier_center_ellipsoid.hpp @@ -69,7 +69,7 @@ std::tuple barrier_center_ellipsoid_linear_ineq(MT const& A d.noalias() = - solve_vec(llt, H, grad); Ad.noalias() = A * d; // Compute the step length - step = std::min(max_step_multiplier * get_max_step(Ad, b_Ax), step_iter); + step = std::min(max_step_multiplier * get_max_step(Ad, b_Ax), step_iter); step_d.noalias() = step*d; x_prev = x; x += step_d; diff --git a/include/preprocess/rounding_util_functions.hpp b/include/preprocess/rounding_util_functions.hpp index 1ee859b25..6b94ace8b 100644 --- a/include/preprocess/rounding_util_functions.hpp +++ b/include/preprocess/rounding_util_functions.hpp @@ -31,9 +31,10 @@ struct AssertBarrierFalseType : std::false_type {}; template struct AssertFalseType : std::false_type {}; -template -NT get_max_step(VT const& Ad, VT const& b_Ax) +template +auto get_max_step(VT const& Ad, VT const& b_Ax) { + using NT = typename VT::Scalar; const int m = Ad.size(); NT max_element = std::numeric_limits::lowest(), max_element_temp; for (int i = 0; i < m; i++) {