Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Namespaces | Typedefs | Functions
random.hpp File Reference
#include <boost/random/mersenne_twister.hpp>
#include <boost/random/uniform_int_distribution.hpp>
#include <boost/random/uniform_real_distribution.hpp>
#include <boost/uuid/detail/seed_rng.hpp>
#include <limits>
#include <type_traits>

Go to the source code of this file.

Classes

class  inexor::util::random::auto_seeded< T >
 Wrapper around any RNG Generator that seeds it automatically, by calling boost::uuids::detail::seed. More...
 
class  inexor::util::random::uniform_open_range_int_distribution< T >
 It is like the boost uniform distribution, but while that uses an closed distribution [min; max], this class uses a half opened one [min; max). More...
 

Namespaces

 inexor
 Show stacktrace on unix, do not include directly.
 
 inexor::util
 
 inexor::util::random
 

Typedefs

typedef boost::random::mt19937 inexor::util::random::rng_engine
 The default random engine for inexor. More...
 
typedef rng_engine::result_type inexor::util::random::seed_t
 The type of the seed the deterministic_generator expects. More...
 
template<typename T >
using inexor::util::random::uniform_generic_open_range_distribution = typename std::conditional< std::is_floating_point< T >::value, boost::random::uniform_real_distribution< T >, uniform_open_range_int_distribution< T > >::type
 A generic uniform random number distribution that works on both floating point and integers. More...
 

Functions

template<typename T >
inexor::util::random::rnd (const T Rmin, const T Rmax)
 Generate a random number between Rmin and Rmax. More...
 
template<typename T >
inexor::util::random::rnd (const T Rmax)
 Generate a random number between 0 and Rmax. More...
 
template<typename T >
inexor::util::random::rnd_raw ()
 Generate any random number. More...
 
template<typename T >
inexor::util::random::deterministic_rnd (const seed_t seed, const T Rmin, const T Rmax)
 Generate a deterministic random number between Rmin and Rmax with a specific seed. More...
 
template<typename T >
inexor::util::random::deterministic_rnd (const seed_t seed, const T Rmax)
 Generate a deterministic random number between 0 and Rmax with a specific seed. More...