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

Should the column index of CSR matrix be in strictly asending order for LU (Cholesky) decomposition?

kaihuang
Novice
1,045 Views

It seems that I must sort the column index for each row of a CSR matrix before using LU factorization, otherwise the result is wrong? Is this a requirement of the pardiso library or the bugs exist in somewhere else?

If the answer of above question is yes, then how can we keep the column index of a CSR matrix to be ascending after sparse matrix multiplication (spmm)? Or any quick way to sort each row? The cost is huge if I must sort each row of the CSR matrix with O(nnz_row^2) algorithm.

Thanks for your time.

0 Kudos
1 Solution
Spencer_P_Intel
Employee
1,029 Views

From documentation: pardiso documentation for C

"ja: For CSR3 format, array ja contains column indices of the sparse matrix A. It is important that the indices are in increasing order per row... "

 

From IE Sparse BLAS, a call to mkl_sparse_sp2m() or mkl_sparse_spmm() can be followed by a call to mkl_sparse_order() to get a sorted matrix output.

View solution in original post

0 Kudos
3 Replies
Spencer_P_Intel
Employee
1,030 Views

From documentation: pardiso documentation for C

"ja: For CSR3 format, array ja contains column indices of the sparse matrix A. It is important that the indices are in increasing order per row... "

 

From IE Sparse BLAS, a call to mkl_sparse_sp2m() or mkl_sparse_spmm() can be followed by a call to mkl_sparse_order() to get a sorted matrix output.

0 Kudos
kaihuang
Novice
983 Views

Thank you. I didn't try mkl_sparse_order() yet, instead I simply use insertion sort which costs acceptable time for my algorithm.

 

Kaihuang

 

0 Kudos
ShanmukhS_Intel
Moderator
976 Views

Hi,


It’s great to know that the issue has been resolved, in case you run into any other issues please feel free to create a new thread.


Best Regards,

Shanmukh.SS


0 Kudos
Reply