# PCFactorSetShiftType
adds a particular type of quantity to the diagonal of the matrix during numerical factorization, thus the matrix has nonzero pivots 
## Synopsis
```
#include "petscpc.h" 
PetscErrorCode PCFactorSetShiftType(PC pc, MatFactorShiftType shifttype)
```
Logically Collective


## Input Parameters

- ***pc -*** the preconditioner context
- ***shifttype -*** type of shift; one of `MAT_SHIFT_NONE`, `MAT_SHIFT_NONZERO`, `MAT_SHIFT_POSITIVE_DEFINITE`, `MAT_SHIFT_INBLOCKS`



## Options Database Key

- ***-pc_factor_shift_type <shifttype> -*** Sets shift type; use '-help' for a list of available types





## See Also
 `PCCHOLESKY`, `PCLU`, `PCFactorSetZeroPivot()`, `PCFactorSetShiftAmount()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/tutorials/ex1.c.html">src/ksp/pc/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/pc/tutorials/ex2.c.html">src/ksp/pc/tutorials/ex2.c.html</A><BR>

## Implementations

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