# MatGetFactorAvailable
Returns a a flag if matrix supports particular type and factor type 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatGetFactorAvailable(Mat mat, MatSolverType type, MatFactorType ftype, PetscBool *flg)
```
Not Collective


## Input Parameters

- ***mat -*** the matrix
- ***type -*** name of solver type, for example, superlu, petsc (to use PETSc's default)
- ***ftype -*** factor type, `MAT_FACTOR_LU`, `MAT_FACTOR_CHOLESKY`, `MAT_FACTOR_ICC`, `MAT_FACTOR_ILU`, `MAT_FACTOR_QR`



## Output Parameter

- ***flg -*** PETSC_TRUE if the factorization is available





## Notes
Some PETSc matrix formats have alternative solvers available that are contained in alternative packages
such as pastix, superlu, mumps etc.

PETSc must have been ./configure to use the external solver, using the option --download-package


## Developer Note
This should actually be called MatCreateFactorAvailable() since MatGetFactor() creates a new factor object


## See Also
 `Mat`, [Matrix Factorization](sec_matfactor), `MatSolverType`, `MatFactorType`, `MatGetFactor()`, `MatCopy()`, `MatDuplicate()`, `MatGetFactor()`, `MatSolverTypeRegister()`,
`MAT_FACTOR_LU`, `MAT_FACTOR_CHOLESKY`, `MAT_FACTOR_ICC`, `MAT_FACTOR_ILU`, `MAT_FACTOR_QR`

## Level
intermediate

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


---
[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)  
