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".

`>>>`

100`Key 100 200 ^. _1`

`>>>`

200`Key 100 200 ^. _2`

# Most significant bit comparisons

compares :: Word -> Word -> OrderingSource

compare the position of the most significant bit of two words

`>>>`

EQ`compares 4 7`

`>>>`

LT`compares 7 9`

`>>>`

GT`compares 9 7`

# Unboxed vector constructors

data family MVector s a

data family Vector a