1
0
mirror of https://github.com/kalmarek/Groups.jl.git synced 2024-11-19 06:30:29 +01:00

use the new reduce for Automorphisms and FPWords

This commit is contained in:
kalmarek 2020-03-25 00:27:47 +01:00
parent 8688d42250
commit bc1063f0fd
No known key found for this signature in database
GPG Key ID: 8BF1A3855328FC15
2 changed files with 8 additions and 23 deletions

View File

@ -361,20 +361,11 @@ function simplifyperms!(W::Automorphism{N}) where N
return reduced return reduced
end end
function reduce!(W::Automorphism) function reduce!(w::Automorphism)
if length(W) == 0 reduced = false
return W while !reduced
elseif length(W.symbols) == 1 reduced = simplifyperms!(Bool, w) && freereduce!(Bool, w)
deleteids!(W)
else
reduced = false
while !reduced
reduced = simplifyperms!(W) && freereduce!(W)
end
end end
W.modified = true
return W return W
end end

View File

@ -134,17 +134,11 @@ end
(*)(s::FPSymbol, W::FPGroupElem) = l_multiply(W, [s]) (*)(s::FPSymbol, W::FPGroupElem) = l_multiply(W, [s])
function reduce!(W::FPGroupElem) function reduce!(W::FPGroupElem)
if length(W) < 2 reduced = false
deleteat!(W.symbols, findall(x -> x.pow == 0, W.symbols)) while !reduced
else W = replace(W, parent(W).rels)
reduced = false reduced = freereduce!(Bool, W)
while !reduced
reduced = freereduce!(W) || replace_all!(W, parent(W).rels)
end
end end
W.savedhash = hash(W.symbols, hash(typeof(W)))
W.modified = false
return W return W
end end