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

Dense Matrix Into CRS Format (For Pardiso)

michaelmoc
Beginner
1,638 Views

Hello!

I was searching for any routine in mkl to compress a dense matrix (stored in vector) into CRS form

used by PARDISO. Does anybody know such routine ?

Thanks for help.

0 Kudos
6 Replies
ArturGuzik
Valued Contributor I
1,638 Views

I'm not aware of any (although I admit, I don't fully understand/know your dense matrix format). The MKL available routines are listed in Sparse BLAS Level 2 and Level 3 Routines Section. Table below.

A.

Matrix converters

 

mkl_ddnscsr

Converts a sparse matrix in the dense representation to the CSR format (3-array variation).

mkl_dcsrcoo

Converts a sparse matrix in the CSR format (3-array variation) to the coordinate format and vice versa.

mkl_dcsrbsr

Converts a sparse matrix in the CSR format to the BSR format (3-array variations) and vice versa.

mkl_dcsrcsc

Converts a sparse matrix in the CSR format to the CSC and vice versa (3-array variations).

mkl_dcsrdia

Converts a sparse matrix in the CSR format (3-array variation) to the diagonal format and vice versa.

mkl_dcsrsky

Converts a sparse matrix in the CSR format (3-array variation) to the sky line format and vice versa.

0 Kudos
michaelmoc
Beginner
1,638 Views
My format is that the whole matrix is defined in 1 dimensional array. (I know its size so i am able to simulate 2D behavior). And i want such matrix convert to PARDISO format, which is CRS.
0 Kudos
Alexander_K_Intel2
1,638 Views

Hi,

If your store all elements of matrixconsistently column by column and want to call Pardiso for unsymmetric matrix you don't need any converters.To call pardiso you need 3 arrays: values, columns and row index. Values is yourvector, columns is array of n*n elements ={1,2,...,n,1,2,..,n,1,2,...n} and rowindexs is array of n+1 elemnts ={1,n+1,2n+1,..,n*n+1}, where n is size of matrix. So you need to create only two arrays in way I described before and after you could use Pardiso for unsymmetric matrix.

With best regards,

Alexander Kalinkin

0 Kudos
Gennady_F_Intel
Moderator
1,638 Views

Michael,

I still believe that the most appropriate for you method is using mkl_ddnscsr function to convert from dense to CSR ( not CRS -:) ) format. Especially if you know the sizes of your matrixes.

--Gennady

0 Kudos
michaelmoc
Beginner
1,638 Views

Gennady!

From what i know PARDISO is running on CRS storage format (http://netlib.org/linalg/html_templates/node91.html) . And thus i can't use CSR. (If i am wrong please correct me, i will gladly use CSR :) ).

Alexander

That is a nice idea but how about performance. It will probably be hit.

Although i will try it :). Thanks.

0 Kudos
michaelmoc
Beginner
1,638 Views

Hello Gennady.

I have read once again CSR method compression documentation and i have noticed 3 array variation of this compression. This is what i really need :). Thank You for pointing this out.

Michael.

0 Kudos
Reply