CNum 0.2.1
CPU-optimized ML library for C++
Loading...
Searching...
No Matches
CNum::Utils::Rand Namespace Reference

Utilities for generating random numbers. More...

Classes

class  RandomGenerator
 A global service for random number generation. More...

Functions

template<typename T>
void generate_n_unique_rand_in_range (size_t low_bound, size_t high_bound, T *out, size_t n, uint64_t logical_id=0)
 Generate n unique random integers.

Detailed Description

Utilities for generating random numbers.

Function Documentation

◆ generate_n_unique_rand_in_range()

template<typename T>
void CNum::Utils::Rand::generate_n_unique_rand_in_range ( size_t low_bound,
size_t high_bound,
T * out,
size_t n,
uint64_t logical_id = 0 )

Generate n unique random integers.

Parameters
low_boundThe low bound of the integer values
high_boundThe high bound of the integer values
outThe pointer to where the random integers are stored
nThe number of unique random integers to generate
logical_idThe logical id of the RNG stream