Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.
7036 Discussions

Questions about sparse matrix coordinate format

M_t__Wimmer
Beginner
391 Views

I have a question regarding the coordinate sparse matrix format: This format is frequently used e.g. in sparse solvers, and usually the convention is that double entries are summed (i.e. a matrix having the entry 1 1 1.0 and 1 1 2.0 are interpreted as the 1,1 element having the value 3.0). Is this also the case for the MKL? I didn't find this information in the documentation which is somewhat vague in this respect.

Best,

Michael

0 Kudos
2 Replies
ArturGuzik
Valued Contributor I
391 Views

Hi,

I might be really wrong on that but I believe that this is not a case for MKL. First of all, the MKL takes the matrix "ready to be solved", so summation is/can be done before call to MKL. Converters also just, well, convert existing matrix to desired format. I don't think you can even describe it in that way (to be automatically summed). The coordinate format takes rows, columns, values, so if you have multiple entries (say (1,1) elements) the number of non-zero elements is smaller than lengths of these arrays. So somebody (compiler/MKL) should complain.

The MKL team probably will correct me and give you a definite answer.

A.

0 Kudos
Gennady_F_Intel
Moderator
391 Views

Michael, Artur is absolutely right, summation is/can be done before call to MKL

quote"..The documentation is somewhat vague in this respect."

See the description of COO format into MKL Reference Manual ( Appendix A, Coordinate Format):

coordinate format is specified by three arrays: values, rows, and column, and a parameter nnz which is number of non-zero elements in A. All three arrays have dimension nnz. The following table describes the arrays in terms of the values, row, and column positions of the non-zero elements in a sparse matrix A.

values - A real or complex array that contains the non-zero elements of A in any order.

rows - Element I of the integer array rows is the number of the row in A that contains the I-th value in the values array.

columns - Element I of the integer array columns is the number of the column in A that contains the I-th value in the values array .

Moreover you can find there the example of sparse matrix representations in this format ( see table A-7).

--Gennady

0 Kudos
Reply