Photon Engine 2.0.0-beta
A physically based renderer.
Loading...
Searching...
No Matches
ph::math::Pcg32 Class Referencefinal

PCG-32 generator. This is the pcg32 generator in O'Neill's original pcg-cpp implementation. References: [1] https://dotat.at/@/2023-06-21-pcg64-dxsm.html [2] https://github.com/imneme/pcg-c-basic [3] https://github.com/wjakob/pcg32. More...

#include <Pcg32.h>

Inheritance diagram for ph::math::Pcg32:
ph::math::TUniformRandomBitGenerator< Pcg32, uint32 >

Public Member Functions

 PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (Pcg32)
 
 Pcg32 (uint64 initialSequence)
 
 Pcg32 (uint64 initialSequence, uint64 initialState)
 Seed the RNG. Specified in two parts. Initial sequence is equivalent to choosing from one of 2^63 different random number sequences (streams), while initial state is equivalent to choosing a starting point in a stream.
 
uint32 impl_generate ()
 
void impl_jumpAhead (uint64 distance)
 
- Public Member Functions inherited from ph::math::TUniformRandomBitGenerator< Pcg32, uint32 >
uint32 generate ()
 
TargetBits generate ()
 
TargetSample generateSample ()
 
void jumpAhead (uint64 distance)
 

Additional Inherited Members

- Public Types inherited from ph::math::TUniformRandomBitGenerator< Pcg32, uint32 >
using BitsType
 
- Protected Member Functions inherited from ph::math::TUniformRandomBitGenerator< Pcg32, uint32 >
 PH_DEFINE_INLINE_RULE_OF_5_MEMBERS (TUniformRandomBitGenerator)
 

Detailed Description

PCG-32 generator. This is the pcg32 generator in O'Neill's original pcg-cpp implementation. References: [1] https://dotat.at/@/2023-06-21-pcg64-dxsm.html [2] https://github.com/imneme/pcg-c-basic [3] https://github.com/wjakob/pcg32.

Constructor & Destructor Documentation

◆ Pcg32() [1/2]

ph::math::Pcg32::Pcg32 ( uint64 initialSequence)
inlineexplicit

◆ Pcg32() [2/2]

ph::math::Pcg32::Pcg32 ( uint64 initialSequence,
uint64 initialState )
inline

Seed the RNG. Specified in two parts. Initial sequence is equivalent to choosing from one of 2^63 different random number sequences (streams), while initial state is equivalent to choosing a starting point in a stream.

Member Function Documentation

◆ impl_generate()

uint32 ph::math::Pcg32::impl_generate ( )
inline

◆ impl_jumpAhead()

void ph::math::Pcg32::impl_jumpAhead ( uint64 distance)
inline

◆ PH_DEFINE_INLINE_RULE_OF_5_MEMBERS()

ph::math::Pcg32::PH_DEFINE_INLINE_RULE_OF_5_MEMBERS ( Pcg32 )

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