1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-30 01:55:28 +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) N = size(Δ.product_matrix,1)
const Δ² = Δ*Δ const Δ² = Δ*Δ
@assert length(Δ) == length(matrix_constraints) @assert length(Δ) == length(matrix_constraints)
m = Model(); m = JuMP.Model();
@variable(m, A[1:N, 1:N], SDP) JuMP.@variable(m, A[1:N, 1:N], SDP)
@SDconstraint(m, A >= zeros(size(A))) JuMP.@SDconstraint(m, A >= zeros(size(A)))
@variable(m, κ >= 0.0) JuMP.@variable(m, κ >= 0.0)
@objective(m, Max, κ) JuMP.@objective(m, Max, κ)
for (pairs, δ², δ) in zip(matrix_constraints, Δ².coefficients, Δ.coefficients) 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 end
return m return m
end end