:orphan:
# 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 Key

- ***-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
 [](ch_matrices), `Mat`, `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</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex7.c.html">src/snes/tutorials/ex7.c</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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
