I have some lists of interpolated functions and I want to know if there is an easy way to operate with them. A simplified example:
listsin = Table[FunctionInterpolation[Sin[i*x], {x, 0, 2 Pi}], {i, 1, 10}]
listlinear = Table[FunctionInterpolation[i*x, {x, 0, 2 Pi}], {i, 1, 10}]
This generates two lists of ten functions each. I want to be able to perform basic operations with these functions: sums, derivatives and products. I came up with a way that works
listsumd = Table[With[{i = i}, (listsin[[i]]'[#] + listlinear[[i]]'[#]) &], {i, 1, 10}]
But want to know if it is possible to do this without having to iterate through all the elements in the table, just by operating directly on the lists.
I also wanted to ask if you know, if it is better to work with lists of functions or with functions over lists (in terms of speed, and code legibility)
– Noel Mar 14 '14 at 13:41a = Table[With[{i = i}, N[Sin[i*#]] &], {i, 1, 10}](each element on the list is a function) and a function over a list would beb = Table[With[{i = i}, N[Sin[i*#]]], {i, 1, 10}] &(it is a function that returns a list of values). They are conceptually equal (a[[i]][x]==b[x][[i]]). Now, if i wanted to perform a calculation, say, compute an integral over x for a given element i, would there be any difference between those two approaches? – Noel Mar 14 '14 at 15:19