dispatch method of main is decided based on G

This commit is contained in:
kalmarek 2018-08-20 03:24:49 +02:00
parent 0cae4882f1
commit 6abb2c4186
3 changed files with 17 additions and 24 deletions

View File

@ -62,8 +62,4 @@ include("main.jl")
G = PropertyTGroups.SpecialAutomorphismGroup(PARSEDARGS) G = PropertyTGroups.SpecialAutomorphismGroup(PARSEDARGS)
if PARSEDARGS["nosymmetry"] main(G)
main(Standard, G)
else
main(Symmetrize, G)
end

6
SLn.jl
View File

@ -59,8 +59,4 @@ include("main.jl")
G = PropertyTGroups.SpecialLinearGroup(PARSEDARGS) G = PropertyTGroups.SpecialLinearGroup(PARSEDARGS)
if PARSEDARGS["nosymmetry"] main(G)
main(Standard, G)
else
main(Symmetrize, G)
end

View File

@ -7,22 +7,22 @@ info(testdir)
mkdir(testdir) mkdir(testdir)
cd(testdir) cd(testdir)
function SL_tests(::Type{T}, args) where {T<:Union{Standard, Symmetrize}} function SL_tests(args)
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
args["p"] = 3 args["p"] = 3
@test main(T, G) == true @test main(G) == true
println("\n"*"="^30*"\n") println("\n"*"="^30*"\n")
begin begin
args["p"] = 5 args["p"] = 5
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false @test main(G) == false
args["warmstart"] = true args["warmstart"] = true
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false @test main(G) == false
end end
println("\n"*"="^30*"\n") println("\n"*"="^30*"\n")
@ -30,20 +30,20 @@ function SL_tests(::Type{T}, args) where {T<:Union{Standard, Symmetrize}}
begin begin
args["p"] = 7 args["p"] = 7
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false @test main(G) == false
println("\n"*"="^30*"\n") println("\n"*"="^30*"\n")
args["upper-bound"] = 0.25 args["upper-bound"] = 0.25
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false @test main(G) == false
end end
println("\n"*"="^30*"\n") println("\n"*"="^30*"\n")
args["N"] = 3 args["N"] = 3
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == true @test main(G) == true
println("\n"*"="^30*"\n") println("\n"*"="^30*"\n")
@ -53,24 +53,25 @@ function SL_tests(::Type{T}, args) where {T<:Union{Standard, Symmetrize}}
args["upper-bound"] = Inf args["upper-bound"] = Inf
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false @test main(G) == false
args["upper-bound"] = 0.27 args["upper-bound"] = 0.27
args["warmstart"] = true args["warmstart"] = true
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == false @test main(G) == false
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == true @test main(G) == true
G = PropertyTGroups.SpecialLinearGroup(args) G = PropertyTGroups.SpecialLinearGroup(args)
@test main(T, G) == true @test main(G) == true
end end
return main(T, G) return main(G)
end end
@testset "SLn's" begin @testset "SLn's" begin
@testset "Non-Symmetrized" begin @testset "Non-Symmetrized" begin
args = Dict( args = Dict(
@ -86,7 +87,7 @@ end
"nosymmetry"=>true, "nosymmetry"=>true,
) )
@time SL_tests(Standard, args) SL_tests(args)
end end
@testset "Symmetrized" begin @testset "Symmetrized" begin
@ -104,6 +105,6 @@ end
"nosymmetry"=>false, "nosymmetry"=>false,
) )
@time SL_tests(Symmetrize, args) SL_tests(args)
end end
end end