From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12040 invoked by alias); 25 Mar 2014 22:51:22 -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 12029 invoked by uid 89); 25 Mar 2014 22:51:21 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.0 required=5.0 tests=AWL,BAYES_00,FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: mail-pb0-f45.google.com Received: from mail-pb0-f45.google.com (HELO mail-pb0-f45.google.com) (209.85.160.45) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Tue, 25 Mar 2014 22:51:19 +0000 Received: by mail-pb0-f45.google.com with SMTP id uo5so1092363pbc.32 for ; Tue, 25 Mar 2014 15:51:17 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=content-type:mime-version:subject:from:in-reply-to:date :content-transfer-encoding:message-id:references:to; bh=w494pz+mo5G9iIo3UvT2QOjXc9noJEUB3ggpgfrcbP0=; b=gxxYOIG+UbtgqYWFc8AY4zbNuzq3nSQF72tQ35s8jyrrRaFBMfoJgg9xouLXd7FDxu /3zq2pxDmkaZ7Mngu3Q48kXijrjYux6ypVzik2QH6T/+XvD2qXF9gGhldz667EFNdu/x cls0609krZUaiMazB2+0gU9D+PUZbwIUKmGtOlhrktNDFESn4s+MvHx1CeL1dw12yAEV 4AXs7ZadFbC61d2thUm0MdGC6xacrwj3Omg+6lV2XGsInX3iR+u38wOIGSSkFIQ/HB7c 7oPjpcbevYEjkgSinVajC+7tAjcIcRXlqiLWQ5Pr75ir1hiuOILrSX5Gs+Lj9Hg9v7mG uUdw== X-Received: by 10.68.252.165 with SMTP id zt5mr82444807pbc.17.1395787877714; Tue, 25 Mar 2014 15:51:17 -0700 (PDT) Received: from dhcp-128-189-74-162.ubcsecure.wireless.ubc.ca (dhcp-128-189-74-162.ubcsecure.wireless.ubc.ca. [128.189.74.162]) by mx.google.com with ESMTPSA id yw3sm49617706pbc.69.2014.03.25.15.51.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 25 Mar 2014 15:51:16 -0700 (PDT) Content-Type: text/plain; charset=windows-1252 Mime-Version: 1.0 (Mac OS X Mail 7.2 \(1874\)) Subject: Re: Compiling & Testing New Interpolation Type From: =?windows-1252?Q?Jean-Fran=E7ois_Caron?= In-Reply-To: Date: Tue, 25 Mar 2014 22:51:00 -0000 Content-Transfer-Encoding: quoted-printable Message-Id: References: <57ABFACA-CA7C-439D-9695-F136F0142156@phas.ubc.ca> <5328EF5C.5010300@colorado.edu> <0665FACA-1454-4C7C-80B5-30D08E71A1B7@phas.ubc.ca> <5329F67E.7080203@colorado.edu> <532A124B.4090608@colorado.edu> <532A13D0.2050609@colorado.edu> <8EA5CA7B-E4C4-48A0-A9EB-BA77F3F1AC11@phas.ubc.ca> <532B23E3.7050700@colorado.edu> <532B2ACF.1060608@colorado.edu> <532B2D8E.8090902@colorado.edu> <532B33B2.6060903@colorado.edu> To: gsl-discuss@sourceware.org X-SW-Source: 2014-q1/txt/msg00031.txt.bz2 Git and Github weren=92t as intimidating as I expected. I have a repo here= with the =93steffen=94 branch including my changes: https://github.com/jfcaron3/gsl-steffen-devel The Savannah git repo didn=92t include a configure script, and I got my mod= ified GSL+Steffen code to compile by directly modifying interpolation/Makef= ile AFTER running ./configure, so I=92m not sure how to compile the files c= loned from my github repo. At least it=92s easier to see the changes now. Jean-Fran=E7ois On Mar 25, 2014, at 14:56 , Jean-Fran=E7ois Caron wro= te: > I=92ve improved my initial code greatly. You can find it here: >=20 > http://bazaar.launchpad.net/~jfcaron/+junk/my_steffen/files >=20 > You can compile it into GSL by adding in the interpolation/Makefile refer= ences to =93steffen.c=94, =93steffen.lo=94, and =93steffen.Plo=94 exactly w= here there are currently references to =93akima.*=94. >=20 > I=92ve tried adding an =93integ=94 method, but I=92m afraid I don=92t eve= n understand the workings of the integ methods for the existing interpolati= on types. I couldn=92t just copy from the akima.c integ method because the= y use a build-in spline calculation function (which I also don=92t understa= nd). Reading uncommented C code is pretty hard. My test program shows tha= t the integration method isn=92t obviously broken, but it fails the tests I= wrote in interpolation/test.c The actual interpolation and derivatives se= em to work and pass the tests. >=20 > I=92ve not used github before, so I guess my next move should be to learn= the basics and start using that, since otherwise describing my additions &= changes are hard to follow. In the meantime, is anyone able to explain ho= w the heck the =93integ=94 methods work? >=20 > Jean-Fran=E7ois >=20 > On Mar 20, 2014, at 11:30 , Patrick Alken wr= ote: >=20 >> Yes that green curve is rather strange and doesn't seem much better than= the cubic spline. I like simplicity too so lets proceed with importing the= steffen code. >>=20 >> On 03/20/2014 12:18 PM, Jean-Fran=E7ois Caron wrote: >>> Definitely an advantage of a) is that it is conceptually simple. b) is= 44 pages while a) is only 7. Even if b) is somehow mathematically superio= r, I like the idea of understanding the tools that I am using (and being ab= le to explain it to my academic supervisor/conference attendees). >>>=20 >>> The MESA astrophysics library (C++ unfortunately) actually includes bot= h types, and has a little graph to show differences: >>> http://mesa.sourceforge.net/interp_1D.html >>>=20 >>> Actually their graph is confusing, blue is supposed to be a), green b),= but the green curve isn=92t piece-wise monotonic between the data points. = I=92m starting to think maybe Stetten and Huynh mean different things when= they say =93monotonic=94. I=92ll try to read Huynh=92s paper to see if th= ey define what they are trying to do. Steffen is pretty clear about his te= chnique being a for an interpolating function that is monotonic between dat= a points - i.e. the interpolating function doesn=92t change sign between da= ta points, and extrema can only occur at said data points. >>>=20 >>> Jean-Fran=E7ois >>>=20 >>> On Mar 20, 2014, at 11:03 , Patrick Alken = wrote: >>>=20 >>>> I see question 1) is answered by section 4 of Steffen's paper - the me= thod works on all data sets, and preserves monotonicity in each interval, w= hich is nice. They also state that method (c) has some serious drawbacks. >>>>=20 >>>> Unfortunately paper (b) doesn't reference (a) and so its difficult to = tell whether (b) offers any advantage over (a) >>>>=20 >>>> On 03/20/2014 11:52 AM, Patrick Alken wrote: >>>>> Hi, I'm moving this discussion over to gsl-discuss which is more suit= ed >>>>> for development issues. >>>>>=20 >>>>> I have 2 naive questions which you may be able to answer since you've >>>>> been working on this code. >>>>>=20 >>>>> 1) If the Steffen algorithm is applied to non-monotonic data, will it >>>>> still provide a solution or does the method encounter an error? >>>>>=20 >>>>> 2) Earlier on the GSL list it was mentioned that there are 3 different >>>>> methods for interpolating monotonic data: >>>>>=20 >>>>> (a) M.Steffen, "A simple method for monotonic interpolation in one >>>>> dimension", Astron. Astrophys. 239, 443-450 (1990). >>>>>=20 >>>>> (b) H.T.Huynh, "Accurate Monotone Cubic Interpolation", SIAM J. Numer. >>>>> Anal. 30, 57-100 (1993). >>>>>=20 >>>>> (c) Fritsch, F. N.; Carlson, R. E., "Monotone Piecewise Cubic >>>>> Interpolation", SIAM J. Numer. Anal. 17 (2), 238=96246 (1980). >>>>>=20 >>>>> I haven't looked at (c) but it seems that (a) and (b) both use piecew= ise >>>>> cubic polynomials and preserve monotonicity. Do you happen to know if >>>>> one method is superior to the other? If one method is significantly >>>>> better than the other two it would make more sense to include that one >>>>> in GSL. >>>>>=20 >>>>> Patrick >>>>>=20 >>>>> On 03/20/2014 11:37 AM, Jean-Fran=E7ois Caron wrote: >>>>>> Yes, I didn=92t bother doing the integration function at the time be= cause I was having trouble just compiling. I will add the integration func= tion, and re-write the eval and deriv/deriv2 functions to use Horner=92s sc= heme for the polynomials. I can generate some comparison graphs using fake= data like in Steffen=92s paper, that sounds easy enough. >>>>>>=20 >>>>>> I=92ll look at the interpolation/test.c file and see if I can come u= p with similar tests. >>>>>>=20 >>>>>> Thanks for offering to help with the integration into GSL itself. I= don=92t know a lot of the procedures (or even politics sometimes!) involve= d. >>>>>>=20 >>>>>> Jean-Fran=E7ois >>>>>>=20 >>>>>> On Mar 20, 2014, at 10:22 , Patrick Alken wrote: >>>>>>=20 >>>>>>> I did notice you talking about 1.6 in your earlier messages, but as= sumed it was a typo and you meant 1.16, oops. >>>>>>>=20 >>>>>>> On 03/20/2014 11:11 AM, Jean-Fran=E7ois Caron wrote: >>>>>>>> My original problem was that I wanted to add an interpolation type= to GSL. Specifically I want monotonic cubic-splines following the descrip= tion in Steffen (1990): http://adsabs.harvard.edu/full/1990A%26A...239..443S >>>>>>> I took a quick look at your code earlier and it looks pretty nice. = I noticed you commented out the _integ function - is this something you cou= ld add to make it feature complete with the other interpolation types? >>>>>>>=20 >>>>>>> It is important to add automated tests for this. Can you look at in= terpolation/test.c and design similar tests for your new method? Also I thi= nk it would be nice to add a figure to the manual illustrating the differen= ces between cubic, akima, and your new steffen method (similar to the figur= es in the Steffen paper). This would help users a lot when trying to decide= what method to use. Do you happen to have a dataset which shows a nice con= trast like Figs 1, 3 and 8 from that paper? >>>>>>>=20 >>>>>>> When everything is ready I would be happy to add it to GSL, as we a= re already planning to update the interpolation module for the next release= . When I find some time I want to import the 2D interpolation extension dis= cussed previously, and also add Hermite interpolation. >>>>>>>=20 >>>>>>> It would be easiest for us if you could clone the GSL git repositor= y and make your changes there. You could make a new branch called 'steffen'= or something and publish it to github, or just send a patch file to me, wh= ichever is easiest. >>>>>>>=20 >>>>>>> Patrick >>>>>>>=20 >>>>>>> On Mar 19, 2014, at 18:40 , Dave Allured - NOAA Affiliate wrote: >>>>>>>>> More data. I tried the same plain build recipe, GSL 1.16 on our = test >>>>>>>>> machine which is at Mac OS 10.9.3. Got another perfect build, no= make >>>>>>>>> check errors, no PPC-related issues. Outputs on request, please = be >>>>>>>>> specific. >>>>>>>>>=20 >>>>>>>>> CC=3Dclang >>>>>>>>> CFLAGS=3D-g >>>>>>>>> ./configure --prefix /Users/dallured/Disk/3rd/gsl/1.16.os10.9 >>>>>>>>>=20 >>>>>>>>> mac27:~/Disk/3rd/gsl/1.16.os10.9 57> sw_vers >>>>>>>>> ProductName: Mac OS X >>>>>>>>> ProductVersion: 10.9.3 >>>>>>>>> BuildVersion: 13D17 >>>>>>>>>=20 >>>>>>>>> mac27:~/Disk/3rd/gsl/1.16.os10.9/src 36> \ >>>>>>>>> ? grep -i '# [a-z]' ../logfiles/make-check.0319a.log | sort | uni= q -c >>>>>>>>> 45 # ERROR: 0 >>>>>>>>> 45 # FAIL: 0 >>>>>>>>> 42 # PASS: 1 >>>>>>>>> 3 # PASS: 2 >>>>>>>>> 45 # SKIP: 0 >>>>>>>>> 42 # TOTAL: 1 >>>>>>>>> 3 # TOTAL: 2 >>>>>>>>> 45 # XFAIL: 0 >>>>>>>>> 45 # XPASS: 0 >>>>>>>>>=20 >>>>>>>>> mac27:~/Disk/3rd/gsl/1.16.os10.9 62> \ >>>>>>>>> ? grep -c -i ppc logfiles/*319a*log >>>>>>>>> logfiles/configure.0319a.os10.9.log:0 >>>>>>>>> logfiles/install.0319a.log:0 >>>>>>>>> logfiles/make-check.0319a.log:0 >>>>>>>>> logfiles/make.0319a.log:0 >>>>>>>>>=20 >>>>>>>>> mac27:~/Disk/3rd/gsl/1.16.os10.9 65> \ >>>>>>>>> ? grep -i ppc src/config.h src/config.log src/config.status >>>>>>>>> src/config.h:/* #undef HAVE_GNUPPC_IEEE_INTERFACE */ >>>>>>>>> src/config.log:HAVE_GNUPPC_IEEE_INTERFACE=3D'' >>>>>>>>> src/config.status:S["HAVE_GNUPPC_IEEE_INTERFACE"]=3D"" >>>>>>>>>=20 >>>>>>>>> --Dave >>>>>>>>>=20 >>>>>>>>> On Wed, Mar 19, 2014 at 5:27 PM, Jean-Francois Caron >>>>>>>>> wrote: >>>>>>>>>> Dave is correct, I am using an "i686" 64-bit x86 mac. For some = reason >>>>>>>>>> it is still looking for the PPC mac header file. The ./configure >>>>>>>>>> stage correctly identifies my system, so it's a bit strange. Al= so GSL >>>>>>>>>> installs without errors when I do it from MacPorts, and MacPorts >>>>>>>>>> doesn't seem to do anything other than ./configure && make, from= my >>>>>>>>>> reading of the portfile. >>>>>>>>>>=20 >>>>>>>>>> When I get back to my Mac, I will look at the NOTES file to see = if >>>>>>>>>> anything needs to be done for 10.9. >>>>>>>>>>=20 >>>>>>>>>> Jean-Fran=E7ois >>=20 >=20