From dd4d23189b94db9a0e94d88ff8b54fb59596c5e8 Mon Sep 17 00:00:00 2001 From: kalmarek Date: Wed, 21 Mar 2018 19:22:09 +0100 Subject: [PATCH] domain(G::AutGroup) returns deepcopy of G.domain --- src/AutGroup.jl | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/AutGroup.jl b/src/AutGroup.jl index 48876a4..c52755c 100644 --- a/src/AutGroup.jl +++ b/src/AutGroup.jl @@ -120,6 +120,8 @@ function perm_autsymbol(a::Vector{Int}) return perm_autsymbol(G(a)) end +domain(G::AutGroup) = deepcopy(G.domain) + ############################################################################### # # AutGroup / AutGroupElem constructors @@ -203,7 +205,7 @@ hash(s::AutSymbol, h::UInt) = hash(s.str, hash(s.pow, hash(:AutSymbol, h))) function hash(g::AutGroupElem, h::UInt) if g.modified - g.savedhash = hash(g(parent(g).domain), hash(typeof(g), hash(parent(g), h))) + g.savedhash = hash(g(domain(parent(g))), hash(typeof(g), hash(parent(g), h))) g.modified = false end return g.savedhash @@ -253,8 +255,7 @@ end function (==)(g::AutGroupElem, h::AutGroupElem) parent(g) == parent(h) || return false - gs = parent(g).domain - return g(gs) == h(gs) + return g(domain(parent(g))) == h(domain(parent(h))) end ###############################################################################