From f7d11d46bc0768852a9c3f3f548a0d908778919b Mon Sep 17 00:00:00 2001 From: odow Date: Fri, 5 Jan 2024 12:09:26 +1300 Subject: [PATCH] Fix dual --- src/MOI_wrapper.jl | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/MOI_wrapper.jl b/src/MOI_wrapper.jl index d821456..6367354 100644 --- a/src/MOI_wrapper.jl +++ b/src/MOI_wrapper.jl @@ -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)