Changeset 1282 for applications/robust/robustlib.cpp
- Timestamp:
- 02/21/11 09:22:08 (13 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/robustlib.cpp
r1281 r1282 1 1 #include "robustlib.h" 2 2 3 3 4 void polyhedron::triangulate(bool should_integrate) … … 33 34 double toprow::integrate_simplex(set<vertex*> simplex, char c) 34 35 { 35 // cout << ((toprow*)this)->condition << endl; 36 36 // cout << ((toprow*)this)->condition << endl; 37 37 38 int condition_order = ((toprow*)this)->condition_order-2; // -2 by bylo, pokud chceme uniformni apriorno 38 39 … … 45 46 { 46 47 47 cout << endl; 48 cout << ((toprow*)this)->condition << endl; 49 cout << "C:" << condition_order+2 << " N:" << my_emlig->number_of_parameters << " C+N:" << condition_order-my_emlig->number_of_parameters+2 << endl; 48 //cout << endl; 49 //cout << ((toprow*)this)->condition << endl; 50 //cout << "C:" << condition_order+2 << " N:" << my_emlig->number_of_parameters << " C+N:" << condition_order-my_emlig->number_of_parameters+2 << endl; 51 50 52 51 53 emlig* current_emlig; … … 84 86 base_vertex = (*base_ref); 85 87 86 cout << "Base coords:" << base_vertex->get_coordinates() << endl; 88 89 //cout << endl << "Base coords:" << base_vertex->get_coordinates() << endl; 87 90 88 91 a_0 = base_vertex->get_coordinates()*cur_condition-as_toprow->condition[0]; 92 89 93 90 94 int row_count = 0; … … 111 115 112 116 break; 113 } 114 117 } 118 119 120 121 if(a_0<current_emlig->likelihood_value) 122 { 123 current_emlig->minimal_vertex = base_vertex; 124 current_emlig->likelihood_value = a_0; 125 } 126 127 double a_m = (*vert_ref)->get_coordinates()*cur_condition-as_toprow->condition[0]; 128 if(a_m<current_emlig->likelihood_value) 129 { 130 current_emlig->minimal_vertex = (*vert_ref); 131 current_emlig->likelihood_value = a_m; 132 } 133 134 //cout << "a0:" << a_0 << " a0 coords:" << base_vertex->get_coordinates() << " am:" << a_m << " am coords:" << (*vert_ref)->get_coordinates() << endl; 135 115 136 //cout << "Absolute coords:(V" << row_count << ")" << (*vert_ref)->get_coordinates() << endl; 116 cout << "Relative coords:(V" << row_count << ")" << relative_coords << endl;137 //cout << "Relative coords:(V" << row_count << ")" << relative_coords << endl; 117 138 118 139 pair<map<double,int>::iterator,bool> returned = as.insert(pair<double,int>(new_a,1)); … … 136 157 while(!order_correct); 137 158 159 /* 138 160 cout << "a_0: " << a_0 << " "; 139 161 int as_count = 1; … … 142 164 cout << "a_" << as_count << ": " << (*as_ref).first << " "; 143 165 as_count++; 144 } 166 }*/ 145 167 146 168 double int_value = 0; … … 224 246 225 247 226 cout << "Probability:" << int_value << endl;248 //cout << "Probability:" << int_value << endl; 227 249 228 250 return int_value;