Skip to content

Commit

Permalink
[Bridges] fix supports of Constraint and Variable starts for some bri…
Browse files Browse the repository at this point in the history
…dges (#2340)
  • Loading branch information
odow authored Nov 2, 2023
1 parent 07d916d commit 1d9fe1b
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 21 deletions.
10 changes: 5 additions & 5 deletions src/Bridges/Constraint/bridges/split_complex_equalto.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,11 +159,11 @@ function MOI.delete(model::MOI.ModelLike, bridge::SplitComplexEqualToBridge)
end

function MOI.supports(
::MOI.ModelLike,
::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:SplitComplexEqualToBridge},
)
return true
model::MOI.ModelLike,
attr::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:SplitComplexEqualToBridge{T,F}},
) where {T,F}
return MOI.supports(model, attr, MOI.ConstraintIndex{F,MOI.EqualTo{T}})
end

function MOI.get(
Expand Down
10 changes: 5 additions & 5 deletions src/Bridges/Constraint/bridges/split_complex_zeros.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,11 +157,11 @@ function MOI.delete(model::MOI.ModelLike, bridge::SplitComplexZerosBridge)
end

function MOI.supports(
::MOI.ModelLike,
::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:SplitComplexZerosBridge},
)
return true
model::MOI.ModelLike,
attr::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:SplitComplexZerosBridge{T,F}},
) where {T,F}
return MOI.supports(model, attr, MOI.ConstraintIndex{F,MOI.Zeros})
end

function MOI.get(
Expand Down
10 changes: 5 additions & 5 deletions src/Bridges/Constraint/bridges/split_hyperrectangle.jl
Original file line number Diff line number Diff line change
Expand Up @@ -154,11 +154,11 @@ function MOI.get(
end

function MOI.supports(
::MOI.ModelLike,
::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:SplitHyperRectangleBridge},
)
return true
model::MOI.ModelLike,
attr::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:SplitHyperRectangleBridge{T,G}},
) where {T,G}
return MOI.supports(model, attr, MOI.ConstraintIndex{G,MOI.Nonnegatives})
end

function MOI.set(
Expand Down
7 changes: 4 additions & 3 deletions src/Bridges/Constraint/bridges/square.jl
Original file line number Diff line number Diff line change
Expand Up @@ -279,9 +279,10 @@ end
function MOI.supports(
model::MOI.ModelLike,
attr::Union{MOI.ConstraintPrimalStart,MOI.ConstraintDualStart},
::Type{<:SquareBridge},
)
return true
::Type{SquareBridge{T,F,G,TT,ST}},
) where {T,F,G,TT,ST}
return MOI.supports(model, attr, MOI.ConstraintIndex{F,TT}) &
MOI.supports(model, attr, MOI.ConstraintIndex{G,MOI.EqualTo{T}})
end

function MOI.set(
Expand Down
6 changes: 3 additions & 3 deletions src/Bridges/Variable/bridges/hermitian.jl
Original file line number Diff line number Diff line change
Expand Up @@ -332,11 +332,11 @@ function unbridged_map(
end

function MOI.supports(
::MOI.ModelLike,
::MOI.VariablePrimalStart,
model::MOI.ModelLike,
attr::MOI.VariablePrimalStart,
::Type{<:HermitianToSymmetricPSDBridge},
)
return true
return MOI.supports(model, attr, MOI.VariableIndex)
end

function MOI.set(
Expand Down

0 comments on commit 1d9fe1b

Please sign in to comment.