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

no arithmetic of GSymbols;

This commit is contained in:
kalmar 2017-05-11 18:09:39 +02:00
parent b5139306f7
commit 038ece45c5

View File

@ -237,9 +237,13 @@ function replace!(W::GWord, index, toreplace::GWord, replacement::GWord; asserts
@assert is_subsymbol(toreplace.symbols[end], W.symbols[index+n-1])
end
first = W.symbols[index]*inv(toreplace.symbols[1])
last = W.symbols[index+n-1]*inv(toreplace.symbols[end])
replacement = first*replacement*last
first = change_pow(W.symbols[index],
W.symbols[index].pow - toreplace.symbols[1].pow)
last = change_pow(W.symbols[index+n-1],
W.symbols[index+n-1].pow - toreplace.symbols[end].pow)
replacement = first * replacement * last
splice!(W.symbols, index:index+n-1, replacement.symbols)
return reduce!(W)
end