Skip to content

Commit

Permalink
add two more test instances
Browse files Browse the repository at this point in the history
  • Loading branch information
lkapelevich committed Aug 17, 2020
1 parent 2100b62 commit 2a43527
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 0 deletions.
41 changes: 41 additions & 0 deletions test/nativeinstances.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1284,6 +1284,47 @@ function matrixepiperentropy2(T; options...)
@test tr(W * log(W)) T(5) atol=tol rtol=tol
end

function matrixepiperentropy3(T; options...)
tol = sqrt(sqrt(eps(T)))
Random.seed!(1)
rt2 = sqrt(T(2))
side = 3
svec_dim = Cones.svec_length(side)
cone_dim = 2 * svec_dim + 1
c = vcat(zeros(T, svec_dim + 1), ones(T, svec_dim))
A = hcat(one(T), zeros(T, 1, 2 * svec_dim))
b = [zero(T)]
h = zeros(T, cone_dim)
G = Diagonal(-one(T) * I, cone_dim)
cones = Cone{T}[Cones.MatrixEpiPerEntropy{T}(cone_dim)]

r = build_solve_check(c, A, b, G, h, cones; tol = tol, options...)
@test r.status == :Optimal
@test r.primal_obj zero(T) atol=tol rtol=tol
@test r.s[1] zero(T) atol=tol rtol=tol
@test r.s[(svec_dim + 2):end] zeros(T, svec_dim) atol=tol rtol=tol
end

function matrixepiperentropy4(T; options...)
tol = sqrt(sqrt(eps(T)))
Random.seed!(1)
rt2 = sqrt(T(2))
side = 3
svec_dim = Cones.svec_length(side)
cone_dim = 2 * svec_dim + 1
c = vcat(zero(T), ones(T, svec_dim), zeros(T, svec_dim))
A = hcat(one(T), zeros(T, 1, 2 * svec_dim))
b = [zero(T)]
h = zeros(T, cone_dim)
G = Diagonal(-one(T) * I, cone_dim)
cones = Cone{T}[Cones.MatrixEpiPerEntropy{T}(cone_dim)]

r = build_solve_check(c, A, b, G, h, cones; tol = tol, options...)
@test r.status == :Optimal
@test r.primal_obj zero(T) atol=tol rtol=tol
@test r.s zeros(T, cone_dim) atol=tol rtol=tol
end

function linmatrixineq1(T; options...)
tol = sqrt(sqrt(eps(T)))
Random.seed!(1)
Expand Down
5 changes: 5 additions & 0 deletions test/nativesets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ inst_cones_few = [
# "matrixepipersquare1",
"matrixepiperentropy1",
"matrixepiperentropy2",
"matrixepiperentropy3",
"matrixepiperentropy4",
# "linmatrixineq1",
# "possemideftri1",
# "possemideftri5",
Expand Down Expand Up @@ -125,6 +127,9 @@ inst_cones_many = [
"matrixepipersquare2",
"matrixepipersquare3",
"matrixepiperentropy1",
"matrixepiperentropy2",
"matrixepiperentropy3",
"matrixepiperentropy4",
"hypoperlogdettri1",
"hypoperlogdettri2",
"hypoperlogdettri3",
Expand Down

0 comments on commit 2a43527

Please sign in to comment.