create Property.Settings from PropertyTGroup and args

This commit is contained in:
kalmarek 2018-09-09 13:09:43 +02:00
parent 1b6793f37c
commit 1b45625a71
1 changed files with 15 additions and 21 deletions

36
main.jl
View File

@ -27,37 +27,31 @@ function summarize(groupdir, iterations, tol, upper_bound, radius, G, S)
info("Precision: $tol")
info("Upper bound: $upper_bound")
info("Radius: $radius")
import PropertyT.Settings
info("Threads: $(Threads.nthreads())")
info("Workers: $(workers())")
info(string(G))
info("with generating set of size $(length(S))")
end
function params(Gr::PropertyTGroup)
radius = Gr.args["radius"]
tol = Gr.args["tol"]
iterations = Gr.args["iterations"]
upper_bound = Gr.args["upper-bound"]
warm = Gr.args["warmstart"]
return radius, tol, iterations, upper_bound, warm
end
function Settings(Gr::PropertyTGroup)
r = Gr.args["radius"]
ub = Gr.args["upper-bound"]
groupdir = "$(PropertyTGroups.name(Gr))_r$r"
radius, tol, iterations, upper_bound, warm = params(Gr)
function Settings(Gr::PropertyTGroup, args, solver):
r = get(args, "radius", 2)
gr_name = PropertyTGroups.name(Gr)*"_r$r"
G = PropertyTGroups.group(Gr)
S = PropertyTGroups.generatingset(Gr)
summarize(groupdir, iterations, tol, upper_bound, radius, G, S)
sol = solver
ub = get(args,"upper_bound", Inf)
tol = get(args,"tol", 1e-10)
ws = get(args, "warmstart", false)
solver = scs_solver(tol, iterations)
return PropertyT.Settings(groupdir, G, S, radius,
solver, upper_bound, tol, warm)
if get(args, "nosymmetry", false)
autS = PropertyTGroups.autS(Gr)
return PropertyT.Settings(gr_name, G, S, r, sol, ub, tol, ws, autS)
else
return PropertyT.Settings(gr_name, G, S, r, sol, ub, tol, ws)
end
end
function main(Gr::SymmetrizedGroup)