# PCFactorSetUseInPlace
Tells the system to do an in-place factorization. For dense matrices, this enables the solution of much larger problems. For sparse matrices the factorization cannot be done truly in-place so this does not save memory during the factorization, but after the matrix is factored, the original unfactored matrix is freed, thus recovering that space. For ICC(0) and ILU(0) with the default natural ordering the factorization is done efficiently in-place. 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCFactorSetUseInPlace(PC pc, PetscBool flg)
```
Logically Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***flg -*** `PETSC_TRUE` to enable, `PETSC_FALSE` to disable



## Options Database Key

- ***-pc_factor_in_place <true,false>-*** Activate/deactivate in-place factorization



## Note
`PCFactorSetUseInplace()` can only be used with the `KSP` method `KSPPREONLY` or when
a different matrix is provided for the multiply and the preconditioner in
a call to `KSPSetOperators()`.
This is because the Krylov space methods require an application of the
matrix multiplication, which is not possible here because the matrix has
been factored in-place, replacing the original matrix.




## See Also
 `PCLU`, `PCCHOLESKY`, `PCILU`, `PCICC`, `PCFactorGetUseInPlace()`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/impls/factor/factor.c.html#PCFactorSetUseInPlace_Factor">PCFactorSetUseInPlace_Factor in src/ksp/pc/impls/factor/factor.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)  
