Skip to content

Commit

Permalink
support pdlp in python model_builder
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Jul 5, 2023
1 parent 56a0211 commit 7f96bd4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
1 change: 0 additions & 1 deletion ortools/linear_solver/wrappers/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ cc_library(
srcs = ["model_builder_helper.cc"],
hdrs = ["model_builder_helper.h"],
copts = [
"-DUSE_HIGHS",
"-DUSE_PDLP",
"-DUSE_SCIP",
"-DUSE_LP_PARSER",
Expand Down
13 changes: 7 additions & 6 deletions ortools/linear_solver/wrappers/model_builder_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,13 @@

#include "ortools/linear_solver/linear_solver.h"
#include "ortools/linear_solver/linear_solver.pb.h"
#include "ortools/linear_solver/proto_solver/highs_proto_solver.h"
#include "ortools/linear_solver/proto_solver/sat_proto_solver.h"
#if defined(USE_SCIP)
#include "ortools/linear_solver/proto_solver/scip_proto_solver.h"
#endif // defined(USE_SCIP)
#if defined(USE_PDLP)
#include "ortools/linear_solver/proto_solver/pdlp_proto_solver.h"
#endif // defined(USE_PDLP)
#if defined(USE_LP_PARSER)
#include "ortools/lp_data/lp_parser.h"
#endif // defined(USE_LP_PARSER)
Expand Down Expand Up @@ -332,16 +334,15 @@ void ModelSolverHelper::Solve(const ModelBuilderHelper& model) {
break;
}
#endif // defined(USE_SCIP)
#if defined(USE_HIGHS)
case MPModelRequest::HIGHS_MIXED_INTEGER_PROGRAMMING:
case MPModelRequest::HIGHS_LINEAR_PROGRAMMING: {
const auto temp = HighsSolveProto(request);
#if defined(USE_PDLP)
case MPModelRequest::PDLP_LINEAR_PROGRAMMING: {
const auto temp = PdlpSolveProto(request);
if (temp.ok()) {
response_ = std::move(temp.value());
}
break;
}
#endif // defined(USE_HIGHS)
#endif // defined(USE_PDLP)
default: {
response_->set_status(
MPSolverResponseStatus::MPSOLVER_SOLVER_TYPE_UNAVAILABLE);
Expand Down

0 comments on commit 7f96bd4

Please sign in to comment.