Skip to content

PRNG functions and expressions

gen_random_range function

template <typename T>
internal::expression_random_range<T>
gen_random_range(const random_bit_generator &gen, T min,
                 T max)

Returns expression that returns pseudo random values of the given range. Copies the given generator

Source code
template <typename T>
KFR_FUNCTION internal::expression_random_range<T> gen_random_range(const random_bit_generator& gen, T min,
                                                                   T max)
{
    return internal::expression_random_range<T>(gen, min, max);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/random.hpp#L212

template <typename T>
internal::expression_random_range<
    T, std::reference_wrapper<random_bit_generator>>
gen_random_range(
    std::reference_wrapper<random_bit_generator> gen, T min,
    T max)

Returns expression that returns pseudo random values of the given range. References the given generator. Use std::ref(gen) to force this overload

Source code
template <typename T>
KFR_FUNCTION internal::expression_random_range<T, std::reference_wrapper<random_bit_generator>>
gen_random_range(std::reference_wrapper<random_bit_generator> gen, T min, T max)
{
    return internal::expression_random_range<T, std::reference_wrapper<random_bit_generator>>(gen, min, max);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/random.hpp#L222

template <typename T>
internal::expression_random_range<T> gen_random_range(T min,
                                                      T max)

Returns expression that returns pseudo random values of the given range

Source code
template <typename T>
KFR_FUNCTION internal::expression_random_range<T> gen_random_range(T min, T max)
{
    return internal::expression_random_range<T>(random_bit_generator(seed_from_rdtsc), min, max);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/random.hpp#L230

gen_random_uniform function

template <typename T>
internal::expression_random_uniform<T>
gen_random_uniform(const random_bit_generator &gen)

Returns expression that returns pseudo random values. Copies the given generator

Source code
template <typename T>
KFR_FUNCTION internal::expression_random_uniform<T> gen_random_uniform(const random_bit_generator& gen)
{
    return internal::expression_random_uniform<T>(gen);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/random.hpp#L187

template <typename T>
internal::expression_random_uniform<
    T, std::reference_wrapper<random_bit_generator>>
gen_random_uniform(
    std::reference_wrapper<random_bit_generator> gen)

Returns expression that returns pseudo random values. References the given generator. Use std::ref(gen) to force this overload

Source code
template <typename T>
KFR_FUNCTION internal::expression_random_uniform<T, std::reference_wrapper<random_bit_generator>>
gen_random_uniform(std::reference_wrapper<random_bit_generator> gen)
{
    return internal::expression_random_uniform<T, std::reference_wrapper<random_bit_generator>>(gen);
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/random.hpp#L196

template <typename T>
internal::expression_random_uniform<T> gen_random_uniform()

Returns expression that returns pseudo random values

Source code
template <typename T>
KFR_FUNCTION internal::expression_random_uniform<T> gen_random_uniform()
{
    return internal::expression_random_uniform<T>(random_bit_generator(seed_from_rdtsc));
}

https://github.com/kfrlib/kfr/blob//include/kfr/base/random.hpp#L204


Auto-generated from sources, Revision , https://github.com/kfrlib/kfr/blob//include/kfr/