Skip to content

Commit

Permalink
hack to correct getobjbound
Browse files Browse the repository at this point in the history
  • Loading branch information
mlubin committed Feb 20, 2017
1 parent c797259 commit f7453bc
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/GLPKInterfaceMIP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,17 @@ end

getobjval(lpm::GLPKMathProgModelMIP) = GLPK.mip_obj_val(lpm.inner)

getobjbound(lpm::GLPKMathProgModelMIP) = lpm.objbound
function getobjbound(lpm::GLPKMathProgModelMIP)
# This is a hack. We observed some cases where mip_status == OPT
# and objval and objbound didn't match.
# We can fix this case, but objbound may still be incorrect in
# cases where the solver terminates early.
if GLPK.mip_status(lpm.inner) == GLPK.OPT
return GLPK.mip_obj_val(lpm.inner)
else
return lpm.objbound
end
end

function getsolution(lpm::GLPKMathProgModelMIP)
lp = lpm.inner
Expand Down

0 comments on commit f7453bc

Please sign in to comment.