Turn on suggestions

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

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Storing a sparse matrix in

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

Robert_E_

Beginner

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

02-12-2020
10:23 AM

123 Views

mkl_?dnscsr deprecated, alternatives?

Since "mkl_?dnscsr" (dense to sparse matrix conversion and vice versa) is deprecated, what should we use instead?

For sparse to dense conversion I could simply use "mkl_sparse_?_spmmd" (product of two sparse matrices, store result as dense matrix), but I couldn't find anything for dense to sparse conversion.

Also, if you happen to know why this method was deprecated, it would be good to know as well. Based on that, I could make my decision to use it anyway.

Regards, Robert

Link Copied

3 Replies

mecej4

Black Belt

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

03-02-2020
05:29 AM

123 Views

Storing a sparse matrix in dense format is wasteful of both memory and CPU. Often, it may be impossible to store the dense matrix, mostly full of zero-valued elements.

If it is possible to process the matrix entries in (row, column) order, as each matrix element (or element contribution) is computed, we know i, j and a_{i,j}. We can immediately update the row-index, column ID and value 1-D arrays, without using the dense representation at all. In other cases, a little bit of sorting and merging may be needed to form the CSR representation.

Robert_E_

Beginner

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

03-02-2020
05:43 AM

123 Views

Hi,

thanks for the reply!

I think sometimes storing a sparse matrix as dense is justified. In my case, I have a small sparse square matrix A and I want to solve a linear system with multiple sparse right hand sides B, s.t. AX = B, where A is size (k x k), B is size (k x n) and k << n.

Now, A can either be sparse or dense, because conversion is cheap, whatever the scenario requires. But in order to make use of the fast BLAS solvers, I have to store B as a dense matrix first.

Also, I haven't found a solver that can deal with multiple sparse right hand sides. Maybe someone has an idea what to do best in this case. Creating my own custom solver is most definitely not a good idea.

regards, Robert

mecej4

Black Belt

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

03-02-2020
06:25 AM

123 Views

I see. Your matrix sizes do not fit the description that I had in mind for "sparse matrix".

Does your linear equation solver have the ability to exploit the sparseness of matrix B? Do all columns of B have the same rows in which the entries are zero?

Topic Options

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

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