MathGroup Archive 2007

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

Search the Archive

Setting and Unsetting values, memory usage problems.

  • To: mathgroup at smc.vnet.net
  • Subject: [mg79606] Setting and Unsetting values, memory usage problems.
  • From: Lyle Gordon <lgordon at gmail.com>
  • Date: Tue, 31 Jul 2007 06:05:27 -0400 (EDT)

I have a function defined like this

f[a_, b_] := f[a,b] = the function f (returns an interpolating
function)

f2[a_, b_, c_] := f[a,b] /.t -> c

I use this to store each solution of the function f[a,b] so that I can
then evaluate it at each time point (f2[a,b,c]) for the specific a & b
without re-evaluating the entire thing (f[a,b]) for each time point.
The problem is that each interpolating function is very large in
memory and the function gets called for many different pairs of a & b
and eventually I run out of memory before the code completes (I have
4gigs). The thing is I don't need to store more than the few most
recent values of f[a,b], however not storing any makes the code too
slow to be usable as f has to be evaluated for everytime point (8000
points). I was wondering if there is a way to code the function to
only store the last 4-5 values of f[a,b] or even just the most recent
one.

Hopefully this makes sense and someone can help.

Thanks,
Lyle Gordon



  • Prev by Date: Re: Re: Where is the Navigate menu item in Workbench
  • Next by Date: Re: Factorise with respect to a variable
  • Previous by thread: How do you set up third party (or your own) packages?
  • Next by thread: Double Integration involving Struve and Neumann functions