# KSPGetInitialGuessNonzero
Determines whether the `KSP` solver is using a zero initial guess. 
## Synopsis
```
#include "petscksp.h" 
#include "petscmat.h" 
PetscErrorCode KSPGetInitialGuessNonzero(KSP ksp, PetscBool *flag)
```
Not Collective


## Input Parameter

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



## Output Parameter

- ***flag -*** `PETSC_TRUE` if guess is nonzero, else `PETSC_FALSE`





## See Also
 [](chapter_ksp), `KSPSetInitialGuessNonzero()`, `KSP`

## Level
intermediate

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