mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-11-19 06:30:29 +01:00
specific hash and == for AutGrouElem (as functions)
This commit is contained in:
parent
3de09cbab5
commit
c20259e1b7
@ -176,6 +176,11 @@ end
|
||||
|
||||
hash(s::AutSymbol, h::UInt) = hash(s.str, hash(s.pow, hash(:AutSymbol, h)))
|
||||
|
||||
function hash(g::AutGroupElem, h::UInt)
|
||||
gens = generators(parent(g).objectGroup)
|
||||
return hash(g(gens), hash(typeof(g), hash(parent(g), h)))
|
||||
end
|
||||
|
||||
function change_pow(s::AutSymbol, n::Int)
|
||||
if n == 0
|
||||
return id_autsymbol()
|
||||
@ -217,6 +222,13 @@ generators(G::AutGroup) = [G(AutGroupElem(elt)) for elt in G.gens]
|
||||
|
||||
(==)(s::AutSymbol, t::AutSymbol) = s.str == t.str && s.pow == t.pow
|
||||
|
||||
function (==)(g::AutGroupElem, h::AutGroupElem)
|
||||
parent(g) == parent(h) || return false
|
||||
G = parent(g).objectGroup
|
||||
gens = generators(G)
|
||||
return g(gens) == h(gens)
|
||||
end
|
||||
|
||||
###############################################################################
|
||||
#
|
||||
# Binary operators
|
||||
|
Loading…
Reference in New Issue
Block a user