From 74a559a17b5664be20d75691ae1604f54d626936 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 2 Jan 2019 15:47:58 +0100 Subject: [PATCH] change WreathProducts accordingly --- src/WreathProducts.jl | 36 +++++++++++++----------------------- 1 file changed, 13 insertions(+), 23 deletions(-) diff --git a/src/WreathProducts.jl b/src/WreathProducts.jl index 989e99f..721cc03 100644 --- a/src/WreathProducts.jl +++ b/src/WreathProducts.jl @@ -16,31 +16,31 @@ export WreathProduct, WreathProductElem > `n-tuples` of elements from `N` # Arguments: -* `N::Group` : the single factor of group $N$ +* `N::Group` : the single factor of the group $N$ * `P::Generic.PermGroup` : full `PermutationGroup` """ -struct WreathProduct{T<:Group, I<:Integer} <: Group - N::DirectPowerGroup{T} +struct WreathProduct{N, T<:Group, I<:Integer} <: Group + N::DirectPowerGroup{N, T} P::Generic.PermGroup{I} - function WreathProduct{T, I}(Gr::T, P::Generic.PermGroup{I}) where {T, I} + function WreathProduct(Gr::T, P::Generic.PermGroup{I}) where {T, I} N = DirectPowerGroup(Gr, Int(P.n)) - return new(N, P) + return new{Int(P.n), T, I}(N, P) end end -struct WreathProductElem{T<:GroupElem, I<:Integer} <: GroupElem - n::DirectPowerGroupElem{T} +struct WreathProductElem{N, T<:GroupElem, I<:Integer} <: GroupElem + n::DirectPowerGroupElem{N, T} p::Generic.perm{I} # parent::WreathProduct - function WreathProductElem{T, I}(n::DirectPowerGroupElem{T}, p::Generic.perm{I}, - check::Bool=true) where {T, I} + function WreathProductElem(n::DirectPowerGroupElem{N,T}, p::Generic.perm{I}, + check::Bool=true) where {N, T, I} if check length(n.elts) == length(p.d) || throw(DomainError( "Can't form WreathProductElem: lengths differ")) end - return new(n, p) + return new{N, T, I}(n, p) end end @@ -50,23 +50,13 @@ end # ############################################################################### -elem_type(::Type{WreathProduct{T, I}}) where {T, I} = WreathProductElem{elem_type(T), I} +elem_type(::Type{WreathProduct{N, T, I}}) where {N, T, I} = WreathProductElem{N, elem_type(T), I} -parent_type(::Type{WreathProductElem{T, I}}) where {T, I} = - WreathProduct{parent_type(T), I} +parent_type(::Type{WreathProductElem{N, T, I}}) where {N, T, I} = + WreathProduct{N, parent_type(T), I} parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p)) -############################################################################### -# -# WreathProduct / WreathProductElem constructors -# -############################################################################### - -WreathProduct(G::T, P::Generic.PermGroup{I}) where {T, I} = WreathProduct{T, I}(G, P) - -WreathProductElem(n::DirectPowerGroupElem{T}, p::Generic.perm{I}, check=true) where {T,I} = WreathProductElem{T,I}(n, p, check) - ############################################################################### # # Parent object call overloads