From a603c104cd00e31ac924c747f6f60d08bdd9f282 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Thu, 21 Feb 2019 16:31:38 +0100 Subject: [PATCH] reorganize tests --- test/1703.09680.jl | 39 ++++++++++++++++ test/1712.07167.jl | 59 ++++++++++++++++++++++++ test/runtests.jl | 110 ++++----------------------------------------- 3 files changed, 106 insertions(+), 102 deletions(-) create mode 100644 test/1703.09680.jl create mode 100644 test/1712.07167.jl diff --git a/test/1703.09680.jl b/test/1703.09680.jl new file mode 100644 index 0000000..ddc8fc3 --- /dev/null +++ b/test/1703.09680.jl @@ -0,0 +1,39 @@ +@testset "1703.09680 Examples" begin + + @testset "SL(2,Z)" begin + N = 2 + G = MatrixSpace(Nemo.ZZ, N,N) + S = Groups.gens(G) + S = [S; inv.(S)] + + rm("SL($N,Z)", recursive=true, force=true) + sett = PropertyT.Settings("SL($N,Z)", G, S, solver(20000, accel=20); upper_bound=0.1) + + @test PropertyT.check_property_T(sett) == false + end + + @testset "SL(3,Z)" begin + N = 3 + G = MatrixSpace(Nemo.ZZ, N,N) + S = Groups.gens(G) + S = [S; inv.(S)] + + rm("SL($N,Z)", recursive=true, force=true) + sett = PropertyT.Settings("SL($N,Z)", G, S, solver(1000, accel=20); upper_bound=0.1) + + @test PropertyT.check_property_T(sett) == true + end + + @testset "SAut(F₂)" begin + N = 2 + G = SAut(FreeGroup(N)) + S = Groups.gens(G) + S = [S; inv.(S)] + + rm("SAut(F$N)", recursive=true, force=true) + sett = PropertyT.Settings("SAut(F$N)", G, S, solver(20000); + upper_bound=0.15, warmstart=false) + + @test PropertyT.check_property_T(sett) == false + end +end diff --git a/test/1712.07167.jl b/test/1712.07167.jl new file mode 100644 index 0000000..2c08b05 --- /dev/null +++ b/test/1712.07167.jl @@ -0,0 +1,59 @@ +@testset "1712.07167 Examples" begin + + @testset "oSL(3,Z)" begin + N = 3 + G = MatrixSpace(Nemo.ZZ, N,N) + S = Groups.gens(G) + S = [S; inv.(S)] + autS = WreathProduct(PermGroup(2), PermGroup(N)) + + rm("oSL($N,Z)", recursive=true, force=true) + sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(2000, accel=20); + upper_bound=0.27, warmstart=false) + + @test PropertyT.check_property_T(sett) == false + #second run just checks the solution + @test PropertyT.check_property_T(sett) == false + + sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(2000, accel=20); + upper_bound=0.27, warmstart=true) + + @test PropertyT.check_property_T(sett) == true + end + + @testset "oSL(4,Z)" begin + N = 4 + G = MatrixSpace(Nemo.ZZ, N,N) + S = Groups.gens(G) + S = [S; inv.(S)] + autS = WreathProduct(PermGroup(2), PermGroup(N)) + + rm("oSL($N,Z)", recursive=true, force=true) + sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(2000, accel=20); + upper_bound=1.3, warmstart=false) + + @test PropertyT.check_property_T(sett) == false + #second run just checks the obtained solution + @test PropertyT.check_property_T(sett) == false + + sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(5000, accel=20); + upper_bound=1.3, warmstart=true) + + @test PropertyT.check_property_T(sett) == true + end + + @testset "SAut(F₃)" begin + N = 3 + G = SAut(FreeGroup(N)) + S = Groups.gens(G) + S = [S; inv.(S)] + autS = WreathProduct(PermGroup(2), PermGroup(N)) + + rm("oSAut(F$N)", recursive=true, force=true) + + sett = PropertyT.Settings("SAut(F$N)", G, S, autS, solver(5000); + upper_bound=0.15, warmstart=false) + + @test PropertyT.check_property_T(sett) == false + end +end diff --git a/test/runtests.jl b/test/runtests.jl index a483cc3..ed689b2 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -3,11 +3,12 @@ using SparseArrays using JLD using PropertyT using Test +using JuMP indexing(n) = [(i,j) for i in 1:n for j in (i+1):n] function Groups.gens(M::MatSpace) - @assert M.cols == M.rows - N = M.cols + @assert ncols(M) == nrows(M) + N = ncols(M) E(i,j) = begin g = M(1); g[i,j] = 1; g end S = [E(i,j) for (i,j) in indexing(N)] S = [S; transpose.(S)] @@ -15,104 +16,9 @@ function Groups.gens(M::MatSpace) end solver(iters; accel=1) = - SCSSolver(max_iters=iters, acceleration_lookback=accel, eps=1e-10) + with_optimizer(SCS.Optimizer, + linear_solver=SCS.Direct, max_iters=iters, + acceleration_lookback=accel, eps=1e-10, warm_start=true) -@testset "1703.09680 Examples" begin - - @testset "SL(2,Z)" begin - N = 2 - G = MatrixSpace(Nemo.ZZ, N,N) - S = Groups.gens(G) - S = [S; inv.(S)] - - rm("SL($N,Z)", recursive=true, force=true) - sett = PropertyT.Settings("SL($N,Z)", G, S, solver(20000, accel=20); upper_bound=0.1) - - @test PropertyT.check_property_T(sett) == false - end - - @testset "SL(3,Z)" begin - N = 3 - G = MatrixSpace(Nemo.ZZ, N,N) - S = Groups.gens(G) - S = [S; inv.(S)] - - rm("SL($N,Z)", recursive=true, force=true) - sett = PropertyT.Settings("SL($N,Z)", G, S, solver(1000, accel=20); upper_bound=0.1) - - @test PropertyT.check_property_T(sett) == true - end - - @testset "SAut(F₂)" begin - N = 2 - G = SAut(FreeGroup(N)) - S = Groups.gens(G) - S = [S; inv.(S)] - - rm("SAut(F$N)", recursive=true, force=true) - sett = PropertyT.Settings("SAut(F$N)", G, S, solver(20000); - upper_bound=0.15, warmstart=false) - - @test PropertyT.check_property_T(sett) == false - end -end - -@testset "1712.07167 Examples" begin - - @testset "oSL(3,Z)" begin - N = 3 - G = MatrixSpace(Nemo.ZZ, N,N) - S = Groups.gens(G) - S = [S; inv.(S)] - autS = WreathProduct(PermGroup(2), PermGroup(N)) - - rm("oSL($N,Z)", recursive=true, force=true) - sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(2000, accel=20); - upper_bound=0.27, warmstart=false) - - @test PropertyT.check_property_T(sett) == false - #second run just checks the solution - @test PropertyT.check_property_T(sett) == false - - sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(2000, accel=10); - upper_bound=0.27, warmstart=true) - - @test PropertyT.check_property_T(sett) == true - end - - @testset "oSL(4,Z)" begin - N = 4 - G = MatrixSpace(Nemo.ZZ, N,N) - S = Groups.gens(G) - S = [S; inv.(S)] - autS = WreathProduct(PermGroup(2), PermGroup(N)) - - rm("oSL($N,Z)", recursive=true, force=true) - sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(5000, accel=10); - upper_bound=1.3, warmstart=false) - - @test PropertyT.check_property_T(sett) == false - #second run just checks the obtained solution - @test PropertyT.check_property_T(sett) == false - - sett = PropertyT.Settings("SL($N,Z)", G, S, autS, solver(20000, accel=10); - upper_bound=1.3, warmstart=true) - - @test PropertyT.check_property_T(sett) == true - end - - @testset "SAut(F₃)" begin - N = 3 - G = SAut(FreeGroup(N)) - S = Groups.gens(G) - S = [S; inv.(S)] - autS = WreathProduct(PermGroup(2), PermGroup(N)) - - rm("oSAut(F$N)", recursive=true, force=true) - - sett = PropertyT.Settings("SAut(F$N)", G, S, autS, solver(10000); - upper_bound=0.15, warmstart=false) - - @test PropertyT.check_property_T(sett) == false - end -end +include("1703.09680.jl") +include("1712.07167.jl")