# MatInvertBlockDiagonal
Inverts the block diagonal entries. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatInvertBlockDiagonal(Mat mat, const PetscScalar **values)
```
Collective on mat


## Input Parameters

- ***mat -*** the matrix



## Output Parameters

- ***values -*** the block inverses in column major order (FORTRAN-like)



## Notes
The size of the blocks is determined by the block size of the matrix.

The blocks never overlap between two MPI ranks, use `MatInvertVariableBlockEnvelope()` for that case

The blocks all have the same size, use `MatInvertVariableBlockDiagonal()` for variable block size


## Fortran Note
This routine is not available from Fortran.




## See Also
 `MatInvertVariableBlockEnvelope()`, `MatInvertBlockDiagonalMat()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/interface/matrix.c.html#MatInvertBlockDiagonal">src/mat/interface/matrix.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex74.c.html">src/ksp/ksp/tutorials/ex74.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mpiaij.c.html#MatInvertBlockDiagonal_MPIAIJ">MatInvertBlockDiagonal_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/seq/aij.c.html#MatInvertBlockDiagonal_SeqAIJ">MatInvertBlockDiagonal_SeqAIJ in src/mat/impls/aij/seq/aij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/mpi/mpibaij.c.html#MatInvertBlockDiagonal_MPIBAIJ">MatInvertBlockDiagonal_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/seq/baij.c.html#MatInvertBlockDiagonal_SeqBAIJ">MatInvertBlockDiagonal_SeqBAIJ in src/mat/impls/baij/seq/baij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/is/matis.c.html#MatInvertBlockDiagonal_IS">MatInvertBlockDiagonal_IS in src/mat/impls/is/matis.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/kaij/kaij.c.html#MatInvertBlockDiagonal_SeqKAIJ">MatInvertBlockDiagonal_SeqKAIJ in src/mat/impls/kaij/kaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/kaij/kaij.c.html#MatInvertBlockDiagonal_MPIKAIJ">MatInvertBlockDiagonal_MPIKAIJ in src/mat/impls/kaij/kaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sell/mpi/mpisell.c.html#MatInvertBlockDiagonal_MPISELL">MatInvertBlockDiagonal_MPISELL in src/mat/impls/sell/mpi/mpisell.c</A><BR>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
