# KSPSetInitialGuessNonzero

Tells the iterative solver that the initial guess is nonzero; otherwise KSP assumes the initial guess is to be zero (and thus zeros it out before solving).

### Synopsis

    #include "petscksp.h"
    PetscErrorCode PETSCKSP_DLLEXPORT KSPSetInitialGuessNonzero(KSP ksp,PetscTruth flg)

Collective on KSP

### Input Parameters

| ksp | - iterative context obtained from KSPCreate()
| flg | - PETSC_TRUE indicates the guess is non-zero, PETSC_FALSE indicates the guess is zero

### Notes

If this is not called the X vector is zeroed in the call to KSPSolve().

### Keywords

KSP, set, initial guess, nonzero

### See Also

KSPGetInitialGuessNonzero(), KSPSetInitialGuessKnoll(), KSPGetInitialGuessKnoll()

Level:beginner
Location:src/ksp/ksp/interface/itfunc.c
Index of all KSP routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/pc/examples/tutorials/ex1.c.html
src/ksp/pc/examples/tutorials/ex2.c.html
src/ksp/examples/tutorials/ex3.c.html
src/ksp/examples/tutorials/ex9.c.html
src/ksp/examples/tutorials/ex6f.F.html