Commit 5d79ee1d authored by Manuel Mohr's avatar Manuel Mohr
Browse files

lpp: Only set solution state to feasible if a solution was found.

parent 4a4429bf
......@@ -190,8 +190,19 @@ static void gurobi_solve(gurobi_t *grb)
case GRB_INFEASIBLE: lpp->sol_state = lpp_infeasible; break;
case GRB_INF_OR_UNBD: lpp->sol_state = lpp_inforunb; break;
case GRB_UNBOUNDED: lpp->sol_state = lpp_unbounded; break;
/* TODO: is this correct? */
default: lpp->sol_state = lpp_feasible; break;
case GRB_LOADED: /* fallthrough */
case GRB_CUTOFF: lpp->sol_state = lpp_unknown; break;
default: {
int num_solutions;
error = GRBgetintattr(grb->model, GRB_INT_ATTR_SOLCOUNT, &num_solutions);
check_gurobi_error(grb, error);
if (num_solutions > 0) {
lpp->sol_state = lpp_feasible;
} else {
lpp->sol_state = lpp_unknown;
}
break;
}
}
if (lpp->sol_state >= lpp_feasible) {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment