#include "petscmat.h" PetscErrorCode MatGetRowIJ(Mat mat,PetscInt shift,PetscBool symmetric,PetscBool inodecompressed,PetscInt *n,const PetscInt *ia[],const PetscInt *ja[],PetscBool *done)Collective on Mat
mat | - the matrix | |
shift | - 0 or 1 indicating we want the indices starting at 0 or 1 | |
symmetric | - PETSC_TRUE or PETSC_FALSE indicating the matrix data structure should be symmetrized | |
inodecompressed | - PETSC_TRUE or PETSC_FALSE indicating if the nonzero structure of the inodes or the nonzero elements is wanted. For BAIJ matrices the compressed version is always used. |
n | - number of rows in the (possibly compressed) matrix | |
ia | - the row pointers [of length n+1] | |
ja | - the column indices | |
done | - indicates if the routine actually worked and returned appropriate ia[] and ja[] arrays; callers are responsible for handling the case when done == PETSC_FALSE and ia and ja are not set |
Use MatRestoreRowIJ() when you are finished accessing the ia[] and ja[] values.
PetscInt ia(1), ja(1)
PetscOffset iia, jja
call MatGetRowIJ(mat,shift,symmetric,inodecompressed,n,ia,iia,ja,jja,done,ierr)
! Access the ith and jth entries via ia(iia + i) and ja(jja + j)
or
PetscInt, pointer :: ia(:),ja(:)
call MatGetRowIJF90(mat,shift,symmetric,inodecompressed,n,ia,ja,done,ierr)
! Access the ith and jth entries via ia(i) and ja(j)