-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
58 lines (44 loc) · 1.81 KB
/
Copy pathmain.cpp
File metadata and controls
58 lines (44 loc) · 1.81 KB
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
51
52
53
54
55
56
57
58
#include "aghInclude.h"
int main (void){
ofstream plik("wyniki.txt", ios_base::out);
//InversiveGenerator (_MIN, _MAX, _SEED, _a, _b)
//LinearGenerator (_MIN, _MAX, _SEED, _a, _b)
//BBS (_p, _q, _MIN, _SEED)
InversiveGenerator inwersyjny(0, 17, 0, 5, 1);
LinearGenerator liniowy(0, 16, 0, 5, 1);
BBS blum (11,11,0,5);
cout << "\tICG\tLCG\tBBS" << endl;
cout << "Min\t" << inwersyjny.getMin() << "\t" << liniowy.getMin() << "\t" << blum.getMin() << endl;
cout << "Max\t" << inwersyjny.getMax() << "\t" << liniowy.getMax() << "\t" << blum.getMax() << endl;
cout << "Seed\t" << inwersyjny.getSeed() << "\t" << liniowy.getSeed() << "\t" << blum.getSeed() << endl;
cout << "I\t" << inwersyjny.getA() << "\t" << liniowy.getA() << "\t" << blum.getP() << endl;
cout << "II\t" << inwersyjny.getB() << "\t" << liniowy.getB() << "\t" << blum.getQ() << endl;
cout << endl << "Wylosowane liczby:" << endl;
cout << "Generator liniowy:\t";
for (int i = 0; i < 10; i++)
liniowy.print();
cout << endl;
cout << "Generator inwersyjny:\t";
for (int i = 0; i < 10; i++)
inwersyjny.print();
cout << endl;
cout << "Generator Blum Blum Shub:\t";
for (int i = 0; i < 10; i++)
blum.print();
cout << endl;
cout << "Testy:" << endl;
liniowy.setSeed(0);
inwersyjny.setSeed(0);
blum.setSeed(5);
Test * array [] = {
new statTest(&inwersyjny), new statTest(&liniowy), new statTest(&blum),
new autoTest(&inwersyjny), new autoTest(&liniowy), new autoTest(&blum),
new runsTest(&inwersyjny), new runsTest(&liniowy), new runsTest(&blum)};
for (int i = 0; i < 9; i++)
{
array[i]->runTest();
array[i]->displayResult(plik);
}
plik.close();
return 0;
}