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

Problem with mkl_dcsrmv

Wolfram_Ruehaak
Beginner
135 Views
Hello

In the attached example (creating dense matrix sv - > transforming into sparse matrix v -> multiplying with vector u) there is a problem with the mkl_dcsrmv routine. I.e. the value stored in the product vector y is wrong.
I would be very happy if someone could tell me what I do wrong.

Heres the code:
test.cpp

Kind regards
Wolfram
0 Kudos
1 Reply
Wolfram_Ruehaak
Beginner
135 Views
I found the reason: as the solution which is solved is y = alpha*A*x + beta*y (and not just y=A*x) it is necessary to initialize y. In the given case all y values hasve to be set to 0 before calling to mkl_dcsrmv.

Kind regards
Wolfram
Reply