SlepcSortEigenvalues — SLEPc 3.25.1 documentation

Skip to main content
`Ctrl`+`K`

# SlepcSortEigenvalues

Sorts a list of eigenvalues according to the sorting criterion specified in a `SlepcSC` context.

## Synopsis

    #include "slepcsys.h"
    PetscErrorCode SlepcSortEigenvalues(SlepcSC sc,PetscInt n,PetscScalar eigr[],PetscScalar eigi[],PetscInt perm[])

Not Collective

## Input Parameters

- sc - the sorting criterion context

- n - number of eigenvalues in the list

- eigr - pointer to the array containing the eigenvalues

- eigi - imaginary part of the eigenvalues (only when using real scalars)

## Output Parameter

- perm - permutation array, must be initialized to `0:n-1` on input

## Notes

The result is a list of indices in the original eigenvalue array corresponding to the first `n` eigenvalues sorted in the specified criterion.

In real scalars, this functions assumes that complex values come in conjugate pairs that are consecutive (including purely imaginary ones).

## See Also

`SlepcSCCompare()`, `SlepcSC`

## Level

developer

## Location

src/sys/slepcsc.c

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