- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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?
Link Copied
3 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Quoting mecej4
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.
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
> 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
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
Reply
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