18#ifndef itkMersenneTwisterRandomVariateGenerator_h
19#define itkMersenneTwisterRandomVariateGenerator_h
123struct MersenneTwisterGlobals;
184 return static_cast<double>(
GetIntegerVariate()) * (1.0 /
double{ std::numeric_limits<uint32_t>::max() });
212 return (
static_cast<double>(
GetIntegerVariate()) + 0.5) /
double{ 1ULL << 32ULL };
330 return hash(time(
nullptr), clock());
368 return (a * 67108864.0 + b) * (1.0 / 9007199254740992.0);
382 return mean + r * std::cos(phi);
392 return ((1.0 - u) * a + u * b);
Control indentation during Print() invocation.
Implements transparent reference counting.
double GetVariateWithClosedRange(const double n)
static IntegerType CreateRandomSeed()
std::atomic< IntegerType > m_Seed
IntegerType GetIntegerVariate(const IntegerType n)
double GetUniformVariate(const double a, const double b)
static Pointer New()
Method for creation through the object factory.
IntegerType GetIntegerVariate()
static Pointer GetInstance()
void PrintSelf(std::ostream &os, Indent indent) const override
double GetVariateWithOpenRange()
void Initialize(const IntegerType seed)
static IntegerType GetNextSeed()
SmartPointer< const Self > ConstPointer
void SetSeed(const IntegerType oneSeed)
static IntegerType hash(time_t t, clock_t c)
IntegerType GetSeed() const
IntegerType m_State[StateVectorLength]
~MersenneTwisterRandomVariateGenerator() override
static void ResetNextSeed()
itkGetGlobalDeclarationMacro(MersenneTwisterGlobals, PimplGlobals)
MersenneTwisterRandomVariateGenerator Self
double GetVariateWithOpenRange(const double n)
SmartPointer< Self > Pointer
double GetVariateWithClosedRange()
double GetVariateWithOpenUpperRange()
static Pointer CreateInstance()
double GetVariateWithOpenUpperRange(const double n)
static MersenneTwisterGlobals * m_PimplGlobals
RandomVariateGeneratorBase Superclass
void InitializeWithoutMutexLocking(const IntegerType seed)
double GetVariate() override
double GetNormalVariate(const double mean=0.0, const double variance=1.0)
MersenneTwisterRandomVariateGenerator()
static constexpr IntegerType StateVectorLength
std::mutex m_InstanceMutex
RandomVariateGeneratorBase()
static constexpr double pi
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....