#include "slepceps.h" PetscErrorCode EPSSetArbitrarySelection(EPS eps,SlepcArbitrarySelectionFn *func,void* ctx)Logically Collective
eps | - eigensolver context obtained from EPSCreate() | |
func | - the arbitrary selection function, see SlepcArbitrarySelectionFn for a calling sequence | |
ctx | - a context pointer (the last parameter to the arbitrary selection function) |
For instance, suppose you want to compute those eigenvectors that maximize a certain computable expression. Then implement the computation using the arguments xr and xi, and return the result in rr. Then set the standard sorting by magnitude so that the eigenpair with largest value of rr is selected.
This evaluation function is collective, that is, all processes call it and it can use collective operations; furthermore, the computed result must be the same in all processes.
The result of func is expressed as a complex number so that it is possible to use the standard eigenvalue sorting functions, but normally only rr is used. Set ri to zero unless it is meaningful in your application.