mirror of
https://github.com/kalmarek/Groups.jl.git
synced 2025-01-09 05:32:32 +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
|
hash(g) != hash(h) && return false
|
||||||
end
|
end
|
||||||
|
|
||||||
length(word(g)) > 8 && normalform!(g)
|
normalform!(g)
|
||||||
length(word(h)) > 8 && normalform!(h)
|
normalform!(h)
|
||||||
|
|
||||||
word(g) == word(h) && return true
|
word(g) == word(h) && return true
|
||||||
|
|
||||||
|
@ -2,8 +2,10 @@
|
|||||||
normalform!(g::FPGroupElement)
|
normalform!(g::FPGroupElement)
|
||||||
Compute the normal form of `g`, possibly modifying `g` in-place.
|
Compute the normal form of `g`, possibly modifying `g` in-place.
|
||||||
"""
|
"""
|
||||||
@inline function normalform!(g::AbstractFPGroupElement)
|
@inline function normalform!(g::AbstractFPGroupElement; force = false)
|
||||||
|
if !force
|
||||||
isnormalform(g) && return g
|
isnormalform(g) && return g
|
||||||
|
end
|
||||||
|
|
||||||
let w = one(word(g))
|
let w = one(word(g))
|
||||||
w = normalform!(w, g)
|
w = normalform!(w, g)
|
||||||
@ -36,9 +38,9 @@ end
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
normalform!(res::AbstractWord, g::FPGroupElement)
|
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)
|
@inline function normalform!(res::AbstractWord, g::AbstractFPGroupElement)
|
||||||
isone(res) && isnormalform(g) && return append!(res, word(g))
|
isone(res) && isnormalform(g) && return append!(res, word(g))
|
||||||
|
Loading…
Reference in New Issue
Block a user