Changeset 1413 for applications/robust/robustlib.h
- Timestamp:
- 12/09/11 17:53:36 (12 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/robustlib.h
r1405 r1413 437 437 start_poly = new polyhedron(); 438 438 }; 439 440 ~c_statistic()441 {442 delete end_poly;443 delete start_poly;444 }445 439 446 440 void append_polyhedron(int row, polyhedron* appended_start, polyhedron* appended_end) … … 1103 1097 1104 1098 this->condition_order = condition_order; 1099 } 1100 1101 ~emlig() 1102 { 1103 for(int i = 0;i<statistic.size();i++) 1104 { 1105 polyhedron* current_polyhedron; 1106 while(statistic.rows[i]!=statistic.end_poly) 1107 { 1108 current_polyhedron = statistic.rows[i]; 1109 statistic.delete_polyhedron(i,statistic.rows[i]); 1110 delete current_polyhedron; 1111 } 1112 } 1113 1114 delete statistic.end_poly; 1115 delete statistic.start_poly; 1116 1117 for(list<condition*>::reverse_iterator c_ref = conditions.rbegin();c_ref!=conditions.rend();c_ref++) 1118 { 1119 delete *c_ref; 1120 } 1121 1122 cout << "Emlig deleted." << endl; 1105 1123 } 1106 1124 … … 2302 2320 pair<double,double> probability_and_sigma = choose_sigma(condition_and_simplex.second); 2303 2321 2322 /* 2323 if(samples.cols()<10) 2324 { 2325 cout << "S-P:" << probability_and_sigma.first << ", "; 2326 pause(0.3); 2327 }*/ 2328 2304 2329 int dimension = condition_and_simplex.second->vertices.size(); 2305 2330 … … 2336 2361 2337 2362 double exponent = extended_coords*condition_and_simplex.first; 2338 double sample_prob = 1*condition_and_simplex.second->volume/condition_and_simplex.second->probability/pow(2*probability_and_sigma.second,condition_order)*exp(-exponent/probability_and_sigma.second);//*probability_and_sigma.first; 2363 double sample_prob = 1*condition_and_simplex.second->volume/condition_and_simplex.second->probability/pow(2*probability_and_sigma.second,condition_order)*exp(-exponent/probability_and_sigma.second)*probability_and_sigma.first; 2364 2365 /* 2366 if(samples.cols()<20) 2367 { 2368 cout << "prob:" << sample_prob << endl; 2369 pause(0.2); 2370 } 2371 */ 2339 2372 2340 2373 sample_coords.ins(sample_coords.size(),probability_and_sigma.second); … … 2736 2769 }; 2737 2770 2771 ~RARX() 2772 { 2773 delete posterior; 2774 } 2775 2738 2776 void bayes(itpp::vec yt) 2739 2777 {