Skip to content

Commit

Permalink
Fix format
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed Dec 5, 2024
1 parent 2ef6709 commit 046e0a3
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 23 deletions.
14 changes: 8 additions & 6 deletions src/Bridges/Variable/bridges/set_dot.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
struct DotProductsBridge{T,S,A,V} <: SetMapBridge{T,S,MOI.SetWithDotProducts{S,A,V}}
struct DotProductsBridge{T,S,A,V} <:
SetMapBridge{T,S,MOI.SetWithDotProducts{S,A,V}}
variables::Vector{MOI.VariableIndex}
constraint::MOI.ConstraintIndex{MOI.VectorOfVariables,S}
set::MOI.SetWithDotProducts{S,A,V}
Expand Down Expand Up @@ -55,13 +56,14 @@ end
# This returns `true` by default for `SetMapBridge`
# but is is not supported for this bridge because `inverse_map_function`
# is not implemented
function MOI.supports(::MOI.ModelLike, ::MOI.VariablePrimalStart, ::Type{<:DotProductsBridge})
function MOI.supports(
::MOI.ModelLike,
::MOI.VariablePrimalStart,
::Type{<:DotProductsBridge},
)
return false
end

function unbridged_map(
::DotProductsBridge,
::Vector{MOI.VariableIndex},
)
function unbridged_map(::DotProductsBridge, ::Vector{MOI.VariableIndex})
return nothing
end
34 changes: 17 additions & 17 deletions test/Bridges/Variable/set_dot.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,30 +27,30 @@ function test_psd()
MOI.Bridges.runtests(
MOI.Bridges.Variable.DotProductsBridge,
model -> begin
x, _ = MOI.add_constrained_variables(model,
x, _ = MOI.add_constrained_variables(
model,
MOI.SetWithDotProducts(
MOI.PositiveSemidefiniteConeTriangle(2),
MOI.TriangleVectorization.([
[1 2.0
2 3],
[4 5.0
5 6],
[
1 2.0
2 3
],
[
4 5.0
5 6
],
]),
)
)
MOI.add_constraint(
model,
1.0x[1],
MOI.EqualTo(0.0),
)
MOI.add_constraint(
model,
1.0x[2],
MOI.LessThan(0.0),
),
)
MOI.add_constraint(model, 1.0x[1], MOI.EqualTo(0.0))
MOI.add_constraint(model, 1.0x[2], MOI.LessThan(0.0))
end,
model -> begin
Q, _ = MOI.add_constrained_variables(model, MOI.PositiveSemidefiniteConeTriangle(2))
Q, _ = MOI.add_constrained_variables(
model,
MOI.PositiveSemidefiniteConeTriangle(2),
)
MOI.add_constraint(
model,
1.0 * Q[1] + 4.0 * Q[2] + 3.0 * Q[3],
Expand Down

0 comments on commit 046e0a3

Please sign in to comment.