# MatMFFDSetHHistory
Sets an array to collect a history of the differencing values (h) computed for the matrix-free product `MATMFFD` matrix 
## Synopsis
```
#include "petscmat.h"   
PetscErrorCode MatMFFDSetHHistory(Mat J, PetscScalar history[], PetscInt nhistory)
```
Logically Collective


## Input Parameters

- ***J -*** the `MATMFFD` matrix-free matrix
- ***history -*** space to hold the history
- ***nhistory -*** number of entries in history, if more entries are generated than
nhistory, then the later ones are discarded





## Note
Use `MatMFFDResetHHistory()` to reset the history counter and collect
a new batch of differencing parameters, h.


## See Also
 `MATMFFD`, `MatMFFDGetH()`, `MatCreateSNESMF()`,
`MatMFFDResetHHistory()`, `MatMFFDSetFunctionError()`

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/mffd/mffd.c.html#MatMFFDSetHHistory_MFFD">MatMFFDSetHHistory_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)  
