Skip to content

Commit

Permalink
Test variable substitution for KernelBridge
Browse files Browse the repository at this point in the history
  • Loading branch information
blegat committed May 10, 2024
1 parent 452ee2b commit 4ec81d2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ jobs:
using Pkg
Pkg.add([
PackageSpec(name="MultivariateBases", rev="master"),
PackageSpec(name="MathOptInterface", rev="master"),
PackageSpec(name="MathOptInterface", rev="bl/test_unbridged"),
])
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
Expand Down
11 changes: 8 additions & 3 deletions test/Bridges/Variable/kernel.jl
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ function test_runtests()
MOI.Bridges.runtests(
SumOfSquares.Bridges.Variable.KernelBridge,
model -> begin
MOI.add_constrained_variables(
p, _ = MOI.add_constrained_variables(
model,
SumOfSquares.WeightedSOSCone{
MOI.PositiveSemidefiniteConeTriangle,
Expand All @@ -30,13 +30,18 @@ function test_runtests()
[1.0 * x^0 * y^0],
),
)
a = float.(1:length(p))
MOI.add_constraint(model, MOI.Utilities.vectorize([a' * p]), MOI.Zeros(1))
end,
model -> begin
Q, _ = MOI.add_constrained_variables(
q, _ = MOI.add_constrained_variables(
model,
MOI.PositiveSemidefiniteConeTriangle(3),
)
end,
a = float.(1:length(q))
MOI.add_constraint(model, MOI.Utilities.vectorize([1.0 * q[1] + 2.0 * q[3] + 4.0 * (1.0q[4] + 1.0q[6]) + 6.0 * q[5]]), MOI.Zeros(1))
end;
allow_outer_constraint_function_error = true,
)
return
end
Expand Down

0 comments on commit 4ec81d2

Please sign in to comment.