24.02.1
|
Uniform distribution within a given number of sub-ranges. More...
#include <Random.h>
Public Types | |
using | fp_dist = typename std::conditional< is_fp_16bit, arm_compute::utils::uniform_real_distribution_16bit< T >, std::uniform_real_distribution< T > >::type |
using | DT = typename std::conditional< is_integral, std::uniform_int_distribution< T >, fp_dist >::type |
using | result_type = T |
using | range_pair = std::pair< result_type, result_type > |
Public Member Functions | |
RangedUniformDistribution (result_type low, result_type high, const std::vector< range_pair > &exclude_ranges) | |
Constructor. More... | |
template<class URNG > | |
result_type | operator() (URNG &g) |
Generate random number. More... | |
Static Public Attributes | |
static constexpr bool | is_fp_16bit = std::is_same<T, half>::value || std::is_same<T, bfloat16>::value |
static constexpr bool | is_integral = std::is_integral<T>::value && !is_fp_16bit |
Uniform distribution within a given number of sub-ranges.
T | Distribution primitive type |
using DT = typename std::conditional<is_integral, std::uniform_int_distribution<T>, fp_dist>::type |
using fp_dist = typename std::conditional<is_fp_16bit, arm_compute::utils::uniform_real_distribution_16bit<T>, std::uniform_real_distribution<T> >::type |
using range_pair = std::pair<result_type, result_type> |
using result_type = T |
|
inline |
Constructor.
[in] | low | lowest value in the range (inclusive) |
[in] | high | highest value in the range (inclusive for uniform_int_distribution, exclusive for uniform_real_distribution) |
[in] | exclude_ranges | Ranges to exclude from the generator |
Definition at line 64 of file Random.h.
References ARM_COMPUTE_ERROR_ON, arm_compute::quantization::epsilon, and RangedUniformDistribution< T >::is_integral.
|
inline |
Generate random number.
URNG | Random number generator object type |
[in] | g | A uniform random number generator object, used as the source of randomness. |
|
staticconstexpr |
Definition at line 49 of file Random.h.
Referenced by RangedUniformDistribution< T >::RangedUniformDistribution().