From a3c2daa492389c4569a69b727644e13328cb7cd7 Mon Sep 17 00:00:00 2001 From: Oscar Dowson Date: Fri, 8 Jul 2022 13:15:46 +1200 Subject: [PATCH 1/3] [Utilities] add ExponentialCone to set_with_dimension (#1941) --- src/Utilities/matrix_of_constraints.jl | 10 ++++++++++ test/Utilities/matrix_of_constraints.jl | 9 +++++++++ 2 files changed, 19 insertions(+) diff --git a/src/Utilities/matrix_of_constraints.jl b/src/Utilities/matrix_of_constraints.jl index 4ed0145755..1fcbd9ee8d 100644 --- a/src/Utilities/matrix_of_constraints.jl +++ b/src/Utilities/matrix_of_constraints.jl @@ -594,6 +594,16 @@ function set_with_dimension(::Type{MOI.RootDetConeSquare}, dim) return MOI.RootDetConeSquare(isqrt(dim - 1)) end +function set_with_dimension(::Type{MOI.ExponentialCone}, dim) + @assert dim == 3 + return MOI.ExponentialCone() +end + +function set_with_dimension(::Type{MOI.DualExponentialCone}, dim) + @assert dim == 3 + return MOI.DualExponentialCone() +end + function set_from_constants(::Vector, ::Type{S}, rows) where {S} return set_with_dimension(S, length(rows)) end diff --git a/test/Utilities/matrix_of_constraints.jl b/test/Utilities/matrix_of_constraints.jl index bc0be90026..7b3ab56152 100644 --- a/test/Utilities/matrix_of_constraints.jl +++ b/test/Utilities/matrix_of_constraints.jl @@ -603,6 +603,15 @@ function test_duplicate() return end +function test_set_with_dimension() + for S in (MOI.ExponentialCone, MOI.DualExponentialCone) + @test MOI.Utilities.set_with_dimension(S, 3) == S() + @test_throws AssertionError MOI.Utilities.set_with_dimension(S, 2) + @test_throws AssertionError MOI.Utilities.set_with_dimension(S, 4) + end + return +end + end TestMatrixOfConstraints.runtests() From 632889eb4dde45c986ef9378a320cc0ff7039cfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sun, 10 Jul 2022 11:23:18 +0200 Subject: [PATCH 2/3] Update PSDSquare_3 test after bridge change (#1942) --- src/Test/test_conic.jl | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Test/test_conic.jl b/src/Test/test_conic.jl index fb16b66def..bee4e59eae 100644 --- a/src/Test/test_conic.jl +++ b/src/Test/test_conic.jl @@ -5640,7 +5640,7 @@ function _test_conic_PositiveSemidefiniteCone_helper_3( @assert psdcone == MOI.PositiveSemidefiniteConeSquare @test ≈( MOI.get(model, MOI.ConstraintDual(), c), - T[1, 0, 0, -1, 1, 0, -1, -1, 1] / T(3), + T[1, -1/2, -1/2, -1/2, 1, -1/2, -1/2, -1/2, 1] / T(3), config, ) end @@ -5714,7 +5714,7 @@ function setup_test( (mock::MOIU.MockOptimizer) -> MOIU.mock_optimize!( mock, ones(T, 1), - (MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeSquare) => [T[1, 0, 0, -1, 1, 0, -1, -1, 1] / 3], + (MOI.VectorAffineFunction{T}, MOI.PositiveSemidefiniteConeSquare) => [T[1, -1/2, -1/2, -1/2, 1, -1/2, -1/2, -1/2, 1] / 3], ), ) return From 1f25d0877c313cf8612d5cf6a493c6a3b4dad8d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beno=C3=AEt=20Legat?= Date: Sat, 23 Jul 2022 23:45:23 +0200 Subject: [PATCH 3/3] Prep for v1.6.1 --- Project.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index d6d6cd804b..5dbe638224 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "MathOptInterface" uuid = "b8f27783-ece8-5eb3-8dc8-9495eed66fee" -version = "1.6.0" +version = "1.6.1" [deps] BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"