Skip to content

Commit 041cffe

Browse files
authored
Merge pull request #190 from jump-dev/bl/jump0.23
Update to MOI v1 and JuMP v0.23
2 parents 5e440f7 + 833b023 commit 041cffe

File tree

4 files changed

+5
-129
lines changed

4 files changed

+5
-129
lines changed

Project.toml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
1818
BlockDiagonals = "0.1"
1919
ChainRulesCore = "1"
2020
IterativeSolvers = "0.9"
21-
JuMP = "0.22"
21+
JuMP = "0.23"
2222
LazyArrays = "0.21, 0.22"
23-
MathOptInterface = "0.10.8"
24-
MathOptSetDistances = "0.1"
23+
MathOptInterface = "1"
24+
MathOptSetDistances = "0.2"
2525
julia = "1.6"
2626

2727
[extras]

test/runtests.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ const MOI = MathOptInterface
1515
const MOIU = MathOptInterface.Utilities
1616
const MOIT = MathOptInterface.Test
1717

18-
const ATOL = 1e-4
19-
const RTOL = 1e-4
18+
const ATOL = 2e-4
19+
const RTOL = 2e-4
2020

2121
@testset "MOI_wrapper" begin
2222
@testset "Utils" begin

test/solver_interface.jl

Lines changed: 0 additions & 121 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,3 @@
1-
const MOIDT = MOI.DeprecatedTest
2-
3-
@testset "Linear tests" begin
4-
MOIDT.contlineartest(DiffOpt.diff_optimizer(GLPK.Optimizer), MOIDT.Config(basis = true), [
5-
"partial_start", # see below
6-
"linear12", # see below
7-
])
8-
model = DiffOpt.diff_optimizer(Ipopt.Optimizer)
9-
MOI.set(model, MOI.Silent(), true)
10-
MOIDT.partial_start_test(
11-
model,
12-
MOIDT.Config(basis = true, optimal_status=MOI.LOCALLY_SOLVED, atol=ATOL, rtol=RTOL)
13-
)
14-
15-
# This requires an infeasiblity certificate for a variable bound.
16-
MOIDT.linear12test(
17-
DiffOpt.diff_optimizer(GLPK.Optimizer),
18-
MOIDT.Config(infeas_certificates=false)
19-
)
20-
end
21-
22-
@testset "Convex Quadratic tests" begin
23-
model = DiffOpt.diff_optimizer(OSQP.Optimizer)
24-
MOI.set(model, MOI.Silent(), true)
25-
MOIDT.qp1test(model, MOIDT.Config(atol=1e-2, rtol=1e-2))
26-
model = DiffOpt.diff_optimizer(OSQP.Optimizer)
27-
MOI.set(model, MOI.Silent(), true)
28-
MOIDT.qp2test(model, MOIDT.Config(atol=1e-2, rtol=1e-2))
29-
model = DiffOpt.diff_optimizer(Ipopt.Optimizer)
30-
MOI.set(model, MOI.Silent(), true)
31-
MOIDT.qp3test(
32-
model,
33-
MOIDT.Config(optimal_status=MOI.LOCALLY_SOLVED, atol=1e-3),
34-
)
35-
end
36-
37-
381
@testset "FEASIBILITY_SENSE zeros objective" begin
392
model = DiffOpt.diff_optimizer(GLPK.Optimizer)
403
MOI.set(model, MOI.Silent(), true)
@@ -50,87 +13,3 @@ end
5013
MOI.optimize!(model)
5114
@test MOI.get(model, MOI.ObjectiveValue()) == 0.0
5215
end
53-
54-
@testset "ModelLike" begin
55-
for opt in [GLPK.Optimizer]
56-
MODEL = DiffOpt.diff_optimizer(opt)
57-
@testset "default_objective_test" begin
58-
MOIDT.default_objective_test(MODEL)
59-
end
60-
@testset "default_status_test" begin
61-
MOIDT.default_status_test(MODEL)
62-
end
63-
@testset "nametest" begin
64-
MOIDT.nametest(MODEL)
65-
end
66-
@testset "validtest" begin
67-
MOIDT.validtest(MODEL)
68-
end
69-
@testset "emptytest" begin
70-
MOIDT.emptytest(MODEL)
71-
end
72-
@testset "orderedindicestest" begin
73-
MOIDT.orderedindicestest(MODEL)
74-
end
75-
@testset "copytest" begin
76-
# Requires VectorOfVariables
77-
# MOIDT.copytest(MODEL, MOIU.CachingOptimizer(
78-
# DiffOpt.diff_optimizer(GLPK.Optimizer),
79-
# GLPK.Optimizer()
80-
# ))
81-
end
82-
end
83-
end
84-
85-
86-
@testset "Unit" begin
87-
MOIDT.unittest(DiffOpt.diff_optimizer(GLPK.Optimizer), MOIDT.Config(atol=ATOL, rtol=RTOL), [
88-
"number_threads", # might not work on all solvers
89-
90-
# not testing integer constraints
91-
"solve_zero_one_with_bounds_1",
92-
"solve_zero_one_with_bounds_2",
93-
"solve_zero_one_with_bounds_3",
94-
"solve_integer_edge_cases",
95-
96-
"delete_soc_variables",
97-
"solve_qcp_edge_cases", # currently only affine or conic constraints
98-
"solve_objbound_edge_cases",
99-
"solve_qp_edge_cases", # No quadratics
100-
"solve_qp_zero_offdiag",
101-
"update_dimension_nonnegative_variables", # TODO: fix this
102-
103-
# see below
104-
"solve_duplicate_terms_vector_affine",
105-
# SOC not supportedot supported
106-
"solve_start_soc",
107-
])
108-
model = DiffOpt.diff_optimizer(SCS.Optimizer)
109-
MOI.set(model, MOI.Silent(), true)
110-
MOIDT.solve_duplicate_terms_obj(model, MOIDT.Config(atol=ATOL, rtol=RTOL))
111-
end
112-
113-
@testset "basic_constraint_tests" begin
114-
# it contains SOCP constraints
115-
model = DiffOpt.diff_optimizer(SCS.Optimizer)
116-
MOI.set(model, MOI.Silent(), true)
117-
MOIDT.basic_constraint_tests(model, MOIDT.Config())
118-
end
119-
120-
# TODO: re-organiza conic tests
121-
@testset "contconic.jl tests" begin
122-
model = DiffOpt.diff_optimizer(SCS.Optimizer)
123-
MOI.set(model, MOI.Silent(), true)
124-
# Needed for `lin2v`
125-
MOI.Bridges.remove_bridge(model.optimizer.optimizer, MOI.Bridges.Variable.ZerosBridge{Float64})
126-
# linear tests
127-
for (name, test) in MOIDT.lintests
128-
test(model, MOIDT.Config(atol=ATOL, rtol=RTOL))
129-
end
130-
131-
CONFIG_LOW_TOL = MOIDT.Config(atol = 1e-3, rtol = 1e-2, duals = false, infeas_certificates = false)
132-
# SOCP tests
133-
for (name, test) in MOIDT.soctests
134-
test(model, CONFIG_LOW_TOL)
135-
end
136-
end

test/utils.jl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,6 @@ const MOI = MathOptInterface
66
import LinearAlgebra: dot, , Diagonal
77
import SparseArrays: sparse
88

9-
const ATOL = 1e-4
10-
const RTOL = 1e-4
11-
129
macro _test(computed, expected::Symbol)
1310
exp = esc(expected)
1411
com = esc(computed)

0 commit comments

Comments
 (0)