Skip to content

DictModel cannot convert a JuMP model with quadratic objective #129

@odow

Description

@odow
julia> using JuMP

julia> import Nonconvex

julia> Nonconvex.@load Ipopt
[ Info: Attempting to load the package NonconvexIpopt.
[ Info: Loading succesful.

julia> model = JuMP.Model();

julia> @variable(model, x >= 0)
x

julia> @objective(model, Min, x^2)
x²

julia> ncvx_model = DictModel(model)
ERROR: AssertionError: obj isa AffExpr
Stacktrace:
 [1] get_objective_info(model::JuMP.Model, nvars::Int64)
   @ NonconvexCore ~/.julia/packages/NonconvexCore/YjDSM/src/models/jump.jl:184
 [2] DictModel(model::JuMP.Model)
   @ NonconvexCore ~/.julia/packages/NonconvexCore/YjDSM/src/models/jump.jl:204
 [3] top-level scope
   @ REPL[7]:1

cc @ccoffrin

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