From 25af19492af3028b7aea876e5a4b8ff5a32ed239 Mon Sep 17 00:00:00 2001 From: Apostolos Chalkis Date: Thu, 4 Jul 2024 23:16:29 -0600 Subject: [PATCH] minor improvements --- .../preprocess/inscribed_ellipsoid_rounding.hpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/include/preprocess/inscribed_ellipsoid_rounding.hpp b/include/preprocess/inscribed_ellipsoid_rounding.hpp index 31d22eb2a..c4beafe96 100644 --- a/include/preprocess/inscribed_ellipsoid_rounding.hpp +++ b/include/preprocess/inscribed_ellipsoid_rounding.hpp @@ -16,20 +16,21 @@ #include "preprocess/feasible_point.hpp" -template -inline static std::tuple -compute_inscribed_ellipsoid(Custom_MT A, VT b, VT const& x0, +// Using MT as to deal with both dense and sparse matrices, MT_dense will be the type of result matrix +template +inline static std::tuple +compute_inscribed_ellipsoid(MT A, VT b, VT const& x0, unsigned int const& maxiter, NT const& tol, NT const& reg) { if constexpr (ellipsoid_type == EllipsoidType::MAX_ELLIPSOID) { - return max_inscribed_ellipsoid(A, b, x0, maxiter, tol, reg); + return max_inscribed_ellipsoid(A, b, x0, maxiter, tol, reg); } else if constexpr (ellipsoid_type == EllipsoidType::LOG_BARRIER || ellipsoid_type == EllipsoidType::VOLUMETRIC_BARRIER || ellipsoid_type == EllipsoidType::VAIDYA_BARRIER) { - return barrier_center_ellipsoid_linear_ineq(A, b, x0); + return barrier_center_ellipsoid_linear_ineq(A, b, x0); } else { std::runtime_error("Unknown rounding method."); @@ -124,8 +125,7 @@ std::tuple inscribed_ellipsoid_rounding(Polytope &P, iter++; } - std::tuple result = std::make_tuple(T, shift, std::abs(round_val)); - return result; + return std::make_tuple(T, shift, std::abs(round_val)); } #endif