MathGroup Archive 2001

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

Search the Archive

Re: Memory Conservation


a) The main difference between Module and Block is just that; Module removes
all local variables.
b) If you do remove finalanswer, you will get a Removed[finalanswer]
expression instead of the required result.
Orestis
PS.If you want to save memory set $HistoryLength=0 before you use your
routine. Share[] helps too sometimes, but it will slow you down, if not used
smartly.


"Shane Frasier" <jsf9k at virginia.edu> wrote in message
news:9iomg8$i13$1 at smc.vnet.net...
> Hi,
>     I have a program in Mathematica that involves large matrices.  I want
to
> make sure that intermediate variables aren't wasting memory, so I have a
few
> questions:
>
> 1)  I have functions that look like
> Module[{i,j,final_answer},...Remove[i,j];final_answer].  Is Remove
necessary
> here, or do module variables cease to exist once the module ends?
>
> 2)  If it is necessary, is there any way to Remove final_answer too before
> the module ends?  In my case, the construction of final_answer is
> complicated, so I want to build it up in stages to avoid having a single,
> long and unreadable line of code.
>
> Thanks for your help,
> Shane Frasier
> jsf9k at virginia.edu
>
>
>




  • Prev by Date: Proof For Cov. Matrix equation?
  • Next by Date: Re: Exponents and notation
  • Previous by thread: Re: Memory Conservation
  • Next by thread: Re: Memory Conservation