PCG64(state_seed, stream) を draw 回進めた次の値を (0, 1) で返す(変換は open_uniform_from_double53)。
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=i64), | intent(in) | :: | state_seed | |||
| integer(kind=i64), | intent(in) | :: | stream | |||
| integer(kind=i64), | intent(in) | :: | draw |
real(dp) function pcg64_open_uniform(state_seed, stream, draw) result(uniform) integer(i64), intent(in) :: state_seed, stream, draw type(c_ptr) :: handle if (draw < 0_i64) error stop 'counter_uniform draw must be >= 0.' handle = pcg64_create(int(state_seed, c_int64_t), int(stream, c_int64_t)) if (.not. c_associated(handle)) error stop 'failed to create a PCG64 generator.' if (draw > 0_i64) call pcg64_advance(handle, int(draw, c_int64_t)) uniform = open_uniform_from_double53(pcg64_random_double53(handle)) call pcg64_destroy(handle) end function pcg64_open_uniform