# MatUpdateMPIAIJWithArray
updates an `MATMPIAIJ` matrix using an array that contains the nonzero values 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatUpdateMPIAIJWithArray(Mat mat, const PetscScalar v[])
```
Collective


## Input Parameters

- ***mat -*** the matrix
- ***v -*** matrix values, stored by row





## Note
The matrix must have been obtained with `MatCreateMPIAIJWithArrays()` or `MatMPIAIJSetPreallocationCSR()`


## See Also
 `MatCreate()`, `MatCreateSeqAIJ()`, `MatSetValues()`, `MatMPIAIJSetPreallocation()`, `MatMPIAIJSetPreallocationCSR()`,
`MATMPIAIJ`, `MatCreateAIJ()`, `MatCreateMPIAIJWithSplitArrays()`, `MatUpdateMPIAIJWithArrays()`, `MatUpdateMPIAIJWithArrays()`

## Level
intermediate

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/aij/mpi/mpiaij.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)  
