Skip to content

Commit 988ab63

Browse files
author
Sylvain Mouret
authored
Merge pull request #73 from JuliaOpt/huckl3b3rry87-pull-request/c1387422
Fix warnings and added support for unconstrained problems
2 parents 9ce2fee + fd6b76e commit 988ab63

File tree

8 files changed

+235
-150
lines changed

8 files changed

+235
-150
lines changed

examples/hs035_restart.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ lambda = ones(n+m)
122122
restartProblem(kp, x, lambda)
123123
@fact applicationReturnStatus(kp) --> :Initialized
124124
solveProblem(kp)
125-
facts("Test optimal solutions (at a different starting point") do
125+
facts("Test optimal solutions (at a different starting point)") do
126126
@fact applicationReturnStatus(kp) --> :Optimal
127127
@fact kp.x --> roughly(
128128
[1.3333333, 0.7777777, 0.4444444], 1e-5)

examples/jump_hs035_options.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ function testmodel(m)
77
+ 2.0*x[1]*x[2] + 2.0*x[1]*x[3])
88
@constraint(m, x[1] + x[2] + 2.0*x[3] <= 3)
99
solve(m)
10-
@test_approx_eq_eps getvalue(x[1]) 1.3333333 1e-5
11-
@test_approx_eq_eps getvalue(x[2]) 0.7777777 1e-5
12-
@test_approx_eq_eps getvalue(x[3]) 0.4444444 1e-5
13-
@test_approx_eq_eps getobjectivevalue(m) 0.1111111 1e-5
10+
@test isapprox(getvalue(x[1]), 1.3333333, atol=1.0e-5)
11+
@test isapprox(getvalue(x[2]), 0.7777777, atol=1.0e-5)
12+
@test isapprox(getvalue(x[3]), 0.4444444, atol=1.0e-5)
13+
@test isapprox(getobjectivevalue(m), 0.1111111, atol=1.0e-5)
1414
end
1515

1616
m = Model(solver=KnitroSolver())
@@ -36,4 +36,4 @@ MathProgBase.freemodel!(ktrmod)
3636
Model(solver=KnitroSolver(tuner_file=joinpath(dirname(@__FILE__)"tuner-explore.opt")))
3737
testmodel(m)
3838
ktrmod = internalmodel(m)
39-
MathProgBase.freemodel!(ktrmod)
39+
MathProgBase.freemodel!(ktrmod)

examples/jump_warmstart.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ using KNITRO, JuMP, Base.Test
22

33
m = Model(solver=KnitroSolver())
44
@variable(m, x)
5-
setValue(x, 5)
5+
setvalue(x, 5)
66
@NLobjective(m, Min, -log(x)+x^2)
77
solve(m)
8-
@test_approx_eq_eps getobjectivevalue(m) 0.84657 1e-5
9-
@test_approx_eq_eps getvalue(x) 0.707107 1e-5
8+
@test isapprox(getobjectivevalue(m), 0.84657, atol=1.0e-5)
9+
@test isapprox(getvalue(x), 0.707107, atol=1.0e-5)
1010

1111
ktrmod = internalmodel(m)
12-
MathProgBase.freemodel!(ktrmod)
12+
MathProgBase.freemodel!(ktrmod)

0 commit comments

Comments
 (0)