List of all members
blaze::Rand< T > Class Template Reference

Default implementation of the Rand class for integral data types.This default implementation of the Rand class creates random, integral numbers in the range $ [0..max] $, where max is the maximal value of the given data type T. More...

#include <Random.h>

Public Member Functions

Generate functions
generate () const
 Generation of a random value in the range $ [0..max] $. More...
 
generate (T min, T max) const
 Generation of a random value in the range $ [min..max] $. More...
 
Randomize functions
void randomize (T &value) const
 Randomization of the given variable with a new value in the range $ [0..max] $. More...
 
void randomize (T &value, T min, T max) const
 Randomization of the given variable with a new value in the range $ [min..max] $. More...
 

Detailed Description

template<typename T>
class blaze::Rand< T >

Default implementation of the Rand class for integral data types.

This default implementation of the Rand class creates random, integral numbers in the range $ [0..max] $, where max is the maximal value of the given data type T.

Member Function Documentation

◆ generate() [1/2]

template<typename T >
T blaze::Rand< T >::generate ( ) const
inline

Generation of a random value in the range $ [0..max] $.

Returns
The generated random value.

This generate function creates a random number in the range $ [0..max] $, where max is the maximal value of the given data type T.

◆ generate() [2/2]

template<typename T >
T blaze::Rand< T >::generate ( min,
max 
) const
inline

Generation of a random value in the range $ [min..max] $.

Parameters
minThe smallest possible random value.
maxThe largest possible random value.
Returns
The generated random value.

This generate function creates a random number in the range $ [min..max] $, where min must be smaller or equal to max. Note that this requirement is only checked in debug mode. In release mode, no check is performed to enforce the validity of the values. Therefore the returned value is undefined if min is larger than max.

◆ randomize() [1/2]

template<typename T >
void blaze::Rand< T >::randomize ( T &  value) const
inline

Randomization of the given variable with a new value in the range $ [0..max] $.

Parameters
valueThe variable to be randomized.
Returns
void

This function randomizes the given variable to a new value in the range $ [0..max] $, where max is the maximal value of the given data type T.

◆ randomize() [2/2]

template<typename T >
void blaze::Rand< T >::randomize ( T &  value,
min,
max 
) const
inline

Randomization of the given variable with a new value in the range $ [min..max] $.

Parameters
valueThe variable to be randomized.
minThe smallest possible random value.
maxThe largest possible random value.
Returns
void

This function randomizes the given variable to a new value in the range $ [min..max] $, where min must be smaller or equal to max. Note that this requirement is only checked in debug mode. In release mode, no check is performed to enforce the validity of the values. Therefore the returned value is undefined if min is larger than max.


The documentation for this class was generated from the following file: