MIDSX 0.1
A x-ray transport code system for dosimetry
Loading...
Searching...
No Matches
Public Member Functions | Private Attributes | Static Private Attributes | List of all members
ProbabilityDist::Uniform Class Reference

Class which represents a uniform distribution. More...

#include <probability_dist.h>

Collaboration diagram for ProbabilityDist::Uniform:

Public Member Functions

 Uniform (double min, double max)
 Constructor for the Uniform class.
 
double sample () const
 Returns a sample from the uniform distribution.
 
void setRange (double min, double max)
 Sets the range of the uniform distribution.
 

Private Attributes

std::uniform_real_distribution< double > dist_
 

Static Private Attributes

static thread_local std::mt19937 generator_
 

Detailed Description

Class which represents a uniform distribution.

Definition at line 23 of file probability_dist.h.

Constructor & Destructor Documentation

◆ Uniform()

ProbabilityDist::Uniform::Uniform ( double min,
double max )
inline

Constructor for the Uniform class.

Parameters
minThe minimum value of the uniform distribution.
maxThe maximum value of the uniform distribution.

Definition at line 32 of file probability_dist.h.

Member Function Documentation

◆ sample()

double ProbabilityDist::Uniform::sample ( ) const
inline

Returns a sample from the uniform distribution.

Returns
A sample from the uniform distribution.

Definition at line 39 of file probability_dist.h.

◆ setRange()

void ProbabilityDist::Uniform::setRange ( double min,
double max )
inline

Sets the range of the uniform distribution.

Parameters
minThe minimum value of the uniform distribution.
maxThe maximum value of the uniform distribution.

Definition at line 49 of file probability_dist.h.

Member Data Documentation

◆ dist_

std::uniform_real_distribution<double> ProbabilityDist::Uniform::dist_
mutableprivate

Definition at line 53 of file probability_dist.h.

◆ generator_

thread_local std::mt19937 ProbabilityDist::Uniform::generator_
staticprivate

Definition at line 54 of file probability_dist.h.


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