1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-22 16:05:27 +01:00

small stylistic tweaks for @constraint(s)

This commit is contained in:
kalmarek 2019-03-10 16:52:54 +01:00
parent 0b92aebb2f
commit 7d0677333c
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15

View File

@ -57,9 +57,8 @@ function SOS_problem(X::GroupRingElem, orderunit::GroupRingElem; upper_bound::Fl
end end
cnstrs = constraints(parent(X).pm) cnstrs = constraints(parent(X).pm)
for (constraint_indices, x, u) in zip(cnstrs, X.coeffs, orderunit.coeffs)
for (constraint, x, u) in zip(cnstrs, X.coeffs, orderunit.coeffs) JuMP.@constraint(m, x - λ*u == sum(P[constraint_indices]))
JuMP.@constraint(m, sum(P[constraint]) == x - λ*u)
end end
JuMP.@objective(m, Max, λ) JuMP.@objective(m, Max, λ)
@ -125,7 +124,7 @@ function addconstraints!(m::JuMP.Model,
x, u = X_orb[t], orderunit_orb[t] x, u = X_orb[t], orderunit_orb[t]
@constraints m begin JuMP.@constraints m begin
x - λ*u == sum(dot(M[π], P[π]) for π in eachindex(data.Uπs)) x - λ*u == sum(dot(M[π], P[π]) for π in eachindex(data.Uπs))
end end
end end