diff --git a/Dependencies.txt b/Dependencies.txt index a43ae9e4b4..a76d9fa871 100644 --- a/Dependencies.txt +++ b/Dependencies.txt @@ -10,7 +10,7 @@ Cgl=0.60.5 Cbc=2.10.7 GLPK=5.0 HiGHS=v1.8.0 -Scip=v900 +Scip=v920 # Python pybind11=v2.12.0 pybind11_abseil=52f2739 diff --git a/WORKSPACE b/WORKSPACE index eacdfa38e4..a17588f1e5 100644 --- a/WORKSPACE +++ b/WORKSPACE @@ -184,9 +184,9 @@ http_archive( new_git_repository( name = "scip", build_file = "//bazel:scip.BUILD.bazel", - patches = ["//bazel:scip-v900.patch"], + patches = ["//bazel:scip-v920.patch"], patch_args = ["-p1"], - tag = "v900", + tag = "v920", remote = "https://github.com/scipopt/scip.git", ) diff --git a/cmake/dependencies/CMakeLists.txt b/cmake/dependencies/CMakeLists.txt index f322d47f45..fc23d05bb4 100644 --- a/cmake/dependencies/CMakeLists.txt +++ b/cmake/dependencies/CMakeLists.txt @@ -280,9 +280,9 @@ if(BUILD_SCIP) FetchContent_Declare( scip GIT_REPOSITORY "https://github.com/scipopt/scip.git" - GIT_TAG "v900" + GIT_TAG "v920" GIT_SHALLOW TRUE - PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/scip-v900.patch" + PATCH_COMMAND git apply --ignore-whitespace "${CMAKE_CURRENT_LIST_DIR}/../../patches/scip-v920.patch" ) FetchContent_MakeAvailable(scip) set(LPI_GLOP_SRC ${scip_SOURCE_DIR}/src/lpi/lpi_glop.cpp PARENT_SCOPE) diff --git a/ortools/gscip/gscip.cc b/ortools/gscip/gscip.cc index 4634e71a6a..d9ccdecc23 100644 --- a/ortools/gscip/gscip.cc +++ b/ortools/gscip/gscip.cc @@ -1001,12 +1001,13 @@ absl::StatusOr GScip::Solve( } const SCIP_STAGE stage = SCIPgetStage(scip_); if (stage != SCIP_STAGE_PRESOLVING && stage != SCIP_STAGE_SOLVING && - stage != SCIP_STAGE_SOLVED) { + stage != SCIP_STAGE_SOLVED && stage != SCIP_STAGE_PRESOLVED) { result.gscip_output.set_status(GScipOutput::UNKNOWN); result.gscip_output.set_status_detail( absl::StrCat("Unexpected SCIP final stage= ", stage, " was expected to be either SCIP_STAGE_PRESOLVING, " - "SCIP_STAGE_SOLVING, or SCIP_STAGE_SOLVED")); + "SCIP_STAGE_SOLVING, SCIP_STAGE_PRESOLVED, or " + "SCIP_STAGE_SOLVED")); return result; } if (params.print_detailed_solving_stats()) { diff --git a/ortools/gscip/gscip_ext.cc b/ortools/gscip/gscip_ext.cc index 0288cd90b0..9070b5a677 100644 --- a/ortools/gscip/gscip_ext.cc +++ b/ortools/gscip/gscip_ext.cc @@ -19,6 +19,7 @@ #include #include "absl/strings/string_view.h" +#include "absl/types/span.h" #include "ortools/base/logging.h" #include "ortools/base/status_macros.h" @@ -80,7 +81,7 @@ absl::Status GScipCreateAbs(GScip* gscip, SCIP_Var* x, SCIP_Var* abs_x, } absl::Status GScipCreateMaximum(GScip* gscip, const GScipLinearExpr& resultant, - const std::vector& terms, + absl::Span terms, absl::string_view name) { // TODO(user): it may be better to write this in terms of the disjuntive // constraint, we need to support disjunctions in gscip.h to do this. @@ -136,7 +137,7 @@ absl::Status GScipCreateMaximum(GScip* gscip, const GScipLinearExpr& resultant, } absl::Status GScipCreateMinimum(GScip* gscip, const GScipLinearExpr& resultant, - const std::vector& terms, + absl::Span terms, absl::string_view name) { std::vector negated_terms; negated_terms.reserve(terms.size()); diff --git a/ortools/gscip/gscip_ext.h b/ortools/gscip/gscip_ext.h index 20dbc202d4..ebf5bf2a93 100644 --- a/ortools/gscip/gscip_ext.h +++ b/ortools/gscip/gscip_ext.h @@ -31,6 +31,7 @@ #include "absl/status/status.h" #include "absl/strings/string_view.h" +#include "absl/types/span.h" #include "ortools/gscip/gscip.h" #include "scip/scip.h" #include "scip/scip_prob.h" @@ -70,13 +71,13 @@ GScipLinearRange GScipLe(GScipLinearExpr left, const GScipLinearExpr& right); // Adds the constraint resultant = maximum(terms). Supports unbounded variables // in terms. absl::Status GScipCreateMaximum(GScip* gscip, const GScipLinearExpr& resultant, - const std::vector& terms, + absl::Span terms, absl::string_view name = ""); // Adds the constraint resultant = minimum(terms). Supports unbounded variables // in terms. absl::Status GScipCreateMinimum(GScip* gscip, const GScipLinearExpr& resultant, - const std::vector& terms, + absl::Span terms, absl::string_view name = ""); // Models the constraint z = 1 => lb <= ax <= ub diff --git a/patches/scip-v900.patch b/patches/scip-v920.patch similarity index 100% rename from patches/scip-v900.patch rename to patches/scip-v920.patch