ParaMonte Fortran 2.0.0
Parallel Monte Carlo and Machine Learning Library
See the latest version documentation.
pm_distUnif::splitmix64_typer Interface Reference

Generate, initialize, and return a scalar object of type splitmix64_type. More...

Detailed Description

Generate, initialize, and return a scalar object of type splitmix64_type.

This generic interface is the constructor of splitmix64_type.
Upon return, the output object can be passed to getUnifRand and setUnifRand to generate uniformly-distributed random values of various intrinsic types and kinds using the splitmix64 algorithm.
See the documentation of splitmix64_type for example usage and calling interface.

Parameters
[in]seed: The input scalar of type integer of kind IK64, containing an integer that serves as the starting point to generate the full RNG seed.
Specify this input argument if you wish to make random simulations reproducible and deterministic, even between multiple independent runs of the program compiled by the same compiler.
(optional. If missing, it is set to a processor-dependent value based on the current date and time.)
[in]imageID: The input positive scalar integer of default kind IK containing the ID of the current image/thread/process.
This can be,
  1. The Coarray image ID as returned by Fortran intrinsic this_image() within a global team of Coarray images.
  2. The MPI rank of the processor (plus one) as returned by the MPI library intrinsic mpi_comm_rank().
  3. The OpenMP thread number as returned by the OpenMP library intrinsic omp_get_thread_num().
  4. Any (positive) integer that uniquely identifies the current processor from other processes.
The image/process/thread ID can be readily obtained by calling getImageID.
This number will be used to set the RNG seed uniquely on each processor.
(optional. If missing, the RNG seed will be set as if it is called in a serial application (or called on the first image).)
Returns
rng : The output scalar object (or array of objects, of the same rank and shape as the input array-like arguments) of type splitmix64_type containing an instance of the splitmix64 random number generator.


Possible calling interfaces

use pm_kind, only: IK
type(splitmix64_type) :: rng
rng = splitmix64_type(seed = seed, imageID = imageID)
print *, rng%state ! The current RNG state.
print *, rng%stream ! The current 64bit integer random number.
!
This module contains classes and procedures for computing various statistical quantities related to t...
This module defines the relevant Fortran kind type-parameters frequently used in the ParaMonte librar...
Definition: pm_kind.F90:268
integer, parameter IK
The default integer kind in the ParaMonte library: int32 in Fortran, c_int32_t in C-Fortran Interoper...
Definition: pm_kind.F90:540
This is the derived type for declaring and generating objects of type splitmix64_type containing a un...
Warning
The condition 0 < imageID must hold for the corresponding input arguments.
This condition is verified only if the library is built with the preprocessor macro CHECK_ENABLED=1.
Remarks
The procedures under discussion are impure.
The procedures under discussion are elemental.
See also
rngf
isHead
getUnifCDF
getUnifRand
setUnifRand
getUnifRandState
setUnifRandState
rngu_type
rngf_type
splitmix64_type
xoshiro256ssw_type
getUnifRandStateSize
Test:
test_pm_distUnif


Final Remarks


If you believe this algorithm or its documentation can be improved, we appreciate your contribution and help to edit this page's documentation and source file on GitHub.
For details on the naming abbreviations, see this page.
For details on the naming conventions, see this page.
This software is distributed under the MIT license with additional terms outlined below.

  1. If you use any parts or concepts from this library to any extent, please acknowledge the usage by citing the relevant publications of the ParaMonte library.
  2. If you regenerate any parts/ideas from this library in a programming environment other than those currently supported by this ParaMonte library (i.e., other than C, C++, Fortran, MATLAB, Python, R), please also ask the end users to cite this original ParaMonte library.

This software is available to the public under a highly permissive license.
Help us justify its continued development and maintenance by acknowledging its benefit to society, distributing it, and contributing to it.

Author:
Amir Shahmoradi, September 1, 2017, 12:00 AM, Institute for Computational Engineering and Sciences (ICES), The University of Texas at Austin

Definition at line 3682 of file pm_distUnif.F90.


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