# MatSNESMFSetFunctionError

Sets the error_rel for the approximation of matrix-vector products using finite differences.

### Synopsis

    #include "petscsnes.h"
    PetscErrorCode PETSCSNES_DLLEXPORT MatSNESMFSetFunctionError(Mat mat,PetscReal error)

Collective on Mat

### Input Parameters

| mat | - the matrix free matrix created via MatCreateSNESMF()
| error_rel | - relative error (should be set to the square root of the relative error in the function evaluations)

### Options Database Keys

| -snes_mf_err <error_rel> | - Sets error_rel

### Notes

The default matrix-free matrix-vector product routine computes

         F'(u)*a = [F(u+h*a) - F(u)]/h where
         h = error_rel*u'a/||a||^2                        if  |u'a| > umin*||a||_{1}
           = error_rel*umin*sign(u'a)*||a||_{1}/||a||^2   else

### Keywords

SNES, matrix-free, parameters

### See Also

MatCreateSNESMF(),MatSNESMFGetH(),
MatSNESMFSetHHistory(), MatSNESMFResetHHistory(), MatSNESMFKSPMonitor()

Level:advanced
Location:src/snes/mf/snesmfj.c
Index of all SNESMF routines
Table of Contents for all manual pages
Index of all manual pages