GroupsWithPropertyT/MCG.jl

89 lines
2.4 KiB
Julia
Raw Normal View History

2017-12-29 17:45:09 +01:00
using ArgParse
2018-01-04 22:08:32 +01:00
function parse_commandline()
args = ArgParseSettings()
@add_arg_table args begin
"--tol"
help = "set numerical tolerance for the SDP solver"
arg_type = Float64
default = 1e-14
"--iterations"
help = "set maximal number of iterations for the SDP solver (default: 20000)"
arg_type = Int
default = 60000
"--upper-bound"
help = "Set an upper bound for the spectral gap"
arg_type = Float64
default = Inf
"--cpus"
help = "Set number of cpus used by solver (default: auto)"
arg_type = Int
required = false
"-N"
help = "Consider mapping class group of surface of genus N"
arg_type = Int
default = 2
"--radius"
help = "Radius of ball B_r(e,S) to find solution over"
arg_type = Int
default = 2
2018-01-04 22:08:32 +01:00
"--warmstart"
help = "Use warmstart.jl as the initial guess for SCS"
action = :store_true
end
return parse_args(args)
end
const PARSEDARGS = parse_commandline()
include("CPUselect.jl")
set_parallel_mthread(PARSEDARGS, workers=false)
2017-12-29 17:45:09 +01:00
2018-01-04 22:08:32 +01:00
using Nemo
using SCS.SCSSolver
using PropertyT
using Groups
include("FPGroups_GAP.jl")
include("groups/mappingclassgroup.jl")
2018-01-04 22:08:32 +01:00
function main(GROUP, parsed_args)
2017-12-29 17:45:09 +01:00
2018-01-04 22:08:32 +01:00
radius = parsed_args["radius"]
tol = parsed_args["tol"]
iterations = parsed_args["iterations"]
upper_bound = parsed_args["upper-bound"]
warm = parsed_args["warmstart"]
2017-12-29 17:45:09 +01:00
2018-01-04 22:08:32 +01:00
name, N = GROUP.groupname(parsed_args)
isdir(name) || mkdir(name)
2017-12-29 17:45:09 +01:00
G, S = GROUP.generatingset(N)
2018-01-04 22:08:32 +01:00
relations = [k*inv(v) for (k,v) in G.rels]
prepare_pm_delta(name, GAP_groupcode(S, relations), radius)
2017-12-29 17:45:09 +01:00
S = unique([S; inv.(S)])
2017-12-29 17:45:09 +01:00
2018-01-04 22:08:32 +01:00
Id = G()
2017-12-29 17:45:09 +01:00
2018-01-04 22:08:32 +01:00
logger = PropertyT.setup_logging(joinpath(name, "$(upper_bound)"))
2017-12-29 17:45:09 +01:00
2018-01-04 22:08:32 +01:00
info(logger, "Group: $name")
info(logger, "Iterations: $iterations")
info(logger, "Precision: $tol")
info(logger, "Upper bound: $upper_bound")
info(logger, "Radius: $radius")
info(logger, G)
info(logger, "Symmetric generating set of size $(length(S))")
info(logger, "Threads: $(Threads.nthreads())")
info(logger, "Workers: $(workers())")
2017-12-29 17:45:09 +01:00
solver = SCSSolver(eps=tol, max_iters=iterations, linearsolver=SCS.Direct, alpha=1.95, acceleration_lookback=1)
2017-12-29 17:45:09 +01:00
2018-01-07 16:12:51 +01:00
PropertyT.check_property_T(name, S, Id, solver, upper_bound, tol, radius, warm)
2018-01-04 22:08:32 +01:00
return 0
2017-12-29 17:45:09 +01:00
end
main(MappingClassGroups, PARSEDARGS)