Visible to Intel only — GUID: GUID-2773D70C-3036-4193-9AC1-C8F43A1B594F
Visible to Intel only — GUID: GUID-2773D70C-3036-4193-9AC1-C8F43A1B594F
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-1/5F5F714D-B7DB-4B59-8964-1324FA0552BB-low.png)
where
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-1/4A1A9200-A69E-4C12-B57E-F8FF8F60F2BA-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-1/F4AA2DC4-789A-453F-93DC-4078BDC4159D-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-1/96F0868A-479B-43AB-8969-294A739E5F52-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-1/B49276D8-612D-4A48-92FA-986EBA3DA233-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-1/4B6E7BF0-FD2F-4127-808D-AB8CB2BC8A3F-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-1/F6C3DB41-1202-4D3C-831B-D674B5386B5C-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2023-1/DB03596D-DF26-4270-B89B-150DB5DEE86D-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.