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-08 00:26:15 +02:00
|
|
|
function summarize(logger, groupdir, iterations, tol, upper_bound, radius, G, S)
|
|
|
|
info(logger, "Group: $groupdir")
|
2018-07-31 12:41:48 +02:00
|
|
|
info(logger, "Iterations: $iterations")
|
|
|
|
info(logger, "Precision: $tol")
|
|
|
|
info(logger, "Upper bound: $upper_bound")
|
2018-08-08 00:26:15 +02:00
|
|
|
info(logger, "Radius: $radius")
|
2018-07-31 12:41:48 +02:00
|
|
|
info(logger, "Threads: $(Threads.nthreads())")
|
|
|
|
info(logger, "Workers: $(workers())")
|
2018-08-08 00:26:15 +02:00
|
|
|
info(logger, string(G))
|
2018-07-31 12:41:48 +02:00
|
|
|
info(logger, "with generating set of size $(length(S))")
|
2018-08-08 00:26:15 +02:00
|
|
|
end
|
|
|
|
|
|
|
|
function params(Gr::SymmetricGroup)
|
|
|
|
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-08 00:28:15 +02:00
|
|
|
main(G::SymmetricGroup) = main(Symmetrize, G)
|
|
|
|
|
|
|
|
function main(::Type{Symmetrize}, Gr::SymmetricGroup)
|
|
|
|
|
|
|
|
radius, tol, iterations, upper_bound, warm, N = 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)
|
|
|
|
|
|
|
|
summarize(logger, groupdir, iterations, tol, upper_bound, radius, G, S)
|
|
|
|
|
|
|
|
autS = PropertyTGroups.autS(Gr)
|
|
|
|
info(logger, "Symmetrising with $(autS)")
|
|
|
|
|
2018-07-31 12:41:48 +02:00
|
|
|
solver = 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)
|
|
|
|
|
2018-08-08 00:28:15 +02:00
|
|
|
sett = Settings(groupdir, N, G, S, autS,
|
|
|
|
radius, solver, upper_bound, tol, warm, logger)
|
|
|
|
return PropertyT.check_property_T(sett)
|
|
|
|
end
|
|
|
|
|
|
|
|
function main(::Type{Standard}, Gr::SymmetricGroup)
|
|
|
|
|
|
|
|
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)
|
|
|
|
|
|
|
|
summarize(logger, groupdir, iterations, tol, upper_bound, radius, G, S)
|
|
|
|
|
|
|
|
solver = SCSSolver(eps=tol, max_iters=iterations, linearsolver=SCS.Direct, alpha=1.95, acceleration_lookback=1)
|
|
|
|
|
|
|
|
return PropertyT.check_property_T(groupdir, S, G(),
|
|
|
|
solver, upper_bound, tol, radius, warm)
|
|
|
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
function main(Gr::GAPGroup)
|
|
|
|
|
|
|
|
include("FPGroups_GAP.jl")
|
|
|
|
|
|
|
|
radius, tol, iterations, upper_bound, warm = params(Gr)
|
|
|
|
|
|
|
|
groupdir = groupname(Gr)
|
|
|
|
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)
|
|
|
|
|
|
|
|
solver = SCSSolver(eps=tol, max_iters=iterations, linearsolver=SCS.Direct, alpha=1.95, acceleration_lookback=1)
|
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
|