Portability | non-portable |
---|---|
Stability | experimental |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Safe Haskell | None |
Keys in Morton order
This module provides combinators for shuffling together the bits of two key components to get a key that is based on their interleaved bits.
See http://en.wikipedia.org/wiki/Z-order_curve for more information about Morton order.
How to perform the comparison without interleaving is described in
https://www.fpcomplete.com/user/edwardk/revisiting-matrix-multiplication-part-2
Keys in Morton order
Key i j
logically orders the keys as if the bits of the keys i
and j
were interleaved. This is equivalent to storing the keys in "Morton Order".
>>>
Key 100 200 ^. _1
100
>>>
Key 100 200 ^. _2
200
Most significant bit comparisons
compares :: Word -> Word -> OrderingSource
compare the position of the most significant bit of two words
>>>
compares 4 7
EQ
>>>
compares 7 9
LT
>>>
compares 9 7
GT
Unboxed vector constructors
data family MVector s a
data family Vector a