# MatMPIAdjSetPreallocation
Sets the array used for storing the matrix elements 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatMPIAdjSetPreallocation(Mat B, PetscInt *i, PetscInt *j, PetscInt *values)
```
Logically Collective


## Input Parameters

- ***A -*** the matrix
- ***i -*** the indices into j for the start of each row
- ***j -*** the column indices for each row (sorted for each row).
The indices in i and j start with zero (NOT with one).
- ***values -*** [optional] edge weights





## See Also
 `MatCreate()`, `MatCreateMPIAdj()`, `MatSetValues()`, `MATMPIADJ`, `MatCreateMPIAdj()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/adj/mpi/mpiadj.c.html#MatMPIAdjSetPreallocation">src/mat/impls/adj/mpi/mpiadj.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/adj/mpi/mpiadj.c.html#MatMPIAdjSetPreallocation_MPIAdj">MatMPIAdjSetPreallocation_MPIAdj in src/mat/impls/adj/mpi/mpiadj.c</A><BR>


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