35#ifndef _BLAZE_UTIL_RANDOM_H_
36#define _BLAZE_UTIL_RANDOM_H_
133template<
typename T >
136template<
typename T,
typename... Args >
137T
rand( Args&&... args );
139template<
typename T >
142template<
typename T,
typename... Args >
143void randomize( T&& value, Args&&... args );
147template<
typename RNG = DefaultRNG >
150template<
typename RNG = DefaultRNG >
176template<
typename RNG = DefaultRNG >
191 template<
typename,
typename >
friend class Rand;
192 template<
typename >
friend uint32_t
getSeed();
193 template<
typename >
friend void setSeed( uint32_t seed );
250template<
typename T >
284 std::uniform_int_distribution<T> dist(
min,
max );
343template<
typename T >
356 std::uniform_real_distribution<T> dist( 0.0, 1.0 );
376 std::uniform_real_distribution<T> dist(
min,
max );
433template<
typename T >
448 return complex<T>( tmp.generate(), tmp.generate() );
489 const T& imagmin,
const T& imagmax )
const
492 return complex<T>( tmp.generate( realmin, realmax ), tmp.generate( imagmin, imagmax ) );
550 const T& imagmin,
const T& imagmax )
const
552 value =
generate( realmin, realmax, imagmin, imagmax );
582template<
typename T >
586 return tmp.generate();
605 return tmp.generate( std::forward<Args>( args )... );
625template<
typename T >
629 tmp.randomize( std::forward<T>( value ) );
649 tmp.randomize( std::forward<T>( value ), std::forward<Args>( args )... );
662 static const uint32_t seed =
static_cast<uint32_t
>( std::time(0) );
674template<
typename RNG >
692template<
typename RNG >
Header file for run time assertion macros.
Header file for the complex data type.
Header file for the EnableIf class template.
Header file for the IsFloatingPoint type trait.
Header file for the IsIntegral type trait.
Base class for non-creatable (static) classes.
Header file for the RemoveCVRef type trait.
Header file for the RemoveCV type trait.
Base class for non-creatable (static) classes.
Definition: NonCreatable.h:66
Default implementation of the Rand class.
Definition: Random.h:230
Random number generator.
Definition: Random.h:179
static uint32_t seed_
The current seed for the variate generator.
Definition: Random.h:184
static RNG rng_
The mersenne twister variate generator.
Definition: Random.h:185
Complex data type of the Blaze library.
32-bit unsigned integer type of the Blaze library.
decltype(auto) min(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise minimum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1339
decltype(auto) max(const DenseMatrix< MT1, SO1 > &lhs, const DenseMatrix< MT2, SO2 > &rhs)
Computes the componentwise maximum of the dense matrices lhs and rhs.
Definition: DMatDMatMapExpr.h:1375
decltype(auto) generate(size_t m, size_t n, OP op)
Generates a new dense matrix filled via the given custom binary operation.
Definition: DMatGenExpr.h:675
void randomize(T &&value, Args &&... args)
Randomization of a given variable.
Definition: Random.h:646
uint32_t defaultSeed()
Returns the default random seed.
Definition: Random.h:660
uint32_t getSeed()
Returns the current seed of the random number generator.
Definition: Random.h:675
T rand(Args &&... args)
Random number function.
Definition: Random.h:602
void setSeed(uint32_t seed)
Setting the seed of the random number generator.
Definition: Random.h:693
#define BLAZE_INTERNAL_ASSERT(expr, msg)
Run time assertion macro for internal checks.
Definition: Assert.h:101
constexpr bool IsFloatingPoint_v
Auxiliary variable template for the IsFloatingPoint type trait.
Definition: IsFloatingPoint.h:95
constexpr bool IsIntegral_v
Auxiliary variable template for the IsIntegral type trait.
Definition: IsIntegral.h:95
typename EnableIf< Condition, T >::Type EnableIf_t
Auxiliary type for the EnableIf class template.
Definition: EnableIf.h:138
Header file for the random number generator used in the Blaze library.
Header file for basic type definitions.