[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Help-gsl] Keeping fixed memory allocation for an interpolating object
From: |
Ruben Farinelli |
Subject: |
[Help-gsl] Keeping fixed memory allocation for an interpolating object |
Date: |
Mon, 14 Oct 2013 11:52:54 +0200 |
User-agent: |
KMail/1.13.2 (Linux/2.6.33.3-85.fc13.i686.PAE; KDE/4.4.2; i686; ; ) |
Dear GSL,
I have the following question.
I need to pass thousands of times two arrays to a custom function in order to
perform a spline interpolation.
However allocating at each call in the function the dimension of the object
and then freeing it via the commands
spline=gsl_spline_alloc(gsl_interp_cspline, BIN);
gsl_spline_init(spline, array_x, array_y, BIN);
\*commands
/*
gsl_spline_free(spline);
is very time consuming.
What I would like to do is allocating the object just once, i.e. when the
function is called for the first time, and then proceed on up to the end
of the loop.
How can I do that ?
Thank you in advance
Best regards
Ruben Farinelli
- [Help-gsl] Keeping fixed memory allocation for an interpolating object,
Ruben Farinelli <=