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

## mkl_sparse_?_ev and mkl_sparse_?_gv, the eigenvalues obtained by the solution are incorrect

Beginner
1,165 Views

HI

I use mkl_sparse_d_ev and mkl_sparse_d_gv to solve the eigenvalues, I tested 10000*10000 matrix, got perfect result output, and got validation of the result.
In my actual use, I have not used such a large matrix to calculate the generalized eigenvalue problem of a 462*462 matrix. The eigenvalues solved are very strange. I use the code for testing large sparse matrices, and there is no problem. Using the same code for small sparse matrices, the calculated results are wrong. Even I solve the eigenvalue problem of diagonal matrices. The result obtained is also not the value of the diagonal.

The two matrices are the stiffness matrix and the mass matrix generated by the finite element. The mass matrix imposes a consistent mass concentration, so it is a diagonal matrix, and I also did not get good results using the eigenvalues of solving the mass matrix.

Below is the test code for my problem, please what is the problem.

8 Replies
Moderator
1,112 Views

Hi,

Thank you for posting on Intel Communities and sharing the project files.

Could you please let us know the actual vs expected results in your case. In addition, please refer to mkl_sparse_d_ev.c example under below path for details regarding the usage of mkl_sparse_d_ev.

Best Regards,

Shanmukh.SS

Beginner
1,094 Views

Thank you very much for your help, there is a zm.txt file in the testcase, where xm.txt ym.txt zm.txt is the diagonal matrix I want to solve, because it is a diagonal matrix, so the eigenvalues should be consistent with zm.txt , but what I solve is obviously inconsistent. I am using Intel Sequential and the code is modified from the example code.
The sample codes are all full matrices. If I want to deal with a symmetric matrix with only upper triangular data, what parameters should I set?

Moderator
1,056 Views

Hi,

>>The sample codes are all full matrices. If I want to deal with a symmetric matrix with only upper triangular data, what parameters should I set?

Below are the input parameters to be used.

Input Parameters:

Parameter    : sparse_matrix_type_t type

Significance : Specifies the type of a sparse matrix

SPARSE_MATRIX_TYPE_SYMMETRIC to be used for the matrix for symmetric matrix (only the requested triangle is processed).

Parameter    : sparse_fill_mode_t mode

Significance : Specifies the triangular matrix part for symmetric, Hermitian, triangular, and block-triangular matrices

SPARSE_FILL_MODE_UPPER to be used for upper triangular data.

For more details regarding the other parameters and functionality of mkl_sparse_?_ev, Kindly refer to below link.

https://www.intel.com/content/www/us/en/develop/documentation/onemkl-developer-reference-c/top/extended-eigensolver-routines/extended-eigensolver-interfaces/ext-eigensolve-ifaces-find-large-small-eigenvalues/mkl-sparse-ev.html

Best Regards,

Shanmukh.SS

Moderator
1,033 Views

Hi,

Reminder:

Has the information provided helped? Is your issue resolved? Kindly let us know if we could close this thread at our end.

Best Regards,

Shanmukh.SS

Beginner
1,009 Views

I didn't solve the problem, he calculated it was still inaccurate, I couldn't find out where the problem was.

Moderator
981 Views

Hi,

We have tried compiling and executing the shared project file and attached the console output with this thread.

Could you please let know the expected output in this case as it would help us in investigating the issue further.

Best Regards,

Shanmukh.SS

Moderator
937 Views

Hi,

A gentle reminder:

Has the information provided helped? Is your issue resolved?

Kindly let us know if we could close this thread at our end.

Best Regards,

Shanmukh.SS

Moderator
910 Views

Hi,

We assume that your issue is resolved. 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