# MatColoringRegister
Adds a new sparse matrix coloring to the  matrix package. 
## Synopsis
```
#include "petscmat.h"  
PetscErrorCode MatColoringRegister(const char sname[], PetscErrorCode (*function)(MatColoring))
```
Not Collective


## Input Parameters

- ***sname -*** name of Coloring (for example `MATCOLORINGSL`)
- ***function -*** function pointer that creates the coloring





## Sample usage
```none
   MatColoringRegister("my_color",MyColor);
```


Then, your partitioner can be chosen with the procedural interface via
```none
MatColoringSetType(part,"my_color")
```
or at runtime via the option
```none
-mat_coloring_type my_color
```


## See Also
 `MatColoringType`, `MatColoringRegisterDestroy()`, `MatColoringRegisterAll()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/color/interface/matcoloring.c.html#MatColoringRegister">src/mat/color/interface/matcoloring.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/color/interface/matcoloring.c)


[Index of all MatOrderings routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
