Changeset 1266 for applications/robust
- Timestamp:
- 12/16/10 18:07:35 (14 years ago)
- Location:
- applications/robust
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/main.cpp
r1254 r1266 16 16 17 17 emlig* emlig1 = new emlig(3); 18 19 emlig1->set_correction_factors(3); 18 20 19 21 //emlig1->step_me(0); -
applications/robust/robustlib.h
r1262 r1266 415 415 class emlig // : eEF 416 416 { 417 vector<set<ivec>> correction_factors;417 418 418 419 419 /// A statistic in a form of a Hasse diagram representing a complex of convex polyhedrons obtained as a result … … 628 628 public: 629 629 630 vector<set<ivec>> correction_factors; 631 630 632 int number_of_parameters; 631 633 … … 924 926 } 925 927 926 vector<list<ivec>> get_correction_factors(int order) 928 929 void set_correction_factors(int order) 927 930 { 928 931 for(int remaining_order = correction_factors.size();remaining_order>order;remaining_order++) … … 931 934 set<ivec> final_factors; 932 935 936 933 937 for(int i = 1;i==number_of_parameters-order+1;i++) 934 { 935 for(int j = 1;j==remaining_order;j++) 936 { 937 factor_templates.insert(zeros(number_of_parameters-order+2)); 938 938 { 939 ivec new_template = vec_2(1,i); 940 //new_template[0]=1; 941 //new_template[1]=i; 942 //factor_templates.insert(new_template); 943 944 945 for(int j = 1;j==remaining_order-1;j++) 946 { 947 939 948 for(set<ivec>::iterator fac_ref = factor_templates.begin();fac_ref!=factor_templates.end();fac_ref++) 940 949 { 941 950 ivec current_template = (*fac_ref); 942 951 943 952 current_template[0]+=1; 944 current_template[i]+=1; 945 953 current_template.ins(current_template.size(),i); 954 955 946 956 if(current_template[0]==remaining_order) 947 957 { 948 final_factors.insert(current_template.right(current_template.size()-1) ;958 final_factors.insert(current_template.right(current_template.size()-1)); 949 959 } 950 960 else … … 952 962 factor_templates.insert(current_template); 953 963 } 954 } 964 } 955 965 } 956 966 } 957 967 958 correction_factors.push_back(final_factors); 968 correction_factors.push_back(final_factors); 959 969 960 970 } … … 1276 1286 };*/ 1277 1287 1278 1288 bool ivec::operator>(const ivec &first, const ivec &second) 1289 { 1290 int size1 = first.size(); 1291 int size2 = second.size(); 1292 1293 int counter1 = 0; 1294 while(0==0) 1295 { 1296 if(first[counter1]==0) 1297 { 1298 size1--; 1299 } 1300 1301 if(first[counter1]!=0) 1302 break; 1303 } 1304 1305 int counter2 = 0; 1306 while(0==0) 1307 { 1308 if(second[counter2]==0) 1309 { 1310 size2--; 1311 } 1312 1313 if(second[counter2]!=0) 1314 break; 1315 } 1316 1317 if(size1!=size2) 1318 { 1319 return size1>size2; 1320 } 1321 else 1322 { 1323 for(int i = 0;i<size1;i++) 1324 { 1325 if(first[counter1+i]!=second[counter2+i]) 1326 { 1327 return first[counter1+i]>second[counter2+i] 1328 } 1329 } 1330 1331 return false; 1332 } 1333 } 1279 1334 1280 1335