no arithmetic of GSymbols;
This commit is contained in:
parent
b5139306f7
commit
038ece45c5
|
@ -237,8 +237,12 @@ function replace!(W::GWord, index, toreplace::GWord, replacement::GWord; asserts
|
||||||
@assert is_subsymbol(toreplace.symbols[end], W.symbols[index+n-1])
|
@assert is_subsymbol(toreplace.symbols[end], W.symbols[index+n-1])
|
||||||
end
|
end
|
||||||
|
|
||||||
first = W.symbols[index]*inv(toreplace.symbols[1])
|
first = change_pow(W.symbols[index],
|
||||||
last = W.symbols[index+n-1]*inv(toreplace.symbols[end])
|
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
|
replacement = first * replacement * last
|
||||||
splice!(W.symbols, index:index+n-1, replacement.symbols)
|
splice!(W.symbols, index:index+n-1, replacement.symbols)
|
||||||
return reduce!(W)
|
return reduce!(W)
|
||||||
|
|
Loading…
Reference in New Issue