Fermat
|
A k-d tree node. A node can either be a leaf and have no children, or be an internal split node. If a split node, its children will be consecutive in memory. Supports up to 7 dimensions.
#include <kd_node.h>
Public Methods | |
CUGAR_HOST_DEVICE | Kd_node () |
CUGAR_HOST_DEVICE | Kd_node (uint32 index) |
CUGAR_HOST_DEVICE | Kd_node (const uint32 split_dim, const float split_plane, uint32 index) |
CUGAR_HOST_DEVICE | Kd_node (const uint32 packed_info, const float split_plane) |
CUGAR_HOST_DEVICE uint32 | is_leaf () const |
CUGAR_HOST_DEVICE uint32 | get_child_offset () const |
CUGAR_HOST_DEVICE uint32 | get_leaf_index () 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 |
CUGAR_HOST_DEVICE uint32 | get_split_dim () const |
CUGAR_HOST_DEVICE float | get_split_plane () const |
Static Public Methods | |
static CUGAR_HOST_DEVICE Kd_node | load (const Kd_node *node) |
static CUGAR_HOST_DEVICE Kd_node | load_ldg (const Kd_node *node) |
Public Members | |
uint32 | m_packed_info |
float | m_split_plane |
Static Public Members | |
static const uint32 | kInvalid = uint32(-1) |
|
inline |
empty constructor
|
inline |
leaf constructor
index | child index |
|
inline |
split node constructor
split_dim | splitting dimension |
split_plane | splitting plane |
index | child index |
|
inline |
leaf constructor
index | child index |
|
inline |
get i-th child
i | child index |
|
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 |
get splitting dimension
|
inline |
get splitting plane
|
inline |
is the i-th child active?
i | child index |
|
inline |
is a leaf?