Skip to content

Commit

Permalink
Format
Browse files Browse the repository at this point in the history
  • Loading branch information
gvidigal-psr committed Jul 22, 2024
1 parent 53c7aef commit cff4eca
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
10 changes: 8 additions & 2 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions test/moi_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down

0 comments on commit cff4eca

Please sign in to comment.