Visible to Intel only — GUID: GUID-60169CE2-C8E0-4E75-BD12-DD795DD9F966
Visible to Intel only — GUID: GUID-60169CE2-C8E0-4E75-BD12-DD795DD9F966
Cubic Splines
Cubic splines are splines whose degree is equal to 3.
Cubic splines are described by the following polynomial
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/EF3CAF47-3BD8-4550-BE46-C42DB06A8F7D-low.png)
where
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/F09C9745-4FCD-4101-A79B-E14542D923BF-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/9E66B3F2-3711-4159-AEC7-1B1EDC3306C7-low.png)
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:
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/0403C073-FEBD-4CD6-AD25-87D3772F2EB6-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/BF4D177F-24FD-47B9-A549-8FADB6E6E2B2-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/D49B486E-A755-4776-943E-73251B4E7309-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/020CF28D-33E1-46FE-9BC5-EAFC96006578-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-2/5F318093-34AE-46A5-9BDD-5967122DF544-low.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.