Chromium Code Reviews| Index: webrtc/test/random.h |
| diff --git a/webrtc/modules/remote_bitrate_estimator/test/random.h b/webrtc/test/random.h |
| similarity index 76% |
| rename from webrtc/modules/remote_bitrate_estimator/test/random.h |
| rename to webrtc/test/random.h |
| index 31c1ec142ebaa7aa8db0c6a5d680a1191418b65a..9a0bc9e9532aae2b70673c72f4085e2961e66cb2 100644 |
| --- a/webrtc/modules/remote_bitrate_estimator/test/random.h |
| +++ b/webrtc/test/random.h |
| @@ -8,14 +8,16 @@ |
| * be found in the AUTHORS file in the root of the source tree. |
| */ |
| -#ifndef WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_RANDOM_H_ |
| -#define WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_RANDOM_H_ |
| +#ifndef WEBRTC_TEST_RANDOM_H_ |
| +#define WEBRTC_TEST_RANDOM_H_ |
| #include "webrtc/typedefs.h" |
| #include "webrtc/base/constructormagic.h" |
| namespace webrtc { |
| +namespace test { |
| + |
| class Random { |
| public: |
| explicit Random(uint32_t seed); |
| @@ -23,9 +25,15 @@ class Random { |
| // Return pseudo-random number in the interval [0.0, 1.0]. |
|
pbos-webrtc
2015/10/15 10:28:02
Is this 1.0 inclusive?
the sun
2015/10/16 21:50:31
Yes, that is why it says so. :)
https://en.wikiped
pbos-webrtc
2015/10/19 13:33:01
I thought [0.0, 1.0) was the "standard" one, since
the sun
2015/10/19 15:10:25
Acknowledged.
|
| float Rand(); |
| + // Return pseudo rounded random number in interval [low, high]. |
| + int Rand(int low, int high); |
|
pbos-webrtc
2015/10/15 10:28:02
pseudo-random number mapped to the interval
|
| + |
| // Normal Distribution. |
| int Gaussian(int mean, int standard_deviation); |
| + // Exponential Distribution. |
| + int Exponential(float lambda); |
| + |
| // TODO(solenberg): Random from histogram. |
| // template<typename T> int Distribution(const std::vector<T> histogram) { |
| @@ -35,6 +43,7 @@ class Random { |
| RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Random); |
| }; |
| +} // namespace test |
| } // namespace webrtc |
| -#endif // WEBRTC_MODULES_REMOTE_BITRATE_ESTIMATOR_TEST_RANDOM_H_ |
| +#endif // WEBRTC_TEST_RANDOM_H_ |