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

I have a huge matrix with very few non-zero elements. Some of the columns and rows may also be completely zero. This matrix should be multiplied by a very long vector which has only few non-zero elements. I know that mkl_?cscmv performs the sparse matrix-vector multiplication but apparently only the matrix can be sparse. I am wondering if there is any MKL routine to calculate the production of such matrix and vector.

Thanks in advance for your help

Link Copied

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

You can have a look at mkl_?csrmm, mkl_?bsrmm, mkl_?cscmm, or mkl_?coomm and simply treat the vector as a sparse matrix.

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

The answer depends quite a bit on the representation that you have used for the sparse vector that you wish to multiply the sparse matrix into. Do you know the indices of the vector entries that are not equal to zero? Do you know the indices of the result vector that are not equal to zero?

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

mecej4 wrote:

The answer depends quite a bit on the representation that you have used for the sparse vector that you wish to multiply the sparse matrix into. Do you know the indices of the vector entries that are not equal to zero? Do you know the indices of the result vector that are not equal to zero?

Each sparse vector is represented by <nz, nRows, ind, data>, where nz and nRows represent number of non-zero elements and number of rows, ind is an array representing index for non-zero elements, and data is an array representing value of non-zero elements. So, I do have the indices of input vector.

For the resulting vector, I know everything except data, i.e. I know what the indices for non-zero elements will be.

Thanks

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