MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / encode_hilbert_prefix

Function encode_hilbert_prefix

nodedb-array/src/coord/encode.rs:19–23  ·  view source on GitHub ↗

Encode a Hilbert prefix for one cell coordinate using the schema's configured per-dim bit budget.

(schema: &ArraySchema, coord: &[CoordValue])

Source from the content-addressed store, hash-verified

17/// Encode a Hilbert prefix for one cell coordinate using the schema's
18/// configured per-dim bit budget.
19pub fn encode_hilbert_prefix(schema: &ArraySchema, coord: &[CoordValue]) -> ArrayResult<u64> {
20 let bits = normalize::bits_per_dim(schema.arity());
21 let normalized = normalize::normalize_coord(schema, coord, bits)?;
22 hilbert::encode(&normalized, bits)
23}
24
25/// Encode a Z-order prefix for one cell coordinate.
26pub fn encode_zorder_prefix(schema: &ArraySchema, coord: &[CoordValue]) -> ArrayResult<u64> {

Callers 4

convert_insert_arrayFunction · 0.85
convert_delete_arrayFunction · 0.85
encode_cell_prefixFunction · 0.85

Calls 4

bits_per_dimFunction · 0.85
normalize_coordFunction · 0.85
encodeFunction · 0.70
arityMethod · 0.45