EPSGetEigenpair — SLEPc 3.25.1 documentation

Skip to main content
`Ctrl`+`K`

# EPSGetEigenpair

Gets the `i`-th solution of the eigenproblem as computed by `EPSSolve()`. The solution consists in both the eigenvalue and the eigenvector.

## Synopsis

    #include "slepceps.h"
    PetscErrorCode EPSGetEigenpair(EPS eps,PetscInt i,PetscScalar *eigr,PetscScalar *eigi,Vec Vr,Vec Vi)

Collective

## Input Parameters

- eps - the linear eigensolver context

- i - index of the solution

## Output Parameters

- eigr - real part of eigenvalue

- eigi - imaginary part of eigenvalue

- Vr - real part of eigenvector

- Vi - imaginary part of eigenvector

## Notes

It is allowed to pass `NULL` for `Vr` and `Vi`, if the eigenvector is not required. Otherwise, the caller must provide valid `Vec` objects, i.e., they must be created by the calling program with e.g. `MatCreateVecs()`.

If the eigenvalue is real, then `eigi` and `Vi` are set to zero. If PETSc is configured with complex scalars the eigenvalue is stored directly in `eigr` (`eigi` is set to zero) and the eigenvector in `Vr` (`Vi` is set to zero). In both cases, the user can pass `NULL` in `eigi` and `Vi`.

The index `i` should be a value between 0 and `nconv`-1 (see `EPSGetConverged()`). Eigenpairs are indexed according to the ordering criterion established with `EPSSetWhichEigenpairs()`.

The 2-norm of the eigenvector is one unless the problem is generalized Hermitian. In this case the eigenvector is normalized with respect to the norm defined by the \(B\) matrix.

In case of structured eigenproblems such as `EPS_BSE`, see the discussion about Extracting Eigenvectors of Structured Eigenproblems.

## See Also

EPS: Eigenvalue Problem Solver, `EPSGetEigenvalue()`, `EPSGetEigenvector()`, `EPSGetLeftEigenvector()`, `EPSSolve()`, `EPSGetConverged()`, `EPSSetWhichEigenpairs()`, `EPSGetInvariantSubspace()`

## Level

beginner

## Location

src/eps/interface/epssolve.c

## Examples

src/eps/tutorials/ex24.c
src/eps/tutorials/ex19.c
src/eps/tutorials/ex34.c
src/eps/tutorials/ex1.c
src/eps/tutorials/ex31.c
src/eps/tutorials/ex41.c

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