Re: Clear value of pre calculated expresion
- To: mathgroup at christensen.cybernetics.net
- Subject: [mg1491] Re: [mg1438] Clear value of pre calculated expresion
- From: wagner at bullwinkle.cs.Colorado.EDU (Dave Wagner)
- Date: Mon, 19 Jun 1995 01:06:09 -0400
- Organization: University of Colorado, Boulder
In article <3rqk54$hs3 at news0.cybernetics.net>,
John Fultz <jfultz at wri.com> wrote:
>> I would like to clear value of pre calculated expresion which Mathematica
>> save in memory. When you do
>>
>> N[Pi,23]
>>
>> Mathematica would calculated number Pi on 23 places and save that value in
>> work memory for future calculations, but some times ( test and simulation )
>> is nice to dont that ... so my question is how clear that type of data from
>> working memory ?
>>
>> Dubravko Penezic
>
>You can do this by evaluating the following lines:
>
>Unprotect[In,Out]
>Clear[In,Out]
>
>This will clear the whole command history up to the current evaluation.
>
>John Fultz
>Wolfram Research, Inc.
I don't think that's what Mr. Penezic was talking about. The kernel
caches the numerical values of things that have been evaluated for some
time, e.g.:
In[1]:=
N[Pi,1000]; // Timing
Out[1]=
{0.216667 Second, Null}
In[2]:=
N[Pi,1000]; // Timing
Out[2]=
{0. Second, Null}
At some point in the distant future, this computation will require .217
seconds again, but there's no (known) way to predict when or to force it to
forget the cached answer. Clearing In/Out has no effect on this.
Except for benchmarking Mathematica itself, I'm not sure why one would
want to clear the cached values, but I think that's the question
being asked.
Dave Wagner
Principia Consulting
(303) 786-8371
dbwagner at princon.com
http://www.princon.com/princon