1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-12-25 02:05: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:
Marek Kaluba 2021-05-16 22:30:50 +02:00
parent 6405a1868e
commit f4858fba14
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 3 additions and 6 deletions

View File

@ -42,12 +42,10 @@ function Base.:(==)(g::A, h::A) where A<:FPGroupElement{<:AutomorphismGroup}
hash(g) != hash(h) && return false
end
normalform!(g)
normalform!(h)
word(g) == word(h) && return true
length(word(g)) > 8 && normalform!(g)
length(word(h)) > 8 && normalform!(h)
@assert isnormalform(g)
@assert isnormalform(h)
word(g) == word(h) && return true
img_computed, imh_computed = false, false

View File

@ -35,7 +35,6 @@ function _update_savedhash!(g::FPGroupElement, data)
end
function Base.hash(g::FPGroupElement, h::UInt)
normalform!(g)
_isvalidhash(g) || _update_savedhash!(g, equality_data(g))
return hash(g.savedhash >> count_ones(__BITFLAGS_MASK) , h)
end