Adding Interpolation Types

Hi, I am currently using a ROOT::Math::Interpolator, but it only provides a small set of hardcoded interpolation types (Linear, Cubic Spline, Akima & ceriodic variants). Currently these methods are failing me because I require monotone interpolation (actually the Linear one is monotone, but it gives bad derivatives). I have found that there are a few well-understood monotone interpolation techniques (my favourite:…239…443S)

Given that GSL is considered “feature complete”, it would be very difficult to add an interpolation method to GSL itself. They recommend that enhancements be provided by external packages.

So my question is: how difficult would it be to implement Steffen (1990) interpolation as a ROOT extension to the existing GSL interpolation methods? I’ve never contributed anything but bug reports to ROOT, so even the process of submitting patches seems opaque. Is it even possible to add a non-GSL interpolator given the structure of ROOT::Math::Interpolator?


I’ve been working on a branch/fork of GSL that includes the simple monotonic interpolation from Steffen (1990) and I’ve been successful. My branch will likely be integrated into some future version of GSL. In the meantime, my branch can be found here: … ee/steffen

Eventually I would like to use the Steffen interpolator through ROOT::Math::Interpolator. Is it possible to compile my own ROOT that links against my GSL branch, and uses the new interpolation method? Do I need to make any modifications to ROOT itself? E.g. are the interpolator types listed explicitly in the ROOT code anywhere, or is it just drawn from GSL? I’m not super familiar with compiling my own ROOT (I usually install it through MacPorts), so are there special considerations when linking with a non-standard library?

Thanks for any advice.

I updated the original reply to the post, but I didn’t realize that it didn’t bump the post to the top. I should have just done a new reply.