Expand description
Implements various index arithmetic functions for perfect binary trees.
Functions§
- children
- Returns an index’s children.
- expand
- Returns an index’s family.
- first_
leaf - Returns the first leaf of a tree rooted at
rootwith adepth. - general_
index_ to_ subtree - Translate the general index
indexinto a subtree index rooted atroot. - is_
in_ subtree - Returns if
indexis in the subtree rooted atroot. - last_
leaf - Returns the last leaf of a tree rooted at
rootwith adepth. - last_
power_ of_ two - Returns the last power of two for
nusing bit twiddling. - log2
- Returns the log base 2 of
n. - next_
power_ of_ two - Returns the next power of two for
nusing bit twiddling. - relative_
depth - Returns the depth between two general indicies.
- root_
from_ depth - Returns the subtree root for
indexassuming the tree isdepthdeep. - sibling
- Returns the index’s sibling.
- subtree_
index_ to_ general - Translate the subtree index
indexrooted atrootinto a general index.