diff --git a/src/MOI_wrapper.jl b/src/MOI_wrapper.jl index fdc50e2..aa85572 100644 --- a/src/MOI_wrapper.jl +++ b/src/MOI_wrapper.jl @@ -222,13 +222,19 @@ function _add_to_constraint_map!(model::Optimizer, ci) return end -function _add_to_constraint_map!(model::Optimizer, ci::MOI.ConstraintIndex{F,S}) where {F<:MOI.ScalarAffineFunction, S} +function _add_to_constraint_map!( + model::Optimizer, + ci::MOI.ConstraintIndex{F,S}, +) where {F<:MOI.ScalarAffineFunction,S} model.last_affine_added += 1 model.constraint_outer_to_inner[ci] = ci return end -function _add_to_constraint_map!(model::Optimizer, ci::MOI.ConstraintIndex{F,S}) where {F<:MOI.ScalarQuadraticFunction, S} +function _add_to_constraint_map!( + model::Optimizer, + ci::MOI.ConstraintIndex{F,S}, +) where {F<:MOI.ScalarQuadraticFunction,S} model.last_quad_add_added += 1 model.constraint_outer_to_inner[ci] = ci return diff --git a/test/moi_tests.jl b/test/moi_tests.jl index c77a851..9682ddd 100644 --- a/test/moi_tests.jl +++ b/test/moi_tests.jl @@ -1659,10 +1659,7 @@ function test_duals_without_parameters() 0.0, ) c1 = MOI.add_constraint(optimizer, cons1, MOI.LessThan(0.0)) - cons2 = MOI.ScalarAffineFunction( - MOI.ScalarAffineTerm.([1.0], [x[2]]), - 0.0, - ) + cons2 = MOI.ScalarAffineFunction([MOI.ScalarAffineTerm(1.0, x[2])], 0.0) c2 = MOI.add_constraint(optimizer, cons2, MOI.LessThan(1.0)) cons3 = MOI.ScalarAffineFunction( MOI.ScalarAffineTerm.([1.0, -1.0], [x[3], z]),