Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Jul 3, 2024
1 parent 7e226b9 commit 2b5a47b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 138 deletions.
1 change: 0 additions & 1 deletion src/Bridges/Constraint/Constraint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ const Certificate = SOS.Certificate
include("empty.jl")
include("psd2x2.jl")
include("diagonally_dominant.jl")
include("scaled_diagonally_dominant.jl")

# SOS polynomial bridges
include("utilities.jl")
Expand Down
120 changes: 0 additions & 120 deletions src/Bridges/Constraint/scaled_diagonally_dominant.jl

This file was deleted.

22 changes: 5 additions & 17 deletions src/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -303,31 +303,19 @@ function PolyJuMP.bridges(
end

function PolyJuMP.bridges(
::Type{<:MOI.AbstractVectorFunction},
F::Type{<:MOI.AbstractVectorFunction},
::Type{<:ScaledDiagonallyDominantConeTriangle},
)
return [(Bridges.Constraint.ScaledDiagonallyDominantBridge, Float64)]
end

function _bridge_coefficient_type(::Type{<:WeightedSOSCone{M}}) where {M}
return _complex(Float64, M)
end

function _bridge_coefficient_type(::Type{SOSPolynomialSet{D,B,C}}) where {D,B,C}
return _complex(Float64, matrix_cone_type(C))
end

function PolyJuMP.bridges(S::Type{<:WeightedSOSCone})
) # Needed so that `Variable.ScaledDiagonallyDominantBridge` is added as well
return Tuple{Type,Type}[(
Bridges.Variable.KernelBridge,
_bridge_coefficient_type(S),
MOI.Bridges.Constraint.VectorSlackBridge,
PolyJuMP.coefficient_type_or_float(F),
)]
end

function PolyJuMP.bridges(
F::Type{<:MOI.AbstractVectorFunction},
::Type{<:WeightedSOSCone},
) # Needed so that `KernelBridge` is added as well
) # Needed so that `Variable.KernelBridge` is added as well
return Tuple{Type,Type}[(
MOI.Bridges.Constraint.VectorSlackBridge,
PolyJuMP.coefficient_type_or_float(F),
Expand Down
15 changes: 15 additions & 0 deletions src/variables.jl
Original file line number Diff line number Diff line change
@@ -1,5 +1,20 @@
export DSOSPoly, SDSOSPoly, SOSPoly

function _bridge_coefficient_type(::Type{<:WeightedSOSCone{M}}) where {M}
return _complex(Float64, M)
end

function _bridge_coefficient_type(::Type{SOSPolynomialSet{D,B,C}}) where {D,B,C}
return _complex(Float64, matrix_cone_type(C))
end

function PolyJuMP.bridges(S::Type{<:WeightedSOSCone})
return Tuple{Type,Type}[(
Bridges.Variable.KernelBridge,
_bridge_coefficient_type(S),
)]
end

function PolyJuMP.bridges(::Type{<:PositiveSemidefinite2x2ConeTriangle})
return [(Bridges.Variable.PositiveSemidefinite2x2Bridge, Float64)]
end
Expand Down

0 comments on commit 2b5a47b

Please sign in to comment.