# MatMPIAIJSetPreallocationCSR

Allocates memory for a sparse parallel matrix in AIJ format (the default parallel PETSc format).

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatMPIAIJSetPreallocationCSR(Mat B,const PetscInt i[],const PetscInt j[], const PetscScalar v[])

Collective on MPI_Comm

### Input Parameters

| B | - the matrix
| 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: this actually copies the values from i[], j[], and a[] to put them into PETSc's internal storage format. Thus changing the values in a[] after this call will not effect the matrix values.

### Keywords

matrix, aij, compressed row, sparse, parallel

### See Also

MatCreate(), MatCreateSeqAIJ(), MatSetValues(), MatMPIAIJSetPreallocation(), MatCreateMPIAIJ(), MPIAIJ,
MatCreateSeqAIJWithArrays(), MatCreateMPIAIJWithSplitArrays()

Level:developer
Location: src/mat/impls/aij/mpi/mpiaij.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages