# MatCreateSeqAIJSELL
Creates a sparse matrix of type `MATSEQAIJSELL`. This type inherits from AIJ and is largely identical, but keeps a "shadow" copy of the matrix in `MATSEQSELL` format, which is used when this format may be more suitable for a requested operation. Currently, `MATSEQSELL` format is used for `MatMult()`, `MatMultTranspose()`, `MatMultAdd()`, `MatMultTransposeAdd()`, and `MatSOR()` operations. 
## Synopsis
```
PetscErrorCode MatCreateSeqAIJSELL(MPI_Comm comm, PetscInt m, PetscInt n, PetscInt nz, const PetscInt nnz[], Mat *A)
```
Collective


## Input Parameters

- ***comm -*** MPI communicator, set to `PETSC_COMM_SELF`
- ***m -*** number of rows
- ***n -*** number of columns
- ***nz -*** number of nonzeros per row (same for all rows)
- ***nnz -*** array containing the number of nonzeros in the various rows
(possibly different for each row) or NULL



## Output Parameter

- ***A -*** the matrix



## Options Database Keys

- ***-mat_aijsell_eager_shadow -*** Construct shadow matrix upon matrix assembly; default is to take a "lazy" approach, performing this step the first time the matrix is applied



## Notes
If nnz is given then nz is ignored

Because `MATSEQAIJSELL is a subtype of `MATSEQAIJ`, the option "-mat_seqaij_type seqaijsell" can be used to make
sequential `MATSEAIJ` matrices default to being instances of `MATSEQAIJSELL`.




## See Also
 `MatCreate()`, `MatCreateMPIAIJSELL()`, `MatSetValues()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/aijsell/aijsell.c.html#MatCreateSeqAIJSELL">src/mat/impls/aij/seq/aijsell/aijsell.c</A>


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