Re: Compile
- To: mathgroup at smc.vnet.net
- Subject: [mg45228] Re: Compile
- From: Maxim <dontsendhere@.>
- Date: Sun, 21 Dec 2003 03:42:20 -0500 (EST)
- References: <brplr9$7tf$1@smc.vnet.net>
- Sender: owner-wri-mathgroup at wolfram.com
Probably unrelated, but consider In[1]:= Module[{subs = x -> x^2}, Plot[x /. subs, {x, 0, 1}, Compiled -> True] ] Module[{subs = x -> x^2}, Plot[x /. subs, {x, 0, 1}, Compiled -> False] ] (straight line with the default setting of Compiled->True and parabola with Compiled->False). Or In[3]:= Module[{y := If[NumericQ[x], x, 1]}, Plot[x y, {x, 0, 1}, Compiled -> True] ] Module[{y := If[NumericQ[x], x, 1]}, Plot[x y, {x, 0, 1}, Compiled -> False] ] (same, straight line in the first case and parabola in the second). The question is probably what exactly Mathematica tries to wrap in Compile and how it then deals with 'external' expressions depending on the iterator variable. In any case it seems that we have yet another untransparent internal transformation that leaves us guessing about the result. Maxim Rytin m.r at prontomail.com
- Follow-Ups:
- Re: Re: Compile
- From: Andrzej Kozlowski <akoz@mimuw.edu.pl>
- Re: Re: Compile