sumMoveIn {lazy.symbolic}R Documentation

Move summation to the right

Description

Move summation to the right

Usage

sumMoveIn(sexp, frombottom = 1, all = 0, debug = 0)

Arguments

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

Details

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})

Examples

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 )


[Package lazy.symbolic version 0.1.4 Index]