slepc-3.12.2 2020-01-13
Report Typos and Errors

# PEPSetStoppingTestFunction

Sets a function to decide when to stop the outer iteration of the eigensolver.

### Synopsis

    #include "slepcpep.h"
    PetscErrorCode PEPSetStoppingTestFunction(PEP pep,PetscErrorCode (*func)(PEP,PetscInt,PetscInt,PetscInt,PetscInt,PEPConvergedReason*,void*),void* ctx,PetscErrorCode (*destroy)(void*))

Logically Collective on pep

### Input Parameters

| pep | - eigensolver context obtained from PEPCreate()
| func | - pointer to the stopping test function
| ctx | - context for private data for the stopping routine (may be null)
| destroy | - a routine for destroying the context (may be null)

### Calling Sequence of func

      func(PEP pep,PetscInt its,PetscInt max_it,PetscInt nconv,PetscInt nev,PEPConvergedReason *reason,void *ctx)

| pep | - eigensolver context obtained from PEPCreate()
| its | - current number of iterations
| max_it | - maximum number of iterations
| nconv | - number of currently converged eigenpairs
| nev | - number of requested eigenpairs
| reason | - (output) result of the stopping test
| ctx | - optional context, as set by PEPSetStoppingTestFunction()

### Note

Normal usage is to first call the default routine PEPStoppingBasic() and then set reason to PEP_CONVERGED_USER if some user-defined conditions have been met. To let the eigensolver continue iterating, the result must be left as PEP_CONVERGED_ITERATING.

### See Also

PEPSetStoppingTest(), PEPStoppingBasic()

Location: src/pep/interface/pepopts.c
Index of all PEP routines
Table of Contents for all manual pages
Index of all manual pages