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

Zero Matrix CSR Format

JBervel
Beginner
315 Views

Hi,

in order to implement a generic algorithm, I need to define the zero matrix in CSR format. Is it possible?

I have defined it with null arrays for elements, rows, etc.... but when I try to call the function mkl_sparse_d_add it crashes with  SPARSE_STATUS_NOT_INITIALIZED error.

How can I define the zero matrix in csr format?

Thanks in advance,

Joaquin

0 Kudos
1 Reply
mecej4
Honored Contributor III
314 Views

I have defined it with null arrays for elements, rows, etc.

That would not work. There is a difference between a matrix that has no rows, columns or values and a matrix of a known size with zero values.

At the least, specify the matrix size correctly, provide correct index values (row index, columns) and provide as many zero values for as many matrix entries as the sparse representation requires. For example, some sparse matrix routines in MKL require that all diagonal entries of symmetric matrices be supplied, including those that are zero.

0 Kudos
Reply