# PCFactorSetMatOrderingType
Sets the ordering routine (to reduce fill) to be used in the `PCLU`, `PCCHOLESKY`, `PCILU`,  or `PCICC` preconditioners 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCFactorSetMatOrderingType(PC pc, MatOrderingType ordering)
```
Logically Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***ordering -*** the matrix ordering name, for example, `MATORDERINGND` or `MATORDERINGRCM`



## Options Database Key

- ***-pc_factor_mat_ordering_type <nd,rcm,...,external> -*** Sets ordering routine





## Notes
Nested dissection is used by default for some of PETSc's sparse matrix formats

For `PCCHOLESKY` and `PCICC` and the `MATSBAIJ` format the only reordering available is natural since only the upper half of the matrix is stored
and reordering this matrix is very expensive.

You can use a `MATSEQAIJ` matrix with Cholesky and ICC and use any ordering.

`MATORDERINGEXTERNAL` means PETSc will not compute an ordering and the package will use its own ordering, usable with `MATSOLVERCHOLMOD`, `MATSOLVERUMFPACK`, and others.


## See Also
 `PCLU`, `PCCHOLESKY`, `PCILU`, `PCICC`, `MatOrderingType`, `MATORDERINGEXTERNAL`, `MATORDERINGND`, `MATORDERINGRCM`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/factor.c.html#PCFactorSetMatOrderingType">src/ksp/pc/impls/factor/factor.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/factimpl.c.html#PCFactorSetMatOrderingType_Factor">PCFactorSetMatOrderingType_Factor in src/ksp/pc/impls/factor/factimpl.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/pc/impls/factor/factor.c)


[Index of all PC routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
