# KSPGetComputeEigenvalues
Gets the flag indicating that the extreme eigenvalues values will be calculated via a Lanczos or Arnoldi process as the linear system is solved. 
## Synopsis
```
#include "petscksp.h" 
#include "petscmat.h" 
PetscErrorCode KSPGetComputeEigenvalues(KSP ksp, PetscBool *flg)
```
Not Collective


## Input Parameter

- ***ksp -*** iterative context obtained from `KSPCreate()`



## Output Parameter

- ***flg -*** `PETSC_TRUE` or `PETSC_FALSE`



## Notes
Currently this option is not valid for all iterative methods.




## See Also
 [](chapter_ksp), `KSPComputeEigenvalues()`, `KSPComputeEigenvaluesExplicitly()`, `KSP`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/interface/itfunc.c.html#KSPGetComputeEigenvalues">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)  
