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

Use HiGHS to compute the dual objective value #226

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
5 changes: 2 additions & 3 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2096,10 +2096,9 @@ function _dual_objective_contribution(l, x, u, d)
return ifelse(abs(x - l) < abs(x - u), l, u) * d
elseif isfinite(l)
return l * d
elseif isfinite(u)
return u * d
else
return 0.0
@assert isfinite(u)
return u * d
end
end

Expand Down
10 changes: 10 additions & 0 deletions test/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -921,6 +921,16 @@ function test_infeasible_point()
return
end

function test_DualObjectiveValue_int()
model = HiGHS.Optimizer()
MOI.set(model, MOI.Silent(), true)
x, _ = MOI.add_constrained_variable(model, MOI.ZeroOne())
MOI.optimize!(model)
@test isnan(MOI.get(model, MOI.DualObjectiveValue()))
return
end

odow marked this conversation as resolved.
Show resolved Hide resolved

end # module

TestMOIHighs.runtests()
Loading