From: Robert D. <rob...@gm...> - 2015-06-05 20:39:55
|
On 2015-06-05, Marduk Bolaños <mar...@ma...> wrote: > The goal is to use one of the answers I got to my previous question on > applying a function under the summation sign, but now it is not only one > summation sign but several. How about: matchdeclare (ss, lambda ([e], not mapatom(e) and (op(e) = 'sum or op(e) = nounify('sum)))); tellsimp (f(ss), apply (op(ss), cons (f(first(ss)), rest(args(ss))))); and then for example: f('sum('sum('sum(a[i,j,k],i,1,m),j,1,n),k,1,o)); => 'sum('sum('sum(f(a[i,j,k]),i,1,m),j,1,n),k,1,o) subst (f=lambda([x], x^2), %); => 'sum('sum('sum(a[i,j,k]^2,i,1,m),j,1,n),k,1,o) ?? best Robert Dodier |