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

◆ transform_sample()

double MayaFlux::Nodes::Generator::Stochastics::Random::transform_sample ( double  sample,
double  start,
double  end 
) const
private

Transforms a raw value to fit within the specified range.

Parameters
sampleRaw value from the distribution
startLower bound of the target range
endUpper bound of the target range
Returns
Transformed value within the specified range

Different distributions require different mathematical transformations to properly map their output while preserving their statistical properties.

Definition at line 75 of file Stochastic.cpp.

76{
78 sample = std::max(start, std::min(end, sample));
80 sample /= end;
81 sample = start + sample * (end - start);
82 }
83 return sample;
84}
Utils::distribution m_type
Current probability distribution algorithm.

References MayaFlux::Utils::EXPONENTIAL, m_type, and MayaFlux::Utils::NORMAL.

Referenced by random_array(), and random_sample().

+ Here is the caller graph for this function: