# KSPGetResidualHistory

Gets the array used to hold the residual history and the number of residuals it contains.

### Synopsis

    #include "petscksp.h"
    PetscErrorCode PETSCKSP_DLLEXPORT KSPGetResidualHistory(KSP ksp,PetscReal *a[],PetscInt *na)

Not Collective

### Input Parameter

ksp -iterative context obtained from KSPCreate()

### Output Parameters

| a | - pointer to array to hold history (or PETSC_NULL)
| na | - number of used entries in a (or PETSC_NULL)

### Notes

Can only be called after a KSPSetResidualHistory() otherwise a and na are set to zero

The Fortran version of this routine has a calling sequence

      call KSPGetResidualHistory(KSP ksp, integer na, integer ierr)

### Keywords

KSP, get, residual, history, norm

### See Also

KSPGetResidualHistory()

Level:advanced
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/snes/examples/tutorials/ex6.c.html