From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13939 invoked by alias); 10 Jan 2014 16:37:08 -0000 Mailing-List: contact gsl-discuss-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gsl-discuss-owner@sourceware.org Received: (qmail 13930 invoked by uid 89); 10 Jan 2014 16:37:07 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.6 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: ipmx6.colorado.edu Received: from ipmx6.colorado.edu (HELO ipmx6.colorado.edu) (128.138.128.246) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 10 Jan 2014 16:37:06 +0000 From: Patrick Alken Received: from bonanza.ngdc.noaa.gov ([140.172.179.41]) by smtp.colorado.edu with ESMTP/TLS/DHE-RSA-AES256-SHA; 10 Jan 2014 09:37:04 -0700 Message-ID: <52D021B0.6080504@colorado.edu> Date: Fri, 10 Jan 2014 16:37:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: gsl-discuss@sourceware.org Subject: Re: interp2d discussion References: <520EB115.9070606@ellipsix.net> <52C708E1.6010601@colorado.edu> <52C9C114.1010303@ellipsix.net> <52CAE093.5060001@colorado.edu> <52CF8F04.60505@ellipsix.net> In-Reply-To: <52CF8F04.60505@ellipsix.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2014-q1/txt/msg00008.txt.bz2 > 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 */ }