Changeset 1319 for applications/robust
- Timestamp:
- 03/28/11 18:09:23 (14 years ago)
- Location:
- applications/robust
- Files:
-
- 2 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/main.cpp
r1307 r1319 162 162 vector<vec> conditions; 163 163 //emlig* emliga = new emlig(2); 164 RARX* my_rarx = new RARX(2, 1);164 RARX* my_rarx = new RARX(2,30); 165 165 166 166 for(int k = 1;k<170;k++) … … 209 209 } 210 210 myfile.close(); 211 } 212 211 } 213 212 } 214 213 -
applications/robust/robustlib.h
r1318 r1319 21 21 using namespace itpp; 22 22 23 const double max_range = 10 0;//numeric_limits<double>::max()/10e-10;23 const double max_range = 10;//numeric_limits<double>::max()/10e-10; 24 24 25 25 /// An enumeration of possible actions performed on the polyhedrons. We can merge them or split them. … … 738 738 if(is_last) 739 739 { 740 if(parent_state == 1) 741 { 742 ((toprow*)current_parent)->condition_sum-=toremove->value; 743 ((toprow*)current_parent)->condition_order--; 744 } 745 746 if(parent_state == -1) 747 { 748 ((toprow*)current_parent)->condition_sum+=toremove->value; 749 ((toprow*)current_parent)->condition_order--; 750 } 751 740 752 if(current_parent->mergechild != NULL) 741 753 { … … 755 767 else 756 768 { 757 if(parent_state == 1)758 {759 ((toprow*)current_parent)->condition_sum-=toremove->value;760 ((toprow*)current_parent)->condition_order--;761 }762 763 if(parent_state == -1)764 {765 ((toprow*)current_parent)->condition_sum+=toremove->value;766 ((toprow*)current_parent)->condition_order--;767 }768 769 769 //current_parent->set_state(0,MERGE); 770 770 … … 784 784 { 785 785 for_merging[level+1].push_back(current_parent); 786 // 786 //current_parent->parentconditions.erase(toremove); 787 787 } 788 788 … … 845 845 else 846 846 { 847 848 849 847 if(current_parent->negativechildren.size()>0) 850 848 { … … 852 850 853 851 ((toprow*)current_parent)->condition_sum-=toadd->value; 854 855 852 856 853 } … … 945 942 for(int i = 0;i<statistic.size();i++) 946 943 { 944 int zero = 0; 945 int one = 0; 946 int two = 0; 947 947 948 for(polyhedron* horiz_ref = statistic.rows[i];horiz_ref!=statistic.get_end();horiz_ref=horiz_ref->next_poly) 948 949 { … … 961 962 962 963 char* string = "Checkpoint"; 964 965 if((*horiz_ref).parentconditions.size()==0) 966 { 967 zero++; 968 } 969 else if((*horiz_ref).parentconditions.size()==1) 970 { 971 one++; 972 } 973 else 974 { 975 two++; 976 } 977 963 978 } 964 979 } … … 1037 1052 void add_and_remove_condition(vec toadd, vec toremove) 1038 1053 { 1054 step_me(0); 1055 1039 1056 likelihood_value = numeric_limits<double>::max(); 1040 1057 … … 1208 1225 toprow* current_negative = (toprow*)(*merge_ref)->negativeparent; 1209 1226 1210 current_positive->condition_sum -= toremove; 1211 current_positive->condition_order--; 1227 //current_positive->condition_sum -= toremove; 1228 //current_positive->condition_order--; 1229 1230 current_positive->parentconditions.erase(condition_to_remove); 1212 1231 1213 1232 current_positive->children.insert(current_positive->children.end(),current_negative->children.begin(),current_negative->children.end()); … … 1242 1261 } 1243 1262 1244 if(current_positive->get_state(SPLIT)!=0 ||current_negative->get_state(SPLIT)==0)1263 if(current_positive->get_state(SPLIT)!=0&¤t_negative->get_state(SPLIT)==0) 1245 1264 { 1246 1265 for(list<polyhedron*>::iterator parent_ref = current_positive->parents.begin();parent_ref!=current_positive->parents.end();parent_ref++) … … 1429 1448 delete *vert_ref; 1430 1449 } 1431 } 1432 } 1433 1434 1450 } 1451 1452 delete condition_to_remove; 1453 } 1454 1455 vector<int> sizevector; 1456 for(int s = 0;s<statistic.size();s++) 1457 { 1458 sizevector.push_back(statistic.row_size(s)); 1459 cout << statistic.row_size(s) << ", "; 1460 } 1461 1462 cout << endl; 1435 1463 1436 1464 if(should_add) … … 1495 1523 positive_poly->my_emlig = this; 1496 1524 negative_poly->my_emlig = this; 1525 1526 positive_poly->parentconditions.insert(current_polyhedron->parentconditions.begin(),current_polyhedron->parentconditions.end()); 1527 negative_poly->parentconditions.insert(current_polyhedron->parentconditions.begin(),current_polyhedron->parentconditions.end()); 1497 1528 1498 1529 for(set<polyhedron*>::iterator grand_ref = current_polyhedron->totallyneutralgrandchildren.begin(); grand_ref != current_polyhedron->totallyneutralgrandchildren.end();grand_ref++) … … 1586 1617 } 1587 1618 1588 /*1589 vector<int> sizevector;1619 1620 sizevector.clear(); 1590 1621 for(int s = 0;s<statistic.size();s++) 1591 1622 { … … 1593 1624 cout << statistic.row_size(s) << ", "; 1594 1625 } 1595 */ 1596 1597 // cout << endl; 1626 1627 cout << endl; 1598 1628 1599 1629 /*