# MatGetColoring

Gets a coloring for a matrix to reduce the number of function evaluations needed to compute a sparse Jacobian via differencing.

### Synopsis

    PetscErrorCode PETSCMAT_DLLEXPORT MatGetColoring(Mat mat,const MatColoringType type,ISColoring *iscoloring)

Collective on Mat

### Input Parameters

mat -the matrix
type -type of coloring, one of the following:

         MATCOLORING_NATURAL - natural (one color for each column, very slow)

         MATCOLORING_SL - smallest-last

         MATCOLORING_LF - largest-first

         MATCOLORING_ID - incidence-degree

### Output Parameters

iscoloring -the coloring

### Options Database Keys

To specify the coloring through the options database, use one of the following

       -mat_coloring_type natural, -mat_coloring_type sl, -mat_coloring_type lf,

       -mat_coloring_type id

To see the coloring use

       -mat_coloring_view

### Notes

These compute the graph coloring of the graph of A^{T}A. The coloring used for efficient (parallel or thread based) triangular solves etc is NOT yet available.

The user can define additional colorings; see MatColoringRegisterDynamic().

The sequential colorings SL, LF, and ID are obtained via the Minpack software that was converted to C using f2c.

### Keywords

matrix, get, coloring

### See Also

MatGetColoringTypeFromOptions(), MatColoringRegisterDynamic(), MatFDColoringCreate(),
SNESDefaultComputeJacobianColor()

Level:intermediate
Location: src/mat/color/color.c
Index of all MatOrderings routines
Table of Contents for all manual pages
Index of all manual pages