[petsc-users] SLEPc mantain eigenvalue/eigenvector ordering compatible with problem matrix

Jose E. Roman jroman at dsic.upv.es
Wed Jul 11 06:16:54 CDT 2012


El 11/07/2012, a las 13:05, Alessio Cardillo escribió:

> Hello to all,
> 
> I am using SLEPc library to solve an eigenvalue problem using the lapack solver.
> 
> the solver works fine (both eigenvalue and eigenvectors are correct)
> but the order in which solutions are given is different from the
> original one.
> 
> My problem is:
> 
> I need to retrieve the pair (eigenvalue + eigenvector) with the same
> order as the original problem matrix OR I need to get the problem
> matrix in the same order as the solution pairs.
> 
> For the sake of clarity, below I report an example of what I mean:
> 
> Cheers,
> 
> Alessio
> 
> 
> 
> COEFFICIENT MATRIX:
> 
> 1  0  0
> 0  2  0
> 0  0  3
> 
> ##### EXPECTED SOLUTION ######
> 
> 1.000 0.000 0.000
> 0.000 1.000 0.000
> 0.000 0.000 1.000
> 
> with eigenvalues
> 
> 1.000   2.000  3.000
> 
> ###### REAL SOLUTION ######
> 
> EIGENVECTOR MATRIX (row ordered)
> 
> 0.000 0.000 1.000
> 0.000 1.000 0.000
> 1.000 0.000 0.000
> 
> EIGENVALUES
> 
> 3.000
> 2.000
> 1.000

The ordering can be selected via EPSSetWhichEigenpairs, but the concept of "the same order as the original problem matrix" is not available because that only makes sense if the matrix is already in diagonal or triangular form. Maybe you want to call LAPACKtrevc directly.

Jose



More information about the petsc-users mailing list