slepc-3.20.2 2024-03-15
Report Typos and Errors

EPSSetEigenvalueComparison

Specifies the eigenvalue comparison function when EPSSetWhichEigenpairs() is set to EPS_WHICH_USER.

Synopsis

#include "slepceps.h" 
PetscErrorCode EPSSetEigenvalueComparison(EPS eps,PetscErrorCode (*func)(PetscScalar ar,PetscScalar ai,PetscScalar br,PetscScalar bi,PetscInt *res,void *ctx),void* ctx)
Logically Collective

Input Parameters

eps  - eigensolver context obtained from EPSCreate()
func  - a pointer to the comparison function
ctx  - a context pointer (the last parameter to the comparison function)

Calling sequence of func

 PetscErrorCode func(PetscScalar ar,PetscScalar ai,PetscScalar br,PetscScalar bi,PetscInt *res,void *ctx)
ar  - real part of the 1st eigenvalue
ai  - imaginary part of the 1st eigenvalue
br  - real part of the 2nd eigenvalue
bi  - imaginary part of the 2nd eigenvalue
res  - result of comparison
ctx  - optional context, as set by EPSSetEigenvalueComparison()

Note

The returning parameter 'res' can be
negative  - if the 1st eigenvalue is preferred to the 2st one
zero  - if both eigenvalues are equally preferred
positive  - if the 2st eigenvalue is preferred to the 1st one

See Also

EPSSetWhichEigenpairs(), EPSWhich

Level

advanced

Location

src/eps/interface/epsopts.c

Examples

src/eps/tutorials/ex18.c


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