base: Tag API methods and variables in random.hh
Change-Id: I75f8843ee696055f156aa0d9e035094d8206f4b9 Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/33115 Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu> Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -64,8 +64,13 @@ class Random : public Serializable
|
||||
|
||||
public:
|
||||
|
||||
/**
|
||||
* @ingroup api_base_utils
|
||||
* @{
|
||||
*/
|
||||
Random();
|
||||
Random(uint32_t s);
|
||||
/** @} */ // end of api_base_utils
|
||||
~Random();
|
||||
|
||||
void init(uint32_t s);
|
||||
@@ -73,6 +78,8 @@ class Random : public Serializable
|
||||
/**
|
||||
* 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
|
||||
@@ -83,6 +90,9 @@ class Random : public Serializable
|
||||
return dist(gen);
|
||||
}
|
||||
|
||||
/**
|
||||
* @ingroup api_base_utils
|
||||
*/
|
||||
template <typename T>
|
||||
typename std::enable_if<std::is_floating_point<T>::value, T>::type
|
||||
random()
|
||||
@@ -91,7 +101,9 @@ class Random : public Serializable
|
||||
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)
|
||||
@@ -104,6 +116,9 @@ class Random : public Serializable
|
||||
void unserialize(CheckpointIn &cp) override;
|
||||
};
|
||||
|
||||
/**
|
||||
* @ingroup api_base_utils
|
||||
*/
|
||||
extern Random random_mt;
|
||||
|
||||
#endif // __BASE_RANDOM_HH__
|
||||
|
||||
Reference in New Issue
Block a user