Visible to Intel only — GUID: GUID-921D7DFC-D546-4FF1-8FEC-79A760DBE209
Visible to Intel only — GUID: GUID-921D7DFC-D546-4FF1-8FEC-79A760DBE209
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-2/EA46DB11-E832-4B58-8EAD-281938C93041-low.png)
where
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/CFE989AB-6A2A-4536-848C-E954B1902EDF-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/E536BFAE-5E51-4A9F-B252-EAFE40391713-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-2/6516B2E7-72ED-4B7A-9605-155A68E20026-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/58C208CA-6EA6-4920-823E-28F279402A84-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/7AAB4718-98E7-456E-A292-725F31BF23D9-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/50FBFD88-1CC7-4F3F-8225-E311E0994622-low.png)
![](/content/dam/docs/us/en/developer-reference-dpcpp/2024-2/5B0BB40A-93CA-4856-950F-4F2DD87D2946-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.