MatGetInertia — PETSc 3.21.4 documentation

Skip to main content
`Ctrl`+`K`

# 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

Matrices, `Mat`, `MatGetFactor()`, `MatCholeskyFactor()`

## Level

advanced

## Location

src/mat/interface/matrix.c

## Implementations

MatGetInertia_SBAIJMUMPS() in src/mat/impls/aij/mpi/mumps/mumps.c
MatGetInertia_SuperLU_DIST() in src/mat/impls/aij/mpi/superlu_dist/superlu_dist.c
MatGetInertia_MKL_PARDISO() in src/mat/impls/aij/seq/mkl_pardiso/mkl_pardiso.c
MatGetInertia_SeqSBAIJ() in src/mat/impls/sbaij/seq/sbaijfact.c

Index of all Mat routines
Table of Contents for all manual pages
Index of all manual pages