Registered Member
|
I see that expression templates can produce optimal code for non-optimal expressions. But how can I determine what code is produced?
I have found in other topic that
can multiply diagonal matrix D by the scalar without overhead. But how can I prove that? (Without looking into the assemply code produced by the compiler) More important: how to detect bad expressions and how to find ways to improve them? |
Moderator
|
This is a tricky question. In general we try to avoid to make it easy to write poor code, but in doubt and for critical expressions you can still ask on this forum.
|
Registered Member
|
Is .cast<TYPE> a no-op when matrix already has TYPE type?
Also I think it is possible to implement function like this which will report information about the code produced by the expression:
|
Moderator
|
yes it's a no-op, like .conjugate() or .real() with non-complex scalar type.
Regarding a "report" mechanism as you suggest, yes this could be doable but that's quite a lot of work with a lot of code duplication, not very funny for the maintenance. |
Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]