Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Oct 4, 2021
1 parent ad23255 commit 4bf6424
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions test/perf/force_bridge_formulation.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ import GLPK
### No bridging

function foo(optimizer, force_bridge_formulation)
model = Model(
optimizer;
bridge_constraints = force_bridge_formulation,
)
model = Model(optimizer; bridge_constraints = force_bridge_formulation)
set_silent(model)
@variable(model, x >= 0)
@constraint(model, 2x + 1 <= 1)
@objective(model, Max, 1.0 * x)
optimize!(model)
return optimize!(model)
end

### ObjectiveFunction bridging
Expand All @@ -24,7 +21,7 @@ function foo_obj(optimizer)
@variable(model, x >= 0)
@constraint(model, 2x + 1 <= 1)
@objective(model, Max, x)
optimize!(model)
return optimize!(model)
end

### variable bridging
Expand All @@ -35,7 +32,7 @@ function foo_var(optimizer)
@variable(model, x[1:1] in MOI.Nonnegatives(1))
@constraint(model, 2x[1] + 1 <= 1)
@objective(model, Max, 1.0 * x[1])
optimize!(model)
return optimize!(model)
end

### constraint bridging
Expand All @@ -46,7 +43,7 @@ function foo_con(optimizer)
@variable(model, x[1:2])
@constraint(model, x in MOI.Nonpositives(2))
@objective(model, Max, 1.0 * x[1])
optimize!(model)
return optimize!(model)
end

const optimizer = ARGS[1] == "clp" ? Clp.Optimizer : GLPK.Optimizer
Expand Down

0 comments on commit 4bf6424

Please sign in to comment.