update main

This commit is contained in:
kalmarek 2018-09-05 17:52:23 +02:00
parent c8f58e1c93
commit e02b410240

124
main.jl
View File

@ -1,15 +1,23 @@
include("logging.jl")
using AbstractAlgebra
using Nemo
using PropertyT
using Groups
using SCS.SCSSolver
# using Mosek
# using CSDP
# using SDPA
scs_solver(tol, iterations) = SCSSolver(eps=tol, max_iters=iterations, linearsolver=SCS.Direct, alpha=1.95, acceleration_lookback=1)
# solver = Mosek.MosekSolver(
# MSK_DPAR_INTPNT_CO_TOL_REL_GAP=tol,
# MSK_IPAR_INTPNT_MAX_ITERATIONS=iterations,
# QUIET=false)
# solver = CSDP.CSDPSolver(axtol=tol, atytol=tol, objtol=tol, minstepp=tol*10.0^-1, minstepd=tol*10.0^-1)
# solver = SDPA.SDPASolver(epsilonStar=tol, epsilonDash=tol)
include("FPGroups_GAP.jl")
include("groups/Allgroups.jl")
using PropertyTGroups
@ -25,16 +33,6 @@ function summarize(groupdir, iterations, tol, upper_bound, radius, G, S)
info("with generating set of size $(length(S))")
end
function params(Gr::SymmetrizedGroup)
radius = Gr.args["radius"]
tol = Gr.args["tol"]
iterations = Gr.args["iterations"]
upper_bound = Gr.args["upper-bound"]
warm = Gr.args["warmstart"]
N = Gr.args["N"]
return radius, tol, iterations, upper_bound, warm, N
end
function params(Gr::PropertyTGroup)
radius = Gr.args["radius"]
tol = Gr.args["tol"]
@ -44,82 +42,46 @@ function params(Gr::PropertyTGroup)
return radius, tol, iterations, upper_bound, warm
end
scs_solver(tol, iterations) = SCSSolver(eps=tol, max_iters=iterations, linearsolver=SCS.Direct, alpha=1.95, acceleration_lookback=1)
# solver = Mosek.MosekSolver(
# MSK_DPAR_INTPNT_CO_TOL_REL_GAP=tol,
# MSK_IPAR_INTPNT_MAX_ITERATIONS=iterations,
# QUIET=false)
# solver = CSDP.CSDPSolver(axtol=tol, atytol=tol, objtol=tol, minstepp=tol*10.0^-1, minstepd=tol*10.0^-1)
# solver = SDPA.SDPASolver(epsilonStar=tol, epsilonDash=tol)
function main(Gr::PropertyTGroup)
function Settings(Gr::PropertyTGroup)
r = Gr.args["radius"]
ub = Gr.args["upper-bound"]
groupdir = "$(PropertyTGroups.name(Gr))_r$r"
isdir(groupdir) || mkdir(groupdir)
logfile = PropertyT.filename(joinpath(groupdir, string(ub)), :fulllog)
logger=setup_logging(logfile, :fulllog)
if Gr.args["nosymmetry"]
return main(Naive, Gr, dir=groupdir)
else
return main(Symmetrize, Gr, dir=groupdir)
end
end
function main(::Type{Symmetrize}, Gr::SymmetrizedGroup; dir=tempname())
radius, tol, iterations, upper_bound, warm, N = params(Gr)
G = PropertyTGroups.group(Gr)
S = PropertyTGroups.generatingset(Gr)
summarize(dir, iterations, tol, upper_bound, radius, G, S)
autS = PropertyTGroups.autS(Gr)
info("Symmetrising with $(autS)")
solver = scs_solver(tol, iterations)
sett = Settings(dir, N, G, S, autS,
radius, solver, upper_bound, tol, warm)
return PropertyT.check_property_T(sett)
end
function main(::Type{Naive}, Gr::SymmetrizedGroup; dir="")
radius, tol, iterations, upper_bound, warm, _ = params(Gr)
G = PropertyTGroups.group(Gr)
S = PropertyTGroups.generatingset(Gr)
summarize(dir, iterations, tol, upper_bound, radius, G, S)
solver = scs_solver(tol, iterations)
return PropertyT.check_property_T(dir, S,
solver, upper_bound, tol, radius, warm)
end
function main(::Type{Naive}, Gr::GAPGroup; dir="")
radius, tol, iterations, upper_bound, warm = params(Gr)
G = PropertyTGroups.group(Gr)
S = PropertyTGroups.generatingset(Gr)
relations = [k*inv(v) for (k,v) in G.rels]
prepare_pm_delta(dir, GAP_groupcode(S, relations), radius)
summarize(dir, iterations, tol, upper_bound, radius, G, S)
summarize(groupdir, iterations, tol, upper_bound, radius, G, S)
solver = scs_solver(tol, iterations)
return PropertyT.check_property_T(dir, S,
solver, upper_bound, tol, radius, warm)
return PropertyT.Settings(groupdir, G, S, radius,
solver, upper_bound, tol, warm)
end
function main(Gr::SymmetrizedGroup)
sett = Settings(Gr)
isdir(PropertyT.fullpath(sett)) || mkpath(PropertyT.fullpath(sett))
if Gr.args["nosymmetry"]
return PropertyT.check_property_T(PropertyT.Naive, sett)
else
autS = PropertyTGroups.autS(Gr)
info("Symmetrising with $(autS)")
sett.autS = autS
return PropertyT.check_property_T(PropertyT.Symmetrize, sett)
end
end
function main(Gr::GAPGroup)
sett = Settings(Gr)
S = [s for s in sett.S if s.symbols[1].pow == 1]
relations = [k*inv(v) for (k,v) in sett.G.rels]
prepare_pm_delta(PropertyT.prepath(sett), GAP_groupcode(S, relations), sett.radius)
return PropertyT.check_property_T(PropertyT.Naive, sett)
end