Automatically generating sums in Mathematica
This is a design issue I came across while working on implementation of Generalized Distributive Law . Suppose you need to automatically generate expressions of the following form (source: yaroslavvb.com ) Terms inside the sum, fixed variables and "summed over" variables are automatically generated for each such expression, and "f" functions are defined separately. To generate expression above, I may need to call sumProduct(factors,fixedVariables,fixedValues,freeVariables,freeRanges) where factors={{1,4},{3,4},{3,4,5}} fixedVariables={1,3} fixedValues={-1,9} freeVariables={4,5} freeRanges=