mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-04 10:06:27 +01:00
generate_balls for RingElem
This commit is contained in:
parent
99c07c6909
commit
36279d2601
@ -390,6 +390,17 @@ function generate_balls{T<:GroupElem}(S::Vector{T}, Id::T=parent(first(S))(); ra
|
|||||||
return B, sizes
|
return B, sizes
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function generate_balls{T<:RingElem}(S::Vector{T}, Id::T=one(parent(first(S))); radius=2, op=*)
|
||||||
|
sizes = Int[]
|
||||||
|
B = [Id]
|
||||||
|
for i in 1:radius
|
||||||
|
BB = [op(i,j) for (i,j) in Base.product(B,S)]
|
||||||
|
B = unique([B; vec(BB)])
|
||||||
|
push!(sizes, length(B))
|
||||||
|
end
|
||||||
|
return B, sizes
|
||||||
|
end
|
||||||
|
|
||||||
###############################################################################
|
###############################################################################
|
||||||
#
|
#
|
||||||
# Includes
|
# Includes
|
||||||
|
Loading…
Reference in New Issue
Block a user