Visible to Intel only — GUID: GUID-C93C30E6-B157-44EB-B5B7-38313B477A05
Visible to Intel only — GUID: GUID-C93C30E6-B157-44EB-B5B7-38313B477A05
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/2024-0/2E90AC59-306A-4583-A015-97EBB68F6244-low.png)
where
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-0/A24ADC1D-8D1F-4BF5-957D-6463E01B6386-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-0/246BAF6A-140B-4A3B-950D-53D113E4FEA5-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/2024-0/066ACE60-E0DA-4C99-BA14-D75DAA295CDB-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-0/792429C5-275B-40D7-9D94-C2882DA7091F-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-0/64283C16-7FF2-4A69-98F8-C28DA8AAC135-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-0/F6BDA756-B7C5-493B-A6D2-788956E76C01-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-0/38F99CC8-A8E9-4EA5-BA7C-2837F43DC205-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.