Class that encapsulates the mersenne-twister random number generator
Initializes mt(nn) with a seed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
|||
integer(kind=i64), | intent(in) | :: | seed |
An integer variable with the random seed |
Initializes by an array with array-length init_key is the array for initializing keys
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
|||
integer(kind=i64), | intent(in) | :: | init_key(:) |
An integer array with random seeds |
Initializes mt(nn) with a seed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
|||
integer(kind=i64), | intent(in) | :: | seed |
An integer variable with the random seed |
Initializes by an array with array-length init_key is the array for initializing keys
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
|||
integer(kind=i64), | intent(in) | :: | init_key(:) |
An integer array with random seeds |
Generates a random number on [0,1]-real-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
Generates a random number on [0,1)-real-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
Generates a random number on (0,1)-real-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
Generates a random number on [-2^63, 2^63-1]-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937) | :: | mt |
A |
type :: mt19937 !! Class that encapsulates the mersenne-twister random number generator private integer(i64) :: mt(nn) =0_i64 ! array for the state vector integer :: mti = nn+1 ! mti==nn+1 means mt(nn) is not initialized contains procedure,public :: init_genrand64 procedure,public :: init_by_array64 generic,public :: initialize => init_genrand64,init_by_array64 procedure,public :: genrand64_real1 procedure,public :: genrand64_real2 procedure,public :: genrand64_real3 procedure,public :: genrand64_int64 end type mt19937