C# Class Pchp.Library.MersenneTwister

Mersanne Twister random generator.
Datei anzeigen Open project: iolevel/peachpie

Public Methods

Method Description
MersenneTwister ( ) : System

Create a new instance of MersenneTwister using a default seed.

MersenneTwister ( uint seed ) : System

Create a new instance of MersenneTwister using a specified seed.

Next ( ) : int

Generates a random signed integer value.

Next ( int min, int max ) : int

Generates a random number from interval [min,max).

NextUnsigned ( ) : uint

Generates a random unsigned integer.

Seed ( uint seed ) : void

Seeds the generator.

Private Methods

Method Description
NextDouble ( ) : double

Generates a random double value from interval [0,1).

Method Details

MersenneTwister() public method

Create a new instance of MersenneTwister using a default seed.
public MersenneTwister ( ) : System
return System

MersenneTwister() public method

Create a new instance of MersenneTwister using a specified seed.
public MersenneTwister ( uint seed ) : System
seed uint The seed.
return System

Next() public method

Generates a random signed integer value.
public Next ( ) : int
return int

Next() public method

Generates a random number from interval [min,max).
public Next ( int min, int max ) : int
min int
max int
return int

NextUnsigned() public method

Generates a random unsigned integer.
public NextUnsigned ( ) : uint
return uint

Seed() public method

Seeds the generator.
public Seed ( uint seed ) : void
seed uint The seed.
return void