# CreateDescriptor

Allocates memory for the descriptor data structure and preliminarily initializes it.

## Syntax

Fortran:

Status = DftiCreateDescriptor( Desc_Handle, &

Precision, &

Forward_Domain, &

Dimension, &

Length )

C:

status = DftiCreateDescriptor( &desc_handle, precision, forward_domain, dimension, length );

## Description

This function allocates memory for the descriptor data structure and instantiates it with all the default configuration settings with respect to the precision, domain, dimension, and length of the desired transform. The domain is understood to be the domain of the forward transform. Since memory is allocated dynamically, the result is actually a pointer to the created descriptor. This function is slightly different from the "initialization" function in more traditional software packages or libraries used for computing FFT. This function does not perform any significant computation work such as twiddle factors computation. The function DftiCommitDescriptor does this work after the function DftiSetValue has set values of all needed parameters.

The precision and (forward) domain are specified through named constants provided in the FFT interface for the configuration values. The choices for precision are `DFTI_SINGLE` and `DFTI_DOUBLE`; and the choices for (forward) domain are `DFTI_COMPLEX` and `DFTI_REAL`. See Table “Named Constant Configuration Values” for the complete table of named constants for configuration values.

Dimension is a simple positive integer indicating the dimension of the transform. Length is either a simple positive integer for one-dimensional transform, or an integer array (pointer in C) containing the positive integers corresponding to the lengths dimensions for multi-dimensional transform.

The function returns `DFTI_NO_ERROR` when completes successfully. See Status Checking Functions for more information on returned status.

## Interface and Prototype

!Fortran interface.

INTERFACE DftiCreateDescriptor

!Note that the body provided here is to illustrate the different

!argument list and types of dummy arguments. The interface

!does not guarantee what the actual function names are.

!Users can only rely on the function name following the keyword INTERFACE

FUNCTION some_actual_function_1D( Desc_Handle, Prec, Dom, Dim, Length )

INTEGER :: some_actual_function_1D

TYPE(DFTI_DESCRIPTOR), POINTER :: Desc_Handle

INTEGER, INTENT(IN) :: Prec, Dom

INTEGER, INTENT(IN) :: Dim, Length

END FUNCTION some_actual_function_1D

FUNCTION some_actual_function_HIGHD( Desc_Handle, Prec, Dom, Dim, Length )

INTEGER :: some_actual_function_HIGHD

TYPE(DFTI_DESCRIPTOR), POINTER :: Desc_Handle

INTEGER, INTENT(IN) :: Prec, Dom

INTEGER, INTENT(IN) :: Dim, Length(*)

END FUNCTION some_actual_function_HIGHD

END INTERFACE DftiCreateDescriptor

Note that the function is overloaded as the actual argument for `Length` can be a scalar or a a rank-one array.

/* C prototype */

long DftiCreateDescriptor( DFTI_DESCRIPTOR_HANDLE *,

DFTI_CONFIG_PARAM ,

DFTI_CONFIG_PARAM ,

long , ... );

The variable arguments facility is used to cope with the argument for lengths that can be a scalar (long), or an array (long *).

Parent topic: Descriptor Manipulation Functions