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