Developer Reference for Intel® oneAPI Math Kernel Library for Fortran

ID 766686
Date 3/22/2024
Public

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

Document Table of Contents

?_forward_trig_transform

Computes the forward Trigonometric Transform of type specified by the parameter.

Syntax

void d_forward_trig_transform(double f[], DFTI_DESCRIPTOR_HANDLE *handle, MKL_INT ipar[], double dpar[], MKL_INT *stat);

void s_forward_trig_transform(float f[], DFTI_DESCRIPTOR_HANDLE *handle, MKL_INT ipar[], float spar[], MKL_INT *stat);

Include Files

  • mkl_trig_transforms.f90

Input Parameters

f

double for d_forward_trig_transform,

float for s_forward_trig_transform,

array of size n for staggered2 transforms and of size n+1 for all other transforms, where n is the size of the problem. On input, contains data vector to be transformed. Note that the following values should be 0.0 up to rounding errors:

  • f[0] and f[n] for sine transforms
  • f[n] for staggered cosine transforms
  • f[0] for staggered sine transforms.

Otherwise, the routine will produce a warning, and the result of the computations for sine transforms may be wrong. The above restrictions meet the requirements of the Intel® oneAPI Math Kernel Library (oneMKL) Poisson Solver, which the TT interface is primarily designed for (for details, seeFast Poisson Solver Routines).

handle

DFTI_DESCRIPTOR_HANDLE*. The data structure used by Intel® oneAPI Math Kernel Library (oneMKL) FFT interface (for details, seeFFT Functions).

ipar

MKL_INT array of size 128. Contains integer data needed for Trigonometric Transform computations.

dpar

double array of size 5n/2+2. Contains double-precision data needed for Trigonometric Transform computations.

spar

float array of size 5n/2+2. Contains single-precision data needed for Trigonometric Transform computations.

Output Parameters

f

Contains the transformed vector on output.

ipar

Contains integer data needed for Trigonometric Transform computations. On output, ipar[6] is updated with the stat value.

stat

MKL_INT*. Contains the routine completion status, which is also written to ipar[6].

Description

The routine computes the forward Trigonometric Transform of type defined in the ?_init_trig_transform routine and passed to ?_forward_trig_transform with the ipar array. The size of the problem n, which determines sizes of the array parameters, is also passed to the routine with the ipar array and defined in the previously called ?_init_trig_transform routine. The other data that facilitates the computation is created by ?_commit_trig_transform and supplied in dpar or spar. For a detailed description of arrays ipar, dpar and spar, refer to Common Parameters. The routine has a commit step, which calls the ?_commit_trig_transform routine. The transform is computed according to formulas given in Transforms Implemented. The routine replaces the input vector f with the transformed vector.

NOTE:

If you need a copy of the data vector f to be transformed, make the copy before calling the ?_forward_trig_transform routine.

Return Values

stat= 0

The routine completed the task normally.

stat= -100

The routine stopped for any of the following reasons:

  • An error in the user's data was encountered.
  • Data in ipar, dpar or spar parameters became incorrect and/or inconsistent as a result of modifications.

stat= -1000

The routine stopped because of an FFT interface error.

stat= -10000

The routine stopped because its commit step failed to complete or the parameter ipar[0] was altered by mistake.