1 #ifndef TIL_CUBIC_SPLINE_INTERPOLATION_TPP_
2 #define TIL_CUBIC_SPLINE_INTERPOLATION_TPP_
7 // small helper functions
10 template < typename T >
12 { return -0.25*cube(x-1); }
14 template < typename T >
16 { return 0.75*(x-3)*square(x-1)+1; }
18 template < typename T >
20 { return 0.75*(x-2)*square(x)+1; }
22 template < typename T >
24 { return 0.25*cube(x); }
27 template < typename T >
28 inline T CubicSplineInterpolation<T>::compute(T f1, T f2, T f3, T f4, T x)
29 { return f1*cubic_1(x) + f2*cubic_2(x) + f3*cubic_3(x) + f4*cubic_4(x); }
33 #endif /*CUBIC_SPLINE_INTERPOLATION_TPP_*/