diff --git a/test/REQUIRE b/test/REQUIRE index 92a0f6e..e4ae2fe 100644 --- a/test/REQUIRE +++ b/test/REQUIRE @@ -1,2 +1,2 @@ -JuMP 0.7 +JuMP 0.13 FactCheck diff --git a/test/runtests.jl b/test/runtests.jl index 993910a..e871829 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,16 +3,16 @@ using Base.Test # JuMP version of bonminEx1_Nonlinear.osil m = Model(solver = OsilSolver()) -@defVar(m, 0 <= x0 <= 1, Bin) -@defVar(m, x1 >= 0) -@defVar(m, x2 >= 0) -@defVar(m, 0 <= x3 <= 5, Int) -@setObjective(m, Min, x0 - x1 - x2) -#@setNLObjective(m, Min, x1/x2) -@addNLConstraint(m, (x1 - 0.5)^2 + (x2 - 0.5)^2 <= 1/π) -@addConstraint(m, x0 - x1 <= 0) -@addConstraint(m, x1 + x2 + x3 <= 2) -#@addNLConstraint(m, 1 <= log(x1/x2)) +@variable(m, 0 <= x0 <= 1, Bin) +@variable(m, x1 >= 0) +@variable(m, x2 >= 0) +@variable(m, 0 <= x3 <= 5, Int) +@objective(m, Min, x0 - x1 - x2) +#@NLobjective(m, Min, x1/x2) +@NLconstraint(m, (x1 - 0.5)^2 + (x2 - 0.5)^2 <= 1/π) +@constraint(m, x0 - x1 <= 0) +@constraint(m, x1 + x2 + x3 <= 2) +#@NLconstraint(m, 1 <= log(x1/x2)) #d = JuMP.JuMPNLPEvaluator(m, JuMP.prepConstrMatrix(m)) @@ -26,11 +26,11 @@ solve(m) nvar = 10 solver=OsilSolver(solver = "couenne") m = Model(solver=solver) -@defVar(m, -10 <= x[i=1:nvar] <= 10) -@setNLObjective(m, Min, sum{1/(1+exp(-x[i])), i=1:nvar}) -@addConstraint(m, sum{x[i], i=1:nvar} <= .4*nvar) +@variable(m, -10 <= x[i=1:nvar] <= 10) +@NLobjective(m, Min, sum{1/(1+exp(-x[i])), i=1:nvar}) +@constraint(m, sum{x[i], i=1:nvar} <= .4*nvar) @test solve(m) == :Optimal -@test isapprox(getValue(x[1]),-10.0) +@test isapprox(getvalue(x[1]),-10.0) include(Pkg.dir("JuMP","test","runtests.jl"))