slepc-3.22.1 2024-10-28
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 */
  SlepcEigenvalueComparisonFn *comparison;
  void           *comparisonctx;
  /* optional region for filtering */
  RG             rg;
};

Notes

The SlepcSC structure contains a mapping function and a comparison function (with associated contexts). The mapping function usually calls ST's backtransform. An optional region can also be used to give higher priority to values inside it.

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

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()

Level

developer

Location

include/slepcsc.h

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