help-gsl
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-gsl] handling memory for ODE micro steps


From: Brian Gough
Subject: Re: [Help-gsl] handling memory for ODE micro steps
Date: Tue, 09 Jan 2007 20:21:44 +0000
User-agent: Wanderlust/2.14.0 (Africa) Emacs/21.3 Mule/5.0 (SAKAKI)

At Fri,  5 Jan 2007 07:56:21 +0100,
Marco Maggi wrote:
>   I wonder if someone can suggest me a somewhat efficient
> way to handle memory allocation and result storage for
> 'gsl_odeiv_evolve_apply()' micro steps results.

Hello,

I think the simplest way is to use realloc to grow a block of memory
as required (doubling is a reasonable strategy) and then create a
matrix view of it at the end.  If there is a risk of running out of
memory you could write the results to a file in binary format as they
are generated and then mmap() it.  

In the GNU C library there is a feature called obstacks which handles
fast growing objects of unknown size, but it may be more complicated
than you need.

-- 
Brian Gough

Network Theory Ltd,
Publishing Free Software Manuals --- http://www.network-theory.co.uk/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]