It gives Pseudorandom numbers and random operations/functions.
Generate a uniformly distributed random integers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | valrange(2) | |||
| integer(kind=int32), | intent(in) | :: | size1 | |||
| integer(kind=int32), | intent(in) | :: | size2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | imax |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | imax | |||
| integer(kind=int32), | intent(in) | :: | n |
Generate a uniformly distributed random integers
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | sz1 | |||
| integer(kind=int32), | intent(in) | :: | sz2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | sz1 | |||
| integer(kind=int32), | intent(in) | :: | sz2 | |||
| integer(kind=int32), | intent(in) | :: | sz3 |
Compute expectation value
| Type | Intent | Optional | Attributes | Name | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
public function func(arg1, arg2, arg3) result(ret)Arguments
Return Value real(kind=real64) |
||||||||||||||||||||||||||||||||||
| real(kind=real64), | intent(in) | :: | arg1 | |||||||||||||||||||||||||||||||
| integer(kind=int32), | intent(in) | :: | arg2 | |||||||||||||||||||||||||||||||
| integer(kind=int32), | intent(in) | :: | arg3 | |||||||||||||||||||||||||||||||
A class for random number
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer(kind=int32), | public | :: | random_int |
it will be deplicated. |
|||
| integer(kind=int32), | public, | allocatable | :: | random_int_seed(:) |
It is a seed number |
||
| integer(kind=int32), | public, | allocatable | :: | random_int_vec(:) |
it will be deplicated. |
||
| real(kind=real64), | public | :: | random_real |
it will be deplicated. |
|||
| real(kind=real64), | public, | allocatable | :: | random_real_vec(:) |
it will be deplicated. |
| procedure, public :: init => initRandom | ../../../ It initializes the random number by a seed. |
| procedure, public :: random => getRandom | ../../../ Returns random number in [0,1) |
| procedure, public :: randint => getRandomInt | ../../../ Returns integer random number |
| procedure, public :: name => nameRandom | ../../../ Returns random name |
| procedure, public :: choiceInt => choiceRandomInt | ../../../ Random choice |
| procedure, public :: choiceReal => choiceRandomReal | ../../../ Random choice |
| procedure, public :: drawOne => drawOneRandomInt | ../../../ Random choice, and the number of the set will be (-1) |
| procedure, public :: draw => drawRandomInt | ../../../ Random choice, and the number of the set will be (-n) |
| procedure, public :: shuffle => shuffleRandomInt | ../../../ Random rearrange of a integer array. |
| procedure, public :: uniform => uniformRandom | ../../../ Generate uniform distribution |
| procedure, public, pass :: gauss_scalar_Random | ../../../ Generate Gaussian distribution |
| procedure, public, pass :: gauss_vector_Random | ../../../ Generate Gaussian distribution |
| procedure, public, pass :: gauss_tensor_Random | ../../../ Generate Gaussian distribution |
| generic, public :: gauss => gauss_scalar_Random, gauss_vector_Random, gauss_tensor_Random | ../../../ Generate Gaussian distribution |
| procedure, public :: ChiSquared => ChiSquaredRandom | ../../../ Generate Chi-Squared distribution |
| procedure, public :: Cauchy => CauchyRandom | ../../../ Generate Cauchy distribution |
| procedure, public :: Lognormal => LognormalRandom | ../../../ Generate Lognormal distribution |
| procedure, public :: InverseGauss => InverseGaussRandom | ../../../ Generate InverseGaussian distribution |
| procedure, public :: save => saveRandom | ../../../ save random number |
| procedure, public :: white => whiteRandom | ../../../ Generate While-Gaussian signal |
| procedure, public, pass :: randnRandomVector | ../../../ Generate a vector of uniform random number. |
| procedure, public, pass :: randnRandomArray | ../../../ Generate a array of uniform random number. |
| generic, public :: randn => randnRandomArray, randnRandomVector | ../../../ Generate a vector/array of uniform random number. |
| procedure, public :: fill => fillRandom | ../../../ Generate a vector of uniform random number. |
| procedure, public :: histogram => histogramRandom | ../../../ Generate a histogram of a vector |
| procedure, public :: scalar => scalarRandom | ../../../ Generate a random scalar of uniform distribution [0,1) |
| procedure, public :: vector => vectorRandom | ../../../ Generate a random vector of uniform distribution [0,1) |
| procedure, public :: matrix => matrixRandom | ../../../ Generate a random matrix of uniform distribution [0,1) |
| procedure, public :: cube => cubeRandom | ../../../ Generate a random cube (3rd order tensor) of uniform distribution [0,1) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_) | :: | obj | ||||
| character(len=*), | intent(in), | optional | :: | distribution |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(in) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | From | |||
| real(kind=real64), | intent(in) | :: | To |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(in) | :: | obj | |||
| integer(kind=int32), | intent(in) | :: | From | |||
| integer(kind=int32), | intent(in) | :: | To |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(in) | :: | obj | |||
| integer(kind=int32), | intent(in), | optional | :: | Vector(:) | ||
| integer(kind=int32), | intent(in), | optional | :: | Array(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(in) | :: | obj | |||
| real(kind=real64), | intent(in), | optional | :: | Vector(:) | ||
| real(kind=real64), | intent(in), | optional | :: | Array(:,:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| integer(kind=int32), | intent(in) | :: | d0 | |||
| integer(kind=int32), | intent(in) | :: | d1 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| integer(kind=int32), | intent(in) | :: | d0 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | list(:) | |||
| integer(kind=int32), | intent(in), | optional | :: | division |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | mu | |||
| real(kind=real64), | intent(in) | :: | sigma |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | mu | |||
| real(kind=real64), | intent(in) | :: | sigma | |||
| integer(kind=int32), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | mu | |||
| real(kind=real64), | intent(in) | :: | sigma | |||
| integer(kind=int32), | intent(in) | :: | n | |||
| integer(kind=int32), | intent(in) | :: | m |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | k |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | mu | |||
| real(kind=real64), | intent(in) | :: | gamma |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | mu | |||
| real(kind=real64), | intent(in) | :: | sigma |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(in) | :: | mu | |||
| real(kind=real64), | intent(in) | :: | lambda |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| integer(kind=int32), | intent(in) | :: | size1 | |||
| integer(kind=int32), | intent(in) | :: | size2 | |||
| integer(kind=int32), | intent(in) | :: | size3 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| integer(kind=int32), | intent(in) | :: | size1 | |||
| integer(kind=int32), | intent(in) | :: | size2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| integer(kind=int32), | intent(in) | :: | size1 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| integer(kind=int32), | intent(in) | :: | size1 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | valrange(2) | |||
| integer(kind=int32), | intent(in) | :: | size1 | |||
| integer(kind=int32), | intent(in) | :: | size2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | imax |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | imax | |||
| integer(kind=int32), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | n |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | sz1 | |||
| integer(kind=int32), | intent(in) | :: | sz2 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer(kind=int32), | intent(in) | :: | sz1 | |||
| integer(kind=int32), | intent(in) | :: | sz2 | |||
| integer(kind=int32), | intent(in) | :: | sz3 |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | this | |||
| integer(kind=int32), | intent(in) | :: | num_sample | |||
| real(kind=real64), | intent(in), | optional | :: | mu | ||
| real(kind=real64), | intent(in), | optional | :: | sigma |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(in) | :: | this | |||
| integer(kind=int32), | intent(inout), | allocatable | :: | vec(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(in) | :: | this | |||
| integer(kind=int32), | intent(inout), | allocatable | :: | vec(:) | ||
| integer(kind=int32), | intent(in) | :: | num |
| Type | Intent | Optional | Attributes | Name | ||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
public function func(arg1, arg2, arg3) result(ret)Arguments
Return Value real(kind=real64) |
||||||||||||||||||||||||||||||||||
| real(kind=real64), | intent(in) | :: | arg1 | |||||||||||||||||||||||||||||||
| integer(kind=int32), | intent(in) | :: | arg2 | |||||||||||||||||||||||||||||||
| integer(kind=int32), | intent(in) | :: | arg3 | |||||||||||||||||||||||||||||||
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(inout) | :: | obj | |||
| real(kind=real64), | intent(inout), | optional | :: | array(:,:) | ||
| real(kind=real64), | intent(inout), | optional | :: | vector(:) |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(Random_), | intent(in) | :: | this | |||
| integer(kind=int32), | intent(inout) | :: | intvec(:) |