1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-24 02:00:30 +01:00

use prepath/fullpath(::Settings) in OrbitData

and in create_SDP_problem generation
This commit is contained in:
kalmarek 2017-10-09 19:46:08 +02:00
parent 36a1151a73
commit b3f1961fbf

View File

@ -30,27 +30,27 @@ immutable OrbitData
dims::Vector{Int}
end
function OrbitData(name::String)
splap = load(joinpath(name, "delta.jld"), "Δ");
pm = load(joinpath(name, "pm.jld"), "pm");
function OrbitData(sett::Settings)
splap = load(joinpath(prepath(sett), "delta.jld"), "Δ");
pm = load(joinpath(prepath(sett), "pm.jld"), "pm");
cnstr = PropertyT.constraints_from_pm(pm);
splap² = similar(splap)
splap² = GroupRings.mul!(splap², splap, splap, pm);
# Uπs = load(joinpath(name, "U_pis.jld"), "Uπs");
Uπs = load(joinpath(name, "U_pis.jld"), "spUπs");
Uπs = load(joinpath(prepath(sett), "U_pis.jld"), "spUπs");
#dimensions of the corresponding πs:
dims = load(joinpath(name, "U_pis.jld"), "dims")
dims = load(joinpath(prepath(sett), "U_pis.jld"), "dims")
m, P = init_model(Uπs);
orbits = load(joinpath(name, "orbits.jld"), "orbits");
orbits = load(joinpath(prepath(sett), "orbits.jld"), "orbits");
n = size(Uπs[1],1)
orb_spcnstrm = [orbit_constraint(cnstr[collect(orb)], n) for orb in orbits]
orb_splap = orbit_spvector(splap, orbits)
orb_splap² = orbit_spvector(splap², orbits)
orbData = OrbitData(name, Uπs, P, orb_spcnstrm, orb_splap, orb_splap², dims);
orbData = OrbitData(fullpath(sett), Uπs, P, orb_spcnstrm, orb_splap, orb_splap², dims);
# orbData = OrbitData(name, Uπs, P, orb_spcnstrm, splap, splap², dims);
@ -175,14 +175,14 @@ function init_model(Uπs)
return m, P
end
function create_SDP_problem(name::String; upper_bound=Inf)
function create_SDP_problem(sett::Settings)
info(logger, "Loading orbit data....")
t = @timed SDP_problem, orb_data = OrbitData(name);
t = @timed SDP_problem, orb_data = OrbitData(sett);
info(logger, PropertyT.timed_msg(t))
if upper_bound < Inf
if sett.upper_bound < Inf
λ = JuMP.getvariable(SDP_problem, )
JuMP.@constraint(SDP_problem, λ <= upper_bound)
JuMP.@constraint(SDP_problem, λ <= sett.upper_bound)
end
t = length(orb_data.laplacian)
@ -227,7 +227,7 @@ function check_property_T(sett::Settings)
λ, P = PropertyT.λandP(sett.name)
else
info(logger, "Creating SDP problem...")
SDP_problem, orb_data = create_SDP_problem(sett.name, upper_bound=sett.upper_bound)
SDP_problem, orb_data = create_SDP_problem(sett)
JuMP.setsolver(SDP_problem, sett.solver)
λ, P = λandP(SDP_problem, orb_data, sett)