[petsc-users] SLEPc function SlepcSortEigenvalues

Michael Povolotskyi mpovolot at purdue.edu
Tue Apr 7 14:59:15 CDT 2015

Hi, I have a related question.
I need to sort eigenvectors after the eigenvalue problem is solved.
For PETSC/SLEPC 3.4 I do the following

EPSSetEigenvalueComparison(eps, &my_sort_function, NULL);
eps->which = EPS_WHICH_USER;
ierr = EPSSortEigenvalues(eps,eps->nconv,eps->eigr,eps->eigi, eps->perm);

How should I modify the code for PETSc/SLEPc 3.5?
Thank you,

On 04/07/2015 03:42 PM, Jose E. Roman wrote:
> El 07/04/2015, a las 21:29, Daniel A Lemus escribió:
>> Hi,
>> I'm using SLEPc version 3.5.3 and it seems that EPSSortEigenvalues was replaced with SlepcSortEigenvalues in a recent release.
>> I can find very little documentation on this SlepcSortEigenvalues function and the SlepcSC argument it takes. There is also no mention of these changes in the SLEPc changes list.
>> Are there any examples on how to use this function and how to set the SlepcSC sorting criterion?
>> Thanks,
>> Daniel
> This function is intended for internal use only, not for application code, that is why it is not well documented. Here is the manpage:
> http://slepc.upv.es/documentation/current/docs/manualpages/sys/SlepcSortEigenvalues.html
> The 'sorting criterion' argument SlepcSC is used in some of the test examples of the DS auxiliary class, e.g.
> http://slepc.upv.es/documentation/current/src/sys/classes/ds/examples/tests/test1.c.html
> Basically it is a struct containing a sorting function and a mapping function, possibly with data contexts.
> This functionality is not available from Fortran.
> Jose

More information about the petsc-users mailing list