Re: Compile nested loops with depending index variables...
- To: mathgroup at smc.vnet.net
- Subject: [mg61163] Re: Compile nested loops with depending index variables...
- From: "Jens-Peer Kuska" <kuska at informatik.uni-leipzig.de>
- Date: Tue, 11 Oct 2005 06:19:11 -0400 (EDT)
- Organization: Uni Leipzig
- References: <difpn1$f0m$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Hi, f = Compile[{n}, Block[{i = 0}, Do[g[i, j], {i, 0, n}, {j, 0, i}]]] compile fine, and evaluate fine, even when it is nonsense to use a compiled function here. Regards Jens "Christoph Lhotka" <lhotka at astro.univie.ac.at> schrieb im Newsbeitrag news:difpn1$f0m$1 at smc.vnet.net... | How is it possible to compile the following code structures in Mathematica: | | Do|Table[exp[i,j,...],{i,0,n},{j,0,i},...], | | for example in | | In[..]:=f=Compile[{n},Do[g[i,j],{i,0,n},{j,0,i}] | Out[..]:= CompiledFunction[...] | | ? | | It does not work, when you use the compiled function, since the compiler | expects a integer expression for i... | | Do[Do[Do ... does not work either! | | This is such a basic construct! | | -- Mag. Christoph Lhotka -- | University of Vienna / Institute for Astronomy | mail. lhotka at astro.univie.ac.at |