Skip to content

Commit

Permalink
Update to MOI v0.9
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed May 31, 2019
1 parent 6ebf072 commit 0748f2a
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 17 deletions.
5 changes: 5 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,14 @@ os:
- osx
julia:
- 1.0
- 1.1

notifications:
email: false

before_script:
- julia -e 'using Pkg; Pkg.add(PackageSpec(name="MathOptInterface", rev="master"))'
- julia -e 'using Pkg; Pkg.add(PackageSpec(name="SemidefiniteOptInterface", rev="bl/moiv0.9"))'

after_success:
# push coverage results to Coveralls and Codecov
Expand Down
30 changes: 30 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name = "SDPA"
uuid = "b9a10b5b-afa4-512f-a053-bb3d8080febc"
repo = "https://github.com/JuliaOpt/SDPA.jl.git"
version = "0.2.0"

[deps]
BinaryProvider = "b99e7846-7c00-51b0-8f62-c81ae34c0232"
CxxWrap = "1f15a43c-97ca-5a2a-ae31-89f07a497df4"
Libdl = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MathOptInterface = "b8f27783-ece8-5eb3-8dc8-9495eed66fee"
MathProgBase = "fdba3010-5040-5b88-9595-932c9decdf73"
SemidefiniteModels = "169818f4-1a3d-53bf-95b3-11177825b1e3"
SemidefiniteOptInterface = "f0680fed-b2cd-5302-98f9-f4da282d86b5"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
BinaryProvider = "≥ 0.5.3"
CxxWrap = "0.8"
MathOptInterface = "0.9"
MathProgBase = "0.7"
SemidefiniteModels = "~0.1.1"
SemidefiniteOptInterface = "0.6"
julia = "1"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test"]
7 changes: 0 additions & 7 deletions REQUIRE

This file was deleted.

30 changes: 20 additions & 10 deletions test/MOI_wrapper.jl
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@ const MOIT = MOI.Test
const MOIU = MOI.Utilities
const MOIB = MOI.Bridges

import SDPA
const optimizer = SDPA.Optimizer()

@testset "SolverName" begin
@test MOI.get(optimizer, MOI.SolverName()) == "SDPA"
end

MOIU.@model(SDModelData,
(),
(MOI.EqualTo, MOI.GreaterThan, MOI.LessThan),
Expand All @@ -16,21 +23,24 @@ MOIU.@model(SDModelData,
(MOI.VectorAffineFunction,))
# UniversalFallback is needed for starting values, even if they are ignored by SDPA
const cache = MOIU.UniversalFallback(SDModelData{Float64}())
const optimizer = MOIU.CachingOptimizer(cache,
SDPA.Optimizer())
const cached = MOIU.CachingOptimizer(cache, optimizer)
const bridged = MOIB.full_bridge_optimizer(cached, Float64)
# test 1e-3 because of rsoc3 test, otherwise, 1e-5 is enough
const config = MOIT.TestConfig(atol=1e-3, rtol=1e-3)

@testset "SolverName" begin
@test MOI.get(optimizer, MOI.SolverName()) == "SDPA"
@testset "Unit" begin
MOIT.unittest(bridged, config,
[# Multiple variable constraints on same variable
"solve_with_lowerbound", "solve_affine_interval",
"solve_with_upperbound",
# Quadratic functions are not supported
"solve_qcp_edge_cases", "solve_qp_edge_cases",
# Integer and ZeroOne sets are not supported
"solve_integer_edge_cases", "solve_objbound_edge_cases"])
end

@testset "Linear tests" begin
MOIT.contlineartest(MOIB.SplitInterval{Float64}(optimizer), config,
["linear12"])
MOIT.contlineartest(bridged, config, ["linear12"])
end
@testset "Conic tests" begin
MOIT.contconictest(MOIB.RootDet{Float64}(MOIB.GeoMean{Float64}(MOIB.RSOCtoPSD{Float64}(MOIB.SOCtoPSD{Float64}(optimizer)))),
config,
["lin3", "soc3", "psds", "rootdets", "logdet", "exp"])
MOIT.contconictest(bridged, config, ["lin3", "soc3", "psds", "rootdets", "logdet", "exp"])
end

0 comments on commit 0748f2a

Please sign in to comment.