Template Class uniform_real_distribution
Defined in File rocrand.hpp
Class Documentation
-
template<class RealType = float>
class uniform_real_distribution Produces random floating-point values uniformly distributed on the interval (0, 1].
- Template Parameters:
RealType – - type of generated values. Only
float,doubleandhalftypes are supported.
Public Functions
-
inline uniform_real_distribution()
Default constructor.
-
inline void reset()
Resets distribution’s internal state if there is any.
-
template<class Generator>
inline void operator()(Generator &g, RealType *output, size_t size) Fills
outputwith uniformly distributed random floating-point values.Generates
sizerandom floating-point values uniformly distributed on the interval (0, 1], and stores them into the device memory referenced byoutputpointer.Requirements:
The device memory pointed by
outputmust have been previously allocated and be large enough to store at leastsizevalues ofRealTypetype.If generator
gis a quasi-random number generator (rocrand_cpp::sobol32_engine), thensizemust be a multiple of that generator’s dimension.
See also: rocrand_generate_uniform(), rocrand_generate_uniform_double(), rocrand_generate_uniform_half()
- Parameters:
g – - An uniform random number generator object
output – - Pointer to device memory to store results
size – - Number of values to generate
-
inline bool operator==(const uniform_real_distribution<RealType> &other)
Returns
trueif the distribution is the same asother.
-
inline bool operator!=(const uniform_real_distribution<RealType> &other)
Returns
trueif the distribution is different fromother.