From 329e481d24d98992f12e6e75b4b6f8c32a41f277 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Fri, 27 Oct 2017 16:13:45 +0200 Subject: [PATCH] move getperm --- src/AutGroup.jl | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index afbbce2..71e8e81 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -119,15 +119,6 @@ function perm_autsymbol(a::Vector{Int}) return perm_autsymbol(G(a)) end -function getperm(s::AutSymbol) - if s.ex.args[1] == :σ - p = s.ex.args[2] - return PermutationGroup(length(p))(p) - else - throw(ArgumentError("$s is not a permutation automorphism!")) - end -end - ############################################################################### # # AutGroup / AutGroupElem constructors @@ -286,6 +277,10 @@ inv(f::AutSymbol) = change_pow(f, -f.pow) ############################################################################### ispermauto(s::AutSymbol) = s.ex.args[1] == :σ +function getperm(s::AutSymbol) + isa(s.typ, PermAut) || throw("$s is not a permutation automorphism") + return s.typ.p +end function simplify_perms!(W::AutGroupElem) reduced = true