3 ms·
Yes... and the transformations are often non-trivial (especially when considering the possibility of out-of-bounds elements, which can't just safely be multipli
by cozzyd 6y ago
Yes... and the transformations are often non-trivial (especially when considering the possibility of out-of-bounds elements, which can't just safely be multiplied by zero--they might be a NaN, or on the edge of a page). It would be nice if there was a tool (or compiler option!) that could convert my branchy code into an "identical" (assuming floating-point associativity, etc.) branchless version.
- snovv_crash 6y agoThe Eigen Array [1] object is fairly close to this. Combining the 'select' with comparisons, chained operators etc. Eigen vectorized stuff pretty effectively too. 1. https://eigen.tuxfamily.org/dox/group__TutorialArrayClass.html https://eigen.tuxfamily.org/dox/group__TutorialArrayClass.ht...
- cozzyd 6y agoInteresting... I've used Eigen for matrix operations before, I did not know they had such a smart general-purpose array implementation!