Changeset 1280 for applications/robust/robustlib.cpp
- Timestamp:
- 02/18/11 21:50:33 (13 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/robustlib.cpp
r1276 r1280 35 35 // cout << ((toprow*)this)->condition << endl; 36 36 37 int condition_order = ((toprow*)this)->condition_order+1; // -2 by bylo, pokud chceme uniformni apriorno 37 int condition_order = ((toprow*)this)->condition_order-2; // -2 by bylo, pokud chceme uniformni apriorno 38 39 int sigma_order = condition_order-my_emlig->number_of_parameters; 38 40 39 41 // cout << "C:" << condition_order << " N:" << my_emlig->number_of_parameters << " C+N:" << condition_order-my_emlig->number_of_parameters << endl; 40 42 // pause(0.1); 41 43 42 if( condition_order-my_emlig->number_of_parameters >0)44 if(sigma_order >= 0) 43 45 { 44 46 45 47 cout << endl; 46 48 cout << ((toprow*)this)->condition << endl; 47 cout << "C:" << condition_order << " N:" << my_emlig->number_of_parameters << " C+N:" << condition_order-my_emlig->number_of_parameters<< 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 50 49 51 emlig* current_emlig; … … 111 113 } 112 114 113 //cout << "Absolute coords:(V" << row_count << ")" << (*vert_ref)->get_coordinates() << endl;114 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; 115 117 116 118 pair<map<double,int>::iterator,bool> returned = as.insert(pair<double,int>(new_a,1)); … … 147 149 int as1_order = (*as_ref).second; 148 150 149 correction_term /= -pow((*as_ref).first,as1_order);151 correction_term /= pow(-(*as_ref).first,as1_order); 150 152 151 153 current_emlig->set_correction_factors(as1_order); … … 174 176 } 175 177 176 } 177 178 double bracket = fact(condition_order-my_emlig->number_of_parameters)/fact(as1_order-1)/pow(a_0-(*as_ref).first,condition_order-my_emlig->number_of_parameters+2); 178 } 179 180 181 182 double bracket = fact(sigma_order)/fact(as1_order-1)/pow(a_0-(*as_ref).first,sigma_order+2); 179 183 for(int k = 0;k < as1_order-1;k++) 180 184 { 181 double bracket_factor = pow((double)-1,k+1)*fact(condition_order-my_emlig->number_of_parameters-k)/fact(as1_order-1-k)/pow(a_0-(*as_ref).first,condition_order-my_emlig->number_of_parameters+1-k); 182 183 // TODO TADY NEKDE JE CHYBA, NEDOJDE KE SPRAVNEMU NAPLNENI CORRECTION FAKTORU!!! 184 for(set<my_ivec>::iterator combi_ref = this->my_emlig->correction_factors[k].begin();combi_ref!=this->my_emlig->correction_factors[k].end();combi_ref++) 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); 186 187 ivec control_vec = ivec(); 188 control_vec.ins(0,my_emlig->number_of_parameters-as1_order+1); 189 190 191 for(multiset<my_ivec>::iterator combi_ref = this->my_emlig->correction_factors[k].begin();combi_ref!=this->my_emlig->correction_factors[k].upper_bound(my_ivec(control_vec));combi_ref++) 185 192 { 186 193 double bracket_combination = 1; 187 for(int j = 0;j<=(*combi_ref).size();j++) 188 { 189 bracket_combination /= factors[(*combi_ref)[j]]; 194 for(int j = 0;j<(*combi_ref).size();j++) 195 { 196 cout << "Factor vector:" << (*combi_ref) << endl; 197 198 bracket_combination /= factors[(*combi_ref)[j]-1]; 190 199 } 191 200 … … 201 210 202 211 203 correction_term *= fact( condition_order-my_emlig->number_of_parameters)/pow(a_0,condition_order-my_emlig->number_of_parameters+2);212 correction_term *= fact(sigma_order)/pow(a_0,sigma_order+2); 204 213 205 214 // cout << c << int_value << endl;