SF_RANDOM Module



























































Used by

  • module~~sf_random~~UsedByGraph module~sf_random SF_RANDOM module~scifor SCIFOR module~scifor->module~sf_random module~sf_sp_linalg SF_SP_LINALG module~scifor->module~sf_sp_linalg module~sf_sp_linalg->module~sf_random

Interfaces

public interface mersenne_init

  • private subroutine init_genrand(seed)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: seed

public interface mt_init

  • private subroutine init_genrand(seed)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: seed

public interface mersenne

  • private function grnd()

    Arguments

    None

    Return Value real(kind=8)

public interface mt_random

  • private subroutine d_grnd_1(A)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8), dimension(:) :: A
  • private subroutine d_grnd_2(A)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8), dimension(:,:) :: A
  • private subroutine d_grnd_3(A)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8), dimension(:,:,:) :: A
  • private subroutine d_grnd_4(A)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8), dimension(:,:,:,:) :: A
  • private subroutine d_grnd_5(A)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8), dimension(:,:,:,:,:) :: A
  • private subroutine d_grnd_6(A)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8), dimension(:,:,:,:,:,:) :: A
  • private subroutine d_grnd_7(A)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8), dimension(:,:,:,:,:,:,:) :: A
  • private subroutine c_grnd_1(A)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=8), dimension(:) :: A
  • private subroutine c_grnd_2(A)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=8), dimension(:,:) :: A
  • private subroutine c_grnd_3(A)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=8), dimension(:,:,:) :: A
  • private subroutine c_grnd_4(A)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=8), dimension(:,:,:,:) :: A
  • private subroutine c_grnd_5(A)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=8), dimension(:,:,:,:,:) :: A
  • private subroutine c_grnd_6(A)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=8), dimension(:,:,:,:,:,:) :: A
  • private subroutine c_grnd_7(A)

    Arguments

    Type IntentOptional Attributes Name
    complex(kind=8), dimension(:,:,:,:,:,:,:) :: A

public interface mt_uniform

  • private function igrnd(l, h)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: l
    integer, intent(in) :: h

    Return Value integer

  • private function dgrnd_uniform(a, b) result(c)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: a
    real(kind=8) :: b

    Return Value real(kind=8)

public interface mt_normal

  • private function gaussrnd()

    Arguments

    None

    Return Value real(kind=8)

  • private function normalrnd(mean, stdev) result(c)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: mean
    real(kind=8) :: stdev

    Return Value real(kind=8)

public interface mt_exponential

  • private function exponentialrnd(mean) result(c)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: mean

    Return Value real(kind=8)

public interface mt_gamma

  • private recursive function gammarnd(shape, scale) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: shape
    real(kind=8) :: scale

    Return Value real(kind=8)

public interface mt_chi_square

  • private function chi_squarernd(dof) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: dof

    Return Value real(kind=8)

public interface mt_inverse_gamma

  • private function inverse_gammarnd(shape, scale) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: shape
    real(kind=8) :: scale

    Return Value real(kind=8)

public interface mt_weibull

  • private function weibullrnd(shape, scale) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: shape
    real(kind=8) :: scale

    Return Value real(kind=8)

public interface mt_cauchy

  • private function cauchyrnd(median, scale) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: median
    real(kind=8) :: scale

    Return Value real(kind=8)

public interface mt_student_t

  • private function student_trnd(dof) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: dof

    Return Value real(kind=8)

public interface mt_laplace

  • private function laplacernd(mean, scale) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: mean
    real(kind=8) :: scale

    Return Value real(kind=8)

public interface mt_log_normal

  • private function log_normalrnd(mu, sigma) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: mu
    real(kind=8) :: sigma

    Return Value real(kind=8)

public interface mt_beta

  • private function betarnd(a, b) result(ans)

    Arguments

    Type IntentOptional Attributes Name
    real(kind=8) :: a
    real(kind=8) :: b

    Return Value real(kind=8)

public interface mt_save

  • private subroutine mtsavef(fname, forma)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: fname
    character(len=1), intent(in) :: forma
  • private subroutine mtsaveu(unum, forma)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unum
    character(len=1), intent(in) :: forma

public interface mt_get

  • private subroutine mtgetf(fname, forma)

    Arguments

    Type IntentOptional Attributes Name
    character(len=*), intent(in) :: fname
    character(len=1), intent(in) :: forma
  • private subroutine mtgetu(unum, forma)

    Arguments

    Type IntentOptional Attributes Name
    integer, intent(in) :: unum
    character(len=1), intent(in) :: forma

Functions

public function random_number_seed(info, file)

Arguments

Type IntentOptional Attributes Name
integer, intent(in), optional :: info
integer, intent(in), optional :: file

Return Value integer

public function random_normal() result(fn_val)

Arguments

None

Return Value real

public function random_gamma(s, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: s
logical, intent(in) :: first

Return Value real

public function random_gamma1(s, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: s
logical, intent(in) :: first

Return Value real

public function random_gamma2(s, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: s
logical, intent(in) :: first

Return Value real

public function random_chisq(ndf, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: ndf
logical, intent(in) :: first

Return Value real

public function random_exponential() result(fn_val)

Arguments

None

Return Value real

public function random_Weibull(a) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: a

Return Value real

public function random_beta(aa, bb, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: aa
real, intent(in) :: bb
logical, intent(in) :: first

Return Value real

public function random_inv_gauss(h, b, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: h
real, intent(in) :: b
logical, intent(in) :: first

Return Value real

public function random_Poisson(mu, first) result(ival)

This work was supported by grant CA-16672 from the National Cancer Institute. GENerate POIsson random deviate Function Generates a single random deviate from a Poisson distribution with mean mu. Arguments mu --> The mean of the Poisson distribution from which a random deviate is to be generated. REAL mu Method For details see: Ahrens, J.H. and Dieter, U. Computer Generation of Poisson Deviates From Modified Normal Distributions. ACM Trans. Math. Software, 8, 2 (June 1982),163-179 TABLES: COEFFICIENTS A0-A7 FOR STEP F. FACTORIALS FACT COEFFICIENTS A(K) - FOR PX = FKVVSUM(A(K)V**K)-DEL SEPARATION OF CASES A AND B .. Scalar Arguments ..

Read more…

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: mu
logical, intent(in) :: first

Return Value integer

public function random_binomial1(n, p, first) result(ival)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real, intent(in) :: p
logical, intent(in) :: first

Return Value integer

public function bin_prob(n, p, r) result(fn_val)

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real, intent(in) :: p
integer, intent(in) :: r

Return Value real

public function lngamma(x) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real(kind=dp), intent(in) :: x

Return Value real(kind=dp)

public function random_binomial2(n, pp, first) result(ival)

This work was supported by grant CA-16672 from the National Cancer Institute. GENerate BINomial random deviate Function Generates a single random deviate from a binomial distribution whose number of trials is N and whose probability of an event in each trial is P. Arguments N --> The number of trials in the binomial distribution from which a random deviate is to be generated. INTEGER N P --> The probability of an event in each trial of the binomial distribution from which a random deviate is to be generated. REAL P FIRST --> Set FIRST = .TRUE. for the first call to perform initialization the set FIRST = .FALSE. for further calls using the same pair of parameter values (N, P). LOGICAL FIRST random_binomial2 <-- A random deviate yielding the number of events from N independent trials, each of which has a probability of event P. INTEGER random_binomial Method This is algorithm BTPE from: Kachitvichyanukul, V. and Schmeiser, B. W. Binomial Random Variate Generation. Communications of the ACM, 31, 2 (February, 1988) 216.

Read more…

Arguments

Type IntentOptional Attributes Name
integer, intent(in) :: n
real, intent(in) :: pp
logical, intent(in) :: first

Return Value integer

public function random_neg_binomial(sk, p) result(ival)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: sk
real, intent(in) :: p

Return Value integer

public function random_von_Mises(k, first) result(fn_val)

Arguments

Type IntentOptional Attributes Name
real, intent(in) :: k
logical, intent(in) :: first

Return Value real

public function random_Cauchy() result(fn_val)

Arguments

None

Return Value real

public function nrand(dseed_)

Arguments

Type IntentOptional Attributes Name
integer, optional :: dseed_

Return Value real(kind=8)


Subroutines

public subroutine random_number_init(shift)

Arguments

Type IntentOptional Attributes Name
integer, optional :: shift

public subroutine random_order(order, n)

Arguments

Type IntentOptional Attributes Name
integer, intent(out) :: order(n)
integer, intent(in) :: n