Skip to content

Commit

Permalink
Fix dual
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jan 4, 2024
1 parent 9e770bb commit f7d11d4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1178,6 +1178,17 @@ function MOI.get(
return _dual_multiplier(model) * rc
end

function MOI.get(
model::Optimizer,
attr::MOI.ConstraintDual,
ci::MOI.ConstraintIndex{MOI.VariableIndex,MOI.Interval{Float64}},
)
MOI.check_result_index_bounds(model, attr)
MOI.throw_if_not_valid(model, ci)
rc = model.inner.mult_x_L[ci.value] - model.inner.mult_x_U[ci.value]
return _dual_multiplier(model) * rc
end

### MOI.NLPBlockDual

function MOI.get(model::Optimizer, attr::MOI.NLPBlockDual)
Expand Down

0 comments on commit f7d11d4

Please sign in to comment.