init_genrand64 Subroutine

private subroutine init_genrand64(me, seed)

Initializes me%mt(nn) with a seed

Arguments

TypeIntentOptionalAttributesName
class(mt19937), intent(inout) :: me
integer(kind=i8), intent(in) :: seed

Contents

Source Code


Source Code

  subroutine init_genrand64(me,seed)
    !! Initializes `me%mt(nn)` with a seed
    implicit none

    class(mt19937),intent(inout) :: me
    integer(i8), intent(in) :: seed

    integer :: i

    me%mt(1) = seed
    do i = 1, nn-1
      me%mt(i+1) = 6364136223846793005_i8 * ieor(me%mt(i), ishft(me%mt(i), -62)) + i
    end do

    me%mti = nn

  end subroutine init_genrand64