PCL
pcl::XoShiRo256ss Class Reference

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

#include <Random.h>

+ Inheritance diagram for pcl::XoShiRo256ss:

Public Member Functions

 XoShiRo256ss (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^256-1, passing strong statistical test suites—actually, it passes all tests we are aware of.

Examples of use:

XoShiRo256ss 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]

References

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

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

Definition at line 477 of file Random.h.

Constructor & Destructor Documentation

◆ XoShiRo256ss()

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

Constructs a XoShiRo256ss 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 488 of file Random.h.

Member Function Documentation

◆ Initialize()

void pcl::XoShiRo256ss::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 556 of file Random.h.

References pcl::RandomSeed64().

◆ operator()()

double pcl::XoShiRo256ss::operator() ( )
inlinenoexcept

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

Definition at line 496 of file Random.h.

◆ UI32()

uint32 pcl::XoShiRo256ss::UI32 ( )
inlinenoexcept

Returns a 32-bit unsigned integer uniform random deviate.

Definition at line 520 of file Random.h.

◆ UI32N()

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

A synonym for UIN().

Definition at line 545 of file Random.h.

◆ UI64()

uint64 pcl::XoShiRo256ss::UI64 ( )
inlinenoexcept

Returns a 64-bit unsigned integer uniform random deviate.

Definition at line 504 of file Random.h.

References pcl::RotL().

◆ UI64N()

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

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

Definition at line 529 of file Random.h.

◆ UIN()

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

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

Definition at line 537 of file Random.h.


The documentation for this class was generated from the following file:
pcl::XoShiRo256ss::XoShiRo256ss
XoShiRo256ss(uint64 seed=0) noexcept(false)
Definition: Random.h:488
pcl::uint32
unsigned int uint32
Definition: Defs.h:669
pcl::uint64
unsigned long long uint64
Definition: Defs.h:685