blakehawkins / zdex

Evaluate Z-order indexing (morton encoding) for types, iterators, and tuples of BitCollections.
https://crates.io/crates/zdex
2 stars 1 forks source link

z-indexes over heterogeneous BitCollections #1

Open blakehawkins opened 4 years ago

blakehawkins commented 4 years ago

(u16, f32).z_index() is not currently possible.

blakehawkins commented 4 years ago

Note that unlike z-indexes over homogeneous types with different masks, z-indexes over heterogeneous types should be right-padded. E.g.:

assert_eq!(
    (FromU8(0b1), FromU16(0b1)).z_index()?,
    0b0000000100000000_0000000000000001  // Not 0b0000000000000000_0000000000000011
)
blakehawkins commented 4 years ago

See https://github.com/nvzqz/bit-collection-rs/issues/1

Need to either refactor BitCollection to enable dyn support, or move to some other bit collection representation.