1
0
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:
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 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

View File

@ -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