NVBIO
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Functions
Sum Trees

Detailed Description

This module implements a class to hold a Sum Tree, an object similar to a Haar Wavelet tree, with the difference that each node encodes the plain sum of the children's coefficients. This data-structure allows O(log(N)) modifications to the values associated with the leaves of the tree.

Classes

struct  nvbio::SumTree< Iterator >
 

Functions

template<typename Iterator >
NVBIO_FORCEINLINE
NVBIO_HOST_DEVICE uint32 
nvbio::sample (const SumTree< Iterator > &tree, const float value)
 

Function Documentation

template<typename Iterator >
NVBIO_FORCEINLINE NVBIO_HOST_DEVICE uint32 nvbio::sample ( const SumTree< Iterator > &  tree,
const float  value 
)

sample a cell from a linear SumTree, returning a leaf with probability proportional to its value in the SumTree

Parameters
valuea value in the range [0,1]
Returns
the sampled cell

Definition at line 129 of file sum_tree_inl.h.