CSC To CSR Matrix Conversion

Open discussion for MAGMA library (Matrix Algebra on GPU and Multicore Architectures)
Post Reply
badlishah
Posts: 9
Joined: Wed Jul 08, 2015 11:19 pm

CSC To CSR Matrix Conversion

Post by badlishah » Thu Aug 27, 2015 7:03 am

Greetings,

Would there be simple way to convert vectors from a CSC matrix to the CSR format? Anyway I can manipulate the indexing?

cheers,
Badlishah

mgates3
Posts: 902
Joined: Fri Jan 06, 2012 2:13 pm

Re: CSC To CSR Matrix Conversion

Post by mgates3 » Thu Aug 27, 2015 7:36 am

Try magma_zmtranspose.
-mark

jeanfell
Posts: 1
Joined: Thu Aug 27, 2015 2:43 pm
Contact:

Re: CSC To CSR Matrix Conversion

Post by jeanfell » Thu Aug 27, 2015 2:48 pm

I was looking for the same answer, magma_zmtranspose didn't work for me btw. Thanks Mark.

badlishah
Posts: 9
Joined: Wed Jul 08, 2015 11:19 pm

Re: CSC To CSR Matrix Conversion

Post by badlishah » Tue Sep 01, 2015 5:48 am

Thank you Mark. That tip was very helpful. Apologies for my ignorance, I am still new in this field :)

How would I actually change the indices used in the matrix? For example in the CUDA CuSparse library there is the CUSPARSE_INDEX_BASE_ZERO and CUSPARSE_INDEX_BASE_ONE that can be used.

Cheers,
Badlishah

hartwig anzt
Posts: 90
Joined: Tue Sep 02, 2014 5:44 pm

Re: CSC To CSR Matrix Conversion

Post by hartwig anzt » Tue Sep 01, 2015 11:26 am

Badlishah,

There is no function for this at this point (all MAGMA sparse is using 0-based indexing). At this point, I would do this manually on the CPU:

for( magma_int_t i=0; i<A.num_rows+1; i++) {
A.row += 1;
}

for( magma_int_t i=0; i<A.nnz; i++) {
A.col += 1;
}

Please let me know if you have problems, then I can provide you with a function.

Thanks, Hartwig

badlishah
Posts: 9
Joined: Wed Jul 08, 2015 11:19 pm

Re: CSC To CSR Matrix Conversion

Post by badlishah » Tue Sep 01, 2015 9:50 pm

Hartwig,

That worked well. Thanks a bundle.

cheers,
Badlishah

Post Reply