:orphan:
# KSPRichardsonSetSelfScale
Sets Richardson to automatically determine optimal scaling at each iteration to minimize the 2-norm of the preconditioned residual 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPRichardsonSetSelfScale(KSP ksp, PetscBool scale)
```
Logically Collective


## Input Parameters

- ***ksp -*** the iterative context
- ***scale -*** `PETSC_TRUE` or the default of `PETSC_FALSE`



## Options Database Key

- ***-ksp_richardson_self_scale -*** Use self-scaling





## Note
Requires two extra work vectors. Uses an extra `VecAXPY()` and `VecDotNorm2()` per iteration.


## Developer Note
Could also minimize the 2-norm of the true residual with one less work vector


## See Also
 [](ch_ksp), `KSPRICHARDSON`, `KSPRichardsonSetScale()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/rich/richscale.c.html#KSPRichardsonSetSelfScale">src/ksp/ksp/impls/rich/richscale.c</A>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/impls/rich/rich.c.html#KSPRichardsonSetSelfScale_Richardson">KSPRichardsonSetSelfScale_Richardson in src/ksp/ksp/impls/rich/rich.c</A><BR>


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


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