Functions | |
| uint32_t | morton_3d (uint32_t x, uint32_t y, uint32_t z) |
| Compute 3D Morton (Z-order) index from integer coordinates. | |
| uint32_t | morton_to_hilbert_3d (uint32_t morton, uint32_t bits) |
| Convert Morton index to Hilbert index using 96-byte LUT. | |
| uint32_t | hilbert_3d (double x, double y, double z, double min_coord, double scale, uint32_t bits=10) |
| Compute 3D Hilbert index from floating-point coordinates. | |
| std::vector< size_t > | hilbert_permutation (const double *coords, size_t n_atoms, uint32_t bits=10) |
| Compute Hilbert-ordered permutation for a set of 3D points. | |
Variables | |
| constexpr uint8_t | MORTON_TO_HILBERT_LUT [96] |
| 96-byte LUT for Morton->Hilbert conversion. | |
|
inline |
Compute 3D Hilbert index from floating-point coordinates.
| x | X coordinate |
| y | Y coordinate |
| z | Z coordinate |
| min_coord | Minimum coordinate value (for normalization) |
| scale | Coordinate range (max - min, for normalization) |
| bits | Precision bits per dimension (default 10, giving 1024 levels) |
Definition at line 124 of file SpaceFilling.h.
|
inline |
Compute Hilbert-ordered permutation for a set of 3D points.
Returns a permutation array such that iterating over atoms in permutation order visits them in Hilbert curve order (spatially coherent).
| coords | Pointer to xyz coordinates, packed as [x0,y0,z0,x1,y1,z1,...] |
| n_atoms | Number of atoms |
| bits | Hilbert precision (default 10) |
Definition at line 156 of file SpaceFilling.h.
|
inline |
Compute 3D Morton (Z-order) index from integer coordinates.
Morton index interleaves bits: xyz -> ...z2y2x2z1y1x1z0y0x0 Uses pdep intrinsic on BMI2-capable CPUs, otherwise bit manipulation.
| x | X coordinate (0 to 2^bits - 1) |
| y | Y coordinate (0 to 2^bits - 1) |
| z | Z coordinate (0 to 2^bits - 1) |
Definition at line 51 of file SpaceFilling.h.
|
inline |
Convert Morton index to Hilbert index using 96-byte LUT.
| morton | Morton (Z-order) index |
| bits | Number of bits per dimension (max 10 for 32-bit output) |
Definition at line 100 of file SpaceFilling.h.
|
inlineconstexpr |
96-byte LUT for Morton->Hilbert conversion.
12 transform states x 8 octants = 96 entries. Upper bits encode next transform state, lower 3 bits encode Hilbert sub-index.
Definition at line 77 of file SpaceFilling.h.