# KSPSetDiagonalScaleFix
Tells `KSP` to diagonally scale the system back after solving. 
## Synopsis
```
#include "petscksp.h" 
#include "petscmat.h" 
PetscErrorCode KSPSetDiagonalScaleFix(KSP ksp, PetscBool fix)
```
Logically Collective


## Input Parameters

- ***ksp -*** the `KSP` context
- ***fix -*** `PETSC_TRUE` to scale back after the system solve, `PETSC_FALSE` to not
rescale (default)



## Notes
Must be called after `KSPSetDiagonalScale()`

Using this will slow things down, because it rescales the matrix before and
after each linear solve. This is intended mainly for testing to allow one
to easily get back the original system to make sure the solution computed is
accurate enough.




## See Also
 [](chapter_ksp), `KSPGetDiagonalScale()`, `KSPSetDiagonalScale()`, `KSPGetDiagonalScaleFix()`, `KSP`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/itfunc.c.html#KSPSetDiagonalScaleFix">src/ksp/ksp/interface/itfunc.c</A>


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


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