-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprng.hpp
More file actions
29 lines (22 loc) · 908 Bytes
/
prng.hpp
File metadata and controls
29 lines (22 loc) · 908 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#ifndef PRNG_H
#define PRNG_H
#include <cstdint>
class PseudoRandomNumberGenerator
{
protected:
const uint64_t m_seed;
const uint64_t m_minimum_value;
const uint64_t m_maximum_value;
public:
PseudoRandomNumberGenerator();
PseudoRandomNumberGenerator(const uint64_t seed);
PseudoRandomNumberGenerator(const uint64_t minimum_value, const uint64_t maximum_value);
PseudoRandomNumberGenerator(const uint64_t seed, const uint64_t minimum_value, const uint64_t maximum_value);
virtual ~PseudoRandomNumberGenerator() {}
static uint64_t generateCryptographicallyInsecureSeed();
virtual uint64_t generateRandomValue() = 0;
double generateUnitNormalRandomValue();
double generateFloatingPointRandomValue(float min, float max);
int64_t generateIntegerRandomValue(int32_t min, int32_t max);
};
#endif