14 #if !defined(RANDOMLIB_RANDOM_HPP)
15 #define RANDOMLIB_RANDOM_HPP 1
17 #include <RandomLib/Config.h>
20 typedef unsigned uint32_t;
21 typedef unsigned long long uint64_t;
32 #if !defined(RANDOMLIB_POWERTABLE)
34 #define RANDOMLIB_POWERTABLE 0
37 #define RANDOMLIB_POWERTABLE 1
41 #if !HAVE_LONG_DOUBLE || defined(_MSC_VER)
42 #define RANDOMLIB_LONGDOUBLEPREC 53
43 #elif defined(__sparc)
44 #define RANDOMLIB_LONGDOUBLEPREC 113
50 #define RANDOMLIB_LONGDOUBLEPREC __LDBL_MANT_DIG__
56 #if !defined(STATIC_ASSERT)
57 # if __cplusplus >= 201103
58 # define STATIC_ASSERT static_assert
59 # elif defined(__GXX_EXPERIMENTAL_CXX0X__)
60 # define STATIC_ASSERT static_assert
61 # elif defined(_MSC_VER) && _MSC_VER >= 1600
62 # define STATIC_ASSERT static_assert
64 # define STATIC_ASSERT(cond,reason) \
65 { enum{ STATIC_ASSERT_ENUM = 1/int(cond) }; }
72 #define RANDOMLIB_HASDENORM(RealType) 1
74 #if defined(_MSC_VER) && defined(RANDOMLIB_SHARED_LIB) && RANDOMLIB_SHARED_LIB
75 # if RANDOMLIB_SHARED_LIB > 1
76 # error RANDOMLIB_SHARED_LIB must be 0 or 1
77 # elif defined(RandomLib_EXPORTS)
78 # define RANDOMLIB_EXPORT __declspec(dllexport)
80 # define RANDOMLIB_EXPORT __declspec(dllimport)
83 # define RANDOMLIB_EXPORT
112 RandomErr(
const std::string& msg) : std::runtime_error(msg) {}
119 #if !defined(RANDOMLIB_BUILDING_LIBRARY)
121 namespace RandomLib {
123 #if !defined(RANDOMLIB_DEFAULT_GENERATOR)
124 #define RANDOMLIB_DEFAULT_GENERATOR SRandomGenerator32
139 #endif // !defined(RANDOMLIB_BUILDING_LIBRARY)
141 #endif // RANDOMLIB_RANDOM_HPP
RandomErr(const std::string &msg)
Generate random integers, reals, and booleans.
#define RANDOMLIB_DEFAULT_GENERATOR
Exception handling for RandomLib.
RANDOMLIB_DEFAULT_GENERATOR RandomGenerator
RandomCanonical< RandomGenerator > Random
Header for RandomCanonical.