MathGroup Archive 2003

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: Re: Compile

  • To: mathgroup at smc.vnet.net
  • Subject: [mg45285] Re: [mg45280] Re: Compile
  • From: Andrzej Kozlowski <akoz at mimuw.edu.pl>
  • Date: Sun, 28 Dec 2003 05:10:46 -0500 (EST)
  • Sender: owner-wri-mathgroup at wolfram.com

You  are probably right about "special evaluation", if you simply mean 
"not exactly the same as what "Evaluate" gives,  though that  hardly 
affects my point, which is that any sensible Mathematica user would 
know when to use Evaluate with Plot and would not come across any such 
"problems". Like all your recent postings, this one again consists of 
contrived examples of no interest to anyone but yourself. Although I do 
not write giant applications of the kind you claim to worry you so much 
about, I have done a rough count of the code  I have written during the 
last few years and found it amounts to over 20000 lines. And yet among 
all that not even once did I come across any of your "awful problems".
Also, I wonder how long it will take before you notice that adopting 
the approach:

"When in trouble or in doubt
run in circles, scream and shout."

is unlikely to elicit a response other than a shrug of the shoulders 
from both Wolfram developers and the majority of other users.

Andrzej Kozlowski


On 27 Dec 2003, at 19:00, Maxim wrote:

>
>
> Bill Rowe wrote:
>
>> On 12/24/03 at 4:35 AM, dontsendhere@. (Maxim) wrote:
>>
>>> Not exactly. An elementary test shows that with both settings for 
>>> Compiled the first
>>> argument of Plot is evaluated in a non-standard way, as it should be 
>>> (Mathematica Book,
>>> A.4.2):
>>
>>> In[1]:=
>>> Plot[Random[], {x, 0, 1}, Compiled -> True]
>>> Plot[Random[], {x, 0, 1}, Compiled -> False]
>>
>>> (plots an irregular curve, not a straight line for one pre-evaluated 
>>> value of Random[]).
>>
>> I don't see how this demonstrates your point. If you Compile an 
>> elementary (one pre-defined by Mathematica, i.e., not defined with 
>> Mathematica code) function I would expect no difference between the 
>> compiled and un-compiled versions. That is, I would expect the 
>> Mathematica interpreter to execucte some compiled code when it sees 
>> the token Random. And I would expect Compile to simply point to this 
>> compiled code.
>>
>> I would expect the only cases where Compile would make a difference 
>> is when the expression to be compiled is a sequence of operations 
>> defined by Mathematica code.
>> --
>> To reply via email subtract one hundred and four
>
> My claim was: the first argument of Plot is evaluated in a 
> non-standard way, that is, wrapping it in Evaluate would change the 
> outcome. Do you not see how the example Plot[Random[],{x,0,1}] 
> demonstrates this point? The argument that the effect of Compiled 
> might change for some more complicated expressions is just 
> speculation. I can make up a more complicated construct, like
>
> Module[{y},
>   y[arg_] := Module[{ans}, ans = arg; ans += Random[]];
>   Plot[y[x], {x, 0, 1}]
> ]
>
> How should Compiled 'make a difference' here? If you think that y[x] 
> will be pre-evaluated, you're wrong.
>
> Maxim Rytin
> m.r at prontomail.com
>
>
>


  • Prev by Date: Re: Finding Repeated Number Blocks
  • Next by Date: Re: Transpose matrix does not work when MatrixForm is used, why?
  • Previous by thread: Re: Compile
  • Next by thread: Re: Compile