Closed rsubburaman closed 4 years ago
Hi Raj,
yes as I already explained in person the problem is the temporary: @alaurenzi can tell you more about this.
Correct, matrix multiplications by default cause temporaries to be created. The reason is
noalias
method)D.noalias() = A*B*C
will always trigger a temporary for performance reasons)Eigen3 is written to perform well in a general purpose scenario, and not to be real-time safe!
I close this, since it is related to a 3rd party library in a specific use case.
@liesrock @alaurenzi @ntsagarakis
I was running an RT plugin on CogIMon realtime pc, and it was repeatedly coming out of the real-time loop whenever it has to evaluate an expression that involved some matrix multiplications. This was happening even after predefining the size of all the matrices involved in that expression. The matrices size were no more than 15x15. After some browsing, I found that this is happening due to a temporary variable dynamically created by Eigen during such matrix multiplications. I also found the following link where a solution has been proposed to avoid this issue.
https://github.com/stulp/tutorials/blob/master/test.md
I tried the above solution, and it works. But the solution seems to make the code a little messy, especially if we have to evaluate a complex expression that involves several matrix multiplication operations. I was wondering if this issue has been addressed already and if the solution is better than the one proposed above.