Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Oct 8, 2023
1 parent d4addb3 commit cea09a9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ end
function MOI.optimize!(model::Optimizer{T}) where {T}
num_variables = length(model.starting_values)
backend = MOI.Nonlinear.SparseReverseMode()
vars = MOI.get(model, MOI.ListOfVariableIndices())
vars = MOI.get(model.variables, MOI.ListOfVariableIndices())
evaluator = MOI.Nonlinear.Evaluator(model.nlp_model, backend, vars)
nlp_data = MOI.NLPBlockData(evaluator)

Expand Down Expand Up @@ -280,7 +280,7 @@ function MOI.optimize!(model::Optimizer{T}) where {T}

initial_x = starting_value.(model, eachindex(model.starting_values))
options = copy(model.options)
has_bounds = any(i -> isfinite(model.variables.lower[i]) || isfinite(model.variables.upper[i]), vars)
has_bounds = any(vi -> isfinite(model.variables.lower[vi.value]) || isfinite(model.variables.upper[vi.value]), vars)
if has_bounds
lower = [model.variables.lower[vi.value] for vi in vars]
upper = [model.variables.upper[vi.value] for vi in vars]
Expand Down

0 comments on commit cea09a9

Please sign in to comment.