Skip to content

Commit

Permalink
fix compile
Browse files Browse the repository at this point in the history
  • Loading branch information
payetvin committed Jul 16, 2024
1 parent dab893f commit 44678a2
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
13 changes: 13 additions & 0 deletions src/solver/utils/ortools_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,19 @@ std::list<std::string> getAvailableOrtoolsSolverName()
return result;
}

std::string availableOrToolsSolversString()
{
const std::list<std::string> 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)
{
Expand Down
7 changes: 7 additions & 0 deletions src/solver/utils/ortools_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@ void ORTOOLS_EcrireJeuDeDonneesLineaireAuFormatMPS(MPSolver* solver,
*/
std::list<std::string> 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
*
Expand Down
5 changes: 2 additions & 3 deletions src/tools/batchrun/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
#include "../../ui/common/winmain.hxx"
#include <antares/version.h>
#include <antares/locale.h>
#include <antares/args/args_to_utf8.h>
#include <antares/solver/utils/ortools_utils.h>
#include "../solver/utils/ortools_utils.h"

#ifdef YUNI_OS_WINDOWS
#include <process.h>
Expand Down Expand Up @@ -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;

Expand Down

0 comments on commit 44678a2

Please sign in to comment.