Community
cancel
Showing results for 
Search instead for 
Did you mean: 
anjuta
Beginner
79 Views

unit diagnal elements in a upper triangular matrix

Jump to solution
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

Accepted Solutions
Gennady_F_Intel
Moderator
79 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

7 Replies
ArturGuzik
Valued Contributor I
79 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.
anjuta
Beginner
79 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.
ArturGuzik
Valued Contributor I
79 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.
anjuta
Beginner
79 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
Gennady_F_Intel
Moderator
80 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

Gennady_F_Intel
Moderator
79 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

Gennady_F_Intel
Moderator
79 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