From 8ddb60a400a4f49cf8cc2377fe51175351a737b7 Mon Sep 17 00:00:00 2001 From: kalmar Date: Mon, 20 Mar 2017 21:41:12 +0100 Subject: [PATCH] Shuffling of JuMP vars, constraints --- src/sdps.jl | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/sdps.jl b/src/sdps.jl index 44d234b..d2446dd 100644 --- a/src/sdps.jl +++ b/src/sdps.jl @@ -55,15 +55,19 @@ function create_SDP_problem(matrix_constraints, Δ::GroupAlgebraElement; upper_b JuMP.@variable(m, A[1:N, 1:N], SDP) JuMP.@SDconstraint(m, A >= 0) JuMP.@constraint(m, sum(A[i] for i in eachindex(A)) == 0) - JuMP.@variable(m, κ >= 0.0) + if upper_bound < Inf - JuMP.@constraint(m, κ <= upper_bound) + JuMP.@variable(m, 0.0 <= κ <= upper_bound) + else + JuMP.@variable(m, κ >= 0) end - JuMP.@objective(m, Max, κ) for (pairs, δ², δ) in zip(matrix_constraints, Δ².coefficients, Δ.coefficients) JuMP.@constraint(m, sum(A[i,j] for (i,j) in pairs) == δ² - κ*δ) end + + JuMP.@objective(m, Max, κ) + return m end