# MatSetUnfactored
Resets a factored matrix to be treated as unfactored. 
## Synopsis
```
#include "petscmat.h" 
PetscErrorCode MatSetUnfactored(Mat mat)
```
Logically Collective on mat


## Input Parameter

- ***mat -*** the factored matrix to be reset



## Notes
This routine should be used only with factored matrices formed by in-place
factorization via ILU(0) (or by in-place LU factorization for the `MATSEQDENSE`
format).  This option can save memory, for example, when solving nonlinear
systems with a matrix-free Newton-Krylov method and a matrix-based, in-place
ILU(0) preconditioner.

Note that one can specify in-place ILU(0) factorization by calling
```none
     PCType(pc,PCILU);
     PCFactorSeUseInPlace(pc);
```

or by using the options -pc_type ilu -pc_factor_in_place

In-place factorization ILU(0) can also be used as a local
solver for the blocks within the block Jacobi or additive Schwarz
methods (runtime option: -sub_pc_factor_in_place).  See Users-Manual: ch_pc
for details on setting local solver options.

Most users should employ the `KSP` interface for linear solvers
instead of working directly with matrix algebra routines such as this.
See, e.g., `KSPCreate()`.




## See Also
 `PCFactorSetUseInPlace()`, `PCFactorGetUseInPlace()`

## Level
developer

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/aij/mpi/mpiaij.c.html#MatSetUnfactored_MPIAIJ">MatSetUnfactored_MPIAIJ in src/mat/impls/aij/mpi/mpiaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/baij/mpi/mpibaij.c.html#MatSetUnfactored_MPIBAIJ">MatSetUnfactored_MPIBAIJ in src/mat/impls/baij/mpi/mpibaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sbaij/mpi/mpisbaij.c.html#MatSetUnfactored_MPISBAIJ">MatSetUnfactored_MPISBAIJ in src/mat/impls/sbaij/mpi/mpisbaij.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/mat/impls/sell/mpi/mpisell.c.html#MatSetUnfactored_MPISELL">MatSetUnfactored_MPISELL in src/mat/impls/sell/mpi/mpisell.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)  
