|
mxlib
c++ tools for analyzing astronomical data and other tasks by Jared R. Males. [git repo]
|
Random number generation.
Classes | |
| class | mx::math::randomT< typeT, _ranengT, _randistT > |
| A random number type, which functions like any other arithmetic type. More... | |
| class | mx::math::laplace_distribution< _RealType > |
| The Laplace (double exponential) continuous distribution for random numbers. More... | |
Functions | |
| template<typename intT> | |
| int | mx::math::randomSeed (intT &seedval) |
| Get a value to use as a random seed. | |
| template<typename realT> | |
| using | mx::math::uniDistT = randomT<realT, std::mt19937_64, std::uniform_real_distribution<realT>> |
| Alias for a uniform random variate. | |
| template<typename realT> | |
| using | mx::math::normDistT = randomT<realT, std::mt19937_64, std::normal_distribution<realT>> |
| Alias for a standard normal random variate. | |
| template<typename realT> | |
| using | mx::math::expDistT = randomT<realT, std::mt19937_64, std::exponential_distribution<realT>> |
| Alias for an exponential random variate. | |
| template<typename realT> | |
| using | mx::math::lapDistT = randomT<realT, std::mt19937_64, laplace_distribution<realT>> |
| Alias for a laplace random variate. | |
| template<typename intT> | |
| using | mx::math::poissonDistT = randomT<intT, std::mt19937_64, std::poisson_distribution<intT>> |
| Alias for a poisson random variate. | |
| template<typename realT> | |
| using | mx::math::lognormDistT = randomT<realT, std::mt19937_64, std::lognormal_distribution<realT>> |
| Alias for a log normal variate. | |
| using mx::math::expDistT = randomT<realT, std::mt19937_64, std::exponential_distribution<realT>> |
Alias for an exponential random variate.
Definition at line 320 of file randomT.hpp.
| using mx::math::lapDistT = randomT<realT, std::mt19937_64, laplace_distribution<realT>> |
Alias for a laplace random variate.
Definition at line 324 of file randomT.hpp.
| using mx::math::lognormDistT = randomT<realT, std::mt19937_64, std::lognormal_distribution<realT>> |
Alias for a log normal variate.
Definition at line 332 of file randomT.hpp.
| using mx::math::normDistT = randomT<realT, std::mt19937_64, std::normal_distribution<realT>> |
Alias for a standard normal random variate.
Definition at line 316 of file randomT.hpp.
| using mx::math::poissonDistT = randomT<intT, std::mt19937_64, std::poisson_distribution<intT>> |
Alias for a poisson random variate.
Definition at line 328 of file randomT.hpp.
| using mx::math::uniDistT = randomT<realT, std::mt19937_64, std::uniform_real_distribution<realT>> |
Alias for a uniform random variate.
Definition at line 312 of file randomT.hpp.
| int mx::math::randomSeed | ( | intT & | seedval | ) |
Get a value to use as a random seed.
On Linux systems, uses /dev/urandom to populate the value with sizeof(intT) bytes. Otherwise, uses time(0) to get time since the epoch.
| intT | is the integer type of seeval. |
| [out] | seedval | will be populated with the seed. |
Definition at line 53 of file randomSeed.hpp.
References mx::errno2error_t(), mx::filererr, and mx::internal::mxlib_error_report().
Referenced by mx::math::randomT< realT, std::mt19937_64, std::normal_distribution< realT > >::seed().