MathGroup Archive 2001

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

Search the Archive

Re: How do I really get rid of previous results?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg29564] Re: How do I really get rid of previous results?
  • From: "Orestis Vantzos" <atelesforos at hotmail.com>
  • Date: Mon, 25 Jun 2001 20:42:17 -0400 (EDT)
  • Organization: National Technical University of Athens, Greece
  • References: <9h66m1$l50$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Mathematica keeps a hidden cache of previous computations, regardless of
cleaning operations (such as Clean and Remove) performed by the user.
What you need is Developer`ClearCache[] (in V4 or 4.1 ofcourse).
Orestis



"Fred Simons" <f.h.simons at tue.nl> wrote in message
news:9h66m1$l50$1 at smc.vnet.net...
> When studying the very interesting approach of Adam Strzebonski to the
> question raised by Maarten van den Burg of finding all real roots of an
> equation, I ran into the following problem.
>
> As done by Adam Strzebonski , I define a polynomial and a list of roots.
>
> poly=x/20+Normal[Series[Cos[x],{x,0,100}]];
> rts=Table[Root[poly,i],{i,14}];//Timing
>
> {1.82 Second,Null}
>
> Finding the numerical values of the elements of the list takes some time:
>
> N[rts] // Timing
>
> {27.9
>
Second,{-38.9752,-19.1433,-18.4538,-13.4028,-11.6152,-7.47114,-4.96317,-1.49
> 593,1.65357,4.48616,8.28087,10.446,14.984,16.324}}
>
> I want to redo this computation.
>
> ClearAll[poly, rts];Remove[poly, rts]
>
> I redefine the polynomial and the table. Now the construction of the table
> is more than three times as fast.
>
> poly=x/20+Normal[Series[Cos[x],{x,0,100}]];
> rts=Table[Root[poly,i],{i,14}];//Timing
>
> {0.55 Second,Null}
>
> And Mathematica still knows the values of my removed table:
>
> N[rts] // Timing
>
> {0.
>
Second,{-38.9752,-19.1433,-18.4538,-13.4028,-11.6152,-7.47114,-4.96317,-1.49
> 593,1.65357,4.48616,8.28087,10.446,14.984,16.324}}
>
> It has nothing to do with the removal of the names, as we see by using
> different names:
>
> rts2=Table[Root[poly,i],{i,14}];//Timing
>
> {0.55 Second,Null}
>
> N[rts2] // Timing
>
> {0.
>
Second,{-38.9752,-19.1433,-18.4538,-13.4028,-11.6152,-7.47114,-4.96317,-1.49
> 593,1.65357,4.48616,8.28087,10.446,14.984,16.324}}
>
> What is going on here, and how do I avoid this behaviour?
>
> Fred Simons
> Eindhoven University of Technology
>
>




  • Prev by Date: Re: Fitting data
  • Next by Date: List problems
  • Previous by thread: How do I really get rid of previous results?
  • Next by thread: Re: How do I really get rid of previous results?