pcg32_next_u64 Function

private function pcg32_next_u64(self) result(r)

Full 64-bit random word built from two consecutive 32-bit outputs; the first output supplies the high half. Fixing the order here is what makes next_real_dp and next_below reproducible for this engine.

Type Bound

pcg32_t

Arguments

Type IntentOptional Attributes Name
class(pcg32_t), intent(inout) :: self

Return Value integer(kind=int64)


Calls

proc~~pcg32_next_u64~~CallsGraph proc~pcg32_next_u64 pcg32_t%pcg32_next_u64 proc~pcg32_step pcg32_step proc~pcg32_next_u64->proc~pcg32_step proc~rotate_right32 rotate_right32 proc~pcg32_step->proc~rotate_right32 proc~u64_add u64_add proc~pcg32_step->proc~u64_add proc~u64_mul u64_mul proc~pcg32_step->proc~u64_mul proc~u64_shr u64_shr proc~pcg32_step->proc~u64_shr

Called by

proc~~pcg32_next_u64~~CalledByGraph proc~pcg32_next_u64 pcg32_t%pcg32_next_u64 proc~pcg32_next_below pcg32_next_below proc~pcg32_next_below->proc~pcg32_next_u64 proc~pcg32_next_exponential_int pcg32_next_exponential_int proc~pcg32_next_exponential_int->proc~pcg32_next_u64 proc~pcg32_next_real_dp pcg32_next_real_dp proc~pcg32_next_real_dp->proc~pcg32_next_u64 proc~pcg32_uniform_below pcg32_uniform_below proc~pcg32_uniform_below->proc~pcg32_next_u64 interface~next_below next_below interface~next_below->proc~pcg32_next_below interface~next_exponential_int next_exponential_int interface~next_exponential_int->proc~pcg32_next_exponential_int interface~next_real_dp next_real_dp interface~next_real_dp->proc~pcg32_next_real_dp proc~pcg32_next_bernoulli_ppm pcg32_next_bernoulli_ppm proc~pcg32_next_bernoulli_ppm->proc~pcg32_uniform_below proc~pcg32_next_poisson_int pcg32_next_poisson_int proc~pcg32_next_poisson_int->proc~pcg32_next_exponential_int proc~pcg32_next_range pcg32_next_range proc~pcg32_next_range->proc~pcg32_uniform_below interface~next_bernoulli_ppm next_bernoulli_ppm interface~next_bernoulli_ppm->proc~pcg32_next_bernoulli_ppm interface~next_poisson_int next_poisson_int interface~next_poisson_int->proc~pcg32_next_poisson_int interface~next_range next_range interface~next_range->proc~pcg32_next_range proc~pcg32_next_exponential_dp pcg32_next_exponential_dp proc~pcg32_next_exponential_dp->interface~next_real_dp proc~pcg32_next_normal_dp pcg32_next_normal_dp proc~pcg32_next_normal_dp->interface~next_real_dp proc~splitmix64_next_exponential_dp splitmix64_next_exponential_dp proc~splitmix64_next_exponential_dp->interface~next_real_dp proc~splitmix64_next_normal_dp splitmix64_next_normal_dp proc~splitmix64_next_normal_dp->interface~next_real_dp interface~next_exponential_dp next_exponential_dp interface~next_exponential_dp->proc~pcg32_next_exponential_dp interface~next_exponential_dp->proc~splitmix64_next_exponential_dp interface~next_normal_dp next_normal_dp interface~next_normal_dp->proc~pcg32_next_normal_dp interface~next_normal_dp->proc~splitmix64_next_normal_dp

Variables

Type Visibility Attributes Name Initial
integer(kind=int64), private :: high
integer(kind=int64), private :: low

Source Code

   function pcg32_next_u64(self) result(r)
      !! Full 64-bit random word built from two consecutive 32-bit outputs; the
      !! first output supplies the high half. Fixing the order here is what makes
      !! `next_real_dp` and `next_below` reproducible for this engine.
      class(pcg32_t), intent(inout) :: self
      integer(int64) :: r

      integer(int64) :: high, low

      high = pcg32_step(self)
      low = pcg32_step(self)
      r = ior(ishft(high, 32), low)
   end function pcg32_next_u64