:orphan:
# MatCreateSeqSELL
Creates a sparse matrix in `MATSEQSELL` format. 
## Synopsis
```
#include "petscmat.h"  
PetscErrorCode MatCreateSeqSELL(MPI_Comm comm, PetscInt m, PetscInt n, PetscInt rlenmax, const PetscInt rlen[], Mat *A)
```
Collective


## Input Parameters

- ***comm -*** MPI communicator, set to `PETSC_COMM_SELF`
- ***m -*** number of rows
- ***n -*** number of columns
- ***rlenmax -*** maximum number of nonzeros in a row, ignored if `rlen` is provided
- ***rlen -*** array containing the number of nonzeros in the various rows (possibly different for each row) or NULL



## Output Parameter

- ***A -*** the matrix





## Notes
It is recommended that one use the `MatCreate()`, `MatSetType()` and/or `MatSetFromOptions()`,
MatXXXXSetPreallocation() paradigm instead of this routine directly.
[MatXXXXSetPreallocation() is, for example, `MatSeqSELLSetPreallocation()`]

Specify the preallocated storage with either `rlenmax` or `rlen` (not both).
Set `rlenmax` = `PETSC_DEFAULT` and `rlen` = `NULL` for PETSc to control dynamic memory
allocation.


## See Also
 `Mat`, `MATSEQSELL`, `MatCreate()`, `MatCreateSELL()`, `MatSetValues()`, `MatSeqSELLSetPreallocation()`, `MATSELL`, `MATSEQSELL`, `MATMPISELL`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sell/seq/sell.c.html#MatCreateSeqSELL">src/mat/impls/sell/seq/sell.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/impls/sell/seq/sell.c)


[Index of all Mat routines](index.md)  
[Table of Contents for all manual pages](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
