:orphan:
# MatColoringPatch
sed inside matrix coloring routines that use `MatGetRowIJ()` and/or `MatGetColumnIJ()`. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatColoringPatch(Mat mat, PetscInt ncolors, PetscInt n, ISColoringValue colorarray[], ISColoring *iscoloring)
```
Collective


## Input Parameters

- ***mat -*** the matrix
- ***ncolors -*** maximum color value
- ***n   -*** number of entries in colorarray
- ***colorarray -*** array indicating color for each column



## Output Parameter

- ***iscoloring -*** coloring generated using colorarray information





## See Also
 [](ch_matrices), `Mat`, `MatGetRowIJ()`, `MatGetColumnIJ()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matrix.c.html#MatColoringPatch">src/mat/interface/matrix.c</A>


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


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