update math_opt, add service; python code

This commit is contained in:
Laurent Perron
2023-12-05 23:50:35 +01:00
parent 6b81dc5b0f
commit 804888fc5a
30 changed files with 1985 additions and 1082 deletions

View File

@@ -48,7 +48,7 @@ absl::Status Main() {
model.Maximize(objective_expression);
ASSIGN_OR_RETURN(const math_opt::SolveResult result,
Solve(model, math_opt::SolverType::kGscip));
RETURN_IF_ERROR(result.termination.IsOptimalOrFeasible());
RETURN_IF_ERROR(result.termination.EnsureIsOptimalOrFeasible());
std::cout << "Objective value: " << result.objective_value() << std::endl
<< "Value for variable x: " << result.variable_values().at(x)
<< std::endl;