2018-08-20 02:54:50 +02:00
|
|
|
include("logging.jl")
|
|
|
|
|
2018-08-08 00:26:39 +02:00
|
|
|
using AbstractAlgebra
|
|
|
|
using Nemo
|
|
|
|
using PropertyT
|
|
|
|
using Groups
|
|
|
|
|
2018-07-31 12:41:48 +02:00
|
|
|
using SCS.SCSSolver
|
|
|
|
# using Mosek
|
|
|
|
# using CSDP
|
|
|
|
# using SDPA
|
|
|
|
|
2018-08-08 00:26:15 +02:00
|
|
|
include("groups/Allgroups.jl")
|
|
|
|
using PropertyTGroups
|
2018-07-31 12:41:48 +02:00
|
|
|
|
2018-08-08 00:26:15 +02:00
|
|
|
struct Symmetrize end
|
|
|
|
struct Standard end
|
2018-07-31 12:41:48 +02:00
|
|
|
|
2018-08-20 02:54:50 +02:00
|
|
|
function summarize(groupdir, iterations, tol, upper_bound, radius, G, S)
|
|
|
|
info("Group: $groupdir")
|
|
|
|
info("Iterations: $iterations")
|
|
|
|
info("Precision: $tol")
|
|
|
|
info("Upper bound: $upper_bound")
|
|
|
|
info("Radius: $radius")
|
|
|
|
info("Threads: $(Threads.nthreads())")
|
|
|
|
info("Workers: $(workers())")
|
|
|
|
info(string(G))
|
|
|
|
info("with generating set of size $(length(S))")
|
2018-08-08 00:26:15 +02:00
|
|
|
end
|
|
|
|
|
2018-08-15 17:19:28 +02:00
|
|
|
function params(Gr::SymmetrizedGroup)
|
2018-08-08 00:26:15 +02:00
|
|
|
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"]
|
|
|
|
iterations = Gr.args["iterations"]
|
|
|
|
upper_bound = Gr.args["upper-bound"]
|
|
|
|
warm = Gr.args["warmstart"]
|
|
|
|
return radius, tol, iterations, upper_bound, warm
|
|
|
|
end
|
2018-07-31 12:41:48 +02:00
|
|
|
|
2018-08-18 23:25:47 +02:00
|
|
|
scs_solver(tol, iterations) = SCSSolver(eps=tol, max_iters=iterations, linearsolver=SCS.Direct, alpha=1.95, acceleration_lookback=1)
|
2018-08-08 19:37:57 +02:00
|
|
|
|
2018-08-20 02:55:19 +02:00
|
|
|
# solver = Mosek.MosekSolver(
|
|
|
|
# MSK_DPAR_INTPNT_CO_TOL_REL_GAP=tol,
|
|
|
|
# MSK_IPAR_INTPNT_MAX_ITERATIONS=iterations,
|
|
|
|
# QUIET=false)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
2018-08-20 02:55:19 +02:00
|
|
|
# solver = CSDP.CSDPSolver(axtol=tol, atytol=tol, objtol=tol, minstepp=tol*10.0^-1, minstepd=tol*10.0^-1)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
2018-08-20 02:55:19 +02:00
|
|
|
# solver = SDPA.SDPASolver(epsilonStar=tol, epsilonDash=tol)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
2018-08-20 02:54:50 +02:00
|
|
|
function main(Gr::PropertyTGroup)
|
|
|
|
r = Gr.args["radius"]
|
|
|
|
ub = Gr.args["upper-bound"]
|
|
|
|
groupdir = "$(PropertyTGroups.name(Gr))_r$r"
|
2018-08-08 00:28:15 +02:00
|
|
|
isdir(groupdir) || mkdir(groupdir)
|
2018-08-20 02:54:50 +02:00
|
|
|
logfile = PropertyT.filename(joinpath(groupdir, string(ub)), :fulllog)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
2018-08-20 02:54:50 +02:00
|
|
|
logger=setup_logging(logfile, :fulllog)
|
|
|
|
|
|
|
|
if Gr.args["nosymmetry"]
|
|
|
|
return main(Naive, Gr, dir=groupdir)
|
|
|
|
else
|
|
|
|
return main(Symmetrize, Gr, dir=groupdir)
|
|
|
|
end
|
|
|
|
end
|
2018-08-08 00:28:15 +02:00
|
|
|
G = PropertyTGroups.group(Gr)
|
|
|
|
S = PropertyTGroups.generatingset(Gr)
|
|
|
|
|
2018-08-20 02:54:50 +02:00
|
|
|
summarize(dir, iterations, tol, upper_bound, radius, G, S)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
|
|
|
autS = PropertyTGroups.autS(Gr)
|
2018-08-20 02:54:50 +02:00
|
|
|
info("Symmetrising with $(autS)")
|
2018-08-08 00:28:15 +02:00
|
|
|
|
2018-08-08 19:37:57 +02:00
|
|
|
solver = scs_solver(tol, iterations)
|
2018-07-31 12:41:48 +02:00
|
|
|
|
2018-08-20 02:54:50 +02:00
|
|
|
sett = Settings(dir, N, G, S, autS,
|
|
|
|
radius, solver, upper_bound, tol, warm)
|
2018-08-08 00:28:15 +02:00
|
|
|
return PropertyT.check_property_T(sett)
|
|
|
|
end
|
|
|
|
|
2018-08-15 17:19:28 +02:00
|
|
|
function main(::Type{Standard}, Gr::SymmetrizedGroup)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
|
|
|
radius, tol, iterations, upper_bound, warm, _ = params(Gr)
|
|
|
|
|
|
|
|
groupdir = "$(PropertyTGroups.name(Gr))_r$radius"
|
|
|
|
isdir(groupdir) || mkdir(groupdir)
|
|
|
|
logger = PropertyT.setup_logging(joinpath(groupdir, "$(upper_bound)"), :fulllog)
|
|
|
|
|
|
|
|
G = PropertyTGroups.group(Gr)
|
|
|
|
S = PropertyTGroups.generatingset(Gr)
|
|
|
|
|
2018-08-20 02:54:50 +02:00
|
|
|
summarize(dir, iterations, tol, upper_bound, radius, G, S)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
2018-08-08 19:37:57 +02:00
|
|
|
solver = scs_solver(tol, iterations)
|
2018-08-08 00:28:15 +02:00
|
|
|
|
2018-08-15 17:20:02 +02:00
|
|
|
if G isa AbstractAlgebra.Ring
|
|
|
|
Id = one(G)
|
|
|
|
else
|
|
|
|
Id = G()
|
|
|
|
end
|
|
|
|
|
|
|
|
return PropertyT.check_property_T(groupdir, S, Id,
|
2018-08-08 00:28:15 +02:00
|
|
|
solver, upper_bound, tol, radius, warm)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function main(Gr::GAPGroup)
|
|
|
|
|
|
|
|
radius, tol, iterations, upper_bound, warm = params(Gr)
|
|
|
|
|
2018-08-08 19:38:22 +02:00
|
|
|
groupdir = "$(PropertyTGroups.name(Gr))_r$radius"
|
2018-08-08 00:28:15 +02:00
|
|
|
isdir(groupdir) || mkdir(groupdir)
|
|
|
|
logger = PropertyT.setup_logging(joinpath(groupdir, "$(upper_bound)"), :fulllog)
|
|
|
|
|
|
|
|
G = PropertyTGroups.group(Gr)
|
|
|
|
S = PropertyTGroups.generatingset(Gr)
|
|
|
|
|
|
|
|
relations = [k*inv(v) for (k,v) in G.rels]
|
|
|
|
prepare_pm_delta(groupdir, GAP_groupcode(S, relations), radius)
|
|
|
|
|
|
|
|
S = unique([S; inv.(S)])
|
|
|
|
|
|
|
|
summarize(logger, groupdir, iterations, tol, upper_bound, radius, G, S)
|
|
|
|
|
2018-08-08 19:37:57 +02:00
|
|
|
solver = scs_solver(tol, iterations)
|
2018-07-31 12:41:48 +02:00
|
|
|
|
2018-08-08 00:28:15 +02:00
|
|
|
return PropertyT.check_property_T(groupdir, S, G(),
|
|
|
|
solver, upper_bound, tol, radius, warm)
|
2018-07-31 12:41:48 +02:00
|
|
|
end
|