Public Types | Public Member Functions
ash::Random< T, Global, S, I, F > Struct Template Reference

Auto-seeded random number generator. More...

#include <ash/random.h>

Inheritance diagram for ash::Random< T, Global, S, I, F >:
Inheritance graph
[legend]

List of all members.

Public Types

typedef T value_type
 The type of number generated.

Public Member Functions

void set_range (T min, T max)
 Change the range of numbers generated.
void unset_range ()
 Remove range restrictions on generated numbers.
operator() () const
 Generate a random number.
operator() (T min, T max) const
 Generate a random number within a range.
 operator T () const
 Cast operator - generate and return a random number.
Constructors/Destructors

We use the default copy constructor.

We use the default destructor.

 Random ()
 Default constructor.
 Random (T min, T max)
 Constructor for a random number within a set range.

Detailed Description

template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
struct ash::Random< T, Global, S, I, F >

Auto-seeded random number generator.

Template Parameters:
TThe type of number to generate. Also defined as Random::value_type.
GlobalUse a global seed (true by default).
Examples:
omp_example/main.cpp.

Member Typedef Documentation

template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
typedef T ash::Random< T, Global, S, I, F >::value_type

Constructor & Destructor Documentation

template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
ash::Random< T, Global, S, I, F >::Random ( ) [inline]
template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
ash::Random< T, Global, S, I, F >::Random ( min,
max 
) [inline]

Constructor for a random number within a set range.

Parameters:
minThe lower bound of the range.
maxThe upper bound of the range.

Reimplemented in ash::Random< T, Global, 64, true, false >, ash::Random< T, Global, 32, false, true >, ash::Random< T, Global, S, false, true >, and ash::Random< T, Global, S, true, false >.


Member Function Documentation

template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
ash::Random< T, Global, S, I, F >::operator T ( ) const [inline]
template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
T ash::Random< T, Global, S, I, F >::operator() ( ) const [inline]
template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
T ash::Random< T, Global, S, I, F >::operator() ( min,
max 
) const [inline]

Generate a random number within a range.

Parameters:
minThe lower bound of the range.
maxThe upper bound of the range.

Reimplemented in ash::Random< T, Global, 64, true, false >, ash::Random< T, Global, 32, false, true >, ash::Random< T, Global, S, false, true >, and ash::Random< T, Global, S, true, false >.

template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
void ash::Random< T, Global, S, I, F >::set_range ( min,
max 
) [inline]

Change the range of numbers generated.

Parameters:
minThe lower bound of the range.
maxThe upper bound of the range.

Reimplemented in ash::Random< T, Global, 64, true, false >, ash::Random< T, Global, 32, false, true >, ash::Random< T, Global, S, false, true >, and ash::Random< T, Global, S, true, false >.

template<typename T, bool Global = true, uint8 S = bitsizeof(T), bool I = is_integral<T>::value, bool F = is_floating_point<T>::value>
void ash::Random< T, Global, S, I, F >::unset_range ( ) [inline]

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


© 2012   AshTL
Licensed under  AGPLv3
Hosted by  Get AshTL at SourceForge.net. Fast, secure and Free Open Source software downloads
Generated by  doxygen 1.7.4