1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-19 07:20:28 +01:00

fix sos_problem_dual

This commit is contained in:
Marek Kaluba 2023-03-19 23:26:44 +01:00
parent bacd170504
commit fb3b51fd6e
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -12,7 +12,7 @@ function sos_problem_dual(
@assert parent(elt) == parent(order_unit) @assert parent(elt) == parent(order_unit)
algebra = parent(elt) algebra = parent(elt)
moment_matrix = let m = algebra.mstructure moment_matrix = let m = algebra.mstructure
[m[-i, j] for i in axes(m, 1) for j in axes(m, 2)] [m[-i, j] for i in axes(m, 1), j in axes(m, 2)]
end end
# 1 variable for every primal constraint # 1 variable for every primal constraint
@ -20,16 +20,16 @@ function sos_problem_dual(
# Symmetrized: # Symmetrized:
# 1 dual variable for every orbit of G acting on basis # 1 dual variable for every orbit of G acting on basis
model = Model() model = Model()
@variable model y[1:length(basis(algebra))] JuMP.@variable(model, y[1:length(basis(algebra))])
@constraint model λ_dual dot(order_unit, y) == 1 JuMP.@constraint(model, λ_dual, dot(order_unit, y) == 1)
@constraint(model, psd, y[moment_matrix] in PSDCone()) JuMP.@constraint(model, psd, y[moment_matrix] in PSDCone())
if !isinf(lower_bound) if !isinf(lower_bound)
throw("Not Implemented yet") throw("Not Implemented yet")
@variable model λ_ub_dual JuMP.@variable(model, λ_ub_dual)
@objective model Min dot(elt, y) + lower_bound * λ_ub_dual JuMP.@objective(model, Min, dot(elt, y) + lower_bound * λ_ub_dual)
else else
@objective model Min dot(elt, y) JuMP.@objective(model, Min, dot(elt, y))
end end
return model return model