From cb47c62f5ddcb93d7c13fc70c917c6e3cf484fb7 Mon Sep 17 00:00:00 2001 From: kalmar Date: Sat, 21 Jan 2017 17:17:45 +0100 Subject: [PATCH] (==) and hash functions for AutGroups --- AutGroups.jl | 3 +++ 1 file changed, 3 insertions(+) diff --git a/AutGroups.jl b/AutGroups.jl index e64d3dc..16e4a91 100644 --- a/AutGroups.jl +++ b/AutGroups.jl @@ -4,6 +4,7 @@ using Groups using Permutations import Base: inv +import Groups: IdSymbol, change_pow, GWord, ==, hash, reduce! export IDSymbol, AutSymbol, AutWord export rmul_AutSymbol, lmul_AutSymbol, flip_AutSymbol, symmetric_AutSymbol @@ -14,6 +15,8 @@ immutable AutSymbol <: GSymbol ex::Expr end +(==)(s::AutSymbol, t::AutSymbol) = s.gen == t.gen && s.pow == t.pow +hash(s::AutSymbol, h::UInt) = hash(s.gen, hash(s.pow, hash(:AutSymbol, h))) IDSymbol(::Type{AutSymbol}) = AutSymbol("(id)", 0, :(IDAutomorphism(N))) change_pow(s::AutSymbol, n::Int) = reduce(AutSymbol(s.gen, n, s.ex))