Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6981 Discussions

Datafitting - Cubic Spline Boundary Conditions

Page__Chris
Beginner
402 Views

I would like to fit a cubic spline with the second derivatives at the end points linearly extrapolated from the two closest interior points. Is there a way to specify this type of boundary condition?

0 Kudos
1 Reply
Pavel_D_Intel1
Employee
402 Views

Hi Chris,

Intel MKL Data Fitting supports next types of boundary conditions for cubic splines:

  • not-a-knot
  • free end
  • periodic
  • user-definedе the first/second derivative at the left/right endpoint

You can set the specifically defined second derivatives at the endpoints as presented below:


MKL_INT bc_type;             // boundary conditions type
double bc[2];                      // array of boundary conditions

bc_type     = DF_BC_2ND_LEFT_DER | DF_BC_2ND_RIGHT_DER;
bc[0] = a;
bc[1] = b;

// Call dfdEditPPSpline1D( task, sorder, stype, bc_type, bc, ic_type, ic, scoeff, scoeffhint );
// Call dfdConstruct1D( task, DF_PP_SPLINE, DF_METHOD_STD );

Full code can be found in “dfdcubicsplineint2der.c” sample.

Feel free to ask more.

Best regards,
Pavel.

0 Kudos
Reply