- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

char transa = 'C';

int m = 100; //the size of the main diagonal - 100

double alpha = 1.0;

char matdescr[] = { 'D', 'U', 'N', 'C' };

//val is created above

int lval = m; //100

int distance[] = {-10, -1, 0, 1, 10};

int ndiag = 5; //5

y.resize(m);

mkl_ddiasv(&transa, &m, α, matdescr, &val[0], &lval, distance, &ndiag, &B.data[0], &y[0]);

Link Copied

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content

Hi Chubbz,

As I see, you handled the input parameters and matrixstorage formatproperly. The key problem is that the mkl_ddiasv and mkl_dcsrsvis for triangular sparse matrix.while thematrix C fromhttp://software.intel.com/sites/products/documentation/hpc/mkl/mklman/index.htmis not a triangular matrx.

See the mkl manual:

The mkl_?csrsv routine solves a system of linear equations with matrix-vector operations for a sparse matrix in the CSR format: `y` := `alpha`*inv(`A`)*`x`

or `y` := `alpha`*inv(`A`')*`x`,

where:

`alpha` is scalar, `x` and `y` are vectors,** A is a sparse upper or lower triangular matrix** with unit or non-unit main diagonal,

`A'`is the transpose of

`A`.

So the output arealways not correct. You may try lapack's function orSparse Solver Routines like pardiso/dss to solve the sparse linear system of equations.

For the function mkl_ddiasv and mkl_dcsrsvthemselves, you may testthe mkl example codes likecspblas_dcsr.c,which be default are in in

Best Regards,

Ying H.

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