# KSPMonitorSingularValue
Prints the two norm of the true residual and estimation of the extreme singular values of the preconditioned problem at each iteration. 
## Synopsis
```
#include "petscksp.h" 
PetscErrorCode KSPMonitorSingularValue(KSP ksp, PetscInt n, PetscReal rnorm, PetscViewerAndFormat *vf)
```
Logically Collective


## Input Parameters

- ***ksp   -*** the iterative context
- ***n     -*** the iteration
- ***rnorm -*** the two norm of the residual
- ***vf    -*** The viewer context



## Options Database Key

- ***-ksp_monitor_singular_value -*** Activates `KSPMonitorSingularValue()`





## Notes
The `KSPCG` solver uses the Lanczos technique for eigenvalue computation,
while `KSPGMRES` uses the Arnoldi technique; other iterative methods do
not currently compute singular values.

This is not called directly by users, rather one calls `KSPMonitorSet()`, with this function as an argument, to cause the monitor
to be used during the `KSP` solve.

Call `KSPMonitorSingularValueCreate()` to create the context needed by this monitor


## See Also
 [](chapter_ksp), `KSP`, `KSPMonitorSet()`, `KSPComputeExtremeSingularValues()`, `KSPMonitorSingularValueCreate()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex30.c.html">src/snes/tutorials/ex30.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ksp/ksp/interface/iterativ.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)  
