:orphan:
# MatMissingDiagonal
Determine if sparse matrix is missing a diagonal entry (or block entry for `MATBAIJ` and `MATSBAIJ` matrices)
## Synopsis
```
#include "petscmat.h"
PetscErrorCode MatMissingDiagonal(Mat mat, PetscBool *missing, PetscInt *dd)
```
Not Collective
## Input Parameter
- ***mat -*** the matrix
## Output Parameters
- ***missing -*** is any diagonal missing
- ***dd -*** first diagonal entry that is missing (optional) on this process
## See Also
[](ch_matrices), `Mat`
## Level
advanced
## Location
src/mat/interface/matrix.c
## Implementations
MatMissingDiagonal_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c
MatMissingDiagonal_SeqAIJ in src/mat/impls/aij/seq/aij.c
MatMissingDiagonal_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c
MatMissingDiagonal_SeqBAIJ in src/mat/impls/baij/seq/baij.c
MatMissingDiagonal_ConstantDiagonal in src/mat/impls/cdiagonal/cdiagonal.c
MatMissingDiagonal_MPIDense in src/mat/impls/dense/mpi/mpidense.c
MatMissingDiagonal_SeqDense in src/mat/impls/dense/seq/dense.c
MatMissingDiagonal_Elemental in src/mat/impls/elemental/matelem.cxx
MatMissingDiagonal_HYPRE in src/mat/impls/hypre/mhypre.c
MatMissingDiagonal_IS in src/mat/impls/is/matis.c
MatMissingDiagonal_Nest in src/mat/impls/nest/matnest.c
MatMissingDiagonal_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c
MatMissingDiagonal_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaij.c
MatMissingDiagonal_ScaLAPACK in src/mat/impls/scalapack/matscalapack.c
MatMissingDiagonal_MPISELL in src/mat/impls/sell/mpi/mpisell.c
MatMissingDiagonal_SeqSELL in src/mat/impls/sell/seq/sell.c
MatMissingDiagonal_Shell in src/mat/impls/shell/shell.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/mat/interface/matrix.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)