Skip to content
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

Update to the new MOI scaled set #283

Merged
merged 1 commit into from
Sep 9, 2023
Merged
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
@@ -12,7 +12,7 @@ SCS_jll = "f4f2fc5b-1d94-523c-97ea-2ab488bedf4b"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
MathOptInterface = "1.17"
MathOptInterface = "1.20"
Requires = "1"
SCS_GPU_jll = "=3.2.3"
SCS_MKL_jll = "=3.2.2, =3.2.3"
15 changes: 8 additions & 7 deletions src/MOI_wrapper/scaled_psd_cone_bridge.jl
Original file line number Diff line number Diff line change
@@ -8,8 +8,9 @@
side_dimension::Int
end

Similar to `MOI.ScaledPositiveSemidefiniteConeTriangle` but it the vectorization
is the lower triangular part column-wise (or the upper triangular part row-wise).
Similar to `MOI.Scaled{MOI.PositiveSemidefiniteConeTriangle}` but it the
vectorization is the lower triangular part column-wise (or the upper triangular
part row-wise).
"""
struct ScaledPSDCone <: MOI.AbstractVectorSet
side_dimension::Int
@@ -30,7 +31,7 @@
struct ScaledPSDConeBridge{T,F} <: MOI.Bridges.Constraint.SetMapBridge{
T,
ScaledPSDCone,
MOI.ScaledPositiveSemidefiniteConeTriangle,
MOI.Scaled{MOI.PositiveSemidefiniteConeTriangle},
F,
F,
}
@@ -40,23 +41,23 @@
function MOI.Bridges.Constraint.concrete_bridge_type(
::Type{ScaledPSDConeBridge{T}},
::Type{F},
::Type{MOI.ScaledPositiveSemidefiniteConeTriangle},
::Type{MOI.Scaled{MOI.PositiveSemidefiniteConeTriangle}},
) where {T,F<:MOI.AbstractVectorFunction}
return ScaledPSDConeBridge{T,F}
end

function MOI.Bridges.map_set(
::Type{<:ScaledPSDConeBridge},
set::MOI.ScaledPositiveSemidefiniteConeTriangle,
set::MOI.Scaled{MOI.PositiveSemidefiniteConeTriangle},
)
return ScaledPSDCone(set.side_dimension)
return ScaledPSDCone(MOI.side_dimension(set))

Check warning on line 53 in src/MOI_wrapper/scaled_psd_cone_bridge.jl

Codecov / codecov/patch

src/MOI_wrapper/scaled_psd_cone_bridge.jl#L53

Added line #L53 was not covered by tests
end

function MOI.Bridges.inverse_map_set(
::Type{<:ScaledPSDConeBridge},
set::ScaledPSDCone,
)
return MOI.ScaledPositiveSemidefiniteConeTriangle(set.side_dimension)
return MOI.Scaled(MOI.PositiveSemidefiniteConeTriangle(set.side_dimension))

Check warning on line 60 in src/MOI_wrapper/scaled_psd_cone_bridge.jl

Codecov / codecov/patch

src/MOI_wrapper/scaled_psd_cone_bridge.jl#L60

Added line #L60 was not covered by tests
end

function _upper_to_lower_triangular_permutation(dim::Int)
Loading