Skip to content

ExaModels.Optimizer fails when variables have bounds #199

@klamike

Description

@klamike
julia> m = Model(() -> ExaModels.Optimizer(madnlp, CUDABackend()))
A JuMP Model
├ solver: madnlp running with ExaModels
├ objective_sense: FEASIBILITY_SENSE
├ num_variables: 0
├ num_constraints: 0
└ Names registered in the model: none

julia> @variable m x  1
x

julia> @objective m Min x^2 + x + 1+ x + 1

julia> optimize!(m)
ERROR: KeyError: key MathOptInterface.ConstraintIndex{MathOptInterface.VariableIndex, MathOptInterface.GreaterThan{Float64}}(1) not found
Stacktrace:

The reason is we skip adding variable bounds to con_to_idx. Note this is not an issue with ExaModel(m) since that path doesn't create the IndexMap

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions