Changeset 1276 for applications/robust
- Timestamp:
- 02/17/11 18:11:46 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/robustlib.cpp
r1275 r1276 91 91 if(vert_ref != base_ref) 92 92 { 93 vec relative_coords = (*vert_ref)->get_coordinates()-base_vertex->get_coordinates(); 94 95 93 vec relative_coords = (*vert_ref)->get_coordinates()-base_vertex->get_coordinates(); 96 94 97 95 jacobian.set_row(row_count,relative_coords); … … 99 97 double new_a = relative_coords*cur_condition; 100 98 101 if(new_a + a_0 == 0 )99 if(new_a + a_0 == 0 || new_a == 0) 102 100 { 103 101 base_ref++; … … 113 111 } 114 112 115 cout << "Absolute coords:(V" << row_count << ")" << (*vert_ref)->get_coordinates() << endl;116 //cout << "Relative coords:(V" << row_count << ")" << relative_coords << endl;113 // cout << "Absolute coords:(V" << row_count << ")" << (*vert_ref)->get_coordinates() << endl; 114 cout << "Relative coords:(V" << row_count << ")" << relative_coords << endl; 117 115 118 116 pair<map<double,int>::iterator,bool> returned = as.insert(pair<double,int>(new_a,1)); … … 178 176 } 179 177 180 double bracket = fact(condition_order- number_of_factors)/fact(as1_order-1)/pow(a_0+(*as_ref).first,condition_order-number_of_factors);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); 181 179 for(int k = 0;k < as1_order-1;k++) 182 180 { 183 double bracket_factor = pow((double)-1,k+1)*fact(condition_order-number_of_factors-k)/fact(as1_order-2-k)/pow(a_0+(*as_ref).first,condition_order-number_of_factors-k);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); 184 182 183 // TODO TADY NEKDE JE CHYBA, NEDOJDE KE SPRAVNEMU NAPLNENI CORRECTION FAKTORU!!! 185 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++) 186 185 { 187 186 double bracket_combination = 1; 188 for(int j = 0;j< (*combi_ref).size();j++)187 for(int j = 0;j<=(*combi_ref).size();j++) 189 188 { 190 189 bracket_combination /= factors[(*combi_ref)[j]]; … … 202 201 203 202 204 correction_term *= fact(condition_order-my_emlig->number_of_parameters)/pow(a_0,condition_order-my_emlig->number_of_parameters+ 1);203 correction_term *= fact(condition_order-my_emlig->number_of_parameters)/pow(a_0,condition_order-my_emlig->number_of_parameters+2); 205 204 206 205 // cout << c << int_value << endl;