diff --git a/ortools/linear_solver/xpress_interface.cc b/ortools/linear_solver/xpress_interface.cc index c28cab27fdf..dd73c03a33a 100644 --- a/ortools/linear_solver/xpress_interface.cc +++ b/ortools/linear_solver/xpress_interface.cc @@ -1912,16 +1912,10 @@ MPSolver::ResultStatus XpressInterface::Solve(MPSolverParameters const& param) { int xpress_stat = 0; if (mMip) { - if (this->maximize_) - status = XPRSmaxim(mLp, "g"); - else - status = XPRSminim(mLp, "g"); + status = XPRSmipoptimize(mLp,""); XPRSgetintattrib(mLp, XPRS_MIPSTATUS, &xpress_stat); } else { - if (this->maximize_) - status = XPRSmaxim(mLp, ""); - else - status = XPRSminim(mLp, ""); + status = XPRSlpoptimize(mLp,""); XPRSgetintattrib(mLp, XPRS_LPSTATUS, &xpress_stat); } diff --git a/ortools/xpress/environment.cc b/ortools/xpress/environment.cc index 0f3fcbba4de..c7aad2d8b43 100644 --- a/ortools/xpress/environment.cc +++ b/ortools/xpress/environment.cc @@ -92,8 +92,8 @@ std::function XPRSaddcbintsol = nullptr; std::function XPRSremovecbintsol = nullptr; std::function XPRSaddcbmessage = nullptr; -std::function XPRSminim = nullptr; -std::function XPRSmaxim = nullptr; +std::function XPRSlpoptimize = nullptr; +std::function XPRSmipoptimize = nullptr; absl::Status LoadXpressFunctions(DynamicLibrary* xpress_dynamic_library) { // This was generated with the parse_header_xpress.py script. @@ -156,8 +156,9 @@ absl::Status LoadXpressFunctions(DynamicLibrary* xpress_dynamic_library) { xpress_dynamic_library->GetFunction(&XPRSaddcbintsol, "XPRSaddcbintsol"); xpress_dynamic_library->GetFunction(&XPRSremovecbintsol, "XPRSremovecbintsol"); xpress_dynamic_library->GetFunction(&XPRSaddcbmessage, "XPRSaddcbmessage"); - xpress_dynamic_library->GetFunction(&XPRSminim, "XPRSminim"); - xpress_dynamic_library->GetFunction(&XPRSmaxim, "XPRSmaxim"); + xpress_dynamic_library->GetFunction(&XPRSlpoptimize, "XPRSlpoptimize"); + xpress_dynamic_library->GetFunction(&XPRSmipoptimize, "XPRSmipoptimize"); + auto notFound = xpress_dynamic_library->FunctionsNotFound(); if (!notFound.empty()) { diff --git a/ortools/xpress/environment.h b/ortools/xpress/environment.h index faee0a7e521..fcbec406c74 100644 --- a/ortools/xpress/environment.h +++ b/ortools/xpress/environment.h @@ -491,8 +491,8 @@ extern std::function XPRSaddcbintsol; extern std::function XPRSremovecbintsol; extern std::function XPRSaddcbmessage; -extern std::function XPRSminim; -extern std::function XPRSmaxim; +extern std::function XPRSlpoptimize; +extern std::function XPRSmipoptimize; } // namespace operations_research