3 ms·
Can you explain what you're getting at? I've spoken to people who authored expression template libraries and they say that mixing auto with expressions is a wor
by KKKKkkkk1 10y ago
Can you explain what you're getting at? I've spoken to people who authored expression template libraries and they say that mixing auto with expressions is a worst practice. You're setting yourself up for bugs. See the third link above. As to chaining affine transformations, how is letting the expression-template library evaluate a chain of transformations different from doing so explicitly? Would you agree that the computation boils down to the same flops either way?
- cjhanks 10y agoYou claimed there was no benefit to expression templates and I agreed that in C++98 this is true. Auto can introduce complications, I agree... I have a few times experienced the aliasing bugs it introduces, it's tricky and not a panacea. Though 99/100 times it allows me to write the code I mean rather than the the syntax that is necessary. Of course concatenation of transforms explicitly can be equivalent in FLOPS... as long as there are no redundant calls to transcendental functions or vector operations which can be folded for better cache coherency.
- srean 10y agoYeah 'auto' really messed ET up. The consequences the design would have on ET was not on the committees mind. I guess there was no one there in the committee who was that deep into high performance computing of this kind. > computation boils down to the same flops either way? same number of operations, yes possibly, but that carries almost no weight at all. Write a straight 3 nested for loop for a matrix multiply and then right another one with some thoughts on cache re-use. The latter will beat the former by an order of magnitude if not two. The situation is a bit better now thanks to 'smart enough compilers'.