Skip to content

Commit

Permalink
Remove Ipopt from tests
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Apr 13, 2023
1 parent 86a4cf1 commit 9ddaaa3
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 24 deletions.
6 changes: 2 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
[compat]
BlockDiagonals = "0.1"
ChainRulesCore = "1"
HiGHS = "1"
Ipopt = "1"
HiGHS = "1.5.1"
IterativeSolvers = "0.9"
JuMP = "1"
LazyArrays = "0.21, 0.22, 1"
Expand All @@ -30,9 +29,8 @@ julia = "1.6"
[extras]
DelimitedFiles = "8bb1440f-4735-579b-a4ab-409b98df4dab"
HiGHS = "87dc4568-4c63-4d18-b0c0-bb2238e4078b"
Ipopt = "b6b21f68-93f8-5de0-b562-5493be1d77c9"
SCS = "c946c3f1-0d1f-5ce8-9dea-7daa1f7e2d13"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["DelimitedFiles", "HiGHS", "Ipopt", "SCS", "Test"]
test = ["DelimitedFiles", "HiGHS", "SCS", "Test"]
4 changes: 2 additions & 2 deletions test/conic_program.jl
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module TestConicProgram

using Test
import DiffOpt
import Ipopt
import HiGHS
import LinearAlgebra
import MathOptInterface as MOI
import SCS
Expand Down Expand Up @@ -848,7 +848,7 @@ function test_singular_exception()
q = [1.0, 1.0]
G = [1.0 1.0]
h = [-1.0]
model = DiffOpt.diff_optimizer(Ipopt.Optimizer)
model = DiffOpt.diff_optimizer(HiGHS.Optimizer)
MOI.set(model, MOI.Silent(), true)
x = MOI.add_variables(model, 2)
quad_terms = MOI.ScalarQuadraticTerm{Float64}[]
Expand Down
13 changes: 6 additions & 7 deletions test/jump.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ using JuMP
import DelimitedFiles
import DiffOpt
import HiGHS
import Ipopt
import IterativeSolvers
import LinearAlgebra
import MathOptInterface as MOI
Expand Down Expand Up @@ -44,7 +43,7 @@ function test_forward_on_trivial_qp()
0.0 -1.0
]
h = [1, 0.7, 0.7, -1, 0, 0]
model = JuMP.Model(() -> DiffOpt.diff_optimizer(Ipopt.Optimizer))
model = JuMP.Model(() -> DiffOpt.diff_optimizer(HiGHS.Optimizer))
MOI.set(model, MOI.Silent(), true)
@variable(model, x[1:2])
@objective(model, Min, x' * Q * x + q' * x)
Expand All @@ -59,7 +58,7 @@ function test_differentiating_trivial_qp_1()
q = [1.0, 1.0]
G = [1.0 1.0]
h = [-1.0]
model = JuMP.direct_model(DiffOpt.diff_optimizer(Ipopt.Optimizer))
model = JuMP.direct_model(DiffOpt.diff_optimizer(HiGHS.Optimizer))
MOI.set(model, MOI.Silent(), true)
x = @variable(model, [1:2])
@objective(model, Min, x' * Q * x + q' * x)
Expand Down Expand Up @@ -103,7 +102,7 @@ function test_differentiating_qp_with_inequality_and_equality_constraints()
h = [1.0, 1.0, 1.0, 0.0, 0.0, 0.0]
A = [1.0 1.0 1.0;]
b = [0.5]
model = Model(() -> DiffOpt.diff_optimizer(Ipopt.Optimizer))
model = Model(() -> DiffOpt.diff_optimizer(HiGHS.Optimizer))
MOI.set(model, MOI.Silent(), true)
@variable(model, x[1:3])
@objective(model, Min, x' * Q * x + q' * x)
Expand Down Expand Up @@ -147,7 +146,7 @@ function test_differentiating_MOI_examples_1()
# st x + 2y + 3z >= 4 (c1)
# x + y >= 1 (c2)
# x, y, z \in R
model = JuMP.direct_model(DiffOpt.diff_optimizer(Ipopt.Optimizer))
model = JuMP.direct_model(DiffOpt.diff_optimizer(HiGHS.Optimizer))
MOI.set(model, MOI.Silent(), true)
@variables(model, begin
x
Expand Down Expand Up @@ -191,7 +190,7 @@ function test_differentiating_moi_examples_2_non_trivial_backward_pass_vector()
# minimize 2 x^2 + y^2 + xy + x + y
# s.t. x, y >= 0
# x + y = 1 (c1)
model = JuMP.Model(() -> DiffOpt.diff_optimizer(Ipopt.Optimizer))
model = JuMP.Model(() -> DiffOpt.diff_optimizer(HiGHS.Optimizer))
MOI.set(model, MOI.Silent(), true)
@variable(model, x 0)
@variable(model, y 0)
Expand Down Expand Up @@ -245,7 +244,7 @@ function test_differentiating_non_trivial_convex_qp_jump()
q = vec(q)
h = vec(h)
b = vec(b)
model = JuMP.Model(() -> DiffOpt.diff_optimizer(Ipopt.Optimizer))
model = JuMP.Model(() -> DiffOpt.diff_optimizer(HiGHS.Optimizer))
MOI.set(model, MOI.Silent(), true)
@variable(model, x[1:nz])
@objective(model, Min, x' * Q * x + q' * x)
Expand Down
3 changes: 1 addition & 2 deletions test/linear_program.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ module TestLinearProgram
using Test
import DiffOpt
import HiGHS
import Ipopt
import MathOptInterface as MOI
import SCS

Expand Down Expand Up @@ -54,7 +53,7 @@ function test_differentiating_a_simple_LP_with_GreaterThan_constraint()
# s.t. x >= 3
nz = 1
qp_test_with_solutions(
Ipopt.Optimizer;
HiGHS.Optimizer;
q = ones(nz),
G = -ones(1, nz),
h = [-3.0],
Expand Down
17 changes: 8 additions & 9 deletions test/quadratic_program.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ using Test
import DelimitedFiles
import DiffOpt
import HiGHS
import Ipopt
import MathOptInterface as MOI
import SCS

Expand Down Expand Up @@ -43,7 +42,7 @@ function test_forward_on_trivial_QP()
]
h = [1, 0.7, 0.7, -1, 0, 0]
qp_test_with_solutions(
Ipopt.Optimizer;
HiGHS.Optimizer;
Q = Q,
q = q,
G = G,
Expand All @@ -68,12 +67,12 @@ function test_differentiating_trivial_qp_1()
G = [1.0 1.0]
h = [-1.0]

model = DiffOpt.diff_optimizer(Ipopt.Optimizer)
model = DiffOpt.diff_optimizer(HiGHS.Optimizer)
MOI.set(model, MOI.Silent(), true)
x = MOI.add_variables(model, 2)

qp_test_with_solutions(
Ipopt.Optimizer;
HiGHS.Optimizer;
Q = Q,
q = q,
G = G,
Expand All @@ -96,7 +95,7 @@ end
# G = [1.0 1.0;]
# h = [-1.0;]
#
# model = DiffOpt.diff_optimizer(Ipopt.Optimizer)
# model = DiffOpt.diff_optimizer(HiGHS.Optimizer)
# x = MOI.add_variables(model, 2)
#
# # define objective
Expand Down Expand Up @@ -149,7 +148,7 @@ function test_differentiating_qp_with_inequality_and_equality_constraints()
A = [1.0 1.0 1.0;]
b = [0.5]
qp_test_with_solutions(
Ipopt.Optimizer;
HiGHS.Optimizer;
Q = Q,
q = q,
G = G,
Expand Down Expand Up @@ -207,7 +206,7 @@ function test_differentiating_moi_examples_1()
]
dh = [-0.35714284; -0.4285714]
qp_test_with_solutions(
Ipopt.Optimizer;
HiGHS.Optimizer;
Q = Q,
q = q,
G = G,
Expand Down Expand Up @@ -256,7 +255,7 @@ function test_differentiating_moi_examples_2()
dA = [0.375 -1.075]
db = [0.7]
qp_test_with_solutions(
Ipopt.Optimizer;
HiGHS.Optimizer;
Q = Q,
q = q,
G = G,
Expand Down Expand Up @@ -321,7 +320,7 @@ function test_differentiating_non_trivial_convex_qp_moi()
dhb = vec(grads_actual[4])
dbb = vec(grads_actual[6])
qp_test(
Ipopt.Optimizer,
HiGHS.Optimizer,
true,
true,
true;
Expand Down

0 comments on commit 9ddaaa3

Please sign in to comment.