lat::BitOpsMortonInterleave< B > Struct Template Reference
Spread bits of n to be one bit apart from their neighbour to the even bit positions in T; the odd bits will be left zero.
More...
#include <Iguana/Utilities/classlib/utils/BitOps.h>
Detailed Description
template<unsigned int B>
struct lat::BitOpsMortonInterleave< B >
Spread bits of n to be one bit apart from their neighbour to the even bit positions in T; the odd bits will be left zero.
To construct a Morton sequence number of two numbers x and y, do mortonInterleave(x) | (mortonInterleave(y) << 1).
Each operation splits the bits in n into chunks of B bits, and moves the chunks B bits away from its neighbours, and fills the spaces with zeroes---like this (`o' denotes bit that is zero, `0' the least significant bit):
- xxxx xxxx 7654 3210 => (B = 4, pattern = 0x0f0f0f0f)
- oooo 7654 oooo 3210 => (B = 2, pattern = 0x33333333)
- oo76 oo54 oo32 oo10 => (B = 1, pattern = 0x55555555)
- o7o6 o5o4 o3o2 o1o0.
Definition at line 330 of file BitOps.h.
The documentation for this struct was generated from the following file:
- Iguana/Utilities/classlib/utils/BitOps.h
Generated on Tue Jun 9 18:48:22 2009 for CMSSW by
1.5.4