Skip to content

Commit

Permalink
Add test
Browse files Browse the repository at this point in the history
  • Loading branch information
odow committed Jan 3, 2025
1 parent f0abce0 commit 93c543f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions test/Bridges/Constraint/SOCtoPSDBridge.jl
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,26 @@ function test_runtests()
return
end

function test_bridging_cost_SOCtoPSD()
inner = MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}())
model = MOI.Bridges.Constraint.SOCtoPSD{Float64}(inner)
x = MOI.add_variables(model, 3)
c = MOI.add_constraint(model, x, MOI.SecondOrderCone(3))
bridge = model.map[c]
MOI.Bridges.bridging_cost(typeof(bridge)) == 10.0
return
end

function test_bridging_cost_RSOCtoPSD()
inner = MOI.Utilities.UniversalFallback(MOI.Utilities.Model{Float64}())
model = MOI.Bridges.Constraint.RSOCtoPSD{Float64}(inner)
x = MOI.add_variables(model, 3)
c = MOI.add_constraint(model, x, MOI.RotatedSecondOrderCone(3))
bridge = model.map[c]
MOI.Bridges.bridging_cost(typeof(bridge)) == 10.0
return
end

end # module

TestConstraintSOCtoPSD.runtests()

0 comments on commit 93c543f

Please sign in to comment.