- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Help me please. I want to solve a system of linear equations using the mkl_dcsrsv function. However, an error is issued.
matrix a
1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 1 0 0 0 0 0 0 0 0 0 0
0 0 -0.4 0 0 0 -0.4 0 1.85 0 -0.4 0 0 0 -0.4 0 0 0
0 0 0 4 0 0 0 4 1 16 0 4 0 0 0 4 0 0
0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
const char transa = 'n';
int b = 2 * nx*ny;
const double alpha = 1.;
char matdescra[6];
matdescra[0] = 'g';
matdescra[1] = ' ';
matdescra[2] = ' ';
matdescra[3] = 'c';
mkl_dcsrsv(&transa, &b, &alpha, matdescra, Acsr,JA,pntrb,pntre,F,x);
What are the problems with matdescra?
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello Ekaterina,
I think the reason is that you specify the first value of matdescra as 'g' which is for general matrix but the routine mkl_dcsrsv solves only systems with triangular matrices. Since your matrix is indeed not triangular, you cannot use mkl_dcsrsv in your case.
Actually, your matrix is very tiny, Do you really want to solve it using a sparse linear solver or is it just an example?
For large matrices you can use direct solver PARDISO from Intel MKL. For small matrices, however, it's easier and more efficient to use functionality for dense matrices.
Best,
Kirill

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