From a67b70b328c4ead77ad7ef711f58b77852a93867 Mon Sep 17 00:00:00 2001 From: Ivet Galabova Date: Tue, 24 Sep 2024 12:29:11 +0300 Subject: [PATCH] added model name and feasible status, testing with cmake and dev branch of highs --- cmake/dependencies/CMakeLists.txt | 3 ++- ortools/linear_solver/proto_solver/highs_proto_solver.cc | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index 6c49336ba8..e7f058c1a5 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -248,7 +248,8 @@ if(BUILD_HIGHS) FetchContent_Declare( highs GIT_REPOSITORY "https://github.com/ERGO-Code/HiGHS.git" - GIT_TAG "v1.7.2" + # GIT_TAG "v1.7.2" + GIT_BRANCH "ortools" GIT_SHALLOW TRUE #PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/highs.patch" ) diff --git a/ortools/linear_solver/proto_solver/highs_proto_solver.cc b/ortools/linear_solver/proto_solver/highs_proto_solver.cc index 9ae1e5352c..2e5e8a03d5 100644 --- a/ortools/linear_solver/proto_solver/highs_proto_solver.cc +++ b/ortools/linear_solver/proto_solver/highs_proto_solver.cc @@ -54,7 +54,7 @@ absl::StatusOr HighsSolveProto( // TODO(user): Set model name. if (model.has_name()) { const std::string model_name = model.name(); - // highs.passModelName(model_name); + highs.passModelName(model_name); } if (request->has_solver_specific_parameters()) { @@ -245,6 +245,9 @@ absl::StatusOr HighsSolveProto( break; default: { // TODO(user): report feasible status. + const HighsInfo& info = Highs::getInfo(). + if (info.primal_solution_status == HighsSolutionStatus::kSolutionStatusFeasible) + response.set_status(MPSOLVER_FEASIBLE); break; } }