Cubic Splines¶
Cubic splines are splines whose degree is equal to 3.
Cubic splines are described by the following polynomial

where


There are a lot of different types of cubic splines: Hermite, natural, Akima, Bessel. However, the current version of DPC++ API supports only one type: Hermite.
Header File¶
#include<oneapi/mkl/experimental/data_fitting.hpp>
Namespace¶
oneapi::mkl::experimental::data_fitiing
Hermite Spline¶
Coefficients of Hermite spline are calculated using the following formulas:


![c_{3,i} = \left( \left[ x_i, x_{i+1} \right]f - s_i \right)  / \left( \Delta x_i \right) - c_{4,i}\left( \Delta x_i \right),](../../_images/math/d219298894fc5e8d63d9c3eb427d74885afd083a.png)
![c_{4,i} = \left( s_i + s_{i+1} - 2\left[ x_i, x_{i+1} \right]f \right) / {\left( \Delta x_i \right)}^2,](../../_images/math/5a99c0f8bc5d9fdb7ab680dcc08d3f20da611fc4.png)

The following boundary conditions are supported for Hermite spline:
Free end (
).
Periodic.
First derivative.
Second Derivative.
Syntax¶
namespace cubic_spline {
  struct hermite {};
}
Example¶
To create a cubic Hermite spline object use the following:
spline<float, cubic_spline::hermite> val(
  /*SYCL queue object*/q,
  /*number of spline functions*/ny
);
Follow the Examples section to see more complicated examples.
      
      
      
).