# MatBDiagGetData

Gets the data for the block diagonal matrix format. For the parallel case, this returns information for the local submatrix.

### Synopsis

    PetscErrorCode PETSCMAT_DLLEXPORT MatBDiagGetData(Mat mat,PetscInt *nd,PetscInt *bs,PetscInt *diag[],PetscInt *bdlen[],PetscScalar ***diagv)

### Input Parameters

mat -the matrix, stored in block diagonal format.

Not Collective

### Output Parameters

| m | - number of rows
| n | - number of columns
| nd | - number of block diagonals
| bs | - each element of a diagonal is an bs x bs dense matrix
| bdlen | - array of total block lengths of block diagonals
| diag | - optional array of block diagonal numbers (length nd). For a matrix element A[i,j], where i=row and j=column, the diagonal number is

        diag = i/bs - j/bs  (integer division)

Set diag=PETSC_NULL on input for PETSc to dynamically allocate memory as needed (expensive).
| diagv | - pointer to actual diagonals (in same order as diag array),

### Notes

See the users manual for further details regarding this storage format.

### Keywords

matrix, block, diagonal, get, data

### See Also

MatCreateSeqBDiag(), MatCreateMPIBDiag()

Level:advanced
Location: src/mat/impls/bdiag/mpi/mpibdiag.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages