1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-27 10:50:29 +01:00

use JuMP explicitly in model generation

This commit is contained in:
kalmar 2017-02-11 13:38:02 +01:00
parent d10e4ca792
commit 6247f97a56

View File

@ -57,14 +57,14 @@ function create_SDP_problem(matrix_constraints, Δ::GroupAlgebraElement)
N = size(Δ.product_matrix,1)
const Δ² = Δ*Δ
@assert length(Δ) == length(matrix_constraints)
m = Model();
@variable(m, A[1:N, 1:N], SDP)
@SDconstraint(m, A >= zeros(size(A)))
@variable(m, κ >= 0.0)
@objective(m, Max, κ)
m = JuMP.Model();
JuMP.@variable(m, A[1:N, 1:N], SDP)
JuMP.@SDconstraint(m, A >= zeros(size(A)))
JuMP.@variable(m, κ >= 0.0)
JuMP.@objective(m, Max, κ)
for (pairs, δ², δ) in zip(matrix_constraints, Δ².coefficients, Δ.coefficients)
@constraint(m, sum(A[i,j] for (i,j) in pairs) == δ² - κ*δ)
JuMP.@constraint(m, sum(A[i,j] for (i,j) in pairs) == δ² - κ*δ)
end
return m
end