Fermat
Public Types | Public Methods | Public Members | Static Public Members | List of all members
cugar::Bintree_node< leaf_index_tag > Struct Template Reference

Detailed description

template<>
struct cugar::Bintree_node< leaf_index_tag >

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)
 

Constructor & Destructor Documentation

◆ Bintree_node() [1/2]

CUGAR_HOST_DEVICE cugar::Bintree_node< leaf_index_tag >::Bintree_node ( )
inline

empty constructor

◆ Bintree_node() [2/2]

CUGAR_HOST_DEVICE cugar::Bintree_node< leaf_index_tag >::Bintree_node ( bool  child0,
bool  child1,
uint32  index 
)
inline

full constructor

Parameters
child0first child activation predicate
child1second child activation predicate
indexchild index

Member Function Documentation

◆ get_child()

CUGAR_HOST_DEVICE uint32 cugar::Bintree_node< leaf_index_tag >::get_child ( const uint32  i) const
inline

get i-th child (among the active ones)

Parameters
ichild index

◆ get_child_count()

CUGAR_HOST_DEVICE uint32 cugar::Bintree_node< leaf_index_tag >::get_child_count ( ) const
inline

get child count

◆ get_child_index()

CUGAR_HOST_DEVICE uint32 cugar::Bintree_node< leaf_index_tag >::get_child_index ( ) const
inline

get offset of the first child

◆ get_leaf_index()

CUGAR_HOST_DEVICE uint32 cugar::Bintree_node< leaf_index_tag >::get_leaf_index ( ) const
inline

get leaf index

◆ get_left()

CUGAR_HOST_DEVICE uint32 cugar::Bintree_node< leaf_index_tag >::get_left ( ) const
inline

get left partition (or kInvalid if not active)

◆ get_right()

CUGAR_HOST_DEVICE uint32 cugar::Bintree_node< leaf_index_tag >::get_right ( ) const
inline

get right partition (or kInvalid if not active)

◆ has_child()

CUGAR_HOST_DEVICE bool cugar::Bintree_node< leaf_index_tag >::has_child ( const uint32  i) const
inline

is the i-th child active?

Parameters
ichild index

◆ is_leaf()

CUGAR_HOST_DEVICE uint32 cugar::Bintree_node< leaf_index_tag >::is_leaf ( ) const
inline

is a leaf?


The documentation for this struct was generated from the following file: