Skip to content

Commit

Permalink
fix adnlpmodels 0.3
Browse files Browse the repository at this point in the history
  • Loading branch information
tmigot authored and abelsiqueira committed Dec 20, 2021
1 parent b9b3e3e commit 4c3a039
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,9 @@ function tests()
@test stats.iter == 0
@test stats.status == :first_order

meta = NLPModelMeta(1, x0 = rand(1), lvar = zeros(1), uvar = ones(1), minimize = false)
nlp = ADNLPModel(meta, Counters(), ADNLPModels.ForwardDiffAD(1), x -> x[1], x -> [])
x0, f = rand(1), x -> x[1]
meta = NLPModelMeta(1, x0 = x0, lvar = zeros(1), uvar = ones(1), minimize = false)
nlp = ADNLPModel(meta, Counters(), ADNLPModels.ForwardDiffAD(1, f, x0), f, x -> [])
stats = ipopt(nlp, print_level = 0)
@test isapprox(stats.solution, ones(1), rtol = 1e-6)
@test isapprox(stats.objective, 1.0, rtol = 1e-6)
Expand Down

0 comments on commit 4c3a039

Please sign in to comment.