Anklang 0.3.0-460-gc4ef46ba
ASE — Anklang Sound Engine (C++)

« « « Anklang Documentation
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Ase::Pcg32Rng Class Reference

#include "randomhash.hh"

Public Member Functions

template<class SeedSeq >
 Pcg32Rng (SeedSeq &seed_sequence)
 Initialize and seed from seed_sequence.
 
 Pcg32Rng (uint64_t offset, uint64_t sequence)
 Initialize and seed by seeking to position offset within stream sequence.
 
 Pcg32Rng ()
 Initialize and seed the generator from a system specific nondeterministic random source.
 
void auto_seed ()
 Seed the generator from a system specific nondeterministic random source.
 
void seed (uint64_t offset, uint64_t sequence)
 Seed by seeking to position offset within stream sequence.
 
template<class SeedSeq >
void seed (SeedSeq &seed_sequence)
 Seed the generator state from a seed_sequence.
 
uint32_t random ()
 Generate uniformly distributed 32 bit pseudo random number.
 

Detailed Description

Pcg32Rng is a permutating linear congruential PRNG. At the core, this pseudo random number generator uses the well known linear congruential generator: 6364136223846793005 * accumulator + 1442695040888963407 mod 2^64. See also TAOCP by D. E. Knuth, section 3.3.4, table 1, line 26. For good statistical performance, the output function of the permuted congruential generator family is used as described on http://www.pcg-random.org/. Period length for this generator is 2^64, the specified seed offset chooses the position of the genrator and the seed sequence parameter can be used to choose from 2^63 distinct random sequences.

Definition at line 420 of file randomhash.hh.

Constructor & Destructor Documentation

◆ Pcg32Rng() [1/3]

template<class SeedSeq >
Ase::Pcg32Rng::Pcg32Rng ( SeedSeq &  seed_sequence)
explicit

Initialize and seed from seed_sequence.

Definition at line 440 of file randomhash.hh.

References seed().

◆ Pcg32Rng() [2/3]

Ase::Pcg32Rng::Pcg32Rng ( uint64_t  offset,
uint64_t  sequence 
)
explicit

Initialize and seed by seeking to position offset within stream sequence.

Definition at line 575 of file randomhash.cc.

References seed().

◆ Pcg32Rng() [3/3]

Ase::Pcg32Rng::Pcg32Rng ( )
explicit

Initialize and seed the generator from a system specific nondeterministic random source.

Definition at line 569 of file randomhash.cc.

References auto_seed().

Member Function Documentation

◆ auto_seed()

void Ase::Pcg32Rng::auto_seed ( )

Seed the generator from a system specific nondeterministic random source.

Definition at line 582 of file randomhash.cc.

References seed().

Referenced by Pcg32Rng().

◆ random()

uint32_t Ase::Pcg32Rng::random ( )

Generate uniformly distributed 32 bit pseudo random number.

Definition at line 459 of file randomhash.hh.

References uint64_t.

◆ seed() [1/2]

template<class SeedSeq >
void Ase::Pcg32Rng::seed ( SeedSeq &  seed_sequence)

Seed the generator state from a seed_sequence.

Definition at line 451 of file randomhash.hh.

References seed(), and uint64_t.

◆ seed() [2/2]

void Ase::Pcg32Rng::seed ( uint64_t  offset,
uint64_t  sequence 
)

Seed by seeking to position offset within stream sequence.

Definition at line 589 of file randomhash.cc.

Referenced by auto_seed(), Pcg32Rng(), Pcg32Rng(), and seed().


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