Changeset 1281 for applications/robust
- Timestamp:
- 02/19/11 17:55:16 (14 years ago)
- Location:
- applications/robust
- Files:
-
- 3 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/main.cpp
r1280 r1281 51 51 emlig1->add_condition(condition4); 52 52 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); 55 55 56 56 // emlig1->step_me(0); -
applications/robust/robustlib.cpp
r1280 r1281 87 87 88 88 a_0 = base_vertex->get_coordinates()*cur_condition-as_toprow->condition[0]; 89 89 90 90 int row_count = 0; 91 91 for(set<vertex*>::iterator vert_ref = simplex.begin(); vert_ref!=simplex.end();vert_ref++) … … 97 97 jacobian.set_row(row_count,relative_coords); 98 98 99 double new_a = relative_coords*cur_condition;99 double new_a = -relative_coords*cur_condition; 100 100 101 101 if(new_a + a_0 == 0 || new_a == 0) … … 113 113 } 114 114 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; 117 117 118 118 pair<map<double,int>::iterator,bool> returned = as.insert(pair<double,int>(new_a,1)); … … 136 136 while(!order_correct); 137 137 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 } 138 145 139 146 double int_value = 0; … … 180 187 181 188 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); 183 190 for(int k = 0;k < as1_order-1;k++) 184 191 { 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); 186 193 187 194 ivec control_vec = ivec(); … … 194 201 for(int j = 0;j<(*combi_ref).size();j++) 195 202 { 196 cout << "Factor vector:" << (*combi_ref) << endl;203 //cout << "Factor vector:" << (*combi_ref) << endl; 197 204 198 205 bracket_combination /= factors[(*combi_ref)[j]-1]; … … 210 217 211 218 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)); 213 220 214 221 // cout << c << int_value << endl; -
applications/robust/robustlib.h
r1280 r1281 1157 1157 current_template.ins(current_template.size(),i); 1158 1158 1159 cout << "template:" << current_template << endl;1159 // cout << "template:" << current_template << endl; 1160 1160 1161 1161 if(current_template.size()==remaining_order+1)