Changeset 1281 for applications/robust

Show
Ignore:
Timestamp:
02/19/11 17:55:16 (13 years ago)
Author:
sindj
Message:

Tak to vypada, ze to konecne pocita spravne, tak to radsi commitnu, protoze vlastne nevim, jak jsem to udelal :-) JS

Location:
applications/robust
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/main.cpp

    r1280 r1281  
    5151        emlig1->add_condition(condition4); 
    5252 
    53         //vec condition3 = "-0.3 0.5 0.5"; 
    54         //emlig1->add_condition(condition3); 
     53        vec condition5 = "-0.3 1.7 1.5"; 
     54        emlig1->add_condition(condition5); 
    5555 
    5656        // emlig1->step_me(0); 
  • applications/robust/robustlib.cpp

    r1280 r1281  
    8787 
    8888                                a_0 = base_vertex->get_coordinates()*cur_condition-as_toprow->condition[0]; 
    89                                  
     89 
    9090                                int row_count = 0; 
    9191                                for(set<vertex*>::iterator vert_ref = simplex.begin(); vert_ref!=simplex.end();vert_ref++) 
     
    9797                                                jacobian.set_row(row_count,relative_coords); 
    9898 
    99                                                 double new_a = relative_coords*cur_condition; 
     99                                                double new_a = -relative_coords*cur_condition; 
    100100 
    101101                                                if(new_a + a_0 == 0 || new_a == 0) 
     
    113113                                                } 
    114114                                                 
    115                                                 cout << "Absolute coords:(V"  << row_count << ")" << (*vert_ref)->get_coordinates() << endl; 
    116                                                 //cout << "Relative coords:(V"  << row_count << ")" << relative_coords << endl; 
     115                                                //cout << "Absolute coords:(V"  << row_count << ")" << (*vert_ref)->get_coordinates() << endl; 
     116                                                cout << "Relative coords:(V"  << row_count << ")" << relative_coords << endl; 
    117117 
    118118                                                pair<map<double,int>::iterator,bool> returned = as.insert(pair<double,int>(new_a,1)); 
     
    136136                        while(!order_correct); 
    137137                         
     138                        cout << "a_0: " << a_0 << "    "; 
     139                        int as_count = 1; 
     140                        for(map<double,int>::iterator as_ref = as.begin();as_ref!=as.end();as_ref++) 
     141                        { 
     142                                cout << "a_" << as_count << ": " << (*as_ref).first << "    "; 
     143                                as_count++; 
     144                        } 
    138145 
    139146                        double int_value = 0; 
     
    180187                                 
    181188 
    182                                 double bracket = fact(sigma_order)/fact(as1_order-1)/pow(a_0-(*as_ref).first,sigma_order+2); 
     189                                double bracket = fact(sigma_order)/fact(as1_order-1)/pow(a_0-(*as_ref).first,sigma_order+1); 
    183190                                for(int k = 0;k < as1_order-1;k++) 
    184191                                { 
    185                                         double bracket_factor = pow((double)-1,k+1)*fact(sigma_order-k)/fact(as1_order-1-k)/pow(a_0-(*as_ref).first,sigma_order+2-k); 
     192                                        double bracket_factor = -pow((double)-1,k+1)*fact(sigma_order-k)/fact(as1_order-1-k)/pow(a_0-(*as_ref).first,sigma_order-k); 
    186193                                         
    187194                                        ivec control_vec = ivec(); 
     
    194201                                                for(int j = 0;j<(*combi_ref).size();j++) 
    195202                                                { 
    196                                                         cout << "Factor vector:" << (*combi_ref) << endl; 
     203                                                        //cout << "Factor vector:" << (*combi_ref) << endl; 
    197204                                                         
    198205                                                        bracket_combination /= factors[(*combi_ref)[j]-1]; 
     
    210217 
    211218                         
    212                         correction_term *= fact(sigma_order)/pow(a_0,sigma_order+2); 
     219                        correction_term *= fact(sigma_order)/abs(pow(a_0,sigma_order+1)); 
    213220 
    214221                        // cout << c << int_value << endl; 
  • applications/robust/robustlib.h

    r1280 r1281  
    11571157                                                        current_template.ins(current_template.size(),i); 
    11581158 
    1159                                                         cout << "template:" << current_template << endl; 
     1159                                                        // cout << "template:" << current_template << endl; 
    11601160                                                         
    11611161                                                        if(current_template.size()==remaining_order+1)