29 #ifndef BINARY_NODE_INCLUDED
30 #define BINARY_NODE_INCLUDED
35 static inline int CenterCount(
int depth ) {
return 1<<depth; }
36 static inline int CornerCount(
int depth ) {
return (1<<depth)+1; }
39 static inline int CenterIndex(
int depth ,
int offSet ) {
return (1<<depth)+offSet-1; }
40 static inline int CornerIndex(
int depth ,
int offSet ) {
return (1<<depth)+offSet-1+depth; }
42 static inline int CornerIndex(
int maxDepth ,
int depth ,
int offSet ,
int forwardCorner ){
return (offSet+forwardCorner)<<(maxDepth-depth); }
43 template<
class Real >
static inline Real
Width(
int depth ){
return Real(1.0/(1<<depth)); }
61 while(
offset>=(1<<depth) )
offset -= (1<<depth) , depth++;
66 while(
offset>=( (1<<depth)+1 ) )
offset -= ( (1<<depth)+1 ) , depth++;
static void CenterAndWidth(int depth, int offset, Real ¢er, Real &width)
static int CornerIndex(int depth, int offSet)
static void CornerDepthAndOffset(int idx, int &depth, int &offset)
static int CumulativeCenterCount(int maxDepth)
static void CornerAndWidth(int idx, Real &corner, Real &width)
static int CenterCount(int depth)
static int CornerCount(int depth)
static void CornerAndWidth(int depth, int offset, Real &corner, Real &width)
static int CenterIndex(int depth, int offSet)
static int CornerIndex(int maxDepth, int depth, int offSet, int forwardCorner)
static Real Width(int depth)
static void CenterDepthAndOffset(int idx, int &depth, int &offset)
static int CumulativeCornerCount(int maxDepth)
static void CenterAndWidth(int idx, Real ¢er, Real &width)