Skip to content

Commit

Permalink
simplify instantiate of JuMP solver
Browse files Browse the repository at this point in the history
  • Loading branch information
jd-lara committed May 25, 2021
1 parent 848c5c5 commit 39c5a94
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions src/core/optimization_container.jl
Original file line number Diff line number Diff line change
Expand Up @@ -99,10 +99,7 @@ function _make_jump_model(settings::Settings)
parameters = get_use_parameters(settings)
optimizer = get_optimizer(settings)
if get_direct_mode_optimizer(settings)
JuMPmodel = JuMP.direct_model(MOI.instantiate(optimizer.optimizer_constructor))
for (k, v) in optimizer.params
set_optimizer_attribute(JuMPmodel, k, v)
end
JuMPmodel = JuMP.direct_model(MOI.instantiate(optimizer))
elseif optimizer === nothing
JuMPmodel = JuMP.Model()
@debug "The optimization model has no optimizer attached"
Expand Down

0 comments on commit 39c5a94

Please sign in to comment.