Python and C++ classes for linear interpolation in 1D