64-bit version of the Mersenne Twister pseudorandom number generator.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer, | private, | parameter | :: | r8 | = | real64 | |
integer, | private, | parameter | :: | i4 | = | int32 | |
integer, | private, | parameter | :: | i8 | = | int64 | |
integer(kind=i8), | private, | parameter | :: | nn | = | 312_i8 | |
integer(kind=i8), | private, | parameter | :: | mm | = | 156_i8 | |
integer(kind=i8), | private, | parameter | :: | seed_def | = | 5489_i8 | |
integer(kind=i8), | private, | parameter | :: | matrix_a | = | -5403634167711393303_i8 | |
integer(kind=i8), | private, | parameter | :: | um | = | -2147483648_i8 | most significant 33 bits |
integer(kind=i8), | private, | parameter | :: | lm | = | 2147483647_i8 | least significant 31 bits |
real(kind=r8), | private, | parameter | :: | pi253_1 | = | 1.0_r8/(2.0_r8**53-1.0_r8) | |
real(kind=r8), | private, | parameter | :: | pi253 | = | 1.0_r8/(2.0_r8**53) | |
real(kind=r8), | private, | parameter | :: | pi252 | = | 1.0_r8/(2.0_r8**52) |
main class for random number generator
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
integer(kind=i8), | public | :: | mt(nn) | = | 0_i8 | array for the state vector |
|
integer, | public | :: | mti | = | nn+1 |
|
generic, public :: initialize => init_genrand64_i4, init_genrand64, init_by_array64 | call first to initialize |
procedure, public :: init_genrand64 | |
procedure, public :: init_by_array64 | |
procedure, public :: init_genrand64_i4 | |
procedure, public :: genrand64_real1 | |
procedure, public :: genrand64_real2 | |
procedure, public :: genrand64_real3 | |
procedure, public :: genrand64_int64 |
Generates a random number on [-2^63, 2^63-1]-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937), | intent(inout) | :: | me |
Generates a random number on [0,1]-real-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937), | intent(inout) | :: | me |
Generates a random number on [0,1)-real-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937), | intent(inout) | :: | me |
Generates a random number on (0,1)-real-interval
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937), | intent(inout) | :: | me |
Initializes me%mt(nn)
with a seed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937), | intent(inout) | :: | me | |||
integer(kind=i4), | intent(in) | :: | seed |
Initializes me%mt(nn)
with a seed
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937), | intent(inout) | :: | me | |||
integer(kind=i8), | intent(in) | :: | seed |
Initializes by an array with array-length
init_key
is the array for initializing keys
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(mt19937), | intent(inout) | :: | me | |||
integer(kind=i8), | intent(in) | :: | init_key(:) |