diff --git a/src/MOI_wrapper/MOI_wrapper.jl b/src/MOI_wrapper/MOI_wrapper.jl index 32a41b13..af0497ad 100644 --- a/src/MOI_wrapper/MOI_wrapper.jl +++ b/src/MOI_wrapper/MOI_wrapper.jl @@ -63,10 +63,6 @@ function MOI.Utilities.load_constants( return end -function MOI.Utilities.function_constants(x::_SetConstants, rows) - return MOI.Utilities.function_constants(x.b, rows) -end - function MOI.Utilities.set_from_constants(x::_SetConstants, S, rows) return MOI.Utilities.set_from_constants(x.b, S, rows) end diff --git a/src/MOI_wrapper/sets/ComplexPositiveSemidefiniteConeTriangle.jl b/src/MOI_wrapper/sets/ComplexPositiveSemidefiniteConeTriangle.jl index b3b7469b..8dbcc74d 100644 --- a/src/MOI_wrapper/sets/ComplexPositiveSemidefiniteConeTriangle.jl +++ b/src/MOI_wrapper/sets/ComplexPositiveSemidefiniteConeTriangle.jl @@ -30,28 +30,6 @@ function MOI.dimension(x::ComplexPositiveSemidefiniteConeTriangle) return x.side_dimension^2 end -function MOI.Utilities.set_dot( - x::AbstractVector{S}, - y::AbstractVector{T}, - set::ComplexPositiveSemidefiniteConeTriangle, -) where {S,T} - U = promote_type(S, T) - result = zero(U) - d = set.side_dimension - k = 0 - for j in 1:d - for i in 1:j-1 - k += 1 - result += 2 * x[k] * y[k] - k += 1 - result += 2 * x[k] * y[k] - end - k += 1 - result += x[k] * y[k] - end - return result -end - function MOI.Utilities.set_dot( x::MOI.Utilities.CanonicalVector{T}, y::MOI.Utilities.CanonicalVector{T}, @@ -66,28 +44,7 @@ function MOI.Utilities.set_dot( end end -function MOI.Utilities.dot_coefficients( - a::AbstractVector, - set::ComplexPositiveSemidefiniteConeTriangle, -) - d = set.side_dimension - b = copy(a) - k = 0 - for j in 1:d - for i in 1:j-1 - k += 1 - b[k] /= 2 - k += 1 - b[k] /= 2 - end - k += 1 - end - return b -end - -function MOI.is_set_dot_scaled(::Type{ComplexPositiveSemidefiniteConeTriangle}) - return true -end +MOI.is_set_dot_scaled(::Type{ComplexPositiveSemidefiniteConeTriangle}) = true struct HermitianComplexPSDConeBridge{T,F} <: MOI.Bridges.Constraint.SetMapBridge{ diff --git a/test/MOI_wrapper.jl b/test/MOI_wrapper.jl index 8c3ab85e..d376d299 100644 --- a/test/MOI_wrapper.jl +++ b/test/MOI_wrapper.jl @@ -523,6 +523,32 @@ function test_NormNuclearConeBridge() return end +function test_HermitianComplexPSDConeBridge() + MOI.Bridges.runtests( + SCS.HermitianComplexPSDConeBridge, + """ + variables: x1, x2, x3, x4 + [x1, x2, x3, x4] in MOI.HermitianPositiveSemidefiniteConeTriangle(2) + """, + """ + variables: x1, x2, x3, x4 + [x1, x2, x4, x3] in SCS.ComplexPositiveSemidefiniteConeTriangle(2) + """, + ) + MOI.Bridges.runtests( + SCS.HermitianComplexPSDConeBridge, + """ + variables: x1, x2, x3, x4, x5, x6, x7, x8, x9 + [x1, x2, x3, x4, x5, x6, x7, x8, x9] in MOI.HermitianPositiveSemidefiniteConeTriangle(3) + """, + """ + variables: x1, x2, x3, x4, x5, x6, x7, x8, x9 + [x1, x2, x7, x3, x4, x8, x5, x9, x6] in SCS.ComplexPositiveSemidefiniteConeTriangle(3) + """, + ) + return +end + end # module TestSCS.runtests()