CAMP 1.0.0
Chemistry Across Multiple Phases
Modules | Functions/Subroutines | Variables
rand.F90 File Reference

The camp_rand module. More...

Go to the source code of this file.

Modules

module  camp_rand
 Random number generators.
 

Functions/Subroutines

subroutine camp_rand::camp_srand (seed, offset)
 Initializes the random number generator to the state defined by the given seed plus offset. If the seed is 0 then a seed is auto-generated from the current time plus offset.
 
subroutine camp_rand::camp_rand_finalize ()
 Cleanup the random number generator.
 
real(kind=dp) function camp_rand::camp_random ()
 Returns a random number between 0 and 1.
 
integer function camp_rand::camp_rand_int (n)
 Returns a random integer between 1 and n.
 
integer function camp_rand::prob_round (val)
 Round val to floor(val) or ceiling(val) with probability proportional to the relative distance from val. That is, Prob(prob_round(val) == floor(val)) = ceil(val) - val.
 
integer function camp_rand::rand_poisson (mean)
 Generate a Poisson-distributed random number with the given mean.
 
integer function camp_rand::rand_binomial (n, p)
 Generate a Binomial-distributed random number with the given parameters.
 
real(kind=dp) function camp_rand::rand_normal (mean, stddev)
 Generates a normally distributed random number with the given mean and standard deviation.
 
subroutine camp_rand::rand_normal_array_1d (mean, stddev, val)
 Generates a vector of normally distributed random numbers with the given means and standard deviations. This is a set of normally distributed scalars, not a normally distributed vector.
 
integer function camp_rand::sample_cts_pdf (pdf)
 Sample the given continuous probability density function.
 
integer function camp_rand::sample_disc_pdf (pdf)
 Sample the given discrete probability density function.
 
subroutine camp_rand::sample_vec_cts_to_disc (vec_cts, n_samp, vec_disc)
 Convert a real-valued vector into an integer-valued vector by sampling.
 
character function camp_rand::rand_hex_char ()
 Generate a random hexadecimal character.
 
subroutine camp_rand::uuid4_str (uuid)
 Generate a version 4 UUID as a string.
 
integer(kind=i_kind) function camp_rand::generate_int_id ()
 Generate an integer id Ids will be sequential, and can only be generated by the primary process.
 

Variables

integer, parameter camp_rand::camp_uuid_len = 36
 Length of a UUID string.
 
integer, private camp_rand::next_id = 100
 Next sequential id.
 

Detailed Description

The camp_rand module.

Definition in file rand.F90.