MatCreateSeqAIJCRL — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# MatCreateSeqAIJCRL

Creates a sparse matrix of type `MATSEQAIJCRL`.

## Synopsis

    PetscErrorCode MatCreateSeqAIJCRL(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), ignored if `nnz` is given

- nnz - array containing the number of nonzeros in the various rows (possibly different for each row) or `NULL`

## Output Parameter

- A - the matrix

## Notes

This type inherits from `MATSEQAIJ`, but stores some additional information that is used to allow better vectorization of the matrix-vector product. At the cost of increased storage, the `MATSEQAIJ` formatted matrix can be copied to a format in which pieces of the matrix are stored in ELLPACK format, allowing the vectorized matrix multiply routine to use stride-1 memory accesses.

## See Also

Matrices, `Mat`, `MatCreate()`, `MatCreateMPIAIJPERM()`, `MatSetValues()`

## Level

intermediate

## Location

src/mat/impls/aij/seq/crl/crl.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages