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


Platform::Util::Random
Class LinearCongruential

NonCopyableType
   |
   +-IRandom
        |
        +-LinearCongruential

Implemented in:
Platform.Util.Random.h

class LinearCongruential:
public IRandom

A random number generator based on the Linear Congruential algorithm.

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

Inner Compounds, Typedefs, and Enumscollapse
enum Constants
          

Fields inherited from class IRandomcollapse
isDeterministic, isUniform

Constructor Summarycollapse
LinearCongruential()
          Creates a new LinearCongruential object with the default seed value.
LinearCongruential(ULong value)
          Creates a new LinearCongruential object with the specified initial seed value.

Method Summarycollapse
Void seed(UInt value)
          Sets the specified seed value.
Void seedHighPrecision(ULong value)
          Sets the specified seed value.

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 LinearCongruential& object)
          Serializes the state of a LinearCongruential object.
friend Io::IDeserializer& operator>>(Io::IDeserializer& deserializer, LinearCongruential& object)
          Deserializes the state of a LinearCongruential object.

 

Constructor Detail

LinearCongruential[inline]

LinearCongruential()

Creates a new LinearCongruential object with the default seed value.

See Also:
DefaultSeed

LinearCongruential[inline]

LinearCongruential(ULong value)

Creates a new LinearCongruential 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(ULong value)

Sets the specified seed value.

Parameters:
value - new seed value

 

Friend Detail

operator<<[inline]

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

Serializes the state of a LinearCongruential 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, LinearCongruential& object)

Deserializes the state of a LinearCongruential 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