![]() |
CosmoBolognaLib
Free Software C++/Python libraries for cosmological calculations
|
The class NormalRandomNumbers. More...
#include <RandomNumbers.h>


Public Member Functions | |
| NormalRandomNumbers (const double mean, const double sigma, const int seed, const double MinVal=par::defaultDouble, const double MaxVal=-par::defaultDouble) | |
| constructor More... | |
| ~NormalRandomNumbers ()=default | |
| default destructor | |
| void | set_mean_sigma (const double mean, const double sigma) |
| set parameters for Normal distribution More... | |
| double | operator() () |
| extract number from the distribution More... | |
Public Member Functions inherited from cbl::random::RandomNumbers | |
| RandomNumbers ()=default | |
| default constructor | |
| RandomNumbers (const int seed, const double MinVal=par::defaultDouble, const double MaxVal=-par::defaultDouble) | |
| constructor More... | |
| virtual | ~RandomNumbers ()=default |
| default destructor | |
| void | set_seed (const int seed) |
| set the random number generator seed More... | |
| void | set_range (const double MinVal, const double MaxVal) |
| set the range for the random number extraction More... | |
| void | set_value (const double value) |
| set the value for constant distribution More... | |
| virtual void | set_mean (const double mean) |
| set the mean for Poisson distribution More... | |
| virtual void | set_discrete_values (const std::vector< double > values, const std::vector< double > weights) |
| set parameters for Discrete distribution More... | |
| virtual void | set_interpolated_distribution (const std::vector< double > values, const std::vector< double > weights) |
| set the parameters for the interpolated distribution More... | |
| virtual void | set_custom_distribution (const distribution_func func, const std::shared_ptr< void > modelInput, const std::vector< double > parameter) |
| set parameters for interpolated distribution More... | |
Protected Attributes | |
| double | m_mean |
| mean | |
| double | m_sigma |
| standard deviation | |
| std::shared_ptr< std::normal_distribution< double > > | m_distribution |
| normal distributionnormal distributionnormal distributionnormal distribution | |
Protected Attributes inherited from cbl::random::RandomNumbers | |
| std::mt19937_64 | m_generator |
| pseudo-random numbers generator | |
| int | m_seed |
| seed | |
| double | m_MinVal |
| minimum value to generate | |
| double | m_MaxVal |
| maximum value to generate | |
The class NormalRandomNumbers.
"Headers/RandomNumbers.h"
The base class to generate random numbers following a Normal distribution
Definition at line 392 of file RandomNumbers.h.
| cbl::random::NormalRandomNumbers::NormalRandomNumbers | ( | const double | mean, |
| const double | sigma, | ||
| const int | seed, | ||
| const double | MinVal = par::defaultDouble, |
||
| const double | MaxVal = -par::defaultDouble |
||
| ) |
constructor
| mean | the Normal distribution mean |
| sigma | the Normal distribution standard deviation |
| seed | the random number generator seed |
| MinVal | lower limit of the random numbers range |
| MaxVal | upper limit of the random numbers range |
Definition at line 145 of file RandomNumbers.cpp.
|
virtual |
extract number from the distribution
Implements cbl::random::RandomNumbers.
Definition at line 165 of file RandomNumbers.cpp.
|
virtual |
set parameters for Normal distribution
| mean | the Normal distribution mean |
| sigma | the Normal distribution standard deviation |
Reimplemented from cbl::random::RandomNumbers.
Definition at line 154 of file RandomNumbers.cpp.