Visible to Intel only — GUID: GUID-E059DBDF-E9A9-4583-8DD9-DA6646EAD610
Visible to Intel only — GUID: GUID-E059DBDF-E9A9-4583-8DD9-DA6646EAD610
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-1/A762490B-40D7-47CC-9705-D83BAB27FC4C-low.png)
where
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-1/2081372A-D4E9-43F1-AB77-74713F515C10-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-1/CD58D640-0F6A-4A78-A076-CD00FBC1A106-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-1/EFAE65CA-232B-42B6-BD36-12987F4BD38F-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-1/F1A1B383-33F4-488E-98CD-981BF4C83F95-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-1/03CFBE1A-D2CA-4507-95EE-94F4C8E0AC18-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-1/F005053A-AF75-4508-8993-F41E1468D79E-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-1/727DDD8B-DA2C-4B58-B62A-F1151E52091C-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.