-
Notifications
You must be signed in to change notification settings - Fork 1
/
example.cc
50 lines (36 loc) · 963 Bytes
/
example.cc
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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#include <iomanip>
#include <map>
#include "xoshiro256ss.h"
void test_xoshiro256ss()
{
vigna::xoshiro256ss gen;
std::random_device dev;
gen.seed(dev());
std::uniform_int_distribution<> dist(0, 10);
std::map<unsigned, unsigned> hist;
for (unsigned n(0); n < 1000000; ++n)
++hist[dist(gen)];
std::cout << "XOSHIRO256**\n";
for (auto p : hist)
std::cout << std::setw(3) << p.first << ' '
<< std::string(p.second / 10000, '*') << '\n';
}
void test_xoroshiro128p()
{
vigna::xoroshiro128p gen;
std::random_device dev;
gen.seed(dev());
std::uniform_int_distribution<> dist(0, 10);
std::map<unsigned, unsigned> hist;
for (unsigned n(0); n < 1000000; ++n)
++hist[dist(gen)];
std::cout << "XOROSHIRO128+\n";
for (auto p : hist)
std::cout << std::setw(3) << p.first << ' '
<< std::string(p.second / 10000, '*') << '\n';
}
int main()
{
test_xoshiro256ss();
test_xoroshiro128p();
}