SplitMix64 generator: a 64-bit counter run through a strong finaliser.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int64), | public | :: | state | = | 0_int64 |
Explicit 64-bit state. Fixed width on purpose: the algorithm is
defined on 64-bit words and must not follow |
Advance the state by the golden-ratio increment and return the mixed 64-bit output.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(splitmix64_t), | intent(inout) | :: | self |
Full 64-bit random word. For SplitMix64 this is simply next; it
exists so that both engines present the same interface to the shared
real and bounded-integer conversions.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(splitmix64_t), | intent(inout) | :: | self |
Set the generator state. Any 64-bit value is a valid seed, including zero: SplitMix64 has no degenerate state.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(splitmix64_t), | intent(inout) | :: | self | |||
| integer(kind=int64), | intent(in) | :: | s |
type :: splitmix64_t !! SplitMix64 generator: a 64-bit counter run through a strong finaliser. integer(int64) :: state = 0_int64 !! Explicit 64-bit state. Fixed width on purpose: the algorithm is !! defined on 64-bit words and must not follow `default_int`. contains procedure :: seed => splitmix64_seed procedure :: next => splitmix64_next procedure :: next_u64 => splitmix64_next_u64 end type splitmix64_t