# MatCreateSeqAIJWithArrays

Creates an sequential AIJ matrix using matrix elements (in CSR format) provided by the user.

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatCreateSeqAIJWithArrays(MPI_Comm comm,PetscInt m,PetscInt n,PetscInt* i,PetscInt*j,PetscScalar *a,Mat *mat)

Coolective on MPI_Comm

### Input Parameters

| comm | - must be an MPI communicator of size 1
| m | - number of rows
| n | - number of columns
| i | - row indices
| j | - column indices
| a | - matrix values

### Output Parameter

mat -the matrix

### Notes

The i, j, and a arrays are not copied by this routine, the user must free these arrays once the matrix is destroyed

You cannot set new nonzero locations into this matrix, that will generate an error.

The i and j indices are 0 based

### See Also

MatCreate(), MatCreateMPIAIJ(), MatCreateSeqAIJ()

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