Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Petros
Beginner
191 Views

Sparse matrix coordinate to CSC conversion

Jump to solution

Hi,

I have a matrix in COO format and want to convert to CSC to be used with KLU solver from SuiteSparse. MKL comes with several converters, but I don't seem to find a mkl_?CSCCOO. Is the only way to do this is through :

mkl_dCSRCOO(...)
mkl_dCSRCSC(...)

Any faster way?

Thanks in advance, Petros.

0 Kudos
1 Solution
mecej4
Black Belt
191 Views

You may be able to skip the conversion altogether if the solver allows you to solve ATx = b in the solution phase, because the CSC representation of A is identical to the CSR representation of AT.

You can use a COO ⇒ CSR converter to do a COO ⇒ CSC conversion by interchanging the COO row and column index vectors in the call. A couple of points to consider carefully: COO data may be in arbitrary order, whereas CSC and CSR have to be in prescribed order; COO data may contain multiple entries for any matrix position, and these entries need not appear consecutively. Make sure that the conversion routine is capable of sorting the COO data and combining multiple entries into a single entry.

View solution in original post

2 Replies
mecej4
Black Belt
192 Views

You may be able to skip the conversion altogether if the solver allows you to solve ATx = b in the solution phase, because the CSC representation of A is identical to the CSR representation of AT.

You can use a COO ⇒ CSR converter to do a COO ⇒ CSC conversion by interchanging the COO row and column index vectors in the call. A couple of points to consider carefully: COO data may be in arbitrary order, whereas CSC and CSR have to be in prescribed order; COO data may contain multiple entries for any matrix position, and these entries need not appear consecutively. Make sure that the conversion routine is capable of sorting the COO data and combining multiple entries into a single entry.

View solution in original post

Petros
Beginner
191 Views

mecej4 wrote:

You may be able to skip the conversion altogether if the solver allows you to solve ATx = b in the solution phase, because the CSC representation of A is identical to the CSR representation of AT.

You can use a COO ⇒ CSR converter to do a COO ⇒ CSC conversion by interchanging the COO row and column index vectors in the call. A couple of points to consider carefully: COO data may be in arbitrary order, whereas CSC and CSR have to be in prescribed order; COO data may contain multiple entries for any matrix position, and these entries need not appear consecutively. Make sure that the conversion routine is capable of sorting the COO data and combining multiple entries into a single entry.

Thanks! I didn't realize that by swapping row and column of the COO I can get the CSC!

Reply