MayaFlux 0.2.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ Random()

MayaFlux::Nodes::Generator::Stochastics::Random::Random ( Utils::distribution  type = Utils::distribution::UNIFORM)

Constructor for the stochastic generator.

Parameters
typeDistribution type to use (default: uniform distribution)

Creates a stochastic generator with the specified probability distribution. The generator is initialized with entropy from the system's random device for non-deterministic behavior across program executions.

Definition at line 5 of file Stochastic.cpp.

6 : m_random_engine(std::random_device {}())
7 , m_current_start(-1.0F)
8 , m_current_end(1.0F)
9 , m_normal_spread(4.0F)
10 , m_type(type)
11 , m_xorshift_state(std::random_device {}() | (static_cast<uint64_t>(std::random_device {}()) << 32))
14{
15 if (m_xorshift_state == 0)
16 m_xorshift_state = 0xDEADBEEFCAFEBABE;
17}
Utils::distribution m_type
Current probability distribution algorithm.
uint64_t m_xorshift_state
Internal state for xorshift random number generation.
double m_normal_spread
Variance parameter for normal distribution.
std::mt19937 m_random_engine
Mersenne Twister entropy generator.
double m_current_start
Lower bound of the current output range.
double m_current_end
Upper bound of the current output range.
std::span< const float > get_gpu_data_buffer() const
Provides access to the GPU data buffer.
Definition Node.cpp:78

References m_xorshift_state.