slepc-3.17.2 2022-08-09
Report Typos and Errors

# SlepcSC

Data structure (C struct) for storing information about the sorting criterion used by different eigensolver objects.

### Synopsis

    struct _n_SlepcSC {
      /* map values before sorting, typically a call to STBackTransform (mapctx=ST) */
      PetscErrorCode (*map)(PetscObject,PetscInt,PetscScalar*,PetscScalar*);
      PetscObject    mapobj;
      /* comparison function such as SlepcCompareLargestMagnitude */
      PetscErrorCode (*comparison)(PetscScalar,PetscScalar,PetscScalar,PetscScalar,PetscInt*,void*);
      void           *comparisonctx;
      /* optional region for filtering */
      RG             rg;
    };

The SlepcSC structure contains a mapping function and a comparison function (with associated contexts). The mapping function usually calls ST's backtransform.

### The comparison function must have the following calling sequence

     comparison(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, stored in comparisonctx

### Note

The returning parameter 'res' can be

| negative | - if the 1st value is preferred to the 2st one
| zero | - if both values are equally preferred
| positive | - if the 2st value is preferred to the 1st one

Fortran usage is not supported.

### See Also

SlepcSCCompare()

Location: include/slepcsc.h
Index of all sys routines
Table of Contents for all manual pages
Index of all manual pages