PCL
pcl::XoRoShiRo1024ss Class Reference

Implementation of the xoroshiro1024** pseudo-random number generator. More...

#include <Random.h>

+ Inheritance diagram for pcl::XoRoShiRo1024ss:

Public Member Functions

 XoRoShiRo1024ss (uint64 seed=0) noexcept(false)
 
void Initialize (uint64 x)
 
double operator() () noexcept
 
uint32 UI32 () noexcept
 
uint32 UI32N (uint32 n) noexcept
 
uint64 UI64 () noexcept
 
uint64 UI64N (uint64 n) noexcept
 
uint32 UIN (uint32 n) noexcept
 
- Public Member Functions inherited from pcl::XoShiRoBase
 XoShiRoBase ()=default
 

Detailed Description

Generation of pseudo-random uniform deviates using the xoroshiro1024** generator developed in 2019 by David Blackman and Sebastiano Vigna. This is a fast, top-quality generator with a period of 2^1024-1, passing strong statistical test suites—actually, it passes all tests we are aware of.

Examples of use:

XoRoShiRo1024ss X; // initialized automatically
// ...
double x = X(); // x = random uniform deviate in the range [0,1)
uint64 y = X.UI64(); // y = 64-bit unsigned integer random uniform deviate
uint32 z = X.UI32(); // z = 32-bit unsigned integer random uniform deviate
uint32 t = X.UIN( 100 ); // t = integer uniform deviate in the range [0,99]
XoRoShiRo1024ss(uint64 seed=0) noexcept(false)
Definition: Random.h:612
unsigned long long uint64
Definition: Defs.h:682
unsigned int uint32
Definition: Defs.h:666

References

David Blackman and Sebastiano Vigna (2019), Scrambled linear pseudorandom number generators (preprint).

See also: http://prng.di.unimi.it/

Definition at line 601 of file Random.h.

Constructor & Destructor Documentation

◆ XoRoShiRo1024ss()

pcl::XoRoShiRo1024ss::XoRoShiRo1024ss ( uint64  seed = 0)
inlinenoexcept

Constructs a XoRoShiRo1024ss pseudo-random number generator.

Parameters
seed64-bit initialization seed. If this parameter is zero, a unique random seed will be generated automatically. The default value is zero.

Definition at line 612 of file Random.h.

Member Function Documentation

◆ Initialize()

void pcl::XoRoShiRo1024ss::Initialize ( uint64  x)
inline

Reinitializes this generator with a new seed.

If the specified seed is zero, a unique, high-quality random seed will be generated automatically by calling RandomSeed64().

Definition at line 679 of file Random.h.

References pcl::RandomSeed64().

◆ operator()()

double pcl::XoRoShiRo1024ss::operator() ( )
inlinenoexcept

Returns a double precision uniform random deviate in the [0,1) range.

Definition at line 620 of file Random.h.

◆ UI32()

uint32 pcl::XoRoShiRo1024ss::UI32 ( )
inlinenoexcept

Returns a 32-bit unsigned integer uniform random deviate.

Definition at line 643 of file Random.h.

◆ UI32N()

uint32 pcl::XoRoShiRo1024ss::UI32N ( uint32  n)
inlinenoexcept

A synonym for UIN().

Definition at line 668 of file Random.h.

◆ UI64()

uint64 pcl::XoRoShiRo1024ss::UI64 ( )
inlinenoexcept

Returns a 64-bit unsigned integer uniform random deviate.

Definition at line 628 of file Random.h.

References pcl::RotL().

◆ UI64N()

uint64 pcl::XoRoShiRo1024ss::UI64N ( uint64  n)
inlinenoexcept

Returns a 64-bit unsigned integer uniform random deviate in the range [0,n-1].

Definition at line 652 of file Random.h.

◆ UIN()

uint32 pcl::XoRoShiRo1024ss::UIN ( uint32  n)
inlinenoexcept

Returns an unsigned integer uniform random deviate in the range [0,n-1].

Definition at line 660 of file Random.h.


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