public:
+ /**
+ * @ingroup api_base_utils
+ * @{
+ */
Random();
Random(uint32_t s);
+ /** @} */ // end of api_base_utils
~Random();
void init(uint32_t s);
/**
* Use the SFINAE idiom to choose an implementation based on
* whether the type is integral or floating point.
+ *
+ * @ingroup api_base_utils
*/
template <typename T>
typename std::enable_if<std::is_integral<T>::value, T>::type
return dist(gen);
}
+ /**
+ * @ingroup api_base_utils
+ */
template <typename T>
typename std::enable_if<std::is_floating_point<T>::value, T>::type
random()
std::uniform_real_distribution<T> dist;
return dist(gen);
}
-
+ /**
+ * @ingroup api_base_utils
+ */
template <typename T>
typename std::enable_if<std::is_integral<T>::value, T>::type
random(T min, T max)
void unserialize(CheckpointIn &cp) override;
};
+/**
+ * @ingroup api_base_utils
+ */
extern Random random_mt;
#endif // __BASE_RANDOM_HH__