Quantcast
Channel: Intel® Software - Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 3005

mkl_?csrcoo converter function

$
0
0

Hi, 

I am trying to get this matrix format converter function to work in C. I checked and edited my program many times as well as checked the documentation but I always end up with the error:

INTEL MKL ERROR: Parameter 1 was incorrect on entry to MKL_DCSRCOO

which refers to the job array. I want to transform a sparse matrix in COO format to CSR format for use in PARDISO. 

I decided to test it out on the example matrix included under the Storage Format example of the mkl-2017-developer-reference-c.pdf

Here is my code snippet below:

int main ()
{
	MKL_INT job[6];
	MKL_INT n = 5;
	MKL_INT nnz = 13;
	MKL_INT info = 0;

	double *acsr = calloc(nnz, sizeof(double));
	MKL_INT *ja = calloc(nnz, sizeof(MKL_INT));
	MKL_INT *ia = calloc(n+1, sizeof(MKL_INT));

	double acoo[] = { 1, -1, -3, -2, 5, 4, 6, 4, -4, 2, 7, 8, -5 };
	MKL_INT rowind[] = { 1, 1, 1, 2, 2, 3, 3, 3, 4, 4, 4, 5, 5 };
	MKL_INT colind[] = { 1, 2, 4, 1, 2, 3, 4, 5, 1, 3, 4, 2, 5 };


	job[0] = 1;
	job[1] = 1;
	job[2] = 1;
	job[5] = 0;

	mkl_dcsrcoo(job, &n, acsr, ja, ia, &nnz, acoo, rowind, colind, &info);

	getchar();
	return 0;
}

I am using the 2017 version of mkl. 
 


Viewing all articles
Browse latest Browse all 3005

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>