mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2025-01-23 08:35:27 +01:00
add missing normalform! before hashing
This commit is contained in:
parent
7230106bfc
commit
93a841359b
@ -37,6 +37,7 @@ function _update_savedhash!(g::AbstractFPGroupElement, data)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function Base.hash(g::AbstractFPGroupElement, h::UInt)
|
function Base.hash(g::AbstractFPGroupElement, h::UInt)
|
||||||
|
g = 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
|
||||||
|
@ -26,8 +26,7 @@ function wlmetric_ball(
|
|||||||
new = collect(
|
new = collect(
|
||||||
op(o, s) for o in @view(ball[sizes[end-1]:end]) for s in S
|
op(o, s) for o in @view(ball[sizes[end-1]:end]) for s in S
|
||||||
)
|
)
|
||||||
append!(ball, new)
|
ball = union!(ball, new)
|
||||||
unique!(ball)
|
|
||||||
push!(sizes, length(ball))
|
push!(sizes, length(ball))
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user