Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.soft-sys.math.mathematica > #6414

Re: dynamic nested loops

From Peter Pein <petsie@dordos.net>
Newsgroups comp.soft-sys.math.mathematica
Subject Re: dynamic nested loops
Date 2011-11-12 12:44 +0000
Organization Steven M. Christensen and Associates, Inc and MathTensor, Inc.
Message-ID <j9lpn9$ljf$1@smc.vnet.net> (permalink)
References <j9irsq$8g5$1@smc.vnet.net>

Show all headers | View raw


Am 11.11.2011 11:03, schrieb Ron:
>... I could construct a list {{i,imin,imax},{j, jmin, jmax}, ...{}} but "Sum" doen't know what to do with the outside braces{...}.
> ANy suggestions would be much appreciated.
>

If you've got such a list, let "Apply" remove the the outer curly braces ;-)

e.g.:
In[1]:= Sum[f[i,j,k],##]& @@ {{i, 1, 3}, {j, 1, 2}, {k, 5, 4, -1}}
Out[1]= f[1, 1, 4] + f[1, 1, 5] + f[1, 2, 4] + f[1, 2, 5] + f[2, 1, 4] + 
f[2, 1, 5] + f[2, 2, 4] + f[2, 2, 5] + f[3, 1, 4] + f[3, 1, 5] + f[3, 2, 
4] + f[3, 2, 5]

Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

dynamic nested loops Ron <ragove@verizon.net> - 2011-11-11 10:03 +0000
  Re: dynamic nested loops Peter Pein <petsie@dordos.net> - 2011-11-12 12:44 +0000
  Re: dynamic nested loops Ray Koopman <koopman@sfu.ca> - 2011-11-13 09:43 +0000

csiph-web