# MatCreateFFT
Creates a matrix object that provides FFT via an external package 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatCreateFFT(MPI_Comm comm, PetscInt ndim, const PetscInt dim[], MatType mattype, Mat *A)
```
Collective


## Input Parameters

- ***comm -*** MPI communicator
- ***ndim -*** the ndim-dimensional transform
- ***dim -*** array of size ndim, dim[i] contains the vector length in the i-dimension
- ***type -*** package type, e.g., `MATFFTW` or `MATSEQCUFFT`



## Output Parameter

- ***A  -*** the matrix



## Options Database Keys

- ***-mat_fft_type -*** set FFT type fft or seqcufft


Note: this serves as a base class for all FFT marix classes, currently `MATFFTW` or `MATSEQCUFFT`




## See Also
 `MATFFTW`, `MATSEQCUFFT`, `MatCreateVecsFFTW()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/fft/fft.c.html#MatCreateFFT">src/mat/impls/fft/fft.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex13.c.html">src/snes/tutorials/ex13.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/fft/fft.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
