Multithreaded sparse matrix multiplication in Matlab

后端 未结 3 1797
故里飘歌
故里飘歌 2021-01-11 21:21

I am performing several matrix multiplications of an NxN sparse (~1-2%) matrix, let\'s call it B, with an NxM dense matrix, let\'s call it A (where M < N). N is large, as

3条回答
  •  滥情空心
    2021-01-11 21:48

    On matlab central the same question was asked, and this answer was given:

    I believe the sparse matrix code is implemented by a few specialized TMW engineers rather than an external library like BLAS/LAPACK/LINPACK/etc... 
    

    Which basically means, that you are out of luck.


    However I can think of some tricks to achieve faster computations:

    1. If you need to do several multiplications: do multiple multiplications at once and process them in parallel?
    2. If you just want to do one multiplication: Cut the matrix into pieces (for example top half and bottom half), do the calculations of the parts in parallel and combine the results afterwards

    Probably these solutions will not turn out to be as fast as properly implemented multithreading, but hopefully you can still get a speedup.

提交回复
热议问题