Skip to content

Prep for v1.6.1 #1963

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -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"
Expand Down
4 changes: 2 additions & 2 deletions src/Test/test_conic.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
10 changes: 10 additions & 0 deletions src/Utilities/matrix_of_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
9 changes: 9 additions & 0 deletions test/Utilities/matrix_of_constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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()