# MatFDColoringSetFunction

Sets the function to use for computing the Jacobian.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatFDColoringSetFunction(MatFDColoring matfd,PetscErrorCode (*f)(void),void *fctx)

Collective on MatFDColoring

### Input Parameters

| coloring | - the coloring context
| f | - the function
| fctx | - the optional user-defined function context

### Notes

In Fortran you must call MatFDColoringSetFunctionSNES() for a coloring object to be used with the SNES solvers and MatFDColoringSetFunctionTS() if it is to be used with the TS solvers.

### Keywords

Mat, Jacobian, finite differences, set, function

Level:intermediate
Location: src/mat/matfd/fdmatrix.c
Index of all MatFD routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/snes/examples/tutorials/ex5.c.html
src/snes/examples/tutorials/ex5s.c.html
src/snes/examples/tutorials/ex14.c.html
src/snes/examples/tutorials/ex26.c.html
src/ts/examples/tutorials/ex7.c.html