4 ms·
Some time ago I wrote a little function to calculate the nth point's coordinates on a Hilbert curve. It uses pext and pdep intrinsics to avoid loops, it's compl
by leni536 10y ago
Some time ago I wrote a little function to calculate the nth point's coordinates on a Hilbert curve. It uses pext and pdep intrinsics to avoid loops, it's completely branchless.
https://github.com/leni536/fast_hilbert_curve https://github.com/leni536/fast_hilbert_curve
https://github.com/leni536/fast_hilbert_curve/wiki/How-efficient-is-it https://github.com/leni536/fast_hilbert_curve/wiki/How-effic...
Maybe I will write an explanation how it works and implement the inverse function similarly.