template<typename C>
requires std::ranges::range<C>
struct bbm::cdf< C >
CDF data structure.
- Template Parameters
-
| C | = container type to store CDF as well as to provide samples for construction. |
Requires that the container 'C' is a range.
sample the CDF given a random variable xi
- Parameters
-
| xi | = random variable between 0 and 1 |
| mask | = enable/disable lanes. |
- Returns
- sampled index, the pdf, and the residual
The value type and index type are determined by the container itself. The random variable is expected to be provided in the same data type as the value type of the container. Hence, if the container stores a packet type, the we also expect the random variable be given as a packet, and the index type to have the same number of channels.
The returned type is a tuple of:
- the sampled index based on xi
- the corresponding pdf of the sample
- the residual, i.e., the rescaled entropy of xi that was not used to determine the sample.