Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.soft-sys.math.mathematica > #11212
| From | David Bailey <dave@removedbailey.co.uk> |
|---|---|
| Newsgroups | comp.soft-sys.math.mathematica |
| Subject | Re: Strange runtime error in Compiled function |
| Date | 2012-08-05 01:54 +0000 |
| Message-ID | <jvkjnt$5ue$1@smc.vnet.net> (permalink) |
| References | <jvg1i7$rkd$1@smc.vnet.net> |
| Organization | Time-Warner Telecom |
On 03/08/2012 09:19, Axel wrote:
> Hi everybody,
> I'm using Mathematica 8.0.1 on a 32bit Win7 system and I have strange problems with the Compile function.
> I have this simple function:
>
> compileTestC = Compile[{{paramList, _Integer, 1}},
> Module[{a, b},
> Print[paramList[[1]]];
> a = paramList[[1]];
>
> If[False,
> b = 1,
> b = 0
> ] ;
> Return[5]
> ]
> ] ;
>
> When I compile and run it the first time, it produces the expected results:
> compileTestC[{100}]
> 100
> 5
>
> But for all subsequent calls I get this strange error message:
> compileTestC[{100}]
> 100
> CompiledFunction::cflist: Nontensor object generated; proceeding with uncompiled evaluation.>>
> 100
> 5
>
Admitedly I am using the 64-bit version of 8.0.4, but I don't think that
is relevant. For me your code runs in the same way however many times I
run it:
In[791]:=
compileTestC =
Compile[{{paramList, _Integer, 1}},
Module[{a, b}, Print[paramList[[1]]];
a = paramList[[1]];
If[False, b = 1, b = 0];
Return[5]]];
In[792]:= compileTestC[{100}]
100
Out[792]= 5
In[797]:= compileTestC[{100}]
100
Out[797]= 5
I am guessing that you actually do something else between the first and
second calls!
Post some code that actually fails, and someone will tell you what is
wrong! Preferably start from a clean kernel, so that whatever code you
post, is not affected by something we cannot see.
David Bailey
http://www.dbaileyconsultancy.co.uk
Back to comp.soft-sys.math.mathematica | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Strange runtime error in Compiled function Axel <axel.kowald@gmail.com> - 2012-08-03 08:19 +0000
Re: Strange runtime error in Compiled function Frank K <fkampas@gmail.com> - 2012-08-04 10:05 +0000
Re: Strange runtime error in Compiled function Axel <axel.kowald@gmail.com> - 2012-08-05 01:56 +0000
Re: Strange runtime error in Compiled function David Bailey <dave@removedbailey.co.uk> - 2012-08-05 01:54 +0000
Re: Strange runtime error in Compiled function Axel <axel.kowald@gmail.com> - 2012-08-06 08:49 +0000
csiph-web