Skip to content

Commit

Permalink
🐛 Fixing bug for MILP solver using IBM CPLEX
Browse files Browse the repository at this point in the history
  • Loading branch information
fplanes committed Nov 16, 2017
1 parent 9d681c7 commit 948781a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/base/solvers/solveCobraMILP.m
Original file line number Diff line number Diff line change
Expand Up @@ -436,11 +436,12 @@
end

% Get results
try x = Result.x; catch x=zeros(size(cplexlp.Model.ub)); end %return zeros if infeasible
try f = osense*Result.objval; catch f=nan; end %return Nan if infeasible
stat = Result.status;
if (stat == 101 || stat == 102 || stat == 1)
solStat = 1; % Opt integer within tolerance
% Return solution if problem is feasible, bounded and optimal
x = Result.x;
f = osense*Result.objval;
elseif (stat == 103 || stat == 3)
solStat = 0; % Integer infeas
elseif (stat == 118 || stat == 119 || stat == 2)
Expand Down

0 comments on commit 948781a

Please sign in to comment.