MPI-AMRVAC 3.1
The MPI - Adaptive Mesh Refinement - Versatile Advection Code (development version)
Loading...
Searching...
No Matches
Public Member Functions | List of all members
mod_random::rng_t Type Reference

Random number generator type, which contains the state. More...

Public Member Functions

procedure, non_overridable set_seed (self, the_seed)
 Set a seed for the rng.
 
procedure, non_overridable jump (self)
 
procedure, non_overridable int_4 (self)
 Return 4-byte integer.
 
procedure, non_overridable int_8 (self)
 Return 8-byte integer.
 
procedure, non_overridable unif_01 (self)
 Get a uniform [0,1) random real (double precision)
 
procedure, non_overridable unif_01_vec (self, rr)
 Fill array with uniform random numbers.
 
procedure, non_overridable normal (self)
 Single normal random number.
 
procedure, non_overridable two_normals (self)
 Return two normal random variates with mean 0 and variance 1. http://en.wikipedia.org/wiki/Marsaglia_polar_method.
 
procedure, non_overridable poisson (self, lambda)
 Return Poisson random variate with rate lambda. Works well for lambda < 30 or so. For lambda >> 1 it can produce wrong results due to roundoff error.
 
procedure, non_overridable circle (self, radius)
 Sample point on a circle with given radius.
 
procedure, non_overridable sphere (self, radius)
 Sample point on a sphere with given radius.
 
procedure, non_overridable next (self)
 Interal routine: get the next value (returned as 64 bit signed integer)
 

Detailed Description

Random number generator type, which contains the state.

Definition at line 20 of file mod_random.t.

Member Function/Subroutine Documentation

◆ circle()

procedure, non_overridable mod_random::rng_t::circle ( class(rng_t), intent(inout)  self,
real(dp), intent(in)  radius 
)
final

Sample point on a circle with given radius.

Definition at line 33 of file mod_random.t.

◆ int_4()

procedure, non_overridable mod_random::rng_t::int_4 ( class(rng_t), intent(inout)  self)
final

Return 4-byte integer.

Definition at line 26 of file mod_random.t.

◆ int_8()

procedure, non_overridable mod_random::rng_t::int_8 ( class(rng_t), intent(inout)  self)
final

Return 8-byte integer.

Definition at line 27 of file mod_random.t.

◆ jump()

procedure, non_overridable mod_random::rng_t::jump ( class(rng_t), intent(inout)  self)
final

Definition at line 25 of file mod_random.t.

◆ next()

procedure, non_overridable mod_random::rng_t::next ( class(rng_t), intent(inout)  self)
final

Interal routine: get the next value (returned as 64 bit signed integer)

Definition at line 35 of file mod_random.t.

◆ normal()

procedure, non_overridable mod_random::rng_t::normal ( class(rng_t), intent(inout)  self)
final

Single normal random number.

Definition at line 30 of file mod_random.t.

◆ poisson()

procedure, non_overridable mod_random::rng_t::poisson ( class(rng_t), intent(inout)  self,
real(dp), intent(in)  lambda 
)
final

Return Poisson random variate with rate lambda. Works well for lambda < 30 or so. For lambda >> 1 it can produce wrong results due to roundoff error.

Definition at line 32 of file mod_random.t.

◆ set_seed()

procedure, non_overridable mod_random::rng_t::set_seed ( class(rng_t), intent(inout)  self,
integer(i8), dimension(2), intent(in)  the_seed 
)
final

Set a seed for the rng.

Definition at line 24 of file mod_random.t.

◆ sphere()

procedure, non_overridable mod_random::rng_t::sphere ( class(rng_t), intent(inout)  self,
real(dp), intent(in)  radius 
)
final

Sample point on a sphere with given radius.

Definition at line 34 of file mod_random.t.

◆ two_normals()

procedure, non_overridable mod_random::rng_t::two_normals ( class(rng_t), intent(inout)  self)
final

Return two normal random variates with mean 0 and variance 1. http://en.wikipedia.org/wiki/Marsaglia_polar_method.

Definition at line 31 of file mod_random.t.

◆ unif_01()

procedure, non_overridable mod_random::rng_t::unif_01 ( class(rng_t), intent(inout)  self)
final

Get a uniform [0,1) random real (double precision)

Definition at line 28 of file mod_random.t.

◆ unif_01_vec()

procedure, non_overridable mod_random::rng_t::unif_01_vec ( class(rng_t), intent(inout)  self,
real(dp), dimension(:), intent(out)  rr 
)
final

Fill array with uniform random numbers.

Definition at line 29 of file mod_random.t.


The documentation for this type was generated from the following file: