Show
Ignore:
Timestamp:
05/10/11 13:10:46 (13 years ago)
Author:
sindj
Message:

Cele rozkopano a znovu poskladano za ucelem spravne integrace a nic - jen se mi podarilo doplnit faktor 1/2n. Sakris. JS

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/robustlib.cpp

    r1362 r1365  
    147147                                //cout << "Base coords: " << base_vertex->get_coordinates() << endl; 
    148148                                //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                                 
    154153                                int row_count = 0; 
    155154                                for(set<vertex*>::iterator vert_ref = simplex->vertices.begin(); vert_ref!=simplex->vertices.end();vert_ref++) 
     
    230229                                cout << "a_" << as_count << ": " << (*as_ref).first << "    "; 
    231230                                as_count++; 
    232                         }*/ 
     231                        } 
     232                        */ 
    233233 
    234234                        double int_value = 0;                    
     
    269269                                                multiplier        /= (*as_ref).first; 
    270270                                                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); 
    275277                                                                 
    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);                                 
    282281 
    283282                                for(int k = 0;k < as1_order-1;k++) 
    284283                                { 
    285284                                        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) 
    287286                                         
    288287                                        ivec control_vec = ivec(); 
     
    302301                                        } 
    303302 
    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); 
    305304 
    306305                                        int division_factor = 1; 
     
    314313 
    315314                                int_value += multiplier*bracket; 
     315 
     316                                 
    316317                                                                                                                                                 
    317318                        } 
    318319 
    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);                      
    322323 
    323324                        correction_term = correction_term_base;//fact(sigma_order)*correction_term_base; 
     
    325326                        //cout << c << int_value << endl; 
    326327 
    327                         int_value += correction_term; 
    328                  
     328                        int_value += correction_term;                    
    329329 
    330330                        //cout << "Probability:" << int_value << endl;