Skip to content

Commit

Permalink
save gurobi's Irreducible Infeasible Sets (IIS) for easier debug of i…
Browse files Browse the repository at this point in the history
…nfeasible optimization problems
  • Loading branch information
martimbrandao committed May 23, 2017
1 parent bf823b1 commit 8da5bb0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/sco/gurobi_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,10 @@ CvxOptStatus GurobiModel::optimize(){
LOG_DEBUG("solver objective value: %.3e", objval);
return CVX_SOLVED;
}
else if (status == GRB_INFEASIBLE) return CVX_INFEASIBLE;
else if (status == GRB_INFEASIBLE) {
GRBcomputeIIS(m_model);
return CVX_INFEASIBLE;
}
else return CVX_FAILED;
}
CvxOptStatus GurobiModel::optimizeFeasRelax(){
Expand Down
3 changes: 2 additions & 1 deletion src/sco/optimizers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,8 +289,9 @@ OptStatus BasicTrustRegionSQP::optimize() {
CvxOptStatus status = model_->optimize();
++results_.n_qp_solves;
if (status != CVX_SOLVED) {
LOG_ERROR("convex solver failed! set TRAJOPT_LOG_THRESH=DEBUG to see solver output. saving model to /tmp/fail.lp");
LOG_ERROR("convex solver failed! set TRAJOPT_LOG_THRESH=DEBUG to see solver output. saving model to /tmp/fail.lp and IIS to /tmp/fail.ilp");
model_->writeToFile("/tmp/fail.lp");
model_->writeToFile("/tmp/fail.ilp");
retval = OPT_FAILED;
goto cleanup;
}
Expand Down

0 comments on commit 8da5bb0

Please sign in to comment.