# MatMFFDSetType
Sets the method that is used to compute the differencing parameter for finite difference matrix-free formulations. 
## Synopsis
```
#include "petscmat.h"   
PetscErrorCode MatMFFDSetType(Mat mat, MatMFFDType ftype)
```

## Input Parameters

- ***mat -*** the "matrix-free" matrix created via `MatCreateSNESMF()`, or `MatCreateMFFD()`
or `MatSetType`(mat,`MATMFFD`);
- ***ftype -*** the type requested, either `MATMFFD_WP` or `MATMFFD_DS`





## Note
For example, such routines can compute h for use in
Jacobian-vector products of the form

F(x+ha) - F(x)
F'(u)a  ~=  ----------------
h


## See Also
 `MATMFFD`, `MATMFFD_WP`, `MATMFFD_DS`, `MatCreateSNESMF()`, `MatMFFDRegister()`, `MatMFFDSetFunction()`, `MatCreateMFFD()`

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/mffd/mffd.c.html#MatMFFDSetType_MFFD">MatMFFDSetType_MFFD in src/mat/impls/mffd/mffd.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/mffd/mffd.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)  
