Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 11/07/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

df?searchcellscallback

A callback function for user-defined search to be passed into df?interpolateex1d, df?integrateex1d, or df?searchcellsex1d.

Syntax

status = dfssearchcellscallback(n, site, cell, flag, user_params, library_params)

status = dfdsearchcellscallback(n, site, cell, flag, user_params, library_params)

Include Files

  • mkl_df.f90

Input Parameters

Name

Type

Description

n

INTEGER(KIND=8)

Number of interpolation sites or integration limits.

site

REAL(KIND=4) DIMENSION(*) for dfssearchcellscallback

REAL(KIND=8) DIMENSION(*) for dfdsearchcellscallback

Array, size n, of interpolation sites or integration limits.

flag

INTEGER(KIND=4) DIMENSION(*)

Array of size n, with values set as follows:

  • If the cell with index cell(i) contains site(i), set flag[i] to 1.
  • Otherwise, set flag(i) to zero. In this case, the library interprets the index as an approximation and computes the index of the cell containing site(i) by using the provided index as a starting point for the search.

user_params

INTEGER DIMENSION(*), optional

Pointer to user-defined parameters of the callback function.

library_params

TYPE(DF_SEARCH_CALLBACK_LIBRARY_PARAMS), optional

Pointer to library-defined parameters of the callback function.

Output Parameters

Name

Type

Description

status

INTEGER

The status returned by the callback function:

  • Zero indicates successful completion of the callback operation.
  • A negative value indicates an error.
  • The DF_STATUS_EXACT_RESULT status indicates that cell indices returned by the callback function are exact. In this case, you do not need to initialize entries of the flag array.

  • A positive value indicates a warning.
See "Task Status and Error Reporting" for error code definitions.

cell

INTEGER(KIND=8) DIMENSION(*)

Array of size n that returns indices of the cells computed by the callback function.

Description

When passed into the df?interpolateex1d, df?integrateex1d, or df?searchcellsex1d routine, this function performs a user-defined search.

The library_params parameter allows the library to provide extra parameters, which the callback function can use to organize computations effectively. The df?interpolateex1d, and df?searchcellsex1d routines do not provide extra parameters. The df?integrateex1d routines use this parameter to specify which type of integration limits, left or right, are provided for the callback. To do this the library declares the DF_SEARCH_CALLBACK_LIBRARY_PARAMS derived type. It currently contains one component, limit_type_flag, of type INTEGER(KIND=4). The field is set by the library to one of two possible values: DF_INTEGR_SEARCH_CB_LLIM_FLAG if the left integration limits are provided, or DF_INTEGR_SEARCH_CB_RLIM_FLAG if the right integration limits are provided.