-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwindowTest.cc
71 lines (54 loc) · 1.19 KB
/
windowTest.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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
#include <iostream>
#include "random.h"
#include "samplestat.h"
using namespace std;
int main(int argc, char* argv[]) {
Random myRand(Random::USE_RNG_LEHMER);
SampleStat myData;
double x;
vector<double> *p;
for (int i=0; i<10; i++) {
x = myRand.normal(0,1);
myData.record(x);
}
for (int i=0; i<10; i++) {
x = myRand.normal(1,1);
myData.record(x);
}
for (int i=0; i<10; i++) {
x = myRand.normal(3,1);
myData.record(x);
}
for (int i=0; i<10; i++) {
x = myRand.normal(5,1);
myData.record(x);
}
for (int i=0; i<10; i++) {
x = myRand.normal(6,2);
myData.record(x);
}
for (int i=0; i<10; i++) {
x = myRand.normal(8,1);
myData.record(x);
}
for (int i=0; i<10; i++) {
x = myRand.normal(9,2);
myData.record(x);
}
for (int i=0; i<20; i++) {
x = myRand.normal(10,2);
myData.record(x);
}
for (int i=0; i<40; i++) {
x = myRand.normal(10,1);
myData.record(x);
}
for (int i=0; i<40; i++) {
x = myRand.normal(10,0.5);
myData.record(x);
}
p = myData.moving_averages(3);
for (vector<double>::iterator i=p->begin(); i!=p->end(); ++i) {
cout << "hello" << endl;
}
}