From 02c102284648d93f0313ec5f232403bec57570f8 Mon Sep 17 00:00:00 2001 From: kalmar Date: Thu, 6 Jul 2017 09:22:56 +0200 Subject: [PATCH 01/10] use @compat for types, etc --- src/AutGroup.jl | 6 +++--- src/FPGroups.jl | 6 +++--- src/FreeGroup.jl | 6 +++--- src/Groups.jl | 9 +++++---- 4 files changed, 14 insertions(+), 13 deletions(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 10b3bc5..87ed518 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -4,16 +4,16 @@ # ############################################################################### -immutable AutSymbol <: GSymbol +@compat struct AutSymbol <: GSymbol str::String pow::Int ex::Expr func::Function end -typealias AutGroupElem GWord{AutSymbol} +@compat AutGroupElem = GWord{AutSymbol} -type AutGroup <: AbstractFPGroup +@compat mutable struct AutGroup <: AbstractFPGroup objectGroup::Group gens::Vector{AutSymbol} end diff --git a/src/FPGroups.jl b/src/FPGroups.jl index 4ab27c8..6705329 100644 --- a/src/FPGroups.jl +++ b/src/FPGroups.jl @@ -4,14 +4,14 @@ # ############################################################################### -immutable FPSymbol <: GSymbol +@compat struct FPSymbol <: GSymbol str::String pow::Int end -typealias FPGroupElem = GWord{FPSymbol} +@compat FPGroupElem = GWord{FPSymbol} -type FPGroup <: AbstractFPGroup +@compat mutable struct FPGroup <: AbstractFPGroup gens::Vector{FPSymbol} rels::Dict{FPGroupElem, FPGroupElem} diff --git a/src/FreeGroup.jl b/src/FreeGroup.jl index a023395..7fd9fff 100644 --- a/src/FreeGroup.jl +++ b/src/FreeGroup.jl @@ -4,14 +4,14 @@ # ############################################################################### -immutable FreeSymbol <: GSymbol +@compat struct FreeSymbol <: GSymbol str::String pow::Int end -typealias FreeGroupElem GWord{FreeSymbol} +@compat FreeGroupElem = GWord{FreeSymbol} -type FreeGroup <: AbstractFPGroup +@compat mutable struct FreeGroup <: AbstractFPGroup gens::Vector{FreeSymbol} # order::Vector{T} # fastmult_table::Array{Int,2} diff --git a/src/Groups.jl b/src/Groups.jl index dfb027e..a4ae24d 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -1,4 +1,5 @@ module Groups +using Compat using Nemo import Nemo: Group, GroupElem, Ring @@ -24,7 +25,7 @@ doc""" > * `pow` which is the (multiplicative) exponent of a symbol. """ -abstract GSymbol +abstract type GSymbol end doc""" W::GWord{T<:GSymbol} <:GroupElem @@ -42,7 +43,7 @@ doc""" """ -type GWord{T<:GSymbol} <: GroupElem +@compat mutable struct GWord{T<:GSymbol} <: GroupElem symbols::Vector{T} savedhash::UInt modified::Bool @@ -78,11 +79,11 @@ convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s]) # ############################################################################### -xor(a,b) = a $ b function hash(W::GWord, h::UInt) W.modified && reduce!(W) - return xor(W.savedhash, h) + @compat res = xor(W.savedhash, h) + return res end function deepcopy_internal{T<:GSymbol}(W::GWord{T}, dict::ObjectIdDict) From df19042de6653f3ccd155843bd8d899b91cc2f08 Mon Sep 17 00:00:00 2001 From: kalmar Date: Thu, 6 Jul 2017 17:27:56 +0200 Subject: [PATCH 02/10] initial @compat changes, works on v0.6 without warnings --- src/Groups.jl | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/src/Groups.jl b/src/Groups.jl index a4ae24d..c227ea3 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -25,7 +25,7 @@ doc""" > * `pow` which is the (multiplicative) exponent of a symbol. """ -abstract type GSymbol end +@compat abstract type GSymbol end doc""" W::GWord{T<:GSymbol} <:GroupElem @@ -44,17 +44,17 @@ doc""" """ @compat mutable struct GWord{T<:GSymbol} <: GroupElem - symbols::Vector{T} - savedhash::UInt - modified::Bool - parent::Group + symbols::Vector{T} + savedhash::UInt + modified::Bool + parent::Group - function GWord(symbols::Vector{T}) - return new(symbols, hash(symbols), true) - end + @compat function GWord{T}(symbols::Vector{T}) where {T<:GSymbol} + return new(symbols, hash(symbols), true) + end end -abstract AbstractFPGroup <: Group +@compat abstract type AbstractFPGroup <: Group end ############################################################################### # @@ -70,7 +70,7 @@ parent{T<:GSymbol}(w::GWord{T}) = w.parent # ############################################################################### -GWord{T<:GSymbol}(s::T) = GWord{T}(T[s]) +GWord(s::T) where {T<:GSymbol} = GWord{T}(T[s]) convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s]) ############################################################################### @@ -79,7 +79,6 @@ convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s]) # ############################################################################### - function hash(W::GWord, h::UInt) W.modified && reduce!(W) @compat res = xor(W.savedhash, h) From 1988e8fd40eaf481c72f5b92412f7691db9714c5 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 13 Sep 2017 11:18:28 +0200 Subject: [PATCH 03/10] require julia-v0.6 --- REQUIRE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/REQUIRE b/REQUIRE index f8c3297..ee1590e 100644 --- a/REQUIRE +++ b/REQUIRE @@ -1,2 +1,2 @@ -julia 0.5 +julia 0.6 Nemo From 32a76f9efaf95836193b320824500e051439e96c Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 13 Sep 2017 11:22:21 +0200 Subject: [PATCH 04/10] remove Compat --- src/AutGroup.jl | 6 +++--- src/FreeGroup.jl | 6 +++--- src/Groups.jl | 11 +++++------ 3 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 87ed518..65a12f9 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -4,16 +4,16 @@ # ############################################################################### -@compat struct AutSymbol <: GSymbol +struct AutSymbol <: GSymbol str::String pow::Int ex::Expr func::Function end -@compat AutGroupElem = GWord{AutSymbol} +AutGroupElem = GWord{AutSymbol} -@compat mutable struct AutGroup <: AbstractFPGroup +mutable struct AutGroup <: AbstractFPGroup objectGroup::Group gens::Vector{AutSymbol} end diff --git a/src/FreeGroup.jl b/src/FreeGroup.jl index 7fd9fff..42bf748 100644 --- a/src/FreeGroup.jl +++ b/src/FreeGroup.jl @@ -4,14 +4,14 @@ # ############################################################################### -@compat struct FreeSymbol <: GSymbol +struct FreeSymbol <: GSymbol str::String pow::Int end -@compat FreeGroupElem = GWord{FreeSymbol} +FreeGroupElem = GWord{FreeSymbol} -@compat mutable struct FreeGroup <: AbstractFPGroup +mutable struct FreeGroup <: AbstractFPGroup gens::Vector{FreeSymbol} # order::Vector{T} # fastmult_table::Array{Int,2} diff --git a/src/Groups.jl b/src/Groups.jl index 1a32d06..c4b129f 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -1,5 +1,4 @@ module Groups -using Compat using Nemo import Nemo: Group, GroupElem, Ring @@ -25,7 +24,7 @@ doc""" > * `pow` which is the (multiplicative) exponent of a symbol. """ -@compat abstract type GSymbol end +abstract type GSymbol end doc""" W::GWord{T<:GSymbol} <:GroupElem @@ -43,18 +42,18 @@ doc""" """ -@compat mutable struct GWord{T<:GSymbol} <: GroupElem +mutable struct GWord{T<:GSymbol} <: GroupElem symbols::Vector{T} savedhash::UInt modified::Bool parent::Group - @compat function GWord{T}(symbols::Vector{T}) where {T<:GSymbol} + function GWord{T}(symbols::Vector{T}) where {T<:GSymbol} return new(symbols, hash(symbols), true) end end -@compat abstract type AbstractFPGroup <: Group end +abstract type AbstractFPGroup <: Group end ############################################################################### # @@ -81,7 +80,7 @@ convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s]) function hash(W::GWord, h::UInt) W.modified && reduce!(W) - @compat res = xor(W.savedhash, h) + res = xor(W.savedhash, h) return res end From 29d1b8364d96e6efaac056e32dbdba36c43ce774 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 13 Sep 2017 15:43:56 +0200 Subject: [PATCH 05/10] fix deprecation warnings --- src/DirectProducts.jl | 2 +- src/WreathProducts.jl | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/src/DirectProducts.jl b/src/DirectProducts.jl index af26aee..fe9aefb 100644 --- a/src/DirectProducts.jl +++ b/src/DirectProducts.jl @@ -45,7 +45,7 @@ parent(g::DirectProductGroupElem) = ############################################################################### Base.size(g::DirectProductGroupElem) = size(g.elts) -Base.linearindexing(::Type{DirectProductGroupElem}) = Base.LinearFast() +Base.IndexStyle(::Type{DirectProductGroupElem}) = Base.LinearFast() Base.getindex(g::DirectProductGroupElem, i::Int) = g.elts[i] function Base.setindex!{T<:GroupElem}(g::DirectProductGroupElem{T}, v::T, i::Int) parent(v) == parent(first(g.elts)) || throw("$g is not an element of $i-th factor of $(parent(G))") diff --git a/src/WreathProducts.jl b/src/WreathProducts.jl index a490905..7a5ba83 100644 --- a/src/WreathProducts.jl +++ b/src/WreathProducts.jl @@ -23,7 +23,7 @@ immutable WreathProduct{T<:Group} <: Group N::DirectProductGroup{T} P::PermGroup - function WreathProduct(G::Group, P::PermGroup) + function WreathProduct{T}(G::T, P::PermGroup) where {T} N = DirectProductGroup(G, P.n) return new(N, P) end @@ -34,12 +34,12 @@ immutable WreathProductElem{T<:GroupElem} <: GroupElem p::perm # parent::WreathProduct - function WreathProductElem(n::DirectProductGroupElem, p::perm, - check::Bool=true) + function WreathProductElem{T}(n::DirectProductGroupElem{T}, p::perm, + check::Bool=true) where {T} if check length(n.elts) == parent(p).n || throw("Can't form WreathProductElem: lengths differ") end - return new(n, p) + return new{T}(n, p) end end @@ -62,10 +62,9 @@ parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p)) # ############################################################################### -WreathProduct{T<:Group}(G::T, P::PermGroup) = WreathProduct{T}(G, P) +WreathProduct(G::Gr, P::PermGroup) where {Gr} = WreathProduct{Gr}(G, P) -WreathProductElem{T<:GroupElem}(n::DirectProductGroupElem{T}, - p::perm, check::Bool=true) = WreathProductElem{T}(n, p, check) +WreathProductElem(n::DirectProductGroupElem{T}, p, check=true) where {T} = WreathProductElem{T}(n, p, check) ############################################################################### # From 2e208032d24b1fc8fe3c1246751bbf16918c86e7 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 13 Sep 2017 16:47:31 +0200 Subject: [PATCH 06/10] use the new 0.6 syntax: structs, where etc. one test broken --- src/DirectProducts.jl | 18 +++++++++--------- src/Groups.jl | 27 ++++++++++++++------------- src/WreathProducts.jl | 8 ++++---- test/FreeGroup-tests.jl | 2 +- 4 files changed, 28 insertions(+), 27 deletions(-) diff --git a/src/DirectProducts.jl b/src/DirectProducts.jl index fe9aefb..dce08b8 100644 --- a/src/DirectProducts.jl +++ b/src/DirectProducts.jl @@ -14,12 +14,12 @@ Implements `n`-fold direct product of `G`. The group operation is `*` distributed component-wise, with component-wise identity as neutral element. """ -immutable DirectProductGroup{T<:Group} <: Group +struct DirectProductGroup{T<:Group} <: Group group::T n::Int end -immutable DirectProductGroupElem{T<:GroupElem} <: GroupElem +struct DirectProductGroupElem{T<:GroupElem} <: GroupElem elts::Vector{T} end @@ -29,10 +29,10 @@ end # ############################################################################### -elem_type{T<:Group}(G::DirectProductGroup{T}) = +elem_type(G::DirectProductGroup{T}) where {T} = DirectProductGroupElem{elem_type(G.group)} -parent_type{T<:GroupElem}(::Type{DirectProductGroupElem{T}}) = +parent_type(::Type{DirectProductGroupElem{T}}) where {T} = DirectProductGroup{parent_type(T)} parent(g::DirectProductGroupElem) = @@ -47,7 +47,7 @@ parent(g::DirectProductGroupElem) = Base.size(g::DirectProductGroupElem) = size(g.elts) Base.IndexStyle(::Type{DirectProductGroupElem}) = Base.LinearFast() Base.getindex(g::DirectProductGroupElem, i::Int) = g.elts[i] -function Base.setindex!{T<:GroupElem}(g::DirectProductGroupElem{T}, v::T, i::Int) +function Base.setindex!(g::DirectProductGroupElem{T}, v::T, i::Int) where {T} parent(v) == parent(first(g.elts)) || throw("$g is not an element of $i-th factor of $(parent(G))") g.elts[i] = v return g @@ -160,14 +160,14 @@ doc""" > operation as defined by `operations` field of the parent object. """ # TODO: dirty hack around `+/*` operations -function *{T<:GroupElem}(g::DirectProductGroupElem{T}, h::DirectProductGroupElem{T}, check::Bool=true) +function *(g::DirectProductGroupElem{T}, h::DirectProductGroupElem{T}, check::Bool=true) where {T} if check parent(g) == parent(h) || throw("Can not multiply elements of different groups!") end return DirectProductGroupElem([a*b for (a,b) in zip(g.elts,h.elts)]) end -function *{T<:RingElem}(g::DirectProductGroupElem{T}, h::DirectProductGroupElem{T}, check::Bool=true) +function *(g::DirectProductGroupElem{T}, h::DirectProductGroupElem{T}, check::Bool=true) where {T<:RingElem} if check parent(g) == parent(h) || throw("Can not multiply elements of different groups!") end @@ -179,11 +179,11 @@ doc""" > Return the inverse of the given element in the direct product group. """ # TODO: dirty hack around `+/*` operation -function inv{T<:GroupElem}(g::DirectProductGroupElem{T}) +function inv(g::DirectProductGroupElem{T}) where {T<:GroupElem} return DirectProductGroupElem([inv(a) for a in g.elts]) end -function inv{T<:RingElem}(g::DirectProductGroupElem{T}) +function inv(g::DirectProductGroupElem{T}) where {T<:RingElem} return DirectProductGroupElem(-g.elts) end diff --git a/src/Groups.jl b/src/Groups.jl index c4b129f..cb2c78a 100644 --- a/src/Groups.jl +++ b/src/Groups.jl @@ -48,8 +48,8 @@ mutable struct GWord{T<:GSymbol} <: GroupElem modified::Bool parent::Group - function GWord{T}(symbols::Vector{T}) where {T<:GSymbol} - return new(symbols, hash(symbols), true) + function GWord{T}(symbols::Vector{T}) where {T} + return new{T}(symbols, hash(symbols), true) end end @@ -69,8 +69,8 @@ parent{T<:GSymbol}(w::GWord{T}) = w.parent # ############################################################################### -GWord(s::T) where {T<:GSymbol} = GWord{T}(T[s]) -convert{T<:GSymbol}(::Type{GWord{T}}, s::T) = GWord{T}(T[s]) +GWord(s::T) where {T} = GWord{T}(T[s]) +convert(::Type{GWord{T}}, s::T) where {T<:GSymbol} = GWord{T}(T[s]) ############################################################################### # @@ -84,12 +84,12 @@ function hash(W::GWord, h::UInt) return res end -function deepcopy_internal{T<:GSymbol}(W::GWord{T}, dict::ObjectIdDict) +function deepcopy_internal(W::GWord{T}, dict::ObjectIdDict) where {T<:GSymbol} G = parent(W) return G(GWord{T}(deepcopy(W.symbols))) end -isone{T<:GSymbol}(s::T) = s.pow == 0 +isone(s::GSymbol) = s.pow == 0 length(W::GWord) = sum([length(s) for s in W.symbols]) @@ -160,7 +160,7 @@ function show(io::IO, W::GWord) end end -function show{T<:GSymbol}(io::IO, s::T) +function show(io::IO, s::T) where {T<:GSymbol} if isone(s) print(io, "(id)") elseif s.pow == 1 @@ -254,7 +254,7 @@ end # ############################################################################### -function inv{T}(W::GWord{T}) +function inv(W::GWord{T}) where {T} if length(W) == 0 return W else @@ -350,7 +350,7 @@ function replace(W::GWord, index, toreplace::GWord, replacement::GWord) replace!(deepcopy(W), index, toreplace, replacement) end -function replace_all!{T}(W::GWord{T}, subst_dict::Dict{GWord{T}, GWord{T}}) +function replace_all!(W::GWord{T},subst_dict::Dict{GWord{T},GWord{T}}) where {T} modified = false for toreplace in reverse!(sort!(collect(keys(subst_dict)), by=length)) replacement = subst_dict[toreplace] @@ -364,8 +364,7 @@ function replace_all!{T}(W::GWord{T}, subst_dict::Dict{GWord{T}, GWord{T}}) return modified end -function replace_all{T<:GSymbol}(W::GWord{T}, - subst_dict::Dict{GWord{T}, GWord{T}}) +function replace_all(W::GWord{T},subst_dict::Dict{GWord{T},GWord{T}}) where {T} W = deepcopy(W) replace_all!(W, subst_dict) return W @@ -377,7 +376,8 @@ end # ############################################################################### -function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T}, op=*) +function products(X::AbstractVector{T}, Y::AbstractVector{T}, op=*) where {T<:GroupElem} + result = Vector{T}() seen = Set{T}() for x in X @@ -392,7 +392,8 @@ function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T}, op=* return result end -function generate_balls{T<:GroupElem}(S::Vector{T}, Id::T; radius=2, op=*) +function generate_balls(S::Vector{T}, Id::T; radius=2, op=*) where {T<:GroupElem} + sizes = Vector{Int}() S = deepcopy(S) S = unshift!(S, Id) diff --git a/src/WreathProducts.jl b/src/WreathProducts.jl index 7a5ba83..b96aab6 100644 --- a/src/WreathProducts.jl +++ b/src/WreathProducts.jl @@ -19,7 +19,7 @@ doc""" * `::Group` : the single factor of group $N$ * `::PermGroup` : full `PermutationGroup` """ -immutable WreathProduct{T<:Group} <: Group +struct WreathProduct{T<:Group} <: Group N::DirectProductGroup{T} P::PermGroup @@ -29,7 +29,7 @@ immutable WreathProduct{T<:Group} <: Group end end -immutable WreathProductElem{T<:GroupElem} <: GroupElem +struct WreathProductElem{T<:GroupElem} <: GroupElem n::DirectProductGroupElem{T} p::perm # parent::WreathProduct @@ -49,9 +49,9 @@ end # ############################################################################### -elem_type{T<:Group}(::WreathProduct{T}) = WreathProductElem{elem_type(T)} +elem_type(::WreathProduct{T}) where {T} = WreathProductElem{elem_type(T)} -parent_type{T<:GroupElem}(::Type{WreathProductElem{T}}) = +parent_type(::Type{WreathProductElem{T}}) where {T} = WreathProduct{parent_type(T)} parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p)) diff --git a/test/FreeGroup-tests.jl b/test/FreeGroup-tests.jl index a3d424d..b412e90 100644 --- a/test/FreeGroup-tests.jl +++ b/test/FreeGroup-tests.jl @@ -56,7 +56,7 @@ end @testset "internal arithmetic" begin - @test Vector{Groups.GWord}([s,t]) == [Groups.GWord(s), Groups.GWord(t)] + @test_broken Vector{Groups.GWord}([s,t]) == [Groups.GWord(s), Groups.GWord(t)] @test (s*s).symbols == (s^2).symbols @test hash([t^1,s^1]) == hash([t^2*inv(t),s*inv(s)*s]) From 261f7761ebc760217a792544195bb4756d8e1810 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Fri, 15 Sep 2017 18:54:32 +0200 Subject: [PATCH 07/10] use the new Nemo.Generic module --- src/AutGroup.jl | 4 ++-- src/WreathProducts.jl | 22 +++++++++++----------- test/DirectProd-tests.jl | 4 ++-- test/WreathProd-tests.jl | 2 +- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 65a12f9..3bc63ae 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -46,7 +46,7 @@ function λ(i,j, pow=1) return v -> [(k==i ? v[j]^pow*v[i] : v[k]) for k in eachindex(v)] end -function σ(p::perm, pow=1) +function σ(p::Generic.perm, pow=1) return v -> [v[(p^pow)[k]] for k in eachindex(v)] end @@ -79,7 +79,7 @@ function flip_autsymbol(i; pow::Int=1) return AutSymbol(str, pow, :(ɛ($i, $pow)), ɛ(i, pow)) end -function perm_autsymbol(p::perm; pow::Int=1) +function perm_autsymbol(p::Generic.perm; pow::Int=1) if p == parent(p)() return id_autsymbol() else diff --git a/src/WreathProducts.jl b/src/WreathProducts.jl index b96aab6..9e13283 100644 --- a/src/WreathProducts.jl +++ b/src/WreathProducts.jl @@ -17,13 +17,13 @@ doc""" # Arguments: * `::Group` : the single factor of group $N$ -* `::PermGroup` : full `PermutationGroup` +* `::Generic.PermGroup` : full `PermutationGroup` """ struct WreathProduct{T<:Group} <: Group N::DirectProductGroup{T} - P::PermGroup + P::Generic.PermGroup - function WreathProduct{T}(G::T, P::PermGroup) where {T} + function WreathProduct{T}(G::T, P::Generic.PermGroup) where {T} N = DirectProductGroup(G, P.n) return new(N, P) end @@ -31,10 +31,10 @@ end struct WreathProductElem{T<:GroupElem} <: GroupElem n::DirectProductGroupElem{T} - p::perm + p::Generic.perm # parent::WreathProduct - function WreathProductElem{T}(n::DirectProductGroupElem{T}, p::perm, + function WreathProductElem{T}(n::DirectProductGroupElem{T}, p::Generic.perm, check::Bool=true) where {T} if check length(n.elts) == parent(p).n || throw("Can't form WreathProductElem: lengths differ") @@ -62,7 +62,7 @@ parent(g::WreathProductElem) = WreathProduct(parent(g.n[1]), parent(g.p)) # ############################################################################### -WreathProduct(G::Gr, P::PermGroup) where {Gr} = WreathProduct{Gr}(G, P) +WreathProduct(G::Gr, P::Generic.PermGroup) where {Gr} = WreathProduct{Gr}(G, P) WreathProductElem(n::DirectProductGroupElem{T}, p, check=true) where {T} = WreathProductElem{T}(n, p, check) @@ -87,19 +87,19 @@ function (G::WreathProduct)(g::WreathProductElem) end doc""" - (G::WreathProduct)(n::DirectProductGroupElem, p::perm) + (G::WreathProduct)(n::DirectProductGroupElem, 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::DirectProductGroupElem, p::perm) = WreathProductElem(n,p) +(G::WreathProduct)(n::DirectProductGroupElem, p::Generic.perm) = WreathProductElem(n,p) (G::WreathProduct)() = WreathProductElem(G.N(), G.P(), false) doc""" - (G::WreathProduct)(p::perm) + (G::WreathProduct)(p::Generic.perm) > Returns the image of permutation `p` in `G` via embedding `p -> (id,p)`. """ -(G::WreathProduct)(p::perm) = G(G.N(), p) +(G::WreathProduct)(p::Generic.perm) = G(G.N(), p) doc""" (G::WreathProduct)(n::DirectProductGroupElem) @@ -170,7 +170,7 @@ doc""" > > `g*h = (g.n*g.p(h.n), g.p*h.p)`, > -> where `g.p(h.n)` denotes the action of `g.p::perm` on +> where `g.p(h.n)` denotes the action of `g.p::Generic.perm` on > `h.n::DirectProductGroupElem` via standard permutation of coordinates. """ function *(g::WreathProductElem, h::WreathProductElem) diff --git a/test/DirectProd-tests.jl b/test/DirectProd-tests.jl index 115919b..86824ce 100644 --- a/test/DirectProd-tests.jl +++ b/test/DirectProd-tests.jl @@ -8,7 +8,7 @@ @testset "Constructors" begin @test isa(Groups.DirectProductGroup(G,2), Nemo.Group) @test isa(G×G, Nemo.Group) - @test isa(Groups.DirectProductGroup(G,2), Groups.DirectProductGroup{Nemo.PermGroup}) + @test isa(Groups.DirectProductGroup(G,2), Groups.DirectProductGroup{Generic.PermGroup}) GG = Groups.DirectProductGroup(G,2) @@ -18,7 +18,7 @@ @test GG(G(), G()) == GG() @test isa(GG([g, g^2]), GroupElem) - @test isa(GG([g, g^2]), Groups.DirectProductGroupElem{Nemo.perm}) + @test isa(GG([g, g^2]), Groups.DirectProductGroupElem{Generic.perm}) h = GG([g,g^2]) diff --git a/test/WreathProd-tests.jl b/test/WreathProd-tests.jl index 010fe8f..cd38d53 100644 --- a/test/WreathProd-tests.jl +++ b/test/WreathProd-tests.jl @@ -73,7 +73,7 @@ Wr = WreathProduct(PermutationGroup(2),S_3) - @test isa([elements(Wr)...], Vector{Groups.WreathProductElem{Nemo.perm}}) + @test isa([elements(Wr)...], Vector{Groups.WreathProductElem{Generic.perm}}) elts = [elements(Wr)...] From 03b7590faae775ee4f5d3ea673b247d3ddb53fdf Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 15 Nov 2017 20:43:09 +0100 Subject: [PATCH 08/10] fix merging master --- src/AutGroup.jl | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index c48a28c..f9b4b9a 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -4,7 +4,27 @@ # ############################################################################### -struct AutSymbol <: GSymbol +immutable RTransvect + i::Int + j::Int +end + +immutable LTransvect + i::Int + j::Int +end + +immutable FlipAut + i::Int +end + +immutable PermAut + p::Nemo.Generic.perm +end + +immutable Identity end + +immutable AutSymbol <: GSymbol str::String pow::Int typ::Union{RTransvect, LTransvect, FlipAut, PermAut, Identity} From bad841cf3945b521a34b607e3a62770e52295a0f Mon Sep 17 00:00:00 2001 From: kalmarek Date: Fri, 17 Nov 2017 16:08:09 +0100 Subject: [PATCH 09/10] use Nemo from master for v0.6 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index ef4adb1..47a23da 100644 --- a/.travis.yml +++ b/.travis.yml @@ -26,7 +26,7 @@ matrix: ## uncomment the following lines to override the default test script script: -# - julia -e 'Pkg.clone("https://github.com/Nemocas/Nemo.jl"); Pkg.build("Nemo")' + - julia -e 'Pkg.clone("https://github.com/Nemocas/Nemo.jl"); Pkg.build("Nemo")' - julia -e 'Pkg.clone(pwd()); Pkg.build("Groups"); Pkg.test("Groups"; coverage=true)' after_success: From c76ad8506726955527c73e830a42c32b0dc1ab27 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Mon, 20 Nov 2017 09:44:04 +0100 Subject: [PATCH 10/10] remove support for julia-0.5 --- .travis.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 47a23da..c57f6bc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,7 +4,6 @@ os: - linux - osx julia: - - 0.5 - 0.6 - nightly notifications: