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

sparse_matrix_checker reports MKL_SPARSE_CHECKER_OUT_OF_RANGE for a very simple matrix

miaodi1987
Beginner
502 Views

I have a 3x4 matrix

0 1 0 0

0 0 2 0

0 0 0 3

 

the corresponding CSR format is:

ia= [0,1,2,3]

ja= [1,2,3]

va= [1,2,3]

 

However, when I check it with sparse_matrix_checker, it says:


*** Input check: i=2, ja[i]=3, neqns=3 are incompatible
Matrix check details: (2, 3, 3)
Matrix check result: MKL_SPARSE_CHECKER_OUT_OF_RANGE

Is there any special request  for MKL's sparse matrix that are not listed in the reference ?

0 Kudos
1 Solution
Spencer_P_Intel
Employee
477 Views

The sparse matrix checker is part of the sparse solvers system APIs.  the matrix handle there only has a single dimension size meaning it is assuming that the matrix is square (sparse solvers in pardiso depend on matrix being square even though QR can be rectangular, it is a separate set of algorithms and APIs), so the sparse_matrix_checker assumes your matrix is square.

 

In your case, you have provided neqns = 3 so it is assuming you have a 3x3 matrix , but you have a rectangular matrix input with a column index which is 3 (base 0) which is out of range, hence the MKL_SPARSE_CHECKER_OUT_OF_RANGE return value.

 

Spencer

View solution in original post

0 Kudos
1 Reply
Spencer_P_Intel
Employee
478 Views

The sparse matrix checker is part of the sparse solvers system APIs.  the matrix handle there only has a single dimension size meaning it is assuming that the matrix is square (sparse solvers in pardiso depend on matrix being square even though QR can be rectangular, it is a separate set of algorithms and APIs), so the sparse_matrix_checker assumes your matrix is square.

 

In your case, you have provided neqns = 3 so it is assuming you have a 3x3 matrix , but you have a rectangular matrix input with a column index which is 3 (base 0) which is out of range, hence the MKL_SPARSE_CHECKER_OUT_OF_RANGE return value.

 

Spencer

0 Kudos
Reply