mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2024-11-19 14:35:28 +01:00
normalform! should be a no-op for normalized words
This commit is contained in:
parent
8137e40998
commit
5993cb328f
@ -36,8 +36,8 @@ function Base.:(==)(
|
||||
hash(g) != hash(h) && return false
|
||||
end
|
||||
|
||||
length(word(g)) > 8 && normalform!(g)
|
||||
length(word(h)) > 8 && normalform!(h)
|
||||
normalform!(g)
|
||||
normalform!(h)
|
||||
|
||||
word(g) == word(h) && return true
|
||||
|
||||
|
@ -2,8 +2,10 @@
|
||||
normalform!(g::FPGroupElement)
|
||||
Compute the normal form of `g`, possibly modifying `g` in-place.
|
||||
"""
|
||||
@inline function normalform!(g::AbstractFPGroupElement)
|
||||
isnormalform(g) && return g
|
||||
@inline function normalform!(g::AbstractFPGroupElement; force = false)
|
||||
if !force
|
||||
isnormalform(g) && return g
|
||||
end
|
||||
|
||||
let w = one(word(g))
|
||||
w = normalform!(w, g)
|
||||
@ -36,9 +38,9 @@ end
|
||||
|
||||
"""
|
||||
normalform!(res::AbstractWord, g::FPGroupElement)
|
||||
Append the normal form of `g` to word `res`, modifying `res` in place.
|
||||
Write the normal form of `g` to word `res`, modifying `res` in place.
|
||||
|
||||
Defaults to the rewriting in the free group.
|
||||
The particular implementation of the normal form depends on `parent(g)`.
|
||||
"""
|
||||
@inline function normalform!(res::AbstractWord, g::AbstractFPGroupElement)
|
||||
isone(res) && isnormalform(g) && return append!(res, word(g))
|
||||
|
Loading…
Reference in New Issue
Block a user