From 8a42e33b6dcbe33fc3cf4f5e19adb6853b5c3593 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 30 Oct 2019 16:25:09 +0100 Subject: [PATCH] =?UTF-8?q?update=20to=20AA-v0.7=20=E2=86=92=20bump=20to?= =?UTF-8?q?=20v0.2.3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Project.toml | 5 ++++- src/AutGroup.jl | 8 ++++---- src/WreathProducts.jl | 20 ++++++++++---------- test/DirectPower-tests.jl | 6 +++--- test/WreathProd-tests.jl | 10 +++++----- 5 files changed, 26 insertions(+), 23 deletions(-) diff --git a/Project.toml b/Project.toml index 39cbdee..c0b99d1 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Groups" uuid = "5d8bd718-bd84-11e8-3b40-ad14f4a32557" authors = ["Marek Kaluba "] -version = "0.2.2" +version = "0.2.3" [deps] AbstractAlgebra = "c3fe647b-3220-5bb0-a1ea-a7954cac585d" @@ -13,3 +13,6 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" [targets] test = ["Test"] + +[compat] +AbstractAlgebra = "^0.7.0" diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 6c80552..8ca68aa 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -19,7 +19,7 @@ struct FlipAut end struct PermAut - perm::Generic.perm{Int8} + perm::Generic.Perm{Int8} end struct Identity end @@ -130,7 +130,7 @@ function flip_autsymbol(i::Integer; pow::Integer=1) end end -function perm_autsymbol(p::Generic.perm{I}; pow::Integer=one(I)) where I<:Integer +function perm_autsymbol(p::Generic.Perm{I}; pow::Integer=one(I)) where I<:Integer if pow != 1 p = p^pow end @@ -143,8 +143,8 @@ function perm_autsymbol(p::Generic.perm{I}; pow::Integer=one(I)) where I<:Intege return id_autsymbol() end -function perm_autsymbol(a::Vector{T}) where T<:Integer - return perm_autsymbol(perm(Vector{Int8}(a), false)) +function perm_autsymbol(a::Vector{<:Integer}) + return perm_autsymbol(Generic.Perm(Vector{Int8}(a), false)) end function domain(G::AutGroup{N}) where N diff --git a/src/WreathProducts.jl b/src/WreathProducts.jl index 562f45c..37e19e6 100644 --- a/src/WreathProducts.jl +++ b/src/WreathProducts.jl @@ -29,12 +29,12 @@ struct WreathProduct{N, T<:Group, PG<:Generic.PermGroup} <: Group end end -struct WreathProductElem{N, T<:GroupElem, P<:Generic.perm} <: GroupElem +struct WreathProductElem{N, T<:GroupElem, P<:Generic.Perm} <: GroupElem n::DirectPowerGroupElem{N, T} p::P function WreathProductElem(n::DirectPowerGroupElem{N,T}, p::P, - check::Bool=true) where {N, T, P<:Generic.perm} + check::Bool=true) where {N, T, P<:Generic.Perm} if check N == length(p.d) || throw(DomainError( "Can't form WreathProductElem: lengths differ")) @@ -69,19 +69,19 @@ function (G::WreathProduct{N})(g::WreathProductElem{N}) where {N} end @doc doc""" - (G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.perm) + (G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.Perm) > Creates an element of wreath product `G` by coercing `n` and `p` to `G.N` and > `G.P`, respectively. """ -(G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.perm) = WreathProductElem(n,p) +(G::WreathProduct)(n::DirectPowerGroupElem, p::Generic.Perm) = WreathProductElem(n,p) (G::WreathProduct)() = WreathProductElem(G.N(), G.P(), false) @doc doc""" - (G::WreathProduct)(p::Generic.perm) + (G::WreathProduct)(p::Generic.Perm) > Returns the image of permutation `p` in `G` via embedding `p -> (id,p)`. """ -(G::WreathProduct)(p::Generic.perm) = G(G.N(), p) +(G::WreathProduct)(p::Generic.Perm) = G(G.N(), p) @doc doc""" (G::WreathProduct)(n::DirectPowerGroupElem) @@ -144,7 +144,7 @@ end # ############################################################################### -(p::perm)(n::DirectPowerGroupElem) = DirectPowerGroupElem(n.elts[p.d]) +(p::Generic.Perm)(n::DirectPowerGroupElem) = DirectPowerGroupElem(n.elts[p.d]) @doc doc""" *(g::WreathProductElem, h::WreathProductElem) @@ -152,7 +152,7 @@ end > > `g*h = (g.n*g.p(h.n), g.p*h.p)`, > -> where `g.p(h.n)` denotes the action of `g.p::Generic.perm` on +> where `g.p(h.n)` denotes the action of `g.p::Generic.Perm` on > `h.n::DirectPowerGroupElem` via standard permutation of coordinates. """ function *(g::WreathProductElem, h::WreathProductElem) @@ -188,7 +188,7 @@ end function iterate(G::WreathProduct, state) state_N, p, state_P = state res = iterate(G.N, state_N) - + if res == nothing resP = iterate(G.P, state_P) if resP == nothing @@ -200,7 +200,7 @@ function iterate(G::WreathProduct, state) else n, state_N = res end - + return G(n,p), (state_N, p, state_P) end diff --git a/test/DirectPower-tests.jl b/test/DirectPower-tests.jl index 95116e0..1409ece 100644 --- a/test/DirectPower-tests.jl +++ b/test/DirectPower-tests.jl @@ -23,7 +23,7 @@ g = perm"(1,2,3)" @test GG(g, g^2) isa GroupElem - @test GG(g, g^2) isa Groups.DirectPowerGroupElem{2, Generic.perm{Int64}} + @test GG(g, g^2) isa Groups.DirectPowerGroupElem{2, Generic.Perm{Int64}} h = GG(g,g^2) @@ -46,7 +46,7 @@ GG = G×G i = perm"(1,3)" g = perm"(1,2,3)" - + h = GG(g,g^2) k = GG(g^3, g^2) @@ -57,7 +57,7 @@ @test h*k == GG(g,g) @test h*inv(h) == (G×G)() - + w = GG(g,i)*GG(i,g) @test w == GG(perm"(1,2)(3)", perm"(2,3)") @test w == inv(w) diff --git a/test/WreathProd-tests.jl b/test/WreathProd-tests.jl index d251536..670842f 100644 --- a/test/WreathProd-tests.jl +++ b/test/WreathProd-tests.jl @@ -15,8 +15,8 @@ @test Groups.WreathProductElem(aa, b) isa AbstractAlgebra.GroupElem x = Groups.WreathProductElem(aa, b) @test x isa Groups.WreathProductElem - @test x isa - Groups.WreathProductElem{3, perm{Int}, perm{Int}} + @test x isa + Groups.WreathProductElem{3, Generic.Perm{Int}, Generic.Perm{Int}} @test B3.N == Groups.DirectPowerGroup(S_2, 3) @test B3.P == S_3 @@ -35,7 +35,7 @@ @testset "Types" begin B3 = Groups.WreathProduct(S_2, S_3) - @test elem_type(B3) == Groups.WreathProductElem{3, perm{Int}, perm{Int}} + @test elem_type(B3) == Groups.WreathProductElem{3, Generic.Perm{Int}, Generic.Perm{Int}} @test parent_type(typeof(B3())) == Groups.WreathProduct{3, parent_type(typeof(B3.N.group())), Generic.PermGroup{Int}} @@ -87,8 +87,8 @@ Wr = WreathProduct(PermutationGroup(2),PermutationGroup(4)) elts = collect(Wr) - @test elts isa Vector{Groups.WreathProductElem{4, perm{Int}, perm{Int}}} - @test order(Wr) == 2^4*factorial(4) + @test elts isa Vector{Groups.WreathProductElem{4, Generic.Perm{Int}, Generic.Perm{Int}}} + @test order(Wr) == 2^4*factorial(4) @test length(elts) == order(Wr) @test all([g*inv(g) == Wr() for g in elts])