# MatMPISBAIJSetPreallocationCSR
Creates a sparse parallel matrix in `MATMPISBAIJ` format using the given nonzero structure and (optional) numerical values 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatMPISBAIJSetPreallocationCSR(Mat B, PetscInt bs, const PetscInt i[], const PetscInt j[], const PetscScalar v[])
```
Collective


## Input Parameters

- ***B -*** the matrix
- ***bs -*** the block size
- ***i -*** the indices into j for the start of each local row (starts with zero)
- ***j -*** the column indices for each local row (starts with zero) these must be sorted for each row
- ***v -*** optional values in the matrix





## Notes
Though this routine has Preallocation() in the name it also sets the exact nonzero locations of the matrix entries
and usually the numerical values as well

Any entries below the diagonal are ignored


## See Also
 `MATMPISBAIJ`, `MatCreate()`, `MatCreateSeqAIJ()`, `MatSetValues()`, `MatMPIBAIJSetPreallocation()`, `MatCreateAIJ()`, `MPIAIJ`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatMPISBAIJSetPreallocationCSR">src/mat/impls/sbaij/mpi/mpisbaij.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatMPISBAIJSetPreallocationCSR_MPISBAIJ">MatMPISBAIJSetPreallocationCSR_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c</A><BR>


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