Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix infeasibility certificate tests #503

Merged
merged 1 commit into from
Feb 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions src/MOI_wrapper/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2903,6 +2903,9 @@ function MOI.get(
)
_throw_if_optimize_in_progress(model, attr)
MOI.check_result_index_bounds(model, attr)
if model.has_unbounded_ray !== nothing
return MOI.Utilities.get_fallback(model, attr, c)
end
row = _info(model, c).row
_update_if_necessary(model)
rhs = Ref{Cdouble}()
Expand Down Expand Up @@ -3108,6 +3111,9 @@ end
function MOI.get(model::Optimizer, attr::MOI.ObjectiveValue)
_throw_if_optimize_in_progress(model, attr)
MOI.check_result_index_bounds(model, attr)
if model.has_unbounded_ray
return MOI.Utilities.get_fallback(model, attr)
end
if attr.result_index > 1
MOI.set(
model,
Expand Down Expand Up @@ -3177,6 +3183,9 @@ end
function MOI.get(model::Optimizer, attr::MOI.DualObjectiveValue)
_throw_if_optimize_in_progress(model, attr)
MOI.check_result_index_bounds(model, attr)
if model.has_infeasibility_cert
return MOI.Utilities.get_fallback(model, attr, Float64)
end
valueP = Ref{Cdouble}()
ret = GRBgetdblattr(model, "ObjBound", valueP)
_check_ret(model, ret)
Expand Down
3 changes: 0 additions & 3 deletions test/MOI/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,6 @@ function test_runtests()
model,
MOI.Test.Config(atol = 1e-3, rtol = 1e-3),
exclude = String[
# TODO(odow): new tests from MOI that need implementing
"test_infeasible_",
"test_unbounded_",
# TODO(odow): investigate errors
# Gurobi Error 10015: Cannot compute IIS on a feasible model
# https://www.gurobi.com/documentation/9.5/refman/error_codes.html
Expand Down