sumExpand {lazy.symbolic}R Documentation

Expand (Distribute) summation

Description

Expand (Distribute) summation

Usage

sumExpand(sexp, frombottom = 0, all = 0, debug = 0)

Arguments

sexp

An expression containing summation

frombottom

= 1 to expand the bottom level summation

all

= 1 to expand all the summations

debug

= 1 to print intermediate result

Details

s( a + b, {scope} )  ->  s( a, {scope} ) + s( b, {scope} )

Examples

sumExpand("s( a + b, {scope} ) ")

exp <- "s(a[i],{i})+s( b*( s(c[i,j],{j}) - s(d[i,j],{j}) ), {i} )"
sumExpand( exp)

exp <- "s( a[i]+b[i] - s( c[ij]-d[ij], {j} ), {i})"
sumExpand( exp, frombottom=1)
sumExpand( exp )
sumExpand( exp, all=1 )


[Package lazy.symbolic version 0.1.4 ]