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

Compress matrix in CSR Format after matrix multiplication

andrefla
Beginner
123 Views
Hello,
is there an easy way (or a predefined function) to compress a matrix in CSR format after a matrix multiplication?
I have two problems:
a) I have to set the number of non zero elements in advance, but I don't know the exact number of non zero elements after the matrix multiplication. So I have to assume the worst case, which is alway higher than the real one.
b) During matrix multiplication there can be zeros introduced, which enlarges my matrix.
The only way I know is, that I can walk through the values array "by hand", delete all zeros and correct all indices in the corresponding index arrays. But that's really exhausting ...
All the best,
Andr
Edit:
I said nothing. I should read the manual twice: Callmkl_?csrmultcsr first with request=1 and after that with request=2
0 Kudos
1 Reply
Gennady_F_Intel
Moderator
123 Views
Andr,
please look at themkl_ddnscsr(,,,,,) routine which converts dense to the CSR representations when job(1) == 0.
will it appropriate for you?
--Gennady
Reply