Skip to content

PRNG functions and expressions


gen_random_normal function

template <typename T, index_t Dims = 1>
expression_random_normal<T, Dims>
gen_random_normal(const random_state &state, T sigma = 1,
                  T mu = 0)

Returns expression that returns pseudorandom values from normal (gaussian) distribution. Copies the given generator


template <typename T, index_t Dims = 1>
expression_random_normal<T, Dims, true> gen_random_normal(
    std::reference_wrapper<random_state> state, T sigma = 1,
    T mu = 0)

Returns expression that returns pseudorandom values from normal (gaussian) distribution. References the given generator. Use std::ref(gen) to force this overload


template <typename T, index_t Dims = 1>
expression_random_normal<T, Dims>
gen_random_normal(T sigma = 1, T mu = 0)

Returns expression that returns pseudorandom values from normal (gaussian) distribution


gen_random_range function

template <typename T, index_t Dims = 1>
expression_random_range<T, Dims>
gen_random_range(const random_state &state, T min, T max)

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


template <typename T, index_t Dims = 1>
expression_random_range<T, Dims, true>
gen_random_range(std::reference_wrapper<random_state> state,
                 T min, T max)

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


template <typename T, index_t Dims = 1>
expression_random_range<T, Dims> gen_random_range(T min,
                                                  T max)

Returns expression that returns pseudorandom values of the given range


gen_random_uniform function

template <typename T, index_t Dims = 1>
expression_random_uniform<T, Dims>
gen_random_uniform(const random_state &state)

Returns expression that returns pseudorandom values. Copies the given generator


template <typename T, index_t Dims = 1>
expression_random_range<T, Dims, true> gen_random_uniform(
    std::reference_wrapper<random_state> state)

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


template <typename T, index_t Dims = 1>
expression_random_range<T, Dims> gen_random_uniform()

Returns expression that returns pseudorandom values


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