morton_encoding
is a crate that helps interleave the bits of numbers,
(called "co-ordinates" in the source code)
thereby creating a so-called "Morton encoding" (also known as a
"Z-order encoding") in whose final result ("Key")
all bits of the same significance are together.
This is helpful for linearising the points of data structures whilst preserving
some measure of locality. Z-order encoding isn't as good at preserving
locality as Hilbert encoding, but it is much easier to compute.
Contents
The functions contained herein are broadly split into four categories:
- "Bloating functions", that interleave a number's bits with zeroes;
- "Shrinking functions", that perform the opposite operation;
- "Morton encoding functions", that interleave some numbers' bits with each other;
- "Morton decoding functions", that perform the opposite operation.
For more detailed information, please refer to each individual function's documentation.
std
vs no_std
This crate (or its documentation, in any event) has currently been compiled with std