Skip to content

[ExaModelsJuMP] Wrapper is broken if JuMP's objective sense is set to Max #56

@frapac

Description

@frapac

Please find attached a MWE:

using Test
using JuMP
using ExaModels
using MadNLP

model = Model()
@variable(model, 0 <= x <= 1)
@objective(model, Max, x^2)

# Optimize with JuMP
JuMP.set_optimizer(model, MadNLP.Optimizer)
JuMP.optimize!(model)
@test JuMP.objective_value(model)  1.0 rtol=1e-7

# Optimize with ExaModels
exam = ExaModels.ExaModel(model)
results = madnlp(exam)
@test results.objective  1.0 rtol=1e-7 #broken!

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