This module provides functions to build radix trees on top of sorted integer sequences. In practice, if the integers are seen as Morton codes of spatial points, the algorithms generate a middle-split k-d tree.
The following code snippet shows an example of how to use such builders:
#include <cugar/bintree/cuda/bintree_gen.h>
#include <cugar/bintree/cuda/bintree_context.h>
typedef Bintree_node<leaf_index_tag> node_type;
const uint32 n_points = 1000000;
...
points.begin(),
points.begin() + n_points,
codes.begin(),
morton_functor<uint32,3>() );
thrust::sort( codes.begin(), codes.end() );
Bintree_writer<node_type, device_tag> tree_writer( nodes, leaves );
n_points,
thrust::raw_pointer_cast( &codes.front() ),
30u,
16u,
false,
true,
tree_writer );