# MatFDColoringSetValues
takes a matrix in compressed color format and enters the matrix into a PETSc `Mat` 
## Synopsis
```
PetscErrorCode MatFDColoringSetValues(Mat J, MatFDColoring coloring, const PetscScalar *y)
```
Collective on J


## Input Parameters

- ***J -*** the sparse matrix
- ***coloring -*** created with `MatFDColoringCreate()` and a local coloring
- ***y -*** column major storage of matrix values with one color of values per column, the number of rows of y should match
the number of local rows of J and the number of columns is the number of colors.




Notes: the matrix in compressed color format may come from an automatic differentiation code

The code will be slightly faster if `MatFDColoringSetBlockSize`(coloring,`PETSC_DEFAULT`,nc); is called immediately after creating the coloring


## See Also
 `MatFDColoringCreate()`, `ISColoring`, `ISColoringCreate()`, `ISColoringSetType()`, `IS_COLORING_LOCAL`, `MatFDColoringSetBlockSize()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/fdmpiaij.c.html#MatFDColoringSetValues">src/mat/impls/aij/mpi/fdmpiaij.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/aij/mpi/fdmpiaij.c)


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