From 44678a22e7f9849bdd5c2e010ebefcdb7154918c Mon Sep 17 00:00:00 2001 From: Vincent Payet Date: Tue, 16 Jul 2024 15:32:56 +0200 Subject: [PATCH] fix compile --- src/solver/utils/ortools_utils.cpp | 13 +++++++++++++ src/solver/utils/ortools_utils.h | 7 +++++++ src/tools/batchrun/main.cpp | 5 ++--- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/src/solver/utils/ortools_utils.cpp b/src/solver/utils/ortools_utils.cpp index 7503fe3d5c..ff6b04caae 100644 --- a/src/solver/utils/ortools_utils.cpp +++ b/src/solver/utils/ortools_utils.cpp @@ -401,6 +401,19 @@ std::list getAvailableOrtoolsSolverName() return result; } +std::string availableOrToolsSolversString() +{ + const std::list availableSolverList = getAvailableOrtoolsSolverName(); + std::ostringstream solvers; + for (const std::string& avail: availableSolverList) + { + bool last = &avail == &availableSolverList.back(); + std::string sep = last ? "." : ", "; + solvers << avail << sep; + } + return solvers.str(); +} + MPSolver* MPSolverFactory(const Antares::Optimization::PROBLEME_SIMPLEXE_NOMME* probleme, const std::string& solverName) { diff --git a/src/solver/utils/ortools_utils.h b/src/solver/utils/ortools_utils.h index e5d63fe765..e08a52f0ca 100644 --- a/src/solver/utils/ortools_utils.h +++ b/src/solver/utils/ortools_utils.h @@ -21,6 +21,13 @@ void ORTOOLS_EcrireJeuDeDonneesLineaireAuFormatMPS(MPSolver* solver, */ std::list getAvailableOrtoolsSolverName(); +/*! + * \brief Return a single string containing all solvers available, separated by a ", " and ending + * with a ".". + * + */ +std::string availableOrToolsSolversString(); + /*! * \brief Create a MPSolver with correct linear or mixed variant * diff --git a/src/tools/batchrun/main.cpp b/src/tools/batchrun/main.cpp index 1cc0004085..f8f34f2abd 100644 --- a/src/tools/batchrun/main.cpp +++ b/src/tools/batchrun/main.cpp @@ -39,8 +39,7 @@ #include "../../ui/common/winmain.hxx" #include #include -#include -#include +#include "../solver/utils/ortools_utils.h" #ifdef YUNI_OS_WINDOWS #include @@ -261,7 +260,7 @@ int main(int argc, char* argv[]) // The folder that contains the solver String dirname; - IO::parent_path(dirname, solver); + IO::ExtractFilePath(dirname, solver); String cmd;