Changeset 1310 for applications/robust
- Timestamp:
- 03/25/11 14:42:14 (14 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
applications/robust/robustlib.h
r1307 r1310 834 834 if(is_last) 835 835 { 836 837 /// \TODO Nechapu druhou podminku, zda se mi ze je to spatne.. Nemela by byt jen prvni? Nebo se jedna o nastaveni totalni neutrality? 836 838 if((current_parent->negativechildren.size()>0&¤t_parent->positivechildren.size()>0)|| 837 839 (current_parent->neutralchildren.size()>0&¤t_parent->totally_neutral==false)) 838 { 840 { 841 for_splitting[level+1].push_back(current_parent); 839 842 840 for_splitting[level+1].push_back(current_parent); 841 842 current_parent->set_state(0, SPLIT); 843 current_parent->set_state(0, SPLIT); 843 844 } 844 845 else … … 947 948 { 948 949 950 /* 949 951 if(i==statistic.size()-1) 950 952 { … … 956 958 cout << ((vertex*)horiz_ref)->get_coordinates() << endl; 957 959 } 960 */ 958 961 959 962 char* string = "Checkpoint"; … … 1216 1219 (*child_ref)->parents.push_back(current_positive); 1217 1220 } 1221 1222 // current_positive->parents.insert(current_positive->parents.begin(),current_negative->parents.begin(),current_negative->parents.end()); 1223 // unique(current_positive->parents.begin(),current_positive->parents.end()); 1224 1225 for(list<polyhedron*>::iterator parent_ref = current_negative->parents.begin();parent_ref!=current_negative->parents.end();parent_ref++) 1226 { 1227 (*parent_ref)->children.remove(current_negative); 1228 1229 switch(current_negative->get_state(SPLIT)) 1230 { 1231 case -1: 1232 (*parent_ref)->negativechildren.remove(current_negative); 1233 break; 1234 case 0: 1235 (*parent_ref)->neutralchildren.remove(current_negative); 1236 break; 1237 case 1: 1238 (*parent_ref)->positivechildren.remove(current_negative); 1239 break; 1240 } 1241 //(*parent_ref)->children.push_back(current_positive); 1242 } 1243 1244 if(current_positive->get_state(SPLIT)!=0||current_negative->get_state(SPLIT)==0) 1245 { 1246 for(list<polyhedron*>::iterator parent_ref = current_positive->parents.begin();parent_ref!=current_positive->parents.end();parent_ref++) 1247 { 1248 if(current_positive->get_state(SPLIT)==1) 1249 { 1250 (*parent_ref)->positivechildren.remove(current_positive); 1251 } 1252 else 1253 { 1254 (*parent_ref)->negativechildren.remove(current_positive); 1255 } 1256 1257 (*parent_ref)->neutralchildren.push_back(current_positive); 1258 } 1259 1260 current_positive->set_state(0,SPLIT); 1261 } 1218 1262 1219 1263 if((current_positive->get_state(SPLIT)==0&&!current_positive->totally_neutral)||(current_negative->get_state(SPLIT)==0&&!current_negative->totally_neutral)) … … 1264 1308 } 1265 1309 1266 current_positive->parents.insert(current_positive->parents.begin(),current_negative->parents.begin(),current_negative->parents.end()); 1267 // unique(current_positive->parents.begin(),current_positive->parents.end()); 1268 1269 for(list<polyhedron*>::iterator parent_ref = current_negative->parents.begin();parent_ref!=current_negative->parents.end();parent_ref++) 1270 { 1271 (*parent_ref)->children.remove(current_negative); 1272 (*parent_ref)->children.push_back(current_positive); 1273 } 1310 1274 1311 1275 1312 current_positive->vertices.insert(current_negative->vertices.begin(),current_negative->vertices.end()); … … 1331 1368 current_positive->grandparents.clear(); 1332 1369 1370 1371 1333 1372 current_positive->totally_neutral = (current_positive->totally_neutral && current_negative->totally_neutral); 1334 1373 … … 1397 1436 } 1398 1437 1438 step_me(0); 1399 1439 1400 1440 if(should_add) … … 1550 1590 } 1551 1591 1552 1592 /* 1553 1593 vector<int> sizevector; 1554 1594 for(int s = 0;s<statistic.size();s++) … … 1557 1597 cout << statistic.row_size(s) << ", "; 1558 1598 } 1599 */ 1559 1600 1560 1601 cout << endl;