# MatGetInertia
Gets the inertia from a factored matrix 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatGetInertia(Mat mat, PetscInt *nneg, PetscInt *nzero, PetscInt *npos)
```
Collective


## Input Parameter

- ***mat -*** the matrix



## Output Parameters

- ***nneg -*** number of negative eigenvalues
- ***nzero -*** number of zero eigenvalues
- ***npos -*** number of positive eigenvalues





## Note
Matrix must have been factored by `MatCholeskyFactor()`


## See Also
 `Mat`, `MatGetFactor()`, `MatCholeskyFactor()`

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mumps/mumps.c.html#MatGetInertia_SBAIJMUMPS">MatGetInertia_SBAIJMUMPS in src/mat/impls/aij/mpi/mumps/mumps.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/seq/sbaijfact.c.html#MatGetInertia_SeqSBAIJ">MatGetInertia_SeqSBAIJ in src/mat/impls/sbaij/seq/sbaijfact.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)  
