# MatGetInertia

Gets the inertia from a factored matrix

### Synopsis

    #include "petscmat.h"
    PetscErrorCode PETSCMAT_DLLEXPORT MatGetInertia(Mat mat,PetscInt *nneg,PetscInt *nzero,PetscInt *npos)

Collective on Mat

### Input Parameter

mat -the matrix

### Output Parameters

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

Notes: Matrix must have been factored by MatCholeskyFactor()

Level:advanced
Location:src/mat/interface/matrix.c
Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/examples/tutorials/ex10.c.html