overload reduce function for AutWords
This commit is contained in:
parent
e98784bd98
commit
5bfd4858a0
|
@ -152,3 +152,20 @@ function simplify_perms!(W::AutWord)
|
||||||
deleteat!(W.symbols, find(x -> x.pow == 0, W.symbols))
|
deleteat!(W.symbols, find(x -> x.pow == 0, W.symbols))
|
||||||
return reduced
|
return reduced
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function reduce!(W::AutWord)
|
||||||
|
if length(W) < 2
|
||||||
|
deleteat!(W.symbols, find(x -> x.pow == 0, W.symbols))
|
||||||
|
else
|
||||||
|
reduced = false
|
||||||
|
while !reduced
|
||||||
|
reduced = join_free_symbols!(W)
|
||||||
|
reduced = simplify_perms!(W)
|
||||||
|
deleteat!(W.symbols, find(x -> x.pow == 0, W.symbols))
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
W.modified = false
|
||||||
|
W.savedhash = hash(W.symbols,hash(typeof(W)))
|
||||||
|
return W
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue