SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND


Platform::Util::Random
Class MersenneTwister

NonCopyableType
   |
   +-IRandom
        |
        +-MersenneTwister

Implemented in:
Platform.Util.Random.h

class MersenneTwister:
public IRandom

A random number generator based on the Mersenne Twister algorithm.

See Also:
http://en.wikipedia.org/wiki/Mersenne_twister

Inner Compounds, Typedefs, and Enumscollapse
enum Constants
          

Fields inherited from class IRandomcollapse
isDeterministic, isUniform

Constructor Summarycollapse
MersenneTwister()
          Creates a new MersenneTwister object with the default seed value.
MersenneTwister(const Containers::Names::UIntArray& array)
          
MersenneTwister(const UInt* array, Int size)
          
MersenneTwister(ULong value)
          Creates a new MersenneTwister object with the specified initial seed value.

Method Summarycollapse
Void seed(UInt value)
          Sets the specified seed value.
Void seedHighPrecision(const UInt* array, Int size)
          Sets the specified seed value from an array of integers.

Methods inherited from class IRandomcollapse
nextBool, nextDouble, nextFloat, nextGaussianDistribution, nextInt, nextLessThan, nextLong, nextNormalDistribution, nextWithinRange, random, seed, shuffle, shuffle, shuffle, shuffle

Friend Summarycollapse
friend Io::ISerializer& operator<<(Io::ISerializer& serializer, const MersenneTwister& object)
          Serializes the state of a MersenneTwister object.
friend Io::IDeserializer& operator>>(Io::IDeserializer& deserializer, MersenneTwister& object)
          Deserializes the state of a MersenneTwister object.

 

Constructor Detail

MersenneTwister[inline]

MersenneTwister()

Creates a new MersenneTwister object with the default seed value.

See Also:
DefaultSeed

MersenneTwister[inline]

MersenneTwister(const Containers::Names::UIntArray& array)


MersenneTwister[inline]

MersenneTwister(const UInt* array, Int size)


MersenneTwister[inline]

MersenneTwister(ULong value)

Creates a new MersenneTwister object with the specified initial seed value.

Parameters:
value - initial seed value

 

Method Detail

seed[virtual, inline]

Void seed(UInt value)

Sets the specified seed value.

Parameters:
value - new seed value
Overrides:
IRandom::seed

seedHighPrecision[inline]

Void seedHighPrecision(const UInt* array, Int size)

Sets the specified seed value from an array of integers.

Parameters:
array - pointer to the array
size - the size of the aray

 

Friend Detail

operator<<[inline]

friend Io::ISerializer& operator<<(Io::ISerializer& serializer, const MersenneTwister& object)

Serializes the state of a MersenneTwister object.

Parameters:
object - an object to serialize
serializer - a serializer to receive state data
Returns:
the reference to the serializer

operator>>[inline]

friend Io::IDeserializer& operator>>(Io::IDeserializer& deserializer, MersenneTwister& object)

Deserializes the state of a MersenneTwister object.

Parameters:
object - an object to deserialize
deserializer - a deserializer to retrieve state data from
Returns:
the reference to the deserializer


SUMMARY:  INNER | FIELD | CONSTR | METHOD | FRIEND DETAIL:  FIELD | CONSTR | METHOD | FRIEND