Skip to content

Commit

Permalink
fix ModelIsSUpported
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Jul 22, 2023
1 parent 49c8f26 commit 7c42a0d
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion ortools/linear_solver/wrappers/model_builder_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,24 @@ ModelSolverHelper::ModelSolverHelper(const std::string& solver_name) {
}

bool ModelSolverHelper::SolverIsSupported() const {
return solver_type_.has_value();
if (!solver_type_.has_value()) return false;
if (solver_type_.value() == MPModelRequest::GLOP_LINEAR_PROGRAMMING) {
return true;
}
#ifdef USE_PDLP
if (solver_type_.value() == MPModelRequest::PDLP_LINEAR_PROGRAMMING) {
return true;
}
#endif // USE_PDLP
if (solver_type_.value() == MPModelRequest::SAT_INTEGER_PROGRAMMING) {
return true;
}
#ifdef USE_SCIP
if (solver_type_.value() == MPModelRequest::SCIP_MIXED_INTEGER_PROGRAMMING) {
return true;
}
#endif // USE_SCIP
return false;
}

void ModelSolverHelper::Solve(const ModelBuilderHelper& model) {
Expand Down

0 comments on commit 7c42a0d

Please sign in to comment.