Skip to main content
`Ctrl`+`K`

# EPSSetStoppingTestFunction

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

## Synopsis

    #include "slepceps.h"
    PetscErrorCode EPSSetStoppingTestFunction(EPS eps,EPSStoppingTestFn *func,PetscCtx ctx,PetscCtxDestroyFn *destroy)

Logically Collective

## Input Parameters

- eps - the linear eigensolver context

- func - stopping test function, see `EPSStoppingTestFn` for the calling sequence

- ctx - context for private data for the stopping routine (may be `NULL`)

- destroy - a routine for destroying the context (may be `NULL`), see `PetscCtxDestroyFn` for the calling sequence

## Note

When implementing a function for this, normal usage is to first call the default routine `EPSStoppingBasic()` and then set `reason` to `EPS_CONVERGED_USER` if some user-defined conditions have been met. To let the eigensolver continue iterating, the result must be left as `EPS_CONVERGED_ITERATING`.

## See Also

EPS: Eigenvalue Problem Solver, `EPSSetStoppingTest()`, `EPSStoppingBasic()`

## Level

advanced

## Location

src/eps/interface/epsopts.c

## Examples

src/eps/tutorials/ex29.c
src/eps/tutorials/ex30.c

Index of all EPS routines Table of Contents for all manual pages Index of all manual pages