use indexing syntax to extract variables from JuMP.model
This commit is contained in:
parent
01fbd037c3
commit
c98e853268
@ -113,7 +113,7 @@ function constrLHS(m::JuMP.Model, data::OrbitData, t)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function addconstraints!(m::JuMP.Model, data::OrbitData, l::Int=length(data.cnstr); var::Symbol = :λ)
|
function addconstraints!(m::JuMP.Model, data::OrbitData, l::Int=length(data.cnstr); var::Symbol = :λ)
|
||||||
λ = getvariable(m, var)
|
λ = m[var]
|
||||||
for t in 1:l
|
for t in 1:l
|
||||||
d, d² = data.laplacian[t], data.laplacianSq[t]
|
d, d² = data.laplacian[t], data.laplacianSq[t]
|
||||||
lhs = constrLHS(m, data, t)
|
lhs = constrLHS(m, data, t)
|
||||||
@ -153,7 +153,7 @@ end
|
|||||||
|
|
||||||
function λandP(m::JuMP.Model, data::OrbitData)
|
function λandP(m::JuMP.Model, data::OrbitData)
|
||||||
info(PropertyT.logger, "Solving SDP problem...")
|
info(PropertyT.logger, "Solving SDP problem...")
|
||||||
varλ = JuMP.getvariable(m, :λ)
|
varλ = m[:λ]
|
||||||
varP = data.Ps
|
varP = data.Ps
|
||||||
λ, P = PropertyT.λandP(data.name, m, varλ, varP)
|
λ, P = PropertyT.λandP(data.name, m, varλ, varP)
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user