C# 클래스 YAMP.Numerics.MT19937Generator

Represents a Mersenne Twister pseudo-random number generator with period 2^19937-1.
The MT19937Generator type bases upon information and the implementation presented on the Mersenne Twister Home Page.
상속: Generator
파일 보기 프로젝트 열기: FlorianRappl/YAMP

공개 메소드들

메소드 설명
MT19937Generator ( ) : System

Initializes a new instance of the MT19937Generator class, using a time-dependent default seed value.

MT19937Generator ( int seed ) : System

Initializes a new instance of the MT19937Generator class, using the specified seed value.

MT19937Generator ( uint seed ) : System

Initializes a new instance of the MT19937Generator class, using the specified seed value.

Next ( ) : int

Returns a nonnegative random number less than MaxValue.

Next ( int maxValue ) : int

Returns a nonnegative random number less than the specified maximum.

Next ( int minValue, int maxValue ) : int

Returns a random number within the specified range.

NextBoolean ( ) : bool

Returns a random Boolean value.

Buffers 32 random bits (1 uint) for future calls, so a new random number is only generated every 32 calls.

NextBytes ( byte buffer ) : void

Fills the elements of a specified array of bytes with random numbers.

Each element of the array of bytes is set to a random number greater than or equal to 0, and less than or equal to Byte.MaxValue.

NextDouble ( ) : double

Returns a nonnegative floating point random number less than 1.0.

NextDouble ( double maxValue ) : double

Returns a nonnegative floating point random number less than the specified maximum.

NextDouble ( double minValue, double maxValue ) : double

Returns a floating point random number within the specified range.

NextInclusiveMaxValue ( ) : int

Returns a nonnegative random number less than or equal to MaxValue.

NextUInt ( ) : uint

Returns an unsigned random number.

Reset ( ) : bool

Resets the MT19937Generator, so that it produces the same pseudo-random number sequence again.

비공개 메소드들

메소드 설명
GenerateNUInts ( ) : void

Generates MT19937Generator.N unsigned random numbers.

Generated random numbers are 32-bit unsigned integers greater than or equal to UInt32.MinValue and less than or equal to UInt32.MaxValue.

ResetBySeedArray ( ) : void

Extends resetting of the MT19937Generator using the seedArray.

ResetGenerator ( ) : void

Resets the MT19937Generator, so that it produces the same pseudo-random number sequence again.

메소드 상세

MT19937Generator() 공개 메소드

Initializes a new instance of the MT19937Generator class, using a time-dependent default seed value.
public MT19937Generator ( ) : System
리턴 System

MT19937Generator() 공개 메소드

Initializes a new instance of the MT19937Generator class, using the specified seed value.
public MT19937Generator ( int seed ) : System
seed int /// A number used to calculate a starting value for the pseudo-random number sequence. /// If a negative number is specified, the absolute value of the number is used. ///
리턴 System

MT19937Generator() 공개 메소드

Initializes a new instance of the MT19937Generator class, using the specified seed value.
public MT19937Generator ( uint seed ) : System
seed uint /// An unsigned number used to calculate a starting value for the pseudo-random number sequence. ///
리턴 System

Next() 공개 메소드

Returns a nonnegative random number less than MaxValue.
public Next ( ) : int
리턴 int

Next() 공개 메소드

Returns a nonnegative random number less than the specified maximum.
/// is less than 0. ///
public Next ( int maxValue ) : int
maxValue int /// The exclusive upper bound of the random number to be generated. /// must be greater than or equal to 0. ///
리턴 int

Next() 공개 메소드

Returns a random number within the specified range.
/// is greater than . ///
public Next ( int minValue, int maxValue ) : int
minValue int /// The inclusive lower bound of the random number to be generated. ///
maxValue int /// The exclusive upper bound of the random number to be generated. /// must be greater than or equal to . ///
리턴 int

NextBoolean() 공개 메소드

Returns a random Boolean value.
Buffers 32 random bits (1 uint) for future calls, so a new random number is only generated every 32 calls.
public NextBoolean ( ) : bool
리턴 bool

NextBytes() 공개 메소드

Fills the elements of a specified array of bytes with random numbers.
Each element of the array of bytes is set to a random number greater than or equal to 0, and less than or equal to Byte.MaxValue.
/// is a null reference ( in Visual Basic). ///
public NextBytes ( byte buffer ) : void
buffer byte An array of bytes to contain random numbers.
리턴 void

NextDouble() 공개 메소드

Returns a nonnegative floating point random number less than 1.0.
public NextDouble ( ) : double
리턴 double

NextDouble() 공개 메소드

Returns a nonnegative floating point random number less than the specified maximum.
/// is less than 0. ///
public NextDouble ( double maxValue ) : double
maxValue double /// The exclusive upper bound of the random number to be generated. /// must be greater than or equal to 0.0. ///
리턴 double

NextDouble() 공개 메소드

Returns a floating point random number within the specified range.
/// is greater than . /// /// The range between and is greater than /// . ///
public NextDouble ( double minValue, double maxValue ) : double
minValue double /// The inclusive lower bound of the random number to be generated. /// The range between and must be less than or equal to /// ///
maxValue double /// The exclusive upper bound of the random number to be generated. /// must be greater than or equal to . /// The range between and must be less than or equal to /// . ///
리턴 double

NextInclusiveMaxValue() 공개 메소드

Returns a nonnegative random number less than or equal to MaxValue.
public NextInclusiveMaxValue ( ) : int
리턴 int

NextUInt() 공개 메소드

Returns an unsigned random number.
public NextUInt ( ) : uint
리턴 uint

Reset() 공개 메소드

Resets the MT19937Generator, so that it produces the same pseudo-random number sequence again.
public Reset ( ) : bool
리턴 bool