Get the CSR arrays and the memory type of the MATSEQAIJ matrix


#include "petscmat.h" 
PetscErrorCode MatSeqAIJGetCSRAndMemType(Mat mat, const PetscInt **i, const PetscInt **j, PetscScalar **a, PetscMemType *mtype)

Not Collective; No Fortran Support

Input Parameter#

  • mat - a matrix of type MATSEQAIJ or its subclasses

Output Parameters#

  • i - row map array of the matrix

  • j - column index array of the matrix

  • a - data array of the matrix

  • mtype - memory type of the arrays


Any of the output parameters can be NULL, in which case the corresponding value is not returned. If mat is a device matrix, the arrays are on the device. Otherwise, they are on the host.

One can call this routine on a preallocated but not assembled matrix to just get the memory of the CSR underneath the matrix. If the matrix is assembled, the data array a is guaranteed to have the latest values of the matrix.

See Also#

Matrices, Mat, MatSeqAIJGetArray(), MatSeqAIJGetArrayRead()






MatSeqAIJGetCSRAndMemType_SeqAIJKokkos() in src/mat/impls/aij/seq/kokkos/aijkok.kokkos.cxx
MatSeqAIJGetCSRAndMemType_SeqAIJCUSPARSE() in src/mat/impls/aij/seq/seqcusparse/
MatSeqAIJGetCSRAndMemType_SeqAIJHIPSPARSE() in src/mat/impls/aij/seq/seqhipsparse/aijhipsparse.hip.c

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