Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
6834 Discussions

## MKL ?trexc function Beginner
281 Views

Good day to all.

I am a student. I'm doing matrix calculations.

There was a problem with using the ?trexc function of MKL that makes the reordering of Schur factorization

In particular, with it's two last parameters: lapack_int* ifst, lapack_int* ilst.

I can't understand, how to makes this reordering step by step.

For example: I have the eigenvalues of matrix after Schur reordering: {198, 59, -47, -147}.

Then, after function ?trexc with parameters ifst = {4, 3, 2, 1}, ilst = {1, 2, 3, 4}  I have the following reordering of EV:

{-147, 198, 59, -47}.

At first I thought, that i-st element of ifst become i-st element of ilst . By this logic it must be follows:

{198, 59, -47, -147}  --->  {-147, -47, 59, 198}. But after ?trexc I have: {198, 59, -47, -147}  --->  {-147, 198, 59, -47}.

In documentation written: "The element (or block) with row index ifst is moved to row ilst by a sequence of exchanges between adjacent elements (or blocks)".  But I have tried to do it, and I have wrong results again.

Best regards,

Fedor Malashin

2 Replies Employee
281 Views

Hi Fedor,

First of all, parameters IFST and ILST of ?TREXC are integer scalars (not arrays).

So in this example ?TREXC is called with IFST = 4 and ILST = 1 since it reads only one element from each of the pointers and the rest 3 elements are ignored.

Documentation says that IFST is move to ILST by adjacent exchanges like that:

Initial state:

ev1 = 198

ev2 = 59

ev3 = -47

ev4 = -147

After exchange ev4  with ev3:

ev1 = 198

ev2 = 59

ev3 = -147

ev4 = -47

After exchange ev3  with ev2:

ev1 = 198

ev2 = -147

ev3 = 59

ev4 = -47

After final exchange ev2 with ev1:

ev1 = -147

ev2 = 198

ev3 = 59

ev4 = -47

that is why the output is like  {-147, 198, 59, -47}.

Best Regards,

Ying Beginner
281 Views

Hi, Ying. 