[976] | 1 | |
---|
| 2 | /*! |
---|
| 3 | \file |
---|
| 4 | \brief Robust |
---|
| 5 | \author Vasek Smidl |
---|
| 6 | |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "robustlib.h" |
---|
[1216] | 10 | #include <vector> |
---|
[1208] | 11 | using namespace itpp; |
---|
[976] | 12 | |
---|
[1275] | 13 | //using namespace bdm; |
---|
[976] | 14 | |
---|
[1275] | 15 | const int emlig_size = 2; |
---|
[1268] | 16 | |
---|
[1272] | 17 | |
---|
[976] | 18 | int main ( int argc, char* argv[] ) { |
---|
| 19 | |
---|
[1186] | 20 | |
---|
[1268] | 21 | emlig* emlig1 = new emlig(emlig_size); |
---|
| 22 | |
---|
[1267] | 23 | /* |
---|
| 24 | emlig1->set_correction_factors(4); |
---|
[1266] | 25 | |
---|
[1267] | 26 | for(int j = 0;j<emlig1->correction_factors.size();j++) |
---|
| 27 | { |
---|
| 28 | for(set<my_ivec>::iterator vec_ref = emlig1->correction_factors[j].begin();vec_ref!=emlig1->correction_factors[j].end();vec_ref++) |
---|
| 29 | { |
---|
[1268] | 30 | cout << j << " "; |
---|
| 31 | |
---|
[1267] | 32 | for(int i=0;i<(*vec_ref).size();i++) |
---|
| 33 | { |
---|
| 34 | cout << (*vec_ref)[i]; |
---|
| 35 | } |
---|
| 36 | |
---|
| 37 | cout << endl; |
---|
| 38 | } |
---|
[1268] | 39 | }*/ |
---|
| 40 | |
---|
[1280] | 41 | vec condition1 = "1.0 1.0 1.0"; |
---|
[1275] | 42 | emlig1->add_condition(condition1); |
---|
[1267] | 43 | |
---|
[1280] | 44 | vec condition2 = "-1.0 1.0 1.0"; |
---|
[1275] | 45 | emlig1->add_condition(condition2); |
---|
[1234] | 46 | |
---|
[1280] | 47 | vec condition3 = "0.5 -1.1 1.0"; |
---|
| 48 | emlig1->add_condition(condition3); |
---|
| 49 | |
---|
| 50 | vec condition4 = "-0.5 -1.0 1.0"; |
---|
| 51 | emlig1->add_condition(condition4); |
---|
| 52 | |
---|
[1275] | 53 | //vec condition3 = "-0.3 0.5 0.5"; |
---|
| 54 | //emlig1->add_condition(condition3); |
---|
| 55 | |
---|
| 56 | // emlig1->step_me(0); |
---|
| 57 | |
---|
| 58 | //emlig1->remove_condition(condition1); |
---|
| 59 | |
---|
| 60 | |
---|
| 61 | |
---|
| 62 | |
---|
| 63 | |
---|
| 64 | /* |
---|
[1219] | 65 | for(int i = 0;i<500;i++) |
---|
| 66 | { |
---|
[1271] | 67 | cout << endl << "Step:" << i << endl; |
---|
| 68 | |
---|
| 69 | |
---|
[1208] | 70 | |
---|
[1268] | 71 | double condition[emlig_size+1]; |
---|
[1220] | 72 | |
---|
[1268] | 73 | for(int k = 0;k<=emlig_size;k++) |
---|
| 74 | { |
---|
[1272] | 75 | condition[k] = (rand()-RAND_MAX/2)/1000.0; |
---|
[1268] | 76 | } |
---|
| 77 | |
---|
[1216] | 78 | |
---|
[1268] | 79 | vec* condition_vec = new vec(condition,emlig_size+1); |
---|
[1219] | 80 | emlig1->add_condition(*condition_vec); |
---|
[1271] | 81 | |
---|
[1272] | 82 | /* |
---|
| 83 | for(polyhedron* toprow_ref = emlig1->statistic.rows[emlig_size]; toprow_ref != emlig1->statistic.end_poly; toprow_ref = toprow_ref->next_poly) |
---|
| 84 | { |
---|
| 85 | cout << ((toprow*)toprow_ref)->probability << endl; |
---|
| 86 | } |
---|
| 87 | */ |
---|
[1275] | 88 | /* |
---|
[1271] | 89 | cout << emlig1->statistic_rowsize(emlig_size) << endl << endl; |
---|
[1268] | 90 | |
---|
[1272] | 91 | /* |
---|
[1271] | 92 | if(i-emlig1->number_of_parameters >= 0) |
---|
| 93 | { |
---|
| 94 | pause(30); |
---|
| 95 | } |
---|
[1272] | 96 | */ |
---|
[1219] | 97 | |
---|
[1271] | 98 | // emlig1->step_me(i); |
---|
[1219] | 99 | |
---|
[1272] | 100 | /* |
---|
[1219] | 101 | vector<int> sizevector; |
---|
| 102 | for(int s = 0;s<=emlig1->number_of_parameters;s++) |
---|
| 103 | { |
---|
| 104 | sizevector.push_back(emlig1->statistic_rowsize(s)); |
---|
| 105 | } |
---|
[1272] | 106 | */ |
---|
[1275] | 107 | //} |
---|
| 108 | |
---|
[1219] | 109 | |
---|
| 110 | |
---|
| 111 | |
---|
| 112 | /* |
---|
| 113 | emlig1->step_me(1); |
---|
| 114 | |
---|
| 115 | vec condition = "2.0 0.0 1.0"; |
---|
| 116 | |
---|
[1208] | 117 | emlig1->add_condition(condition); |
---|
| 118 | |
---|
[1216] | 119 | vector<int> sizevector; |
---|
| 120 | for(int s = 0;s<=emlig1->number_of_parameters;s++) |
---|
| 121 | { |
---|
| 122 | sizevector.push_back(emlig1->statistic_rowsize(s)); |
---|
| 123 | } |
---|
| 124 | |
---|
[1219] | 125 | emlig1->step_me(2); |
---|
[1216] | 126 | |
---|
[1219] | 127 | condition = "2.0 1.0 0.0"; |
---|
[1216] | 128 | |
---|
| 129 | emlig1->add_condition(condition); |
---|
| 130 | |
---|
| 131 | sizevector.clear(); |
---|
| 132 | for(int s = 0;s<=emlig1->number_of_parameters;s++) |
---|
| 133 | { |
---|
| 134 | sizevector.push_back(emlig1->statistic_rowsize(s)); |
---|
| 135 | } |
---|
[1219] | 136 | */ |
---|
[1216] | 137 | |
---|
[976] | 138 | return 0; |
---|
| 139 | } |
---|