df?interpolate1d/df?interpolateex1d
Runs data fitting computations.
Syntax

status = dfsinterpolate1d(task, type, method, nsite, site, sitehint, ndorder, dorder, datahint, r, rhint, cell)
status = dfdinterpolate1d(task, type, method, nsite, site, sitehint, ndorder, dorder, datahint, r, rhint, cell)
status = dfsinterpolateex1d(task, type, method, nsite, site, sitehint, ndorder, dorder, datahint, r, rhint, cell, le_cb, le_params, re_cb, re_params, i_cb, i_params, search_cb, search_params)
status = dfdinterpolateex1d(task, type, method, nsite, site, sitehint, ndorder, dorder, datahint, r, rhint, cell, le_cb, le_params, re_cb, re_params, i_cb, i_params, search_cb, search_params)
Input Parameters
Name 
Type 
Description 

task 
TYPE(DF_TASK) 
Descriptor of the task. 
INTEGER 
Type of splinebased computations. The parameter takes one or more values combined with an 

method 
INTEGER 
Computation method. The supported value is DF_METHOD_PP. 
nsite 
INTEGER 
Number of interpolation sites. 
site 
REAL(KIND=4) DIMENSION(*) for dfsinterpolate1d/dfsinterpolateex1d REAL(KIND=8) DIMENSION(*) for dfdinterpolate1d/dfdinterpolateex1d 
Array of interpolation sites of size nsite. The structure of the array is defined by the sitehint parameter:

sitehint 
INTEGER 
A flag describing the structure of the interpolation sites. For the list of possible values of sitehint, see table "Hint Values for Interpolation Sites". If you set the flag to DF_NO_HINT, the library interprets the sitedefined partition as nonuniform. 
ndorder 
INTEGER 
Maximal derivative order increased by one to be computed at interpolation sites. 
dorder 
INTEGER DIMENSION(*) 
Array of size ndorder that defines the order of the derivatives to be computed at the interpolation sites. If all the elements in dorder are zero, the library computes the spline values only. If you do not need interpolation computations, set ndorder to zero and pass a NULL pointer to dorder. 
datahint 
REAL(KIND=4) DIMENSION(*) for dfsinterpolate1d/dfsinterpolateex1d REAL(KIND=8) DIMENSION(*) for dfdinterpolate1d/dfdinterpolateex1d 
Array that contains additional information about the structure of partition x and interpolation sites. This data helps to speed up the computation. If you provide a NULL pointer, the routine uses the default settings for computations. For details on the datahint array, see table "Structure of the datahint Array". 
r 
REAL(KIND=4) DIMENSION(*) for dfsinterpolate1d/dfsinterpolateex1d REAL(KIND=8) DIMENSION(*) for dfdinterpolate1d/dfdinterpolateex1d 
Array for results. If you do not need splinebased interpolation or integration, set this pointer to NULL. 
rhint 
INTEGER 
A flag describing the structure of the results. For the list of possible values of rhint, see table "Hint Values for the rhint Parameter". If you set the flag to DF_NO_HINT, the library stores the result in rowmajor format. 
cell 
INTEGER DIMENSION(*) 
Array of cell indices in partition x that contain the interpolation sites. Provide this parameter as input if type is DF_INTERP_USER_CELL. If you do not need cell indices, set this parameter to NULL. 
le_cb 
INTEGER 
Userdefined callback function for extrapolation at the sites to the left of the interpolation interval. 
le_params 
INTEGER DIMENSION(*) 
Pointer to additional userdefined parameters passed by the library to the le_cb function. 
re_cb 
INTEGER 
Userdefined callback function for extrapolation at the sites to the right of the interpolation interval. 
re_params 
INTEGER DIMENSION(*) 
Pointer to additional userdefined parameters passed by the library to the re_cb function. 
i_cb 
INTEGER 
Userdefined callback function for interpolation within the interpolation interval. 
i_params 
INTEGER DIMENSION(*) 
Pointer to additional userdefined parameters passed by the library to the i_cb function. 
search_cb 
INTEGER 
Userdefined callback function for computing indices of cells that can contain interpolation sites. 
search_params 
INTEGER DIMENSION(*) 
Pointer to additional userdefined parameters passed by the library to the search_cb function. 
Output Parameters
Name 
Type 
Description 

status 
INTEGER 

r 
Contains results of computations at the interpolation sites. 

cell 
Array of cell indices in partition x that contain the interpolation sites, which is computed if type is DF_CELL. 
Description
The df?interpolate1d/df?interpolateex1d routine performs splinebased computations with userdefined settings. The routine supports two types of computations for interpolation sites provided in array site:
Type 
Description 

DF_INTERP 
Compute derivatives of predefined order. The derivative of the zero order is the spline value. 
DF_INTERP_USER_CELL 
Compute derivatives of predefined order given userprovided cell indices. The derivative of the zero order is the spline value. For this type of the computations you should provide a valid cell array, which holds the indices of cells in the site array containing relevant interpolation sites. 
DF_CELL 
Compute indices of cells in partition x that contain the sites. 
If the indices of cells which contain interpolation types are available before the call to df?interpolate1d/df?interpolateex1d, you can improve performance by using the DF_INTERP_USER_CELL computation type.
Note
If you pass any combination of DF_INTERP, DF_INTERP_USER_CELL, and DF_CELL computation types to the routine, the library uses the DF_INTERP_USER_CELL computation mode.
If you specify DF_INTERP_USER_CELL computation mode and a userdefined callback function for computing cell indices to df?interpolateex1d, the library uses the DF_INTERP_USER_CELL computation mode, and the callback function is not called.
If the sites do not belong to interpolation interval [a, b] , the library uses:
 polynomial P_{0} of the spline constructed on interval [x_{0}, x_{1}] for computations at the sites to the left of a.
 polynomial P_{n2} of the spline constructed on interval [x_{n2}, x_{n1}] for computations at the sites to the right of b.
Interpolation sites support the following hints:
Value 
Description 

DF_NON_UNIFORM_PARTITION 
Partition is nonuniform. 
DF_UNIFORM_PARTITION 
Partition is uniform. 
DF_SORTED_DATA 
Interpolation sites are sorted in the ascending order and define a nonuniform partition. 
DF_NO_HINT 
No hint is provided. By default, the partition defined by interpolation sites is interpreted as nonuniform. 
Note
If you pass a sorted array of interpolation sites to the Intel MKL, set the sitehint parameter to the DF_SORTED_DATA value. The library uses this information when choosing the search algorithm and ignores any other data hints about the structure of the interpolation sites.
Data Fitting computation routines can use the following hints to speed up the computation:
 DF_UNIFORM_PARTITION describes the structure of breakpoints and the interpolation sites.
 DF_QUASI_UNIFORM_PARTITION describes the structure of breakpoints.
Pass the above hints to the library when appropriate.
The r pointer defines the memory location for the sets of interpolation and integration results for all coordinates of function y. The sets are stored one by one, in the successive order of the function coordinates from y_{1} to y_{ny}.
You can define the following settings for packing the results within each set:
 Computation type: interpolation, integration, or both.
 Computation parameters: derivative orders.
 Storage format for the results. You can specify the format using the rhint parameter values described in the table below:
Value 
Description 

DF_MATRIX_STORAGE_ROWS 
Data is stored in rowmajor format according to C conventions. 
DF_MATRIX_STORAGE_COLS 
Data is stored in columnmajor format according to Fortran conventions. 
DF_NO_HINT 
No hint is provided. By default, the results are stored in rowmajor format. 
For splinebased interpolation, you should set the derivatives whose values are required for the computation. You can provide the derivatives by setting the dorder array of size ndorder as follows:
See below a common structure of the storage formats of the interpolation results within each set r for computing derivatives of order i_{1}, i_{2},...,i_{m} at nsite interpolation sites. In this description, j is the coordinate of the vectorvalued function:

Rowmajor format

Columnmajor format
To speed up Data Fitting computations, use the datahint parameter that provides additional information about the structure of the partition and interpolation sites. This data represents a floatingpoint or a double array with the following structure:
Element Number 
Description 

1 
Task dimension 
2 
Type of additional information 
3 
Reserved field 
4 
The total number q of elements containing additional information. 
5 
Element (1) 
... 
... 
q+4 
Element (q) 
Data Fitting computation functions support the following types of additional information for datahint(2)
:
Type 
Element Number 
Parameter 

DF_NO_APRIORI_INFO 
0 
No parameters are provided. Information about the data structure is absent. 
DF_APRIORI_MOST_LIKELY_CELL 
1 
Index of the cell that is likely to contain interpolation sites. 
To compute indices of the cells that contain interpolation sites, provide the pointer to the array of size nsite for the results. The library supports the following scheme of cell indexing for the given partition{x_{i}}, i=1,...,nx:
cell(j)
= i, if site(j)
∈[x_{i}, x_{i+1}), i = 0,..., nx,
where
 x_{0} = ∞
 x_{nx+1} = +∞
 j = 1,..., nsite
To perform interpolation computations with spline types unsupported in the Data Fitting component, use the extended version of the routine df?interpolateex1d. With this routine, you can provide userdefined callback functions for computations within, to the left of, or to the right of interpolaton interval [a, b]. The callback functions compute indices of the cells that contain the specified interpolation sites or can serve as an approximation for computing the exact indices of such cells.
If you do not pass any function for computations at the sites outside the interval [a, b], the routine uses the default settings.