From d3687c3f36d7d32e27ab0e331c6f783a3aa34df6 Mon Sep 17 00:00:00 2001 From: Corentin Le Molgat Date: Fri, 14 Oct 2022 17:04:37 +0200 Subject: [PATCH] linear_solver: google3 export --- ortools/linear_solver/linear_solver.cc | 1 + ortools/linear_solver/linear_solver.h | 1 - ortools/linear_solver/proto_solver/sat_proto_solver.cc | 6 +++++- ortools/linear_solver/proto_solver/sat_solver_utils.cc | 2 +- ortools/linear_solver/scip_callback.cc | 2 +- 5 files changed, 8 insertions(+), 4 deletions(-) diff --git a/ortools/linear_solver/linear_solver.cc b/ortools/linear_solver/linear_solver.cc index 63b2b2559f..050737f0ee 100644 --- a/ortools/linear_solver/linear_solver.cc +++ b/ortools/linear_solver/linear_solver.cc @@ -524,6 +524,7 @@ bool MPSolver::SupportsProblemType(OptimizationProblemType problem_type) { return true; } #endif + return false; } diff --git a/ortools/linear_solver/linear_solver.h b/ortools/linear_solver/linear_solver.h index 8bd9fbae1b..ab8d874d4c 100644 --- a/ortools/linear_solver/linear_solver.h +++ b/ortools/linear_solver/linear_solver.h @@ -215,7 +215,6 @@ class MPSolver { CPLEX_MIXED_INTEGER_PROGRAMMING = 11, XPRESS_LINEAR_PROGRAMMING = 101, XPRESS_MIXED_INTEGER_PROGRAMMING = 102, - HIGHS_MIXED_INTEGER_PROGRAMMING = 16, // Boolean optimization problem (requires only integer variables and works diff --git a/ortools/linear_solver/proto_solver/sat_proto_solver.cc b/ortools/linear_solver/proto_solver/sat_proto_solver.cc index 71faf97072..ef5aecaa13 100644 --- a/ortools/linear_solver/proto_solver/sat_proto_solver.cc +++ b/ortools/linear_solver/proto_solver/sat_proto_solver.cc @@ -16,6 +16,7 @@ #include #include #include +#include #include #include #include @@ -259,8 +260,11 @@ absl::StatusOr SatSolveProto( } } if (params.mip_var_scaling() != 1.0) { + const double max_bound = params.mip_scale_large_domain() + ? std::numeric_limits::infinity() + : params.mip_max_bound(); const std::vector other_scaling = sat::ScaleContinuousVariables( - params.mip_var_scaling(), params.mip_max_bound(), mp_model); + params.mip_var_scaling(), max_bound, mp_model); for (int i = 0; i < var_scaling.size(); ++i) { var_scaling[i] *= other_scaling[i]; } diff --git a/ortools/linear_solver/proto_solver/sat_solver_utils.cc b/ortools/linear_solver/proto_solver/sat_solver_utils.cc index e6248250a7..8712f7f7a1 100644 --- a/ortools/linear_solver/proto_solver/sat_solver_utils.cc +++ b/ortools/linear_solver/proto_solver/sat_solver_utils.cc @@ -27,7 +27,7 @@ namespace operations_research { #define ADD_LP_PREPROCESSOR(name) \ names.push_back(#name); \ - lp_preprocessors.push_back(absl::make_unique(&glop_params)); + lp_preprocessors.push_back(std::make_unique(&glop_params)); glop::ProblemStatus ApplyMipPresolveSteps( const glop::GlopParameters& glop_params, MPModelProto* model, diff --git a/ortools/linear_solver/scip_callback.cc b/ortools/linear_solver/scip_callback.cc index 9e0c619298..4c3ea23c68 100644 --- a/ortools/linear_solver/scip_callback.cc +++ b/ortools/linear_solver/scip_callback.cc @@ -166,7 +166,7 @@ ScipSeparationResult RunSeparation(internal::ScipCallbackRunner* runner, CHECK_OK(SCIP_TO_STATUS(SCIPreleaseRow(scip, &row))); // TODO(user): when infeasible is true, it better to have the scip // return status be cutoff instead of cutting plane added (e.g. see - // cs/scip/cons_knapsack.c). However, as we use + // cs/scip/src/scip/cons_knapsack.c). However, as we use // SCIPaddRow(), it isn't clear this will even happen. if (result != ScipSeparationResult::kLazyConstraintAdded) { // NOTE(user): if we have already found a violated lazy constraint,