blob: 9a0bc9e9532aae2b70673c72f4085e2961e66cb2 [file] [log] [blame]
stefanc62642c2015-07-07 04:20:34 -07001/*
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved.
3 *
4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree.
9 */
10
solenberg5bdddf92015-10-15 05:10:30 -070011#ifndef WEBRTC_TEST_RANDOM_H_
12#define WEBRTC_TEST_RANDOM_H_
stefanc62642c2015-07-07 04:20:34 -070013
14#include "webrtc/typedefs.h"
15#include "webrtc/base/constructormagic.h"
16
17namespace webrtc {
18
solenberg5bdddf92015-10-15 05:10:30 -070019namespace test {
20
stefanc62642c2015-07-07 04:20:34 -070021class Random {
22 public:
23 explicit Random(uint32_t seed);
24
25 // Return pseudo-random number in the interval [0.0, 1.0].
26 float Rand();
27
solenberg5bdddf92015-10-15 05:10:30 -070028 // Return pseudo rounded random number in interval [low, high].
29 int Rand(int low, int high);
30
stefanc62642c2015-07-07 04:20:34 -070031 // Normal Distribution.
32 int Gaussian(int mean, int standard_deviation);
33
solenberg5bdddf92015-10-15 05:10:30 -070034 // Exponential Distribution.
35 int Exponential(float lambda);
36
stefanc62642c2015-07-07 04:20:34 -070037 // TODO(solenberg): Random from histogram.
38 // template<typename T> int Distribution(const std::vector<T> histogram) {
39
40 private:
41 uint32_t a_;
42 uint32_t b_;
43
henrikg3c089d72015-09-16 05:37:44 -070044 RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(Random);
stefanc62642c2015-07-07 04:20:34 -070045};
solenberg5bdddf92015-10-15 05:10:30 -070046} // namespace test
stefanc62642c2015-07-07 04:20:34 -070047} // namespace webrtc
48
solenberg5bdddf92015-10-15 05:10:30 -070049#endif // WEBRTC_TEST_RANDOM_H_