1 | |
---|
2 | /*! |
---|
3 | \file |
---|
4 | \brief Robust |
---|
5 | \author Vasek Smidl |
---|
6 | |
---|
7 | */ |
---|
8 | |
---|
9 | #include "robustlib.h" |
---|
10 | #include <vector> |
---|
11 | using namespace itpp; |
---|
12 | |
---|
13 | using namespace bdm; |
---|
14 | |
---|
15 | const int emlig_size = 4; |
---|
16 | |
---|
17 | int main ( int argc, char* argv[] ) { |
---|
18 | |
---|
19 | |
---|
20 | emlig* emlig1 = new emlig(emlig_size); |
---|
21 | |
---|
22 | /* |
---|
23 | emlig1->set_correction_factors(4); |
---|
24 | |
---|
25 | for(int j = 0;j<emlig1->correction_factors.size();j++) |
---|
26 | { |
---|
27 | for(set<my_ivec>::iterator vec_ref = emlig1->correction_factors[j].begin();vec_ref!=emlig1->correction_factors[j].end();vec_ref++) |
---|
28 | { |
---|
29 | cout << j << " "; |
---|
30 | |
---|
31 | for(int i=0;i<(*vec_ref).size();i++) |
---|
32 | { |
---|
33 | cout << (*vec_ref)[i]; |
---|
34 | } |
---|
35 | |
---|
36 | cout << endl; |
---|
37 | } |
---|
38 | }*/ |
---|
39 | |
---|
40 | |
---|
41 | //emlig1->step_me(0); |
---|
42 | |
---|
43 | for(int i = 0;i<500;i++) |
---|
44 | { |
---|
45 | cout << endl << "Step:" << i << endl; |
---|
46 | |
---|
47 | |
---|
48 | |
---|
49 | double condition[emlig_size+1]; |
---|
50 | |
---|
51 | for(int k = 0;k<=emlig_size;k++) |
---|
52 | { |
---|
53 | condition[k] = rand()/1000.0; |
---|
54 | } |
---|
55 | |
---|
56 | |
---|
57 | vec* condition_vec = new vec(condition,emlig_size+1); |
---|
58 | emlig1->add_condition(*condition_vec); |
---|
59 | |
---|
60 | cout << emlig1->statistic_rowsize(emlig_size) << endl << endl; |
---|
61 | |
---|
62 | if(i-emlig1->number_of_parameters >= 0) |
---|
63 | { |
---|
64 | pause(30); |
---|
65 | } |
---|
66 | |
---|
67 | // emlig1->step_me(i); |
---|
68 | |
---|
69 | vector<int> sizevector; |
---|
70 | for(int s = 0;s<=emlig1->number_of_parameters;s++) |
---|
71 | { |
---|
72 | sizevector.push_back(emlig1->statistic_rowsize(s)); |
---|
73 | } |
---|
74 | } |
---|
75 | |
---|
76 | |
---|
77 | |
---|
78 | /* |
---|
79 | emlig1->step_me(1); |
---|
80 | |
---|
81 | vec condition = "2.0 0.0 1.0"; |
---|
82 | |
---|
83 | emlig1->add_condition(condition); |
---|
84 | |
---|
85 | vector<int> sizevector; |
---|
86 | for(int s = 0;s<=emlig1->number_of_parameters;s++) |
---|
87 | { |
---|
88 | sizevector.push_back(emlig1->statistic_rowsize(s)); |
---|
89 | } |
---|
90 | |
---|
91 | emlig1->step_me(2); |
---|
92 | |
---|
93 | condition = "2.0 1.0 0.0"; |
---|
94 | |
---|
95 | emlig1->add_condition(condition); |
---|
96 | |
---|
97 | sizevector.clear(); |
---|
98 | for(int s = 0;s<=emlig1->number_of_parameters;s++) |
---|
99 | { |
---|
100 | sizevector.push_back(emlig1->statistic_rowsize(s)); |
---|
101 | } |
---|
102 | */ |
---|
103 | |
---|
104 | return 0; |
---|
105 | } |
---|