diff --git a/src/Orbit-wise.jl b/src/Orbit-wise.jl index 46cae82..cebe9a1 100644 --- a/src/Orbit-wise.jl +++ b/src/Orbit-wise.jl @@ -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)