Changeset 1365 for applications/robust/robustlib.cpp
- Timestamp:
- 05/10/11 13:10:46 (13 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/robustlib.cpp
r1362 r1365 147 147 //cout << "Base coords: " << base_vertex->get_coordinates() << endl; 148 148 //cout << "Condition: " << as_toprow->condition_sum << endl; 149 //pause(10); 150 151 a_0 = base_vertex->get_coordinates()*cur_condition-as_toprow->condition_sum[0]; 152 153 149 //pause(0.1); 150 151 a_0 = -base_vertex->get_coordinates()*cur_condition+as_toprow->condition_sum[0]; 152 154 153 int row_count = 0; 155 154 for(set<vertex*>::iterator vert_ref = simplex->vertices.begin(); vert_ref!=simplex->vertices.end();vert_ref++) … … 230 229 cout << "a_" << as_count << ": " << (*as_ref).first << " "; 231 230 as_count++; 232 }*/ 231 } 232 */ 233 233 234 234 double int_value = 0; … … 269 269 multiplier /= (*as_ref).first; 270 270 number_of_factors += 1; 271 } 272 273 } 274 271 } 272 } 273 274 double gamma_multiplier = -(*as_ref).first-a_0; 275 276 double bracket = fact(as1_order-1)/pow(gamma_multiplier,sigma_order+1); 275 277 276 277 double bracket = fact(as1_order-1)/pow(a_0-(*as_ref).first,sigma_order+1); 278 279 simplex->insert_gamma(0,bracket*multiplier,a_0-(*as_ref).first); 280 281 // bracket *= fact(sigma_order); 278 simplex->insert_gamma(0,bracket*multiplier,gamma_multiplier); 279 280 // bracket *= fact(sigma_order); 282 281 283 282 for(int k = 0;k < as1_order-1;k++) 284 283 { 285 284 double local_bracket = 0; 286 double bracket_factor = -pow((double)-1,k+1)/fact(as1_order-1-k)/pow(a_0-(*as_ref).first,sigma_order-k);285 double bracket_factor = 1/fact(as1_order-1-k)/pow(gamma_multiplier,sigma_order-k);//pow((double)-1,k+1) 287 286 288 287 ivec control_vec = ivec(); … … 302 301 } 303 302 304 simplex->insert_gamma(k+1,local_bracket*multiplier, a_0-(*as_ref).first);303 simplex->insert_gamma(k+1,local_bracket*multiplier,gamma_multiplier); 305 304 306 305 int division_factor = 1; … … 314 313 315 314 int_value += multiplier*bracket; 315 316 316 317 317 318 } 318 319 319 double correction_term_base = correction_term/pow( a_0,sigma_order+1);320 321 simplex->insert_gamma(0,correction_term_base, a_0);320 double correction_term_base = correction_term/pow(-a_0,sigma_order+1); 321 322 simplex->insert_gamma(0,correction_term_base,-a_0); 322 323 323 324 correction_term = correction_term_base;//fact(sigma_order)*correction_term_base; … … 325 326 //cout << c << int_value << endl; 326 327 327 int_value += correction_term; 328 328 int_value += correction_term; 329 329 330 330 //cout << "Probability:" << int_value << endl;