Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- from CSR to CSC for non-square (m x n) matrix

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

Renat_S_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

09-04-2013
05:06 AM

115 Views

from CSR to CSC for non-square (m x n) matrix

Link Copied

2 Replies

Kwangjin_L_

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-19-2013
03:36 AM

115 Views

To obtain transpose of non-square matrix

I used "mkl_?csradd" function with trans = 'T' and zero-matrix.

This is not efficient. Any other way?

mecej4

Black Belt

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

11-21-2013
04:32 AM

115 Views

To convert from CSR to CSC or, which is equivalent, to find the CSR representation of A^{T} given the CSR representation of the sparse rectangular matrix A of size *m* X *n*, one simple way involves (i) conceptually padding up the matrix with additional zero entries to a square matrix of size *N *X *N* where *N* = max (*m*,*n*), and (ii) calling the MKL converter.

Note that, in the 3-array CSR representation, no changes need to be made to the **values **or **columns ** arrays (and, when *m > n, *to* ***rowIndex**) as a result of the padding-up, since none of the padding elements is non-zero. If *m < n, t*he **rowIndex **array should be padded up by replicating the prior last value, i.e., *n*_{nz}+1.

If *m* and *n *differ from each other so much that you are concerned about the wasted CPU cycles devoted to processing the additional zeros used to pad the matrix, you can write your own converter routine, noting that if log_{2} *n*_{nz} is significantly less than max (*m*,*n*) it may be worthwhile to sort the **values **and **columns **arrays by column indices before computing the 3-array representation of the transpose.

For more complete information about compiler optimizations, see our Optimization Notice.