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

unit diagnal elements in a upper triangular matrix

anjuta
Beginner
518 Views
I'm trying to use mkl_dcscsv to do a upper triangular solve, and the matrix has
only unit diagnal elements. I found that I still need to include the diagnal elements in the matrix storage vectors passed to mkl_dcscsv, otherwise the result will be wrong. I'm wondering if there's any specific reason for this? I mean isn't it intuitive not to include the unit diagnal elements?

Thanks
0 Kudos
1 Solution
Gennady_F_Intel
Moderator
518 Views
Hello.
Thanks for the example. all right with this example.
The unit diagonal elements can be omitted accordingly the description of mkl_dcscsv and therefore that's the bug.This issue has been submitted to our internal development tracking database for further investigation, we will inform you once a new update becomes available.
--Gennady Fedorov

View solution in original post

0 Kudos
7 Replies
ArturGuzik
Valued Contributor I
518 Views
Sure it is but how MKL is supposed to "guess" it?
I believe you might have overlooked the description of the input parameters. Take a look at Possible Values of the Parameter matdescra (descra) where you can find that you can specify main diagonal type to be non-unit or unit. The combinations are described in Possible Combinations of Element Values of the Parameter matdescra.

A.
0 Kudos
anjuta
Beginner
518 Views
Yes, I did specify the main diagnonal type to be unit in matdescra, then I assume I don't need to include the diagnoal elements in the sparse matrix representation since they are all 1s. So is my assumption valid or not?
from my testing, I think it's not.
0 Kudos
ArturGuzik
Valued Contributor I
518 Views
OK then. The docs suggest that the elements can be omitted. If your matrix is properly represented in compressed storage, it seems as a bug. If you could post the code, then Intel people could take a look.

A.
0 Kudos
anjuta
Beginner
518 Views
The code looks like this:

#include
#include "mkl.h"
#include "mkl_types.h"
#include "mkl_spblas.h"

int main(int argc, char **argv)
{
/*double values[] = {1.0, 1.0, -0.000999, 1.0, 0.2, -0.2, 1.0, -1.0, 1.0};
MKL_INT rows[] = {0, 1, 0, 2, 0, 2, 3, 1, 4};
MKL_INT colIndex[] = {0, 1, 2, 4, 7, 9};*/
double values[] = {-0.000999, 0.2, -0.2, -1.0};
MKL_INT rows[] = {0, 0, 2, 1};
MKL_INT colIndex[] = {0, 0, 0, 1, 3, 4};
double rhs[5] = {0, 0, 0, 0, 0.001998};
double sol[5] = {1.0, 1.0, 1.0, 1.0, 1.0};
char transa = 'n';
char matdescra[6];
MKL_INT m = 5;
double alpha = 1.0;

matdescra[0] = 't';
matdescra[1] = 'u';
matdescra[2] = 'u';
matdescra[3] = 'c';

mkl_dcscsv(&transa, &m, α, matdescra, values, rows, colIndex, &(colIndex[1]), rhs, sol);

printf("sol = %.7e %.7e %.7e %.7e %.7e\n", sol[0], sol[1], sol[2], sol[3], sol[4]);
return 0;
}

The correct results would be:
0, 0.001998, 0, 0, 0.001998

but with the above code, I'm getting

0, 0, 0, 0, 0.001998

once I put the unit diagonal elements in, the result is correct.

Thanks
0 Kudos
Gennady_F_Intel
Moderator
519 Views
Hello.
Thanks for the example. all right with this example.
The unit diagonal elements can be omitted accordingly the description of mkl_dcscsv and therefore that's the bug.This issue has been submitted to our internal development tracking database for further investigation, we will inform you once a new update becomes available.
--Gennady Fedorov
0 Kudos
Gennady_F_Intel
Moderator
518 Views

Hello,
just for your informatin:

This issue has been submitted to our internal development tracking database for further implementation,

we will inform you once a new update becomes available.

Here is a bug tracking number for your reference: 200092519

Regards, Gennady

0 Kudos
Gennady_F_Intel
Moderator
518 Views

Dear Customer,

The problem you reported has been fixed into the latest MKL 10.2 Update 6 version released recently.

You can Download this version from Intel Registration Center: https://registrationcenter.intel.com/regcenter/register.aspx

See announcement about thathere.

Please let us know if the problem is still exist.

--Gennady

0 Kudos
Reply