1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-11-29 17:50:27 +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 return m, λ, P
end end
function λandP(m::JuMP.Model, data::OrbitData, sett::Settings) function computeλandP(Δ::GroupRingElem, sett::Settings, ws=nothing; solverlog=tempname()*".log")
info("Solving SDP problem...") @time orbit_data = OrbitData(sett);
@time λ, Ps = λandP(m, data, sett.warmstart) 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 λ, P, ws = solve_SDP(SDP_problem, varλ, varP, ws, solverlog=solverlog)
@time recP = reconstruct_sol(preps, data.Us, Ps, data.dims)
fname = filename(fullpath(sett), :P) fname = filename(fullpath(sett), :P)
save(fname, "origP", Ps, "P", recP) save(joinpath(dirname(fname), "orig_"*basename(fname)), "origP", P)
return λ, recP
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 end
function load_preps(fname::String, G::Group) function load_preps(fname::String, G::Group)