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
end
function reduce!(W::Automorphism)
if length(W) == 0
return W
elseif length(W.symbols) == 1
deleteids!(W)
else
reduced = false
while !reduced
reduced = simplifyperms!(W) && freereduce!(W)
end
function reduce!(w::Automorphism)
reduced = false
while !reduced
reduced = simplifyperms!(Bool, w) && freereduce!(Bool, w)
end
W.modified = true
return W
end

View File

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