Fermat
|
A "slim" binary tree node, with a single primitive index per leaf. A node can either be a leaf and have no children, or be an internal split node. If a split node, it can either have one or two children: for example, it can have one if a set of points is concentrated in one half-space.
#include <bintree_node.h>
Public Types | |
typedef leaf_index_tag | node_tag |
Public Methods | |
CUGAR_HOST_DEVICE | Bintree_node () |
CUGAR_HOST_DEVICE | Bintree_node (bool child0, bool child1, uint32 index) |
CUGAR_HOST_DEVICE uint32 | is_leaf () const |
CUGAR_HOST_DEVICE uint32 | get_child_index () const |
CUGAR_HOST_DEVICE uint32 | get_leaf_index () const |
CUGAR_HOST_DEVICE uint32 | get_child_count () const |
CUGAR_HOST_DEVICE uint32 | get_child (const uint32 i) const |
CUGAR_HOST_DEVICE bool | has_child (const uint32 i) const |
CUGAR_HOST_DEVICE uint32 | get_left () const |
CUGAR_HOST_DEVICE uint32 | get_right () const |
Public Members | |
uint32 | m_packed_info |
Static Public Members | |
static const uint32 | kInvalid = uint32(-1) |
|
inline |
empty constructor
|
inline |
full constructor
child0 | first child activation predicate |
child1 | second child activation predicate |
index | child index |
|
inline |
get i-th child (among the active ones)
i | child index |
|
inline |
get child count
|
inline |
get offset of the first child
|
inline |
get leaf index
|
inline |
get left partition (or kInvalid if not active)
|
inline |
get right partition (or kInvalid if not active)
|
inline |
is the i-th child active?
i | child index |
|
inline |
is a leaf?