1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-19 07:20:28 +01:00

add compute/load prefixes

This commit is contained in:
kalmarek 2018-08-20 04:00:58 +02:00
parent 684283fd56
commit c9b226f550

View File

@ -134,19 +134,24 @@ function SOS_problem(X::GroupRingElem, orderunit::GroupRingElem, data::OrbitData
return m, λ, P
end
function λandP(m::JuMP.Model, data::OrbitData, sett::Settings)
info("Solving SDP problem...")
@time λ, Ps = λandP(m, data, sett.warmstart)
function computeλandP(Δ::GroupRingElem, sett::Settings, ws=nothing; solverlog=tempname()*".log")
@time orbit_data = OrbitData(sett);
info("Creating SDP problem...")
info("Reconstructing P...")
SDP_problem, varλ, varP = SOS_problem(Δ^2, Δ, orbit_data, upper_bound=sett.upper_bound)
JuMP.setsolver(SDP_problem, sett.solver)
info(Base.repr(SDP_problem))
preps = load_preps(filename(prepath(sett), :preps), sett.autS)
@time recP = reconstruct_sol(preps, data.Us, Ps, data.dims)
@time λ, P, ws = solve_SDP(SDP_problem, varλ, varP, ws, solverlog=solverlog)
fname = filename(fullpath(sett), :P)
save(fname, "origP", Ps, "P", recP)
return λ, recP
save(joinpath(dirname(fname), "orig_"*basename(fname)), "origP", P)
info("Reconstructing P...")
preps = load_preps(filename(prepath(sett), :preps), sett.autS)
@time recP = reconstruct_sol(preps, orbit_data.Uπs, P, orbit_data.dims)
return λ, recP, ws
end
function load_preps(fname::String, G::Group)