slepc-3.7.3 2016-09-29
Report Typos and Errors

# DSSort

Sorts the result of DSSolve() according to a given sorting criterion.

### Synopsis

    #include "slepcds.h"
    PetscErrorCode DSSort(DS ds,PetscScalar *eigr,PetscScalar *eigi,PetscScalar *rr,PetscScalar *ri,PetscInt *k)

Logically Collective on DS

### Input Parameters

| ds | - the direct solver context
| eigr | - array containing the computed eigenvalues (real part)
| eigi | - array containing the computed eigenvalues (imaginary part)
| rr | - (optional) array containing auxiliary values (real part)
| ri | - (optional) array containing auxiliary values (imaginary part)

### Input/Output Parameter

| k | - (optional) number of elements in the leading group

### Notes

This routine sorts the arrays provided in eigr and eigi, and also sorts the dense system stored inside ds (assumed to be in condensed form). The sorting criterion is specified with DSSetSlepcSC().

If arrays rr and ri are provided, then a (partial) reordering based on these values rather than on the eigenvalues is performed. In symmetric problems a total order is obtained (parameter k is ignored), but otherwise the result is sorted only partially. In this latter case, it is only guaranteed that all the first k elements satisfy the comparison with any of the last n-k elements. The output value of parameter k is the final number of elements in the first set.

### See Also

DSSolve(), DSSetSlepcSC()

Location: src/sys/classes/ds/interface/dsops.c
Index of all DS routines
Table of Contents for all manual pages
Index of all manual pages