1
0
mirror of https://github.com/kalmarek/PropertyT.jl.git synced 2024-12-25 10:20:30 +01:00

fix indentation

This commit is contained in:
kalmarek 2018-04-08 22:46:28 +02:00
parent 2d89c38657
commit 589e1882cd

View File

@ -183,54 +183,54 @@ function rankOne_projections(BN::WreathProduct, T::Type=Rational{Int})
return all_projs
end
##############################################################################
#
# General Groups Misc
#
##############################################################################
##############################################################################
#
# General Groups Misc
#
##############################################################################
doc"""
products(X::Vector{GroupElem}, Y::Vector{GroupElem}, op=*)
> Returns a vector of all possible products (or `op(x,y)`), where $x\in X$ and
> $y\in Y$ are group elements. You may specify which operation is used when
> forming 'products' by adding `op` (which is `*` by default).
"""
function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T}, op=*)
result = Vector{T}()
seen = Set{T}()
for x in X
for y in Y
z = op(x,y)
if !in(z, seen)
push!(seen, z)
push!(result, z)
end
doc"""
products(X::Vector{GroupElem}, Y::Vector{GroupElem}, op=*)
> Returns a vector of all possible products (or `op(x,y)`), where $x\in X$ and
> $y\in Y$ are group elements. You may specify which operation is used when
> forming 'products' by adding `op` (which is `*` by default).
"""
function products{T<:GroupElem}(X::AbstractVector{T}, Y::AbstractVector{T}, op=*)
result = Vector{T}()
seen = Set{T}()
for x in X
for y in Y
z = op(x,y)
if !in(z, seen)
push!(seen, z)
push!(result, z)
end
end
return result
end
return result
end
doc"""
generateGroup(gens::Vector{GroupElem}, r=2, Id=parent(first(gens))(), op=*)
> Produces all elements of a group generated by elements in `gens` in ball of
> radius `r` (word-length metric induced by `gens`).
> If `r(=2)` is specified the procedure will terminate after generating ball
> of radius `r` in the word-length metric induced by `gens`.
> The identity element `Id` and binary operation function `op` can be supplied
> to e.g. take advantage of additive group structure.
"""
function generateGroup{T<:GroupElem}(gens::Vector{T}, r=2, Id::T=parent(first(gens))(), op=*)
n = 0
R = 1
elts = gens
gens = [Id; gens]
while n length(elts) && R < r
# @show elts
R += 1
n = length(elts)
elts = products(elts, gens, op)
end
return elts
doc"""
generateGroup(gens::Vector{GroupElem}, r=2, Id=parent(first(gens))(), op=*)
> Produces all elements of a group generated by elements in `gens` in ball of
> radius `r` (word-length metric induced by `gens`).
> If `r(=2)` is specified the procedure will terminate after generating ball
> of radius `r` in the word-length metric induced by `gens`.
> The identity element `Id` and binary operation function `op` can be supplied
> to e.g. take advantage of additive group structure.
"""
function generateGroup{T<:GroupElem}(gens::Vector{T}, r=2, Id::T=parent(first(gens))(), op=*)
n = 0
R = 1
elts = gens
gens = [Id; gens]
while n length(elts) && R < r
# @show elts
R += 1
n = length(elts)
elts = products(elts, gens, op)
end
return elts
end
end # of module Projections