1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-07-12 01:35:30 +02:00

specialise generate_balls, products

This commit is contained in:
kalmar 2017-06-05 17:32:20 +02:00
parent 1d3017389f
commit 17888437ff

View File

@ -336,7 +336,7 @@ replace_all(W::GWord, subst_dict::Dict{GWord, GWord}) = replace_all!(deepcopy(W)
# #
############################################################################### ###############################################################################
function products{T}(X::AbstractVector{T}, Y::AbstractVector{T}) function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T})
result = Vector{T}() result = Vector{T}()
seen = Set{T}() seen = Set{T}()
for x in X for x in X
@ -351,7 +351,7 @@ function products{T}(X::AbstractVector{T}, Y::AbstractVector{T})
return result return result
end end
function generate_balls(S, Id; radius=2) function generate_balls{T<:GroupElem}(S::Vector{T}, Id::T; radius=2)
sizes = Vector{Int}() sizes = Vector{Int}()
S = unshift!(S, Id) S = unshift!(S, Id)
B = [Id] B = [Id]