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

better logging in Orbit-wise.jl

This commit is contained in:
kalmarek 2017-08-27 19:06:17 +02:00
parent 0c40e16e9e
commit 2724612ea3

View File

@ -170,18 +170,19 @@ function init_model(Uπs)
end
function create_SDP_problem(name::String; upper_bound=Inf)
info(PropertyT.logger, "Loading orbit data....")
info(logger, "Loading orbit data....")
t = @timed SDP_problem, orb_data = OrbitData(name);
info(PropertyT.logger, PropertyT.timed_msg(t))
info(logger, PropertyT.timed_msg(t))
if upper_bound < Inf
λ = JuMP.getvariable(SDP_problem, )
JuMP.@constraint(SDP_problem, λ <= upper_bound)
end
info(PropertyT.logger, "Adding constraints... ")
t = length(orb_data.laplacian)
info(logger, "Adding $t constraints ... ")
t = @timed addconstraints!(SDP_problem, orb_data)
info(PropertyT.logger, PropertyT.timed_msg(t))
info(logger, PropertyT.timed_msg(t))
return SDP_problem, orb_data
end
@ -194,13 +195,16 @@ function λandP(m::JuMP.Model, data::OrbitData)
end
function λandP(m::JuMP.Model, data::OrbitData, sett::Settings)
info(PropertyT.logger, "Solving SDP problem...")
info(logger, "Solving SDP problem...")
λ, Ps = λandP(m, data)
info(PropertyT.logger, "Reconstructing P...")
@time mreps = matrix_reps(sett.G, sett.S, sett.AutS, sett.radius)
info(logger, "Reconstructing P...")
@time recP = reconstruct_sol(mreps, data.Us, Ps, data.dims)
t = @timed preps = perm_reps(sett.G, sett.S, sett.AutS, sett.radius)
info(logger, PropertyT.timed_msg(t))
t = @timed recP = reconstruct_sol(preps, data.Us, Ps, data.dims)
info(logger, PropertyT.timed_msg(t))
fname = PropertyT.λSDPfilenames(data.name)[2]
save(fname, "origP", Ps, "P", recP)