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

AutGroup constructor

This commit is contained in:
kalmar 2017-05-12 19:55:50 +02:00
parent 5aa68207df
commit 6993c284cd

View File

@ -114,6 +114,25 @@ function getperm(s::AutSymbol)
end
end
function AutGroup(G::FPGroup; outer=false, special=false)
length(G.rels) == 0 || throw("Don't know how to construct AutGroup of $G.")
n = length(G.generators)
indexing = [[i,j] for i in 1:n for j in 1:n if i≠j]
rmuls = [rmul_autsymbol(i,j) for (i,j) in indexing]
lmuls = [lmul_autsymbol(i,j) for (i,j) in indexing]
S = [rmuls..., lmuls...]
if special
flips = [flip_autsymbol(i) for i in 1:n]
append!(S, flips...)
elseif outer
perms = collect(elements(PermutationGroup(n)))
perms = [perm_autsymbol(p) for p in perms[2:end]] # leave the identity
append!(S, perms)
end
return new(G, S)
end
function (f::AutSymbol){T}(v::Vector{GWord{T}})
if f.pow == 0
return v