Skip to main content

Module normalize

Module normalize 

Source
Expand description

Per-dimension coordinate normalization.

Space-filling curves (Hilbert, Z-order) operate on equal-width unsigned integer coordinates. This module maps each CoordValue into a u64 in [0, 2^bits) relative to the dimension’s [Domain]. The bit budget is shared across dims so the total prefix fits in 64 bits.

Constants§

MAX_DIMS
Maximum dims supported by ND Hilbert in this implementation.
PREFIX_BITS
Total bit budget for the combined space-filling-curve prefix.

Functions§

bits_per_dim
Bits per dim for an n-dim schema, dividing PREFIX_BITS evenly (truncated). Returns at least 1 bit per dim.
normalize_coord
Normalize one cell coordinate into per-dim integer coordinates in [0, 2^bits). The output Vec has the same arity as the schema.