- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

I am trying to use the dsytrd/dorg function to calculate the eigenvalues and eigen vectors for a symmetric matrix. For some reason (probably my incorrect way of calling them), it does not seem to do the job. All the results are wrong. This is a very simple code snipet using the dsytrd to do the tridiagonal decomposition. The output in array d (for the eigenvalues) is completely wrong.

Any help appreciated.

John

**double[] a = new double[] { 1, 2, 2, 1 };double[] d = new double[2];double[] e = new double[2];double[] tau = new double[2];unsafe{ fixed (double* pa = a, pd = d, pe = e, ptau = tau) { int info = LAPACKE_dsytrd(LAPACK_ROW_MAJOR, 'L', 2, pa, 2, pd, pe, ptau); }}**

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Reminder:

Has the solution provided helped.

If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue. Thank you!

Best Regards,

Shanmukh.SS

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

May I kindly suggest that:

1. You consider using Pardiso and feast

2. @mecej4 very kindly set up PARDISO and feast to solve this type of problem for me, (I could not get the packing to work) in a program called Lothuur - Norse God.

It works. You will need to pull out the bits you need, but it is pretty modular.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Thanks for reaching out to us.

Kindly share us the complete reproducer, so that we could troubleshoot the issue from end.

In addition, for your information, Below function is used to reduce a real symmetric matrix to tridiagonal form. (Attaching the developer link for your reference)

lapack_int LAPACKE_dsytrd (int matrix_layout, char uplo, lapack_int n, double* a, lapack_int lda, double* d, double* e, double* tau);

To compute all eigenvalues and optionally, to compute all eigenvectors of a real symmetric matrix using divide and conquer algorithm below function is used. (Attaching the developer reference link for your reference)

lapack_int LAPACKE_dsyevd (int matrix_layout, char jobz, char uplo, lapack_int n, double* a, lapack_int lda, double* w);

Besides this, you can refer to examples over path C:\Program Files (x86)\Intel\oneAPI\mkl\latest\examples\examples_core_c.zip\c\lapack\source\

Best Regards,

Shanmukh.SS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Reminder:

Has the solution provided helped? Is your issue resolved? Please let us know if the issue still persists.

Best Regards,

Shanmukh.SS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Many thanks for the reply. I did try LAPACKE_dsyevd and it works!. I didn't know there were two categories of functions, computational routines and driver routines. The latter is probably is more suitable for my application. But I have not got the computational routine working (see the beginning of the post). My understanding is that after the decomposition into tridiagonal matrix, the results stored in array 'd' should be the eigenvalues. But in my case, it is not.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

To further explain the problem I have, I have attached a screenshot. Basically, I tried to decompose a very simple symmetric matrix

[1, 2]

[2, 1]

The eigenvalues should be 3 and -1. But as you see in the screenshot, after calling the function, I get 1 and 1 in the d array.

Please let me know if there is any wrong with the way I called the function. Thanks.

John

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

To find all eigenvalues of a tridiagonal matrix T, you could use the function "sterf" which computes all eigenvalues of a real symmetric tridiagonal matrix using QR algorithm.

Attached the links for your reference.

sterf functionality:

Symmetric Eigenvalue Problems: LAPACK Computational Routines:

The eigenvalues should be 3 and -1. But as you see in the screenshot, after calling the function, I get 1 and 1 in the d array.

>> As per the sytrd functionality, d contains the diagonal elements of the matrix T which is the same as output provided by you.

To further clarify the significance of each parameter, attaching the reference link for "sytrd" functionality which reduces a real symmetric matrix to tridiagonal form.

Best Regards,

Shanmukh.SS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Reminder:

Has the solution provided helped.

If this resolves your issue, make sure to accept this as a solution. This would help others with similar issue. Thank you!

Best Regards,

Shanmukh.SS

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi,

Thanks for accepting our solution. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel.

Best Regards,

Shanmukh.SS

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page