sumMoveIn {lazy.symbolic} | R Documentation |
Move summation to the right
sumMoveIn(sexp, frombottom = 1, all = 0, debug = 0)
sexp |
An expression containing summation |
frombottom |
= 1 to expand the bottom level summation |
all |
= 1 to move all the movable summations |
debug |
= 1 to print intermediate result |
s( s( a[i,j]*b[j,k]*c[k,l], {k}) , {j}) -> s( a[i,j]*s( b[j,k]*c[k,l], {k}) , {j})
sumMoveIn( "s( s( a[i,j]*b[j,k]*c[k,l], {k}) , {j})" )
sumMoveIn( "s( s( a[i,j]/b[j,k]*c[k,l], {k}) , {j})" )
sumMoveIn( "s( s( c[k,l]/a[i,j]/b[j,k], {k}) , {j})" )
exp="s( x * s( s( a[i,j]*b[j,k]*c[k,l], {k}) , {j}), {l})"
sumMoveIn( exp, all=1 )
exp="s( x + s( s( a[i,j]*b[j,k]*c[k,l], {k}) - y, {j}), {l})"
sumMoveIn( exp, all=1 )