Showing results for

- Intel Community
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
- Efficient storage of sparse matrix with constant non-zero elements

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

Highlighted
##

I have a sparse matrix whose non-zero elements are always ones ( = 1). Is there a storage scheme supported by MKL that will save the memory space required for storing the data array and stores only the indices arrays?

Customer__Intel4

Beginner

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

11-14-2011
06:41 AM

15 Views

Efficient storage of sparse matrix with constant non-zero elements

3 Replies

Highlighted
##

While I understand your motivation for asking, I feel that there is little use for such a representation, for the following reason.

If any transformation is performed upon or using the special matrix, it will probably cease to have all nonzero values equal to 1. Therefore, the special representation, if it existed, would only apply to the original matrix. It would also be probably necessary to convert (or provide a routine to convert) from the special representation to the usual (ir,jc,v) representation before calling solver routines.

mecej4

Black Belt

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

11-14-2011
07:32 AM

15 Views

If any transformation is performed upon or using the special matrix, it will probably cease to have all nonzero values equal to 1. Therefore, the special representation, if it existed, would only apply to the original matrix. It would also be probably necessary to convert (or provide a routine to convert) from the special representation to the usual (ir,jc,v) representation before calling solver routines.

Highlighted
##

*While I understand your motivation for asking, I feel that there is little use for such a representation, for the following reason.*

If any transformation is performed upon or using the special matrix, it will probably cease to have all nonzero values equal to 1. Therefore, the special representation, if it existed, would only apply to the original matrix. It would also be probably necessary to convert (or provide a routine to convert) from the special representation to the usual (ir,jc,v) representation before calling solver routines.I will use this special matrix to multiply it with vectors. My program will not alter it at all!

Customer__Intel4

Beginner

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

11-14-2011
10:16 AM

15 Views

Quoting mecej4

If any transformation is performed upon or using the special matrix, it will probably cease to have all nonzero values equal to 1. Therefore, the special representation, if it existed, would only apply to the original matrix. It would also be probably necessary to convert (or provide a routine to convert) from the special representation to the usual (ir,jc,v) representation before calling solver routines.

Highlighted
##

*> I will use this special matrix to multiply it with vectors. My program will not alter it at all!*

In that case, the matrix-vector product calculation can be expressed quite simply using only the ir() and jc() arrays, with the implied value of 1, using a couple of lines of code. For example, to compute u = A . x with A in coordinate storage format :

u(1:n) = 0

do iz = 1, nnz

c u(ir(iz)) = u(ir(iz)) + val(ir(iz),jc(iz)) * x(jc(iz)) ! general case

u(ir(iz)) = u(ir(iz)) + x(jc(iz)) ! special case

end do

mecej4

Black Belt

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

11-14-2011
10:54 AM

15 Views

u(1:n) = 0

do iz = 1, nnz

c u(ir(iz)) = u(ir(iz)) + val(ir(iz),jc(iz)) * x(jc(iz)) ! general case

u(ir(iz)) = u(ir(iz)) + x(jc(iz)) ! special case

end do

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