Registered Member
|
Dear Eigen community,
I am a new guy using Eigen and so far I am really satisfied using it, because I have had a good performance using the Full-Matrix module compared to Matlab. However, this is not the same if I use The Sparse Module. I have tried using MKL (9.38 s)and other libraries in order to improve my performance and I have got a worse performance than Matlab (0.82 s). I would like to know what I am doing wrong, please find bellow the code I am employing. If somebody can help me, I would really appreciate it! Thanks for taking time in answering,
|
Moderator
|
Your example is quite unusual because the result is completely dense. With Eigen, you can use a different product algorithm by calling .pruned():
ddd = (ccc.transpose()*ccc).pruned(); It should be faster for your use case. |
Registered Member
|
Dear ggael,
Thanks for your answer. Actually ".pruned()" IS FASTER than my method. I have got 2.47 (s) instead of 9.38 (s). However, I still don't understand why Matlab gets 0.82 (s); what does make Matlab so fast? is it possible to get that performance in Eigen? P.S: That sort of multiplication, you will find it very often in Finite Element Analysis to assemble stiffness matrices and force vectors, in fact, they are not as the example I gave above, the idea is to check if at least I get the same performance like Matlab, because I want to change Matlab to C++, and Eigen is the most suitable library so far. |
Moderator
|
It does not make sense to bench sparse algebra on non representative sparse structures.
|
Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell