This is the mail archive of the
gsl-discuss@sourceware.org
mailing list for the GSL project.
Re: interp2d discussion
- From: Patrick Alken <patrick dot alken at Colorado dot EDU>
- To: gsl-discuss at sourceware dot org
- Date: Fri, 10 Jan 2014 09:37:04 -0700
- Subject: Re: interp2d discussion
- Authentication-results: sourceware.org; auth=none
- References: <520EB115 dot 9070606 at ellipsix dot net> <52C708E1 dot 6010601 at colorado dot edu> <52C9C114 dot 1010303 at ellipsix dot net> <52CAE093 dot 5060001 at colorado dot edu> <52CF8F04 dot 60505 at ellipsix dot net>
Sure, that would be a reasonable option, but I'd like to do a bit of
research (i.e. ask a few more people for opinions) to see what solution
will be the least confusing. After all, if there is a change to be made,
this is the time to do it, not later after the code is incorporated into
GSL. I think backward compatibility will not be too much of a problem
because people will have to make other changes anyway to transition from
the interp2d_* functions to the corresponding gsl_* functions.
I think 2 additional functions could be added to help solve this issue
and hide the indexing
from the user:
interp2d_grid_set(double zarr[], size_t i, size_t j, double z)
{
/* set point (i,j) of grid 'zarr' to value 'z' */
}
and
interp2d_grid_fill(double zarr[], int (*grid_func)(double x, double y,
void *params))
{
/* fill entire grid 'zarr' using callback function 'grid_func'; this
would be useful
* in cases where the user has a continuous/analytic function which
is expensive to call, but
* they'd like to make a grid and then interpolate from it
*/
}