mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-12-26 02:20:30 +01:00
move normalform! to equality_data
heuristic: compute normalform! only if length of automorphism is greater than 8
This commit is contained in:
parent
6405a1868e
commit
f4858fba14
@ -42,12 +42,10 @@ function Base.:(==)(g::A, h::A) where A<:FPGroupElement{<:AutomorphismGroup}
|
|||||||
hash(g) != hash(h) && return false
|
hash(g) != hash(h) && return false
|
||||||
end
|
end
|
||||||
|
|
||||||
normalform!(g)
|
length(word(g)) > 8 && normalform!(g)
|
||||||
normalform!(h)
|
length(word(h)) > 8 && normalform!(h)
|
||||||
word(g) == word(h) && return true
|
|
||||||
|
|
||||||
@assert isnormalform(g)
|
word(g) == word(h) && return true
|
||||||
@assert isnormalform(h)
|
|
||||||
|
|
||||||
img_computed, imh_computed = false, false
|
img_computed, imh_computed = false, false
|
||||||
|
|
||||||
|
@ -35,7 +35,6 @@ function _update_savedhash!(g::FPGroupElement, data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Base.hash(g::FPGroupElement, h::UInt)
|
function Base.hash(g::FPGroupElement, h::UInt)
|
||||||
normalform!(g)
|
|
||||||
_isvalidhash(g) || _update_savedhash!(g, equality_data(g))
|
_isvalidhash(g) || _update_savedhash!(g, equality_data(g))
|
||||||
return hash(g.savedhash >> count_ones(__BITFLAGS_MASK) , h)
|
return hash(g.savedhash >> count_ones(__BITFLAGS_MASK) , h)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user