Changeset 1307 for applications/robust

Show
Ignore:
Timestamp:
03/24/11 16:21:08 (13 years ago)
Author:
sindj
Message:

Odstraneni dalsich chyb ve spojovani polyhedronu. Jeste nejsou vsechny vychytane. JS

Location:
applications/robust
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/main.cpp

    r1301 r1307  
    162162                vector<vec> conditions; 
    163163                //emlig* emliga = new emlig(2); 
    164                 RARX* my_rarx = new RARX(2,0); 
     164                RARX* my_rarx = new RARX(2,1); 
    165165 
    166166                for(int k = 1;k<170;k++) 
  • applications/robust/robustlib.h

    r1301 r1307  
    767767                                                        } 
    768768 
    769                                                         //current_parent->set_state(0,MERGE);                                                    
     769                                                        //current_parent->set_state(0,MERGE);    
     770 
     771                                                        if(level == number_of_parameters - 1) 
     772                                                        { 
     773                                                                toprow* cur_par_toprow = ((toprow*)current_parent); 
     774                                                                cur_par_toprow->probability = 0.0; 
     775                                                                                 
     776                                                                for(list<set<vertex*>>::iterator t_ref = current_parent->triangulation.begin();t_ref!=current_parent->triangulation.end();t_ref++) 
     777                                                                { 
     778                                                                        cur_par_toprow->probability += cur_par_toprow->integrate_simplex(*t_ref,'C'); 
     779                                                                }                                                                        
     780                                                        } 
    770781                                                } 
    771782 
     
    776787                                                }                                                
    777788 
    778                                                 current_parent->mergechild = NULL; 
    779                                                 current_parent->message_counter = 0;                                             
    780  
    781                                                 if(level == number_of_parameters - 1) 
    782                                                 { 
    783                                                         toprow* cur_par_toprow = ((toprow*)current_parent); 
    784                                                         cur_par_toprow->probability = 0.0; 
    785                                                                          
    786                                                         for(list<set<vertex*>>::iterator t_ref = current_parent->triangulation.begin();t_ref!=current_parent->triangulation.end();t_ref++) 
    787                                                         { 
    788                                                                 cur_par_toprow->probability += cur_par_toprow->integrate_simplex(*t_ref,'C'); 
    789                                                         }                                                                        
    790                                                 } 
     789                                                                                                 
    791790                                        }                                        
    792791                                } 
     
    879878                                                        } 
    880879 
    881                                                         current_parent->positivechildren.clear(); 
    882                                                         current_parent->negativechildren.clear(); 
    883                                                         current_parent->neutralchildren.clear(); 
    884                                                         current_parent->totallyneutralchildren.clear(); 
    885                                                         current_parent->totallyneutralgrandchildren.clear(); 
    886                                                         // current_parent->grandparents.clear(); 
    887                                                         current_parent->positiveneutralvertices.clear(); 
    888                                                         current_parent->negativeneutralvertices.clear(); 
    889                                                         current_parent->totally_neutral = NULL; 
    890                                                         current_parent->kids_rel_addresses.clear(); 
    891                                                         current_parent->message_counter = 0; 
     880                                                        if(current_parent->mergechild == NULL) 
     881                                                        { 
     882                                                                current_parent->positivechildren.clear(); 
     883                                                                current_parent->negativechildren.clear(); 
     884                                                                current_parent->neutralchildren.clear(); 
     885                                                                current_parent->totallyneutralchildren.clear(); 
     886                                                                current_parent->totallyneutralgrandchildren.clear(); 
     887                                                                // current_parent->grandparents.clear(); 
     888                                                                current_parent->positiveneutralvertices.clear(); 
     889                                                                current_parent->negativeneutralvertices.clear(); 
     890                                                                current_parent->totally_neutral = NULL; 
     891                                                                current_parent->kids_rel_addresses.clear(); 
     892                                                        }                                                        
    892893                                                } 
    893894                                        } 
     
    896897                                if(is_last) 
    897898                                { 
     899                                        current_parent->mergechild = NULL; 
     900                                        current_parent->message_counter = 0; 
     901 
    898902                                        send_state_message(current_parent,toadd,toremove,level+1); 
    899903                                } 
     
    12131217                                                } 
    12141218                                                 
    1215                                                 current_positive->negativechildren.insert(current_positive->negativechildren.end(),current_negative->negativechildren.begin(),current_negative->negativechildren.end());                                                 
     1219                                                if((current_positive->get_state(SPLIT)==0&&!current_positive->totally_neutral)||(current_negative->get_state(SPLIT)==0&&!current_negative->totally_neutral)) 
     1220                                                { 
     1221                                                        current_positive->negativechildren.insert(current_positive->negativechildren.end(),current_negative->negativechildren.begin(),current_negative->negativechildren.end());                                                 
     1222                                                         
     1223                                                        current_positive->positivechildren.insert(current_positive->positivechildren.end(),current_negative->positivechildren.begin(),current_negative->positivechildren.end()); 
     1224                                                                                                         
     1225                                                        current_positive->neutralchildren.insert(current_positive->neutralchildren.end(),current_negative->neutralchildren.begin(),current_negative->neutralchildren.end()); 
    12161226                                                 
    1217                                                 current_positive->positivechildren.insert(current_positive->positivechildren.end(),current_negative->positivechildren.begin(),current_negative->positivechildren.end()); 
    1218                                                                                                  
    1219                                                 current_positive->neutralchildren.insert(current_positive->neutralchildren.end(),current_negative->positivechildren.begin(),current_negative->positivechildren.end()); 
    1220                                          
    1221                                                 switch((*merge_ref)->get_state(SPLIT)) 
    1222                                                 { 
    1223                                                 case -1: 
    1224                                                         current_positive->negativechildren.remove(*merge_ref); 
    1225                                                         break; 
    1226                                                 case 0: 
    1227                                                         current_positive->neutralchildren.remove(*merge_ref); 
    1228                                                         break; 
    1229                                                 case 1: 
    1230                                                         current_positive->positivechildren.remove(*merge_ref); 
    1231                                                         break; 
     1227                                                        switch((*merge_ref)->get_state(SPLIT)) 
     1228                                                        { 
     1229                                                        case -1: 
     1230                                                                current_positive->negativechildren.remove(*merge_ref); 
     1231                                                                break; 
     1232                                                        case 0: 
     1233                                                                current_positive->neutralchildren.remove(*merge_ref); 
     1234                                                                break; 
     1235                                                        case 1: 
     1236                                                                current_positive->positivechildren.remove(*merge_ref); 
     1237                                                                break; 
     1238                                                        } 
     1239 
     1240                                                        current_positive->totallyneutralchildren.insert(current_negative->totallyneutralchildren.begin(),current_negative->totallyneutralchildren.end()); 
     1241                                                         
     1242                                                        current_positive->totallyneutralchildren.erase(*merge_ref); 
     1243 
     1244                                                        current_positive->totallyneutralgrandchildren.insert(current_negative->totallyneutralgrandchildren.begin(),current_negative->totallyneutralgrandchildren.end()); 
     1245 
     1246                                                        current_positive->negativeneutralvertices.insert(current_negative->negativeneutralvertices.begin(),current_negative->negativeneutralvertices.end()); 
     1247                                                        current_positive->positiveneutralvertices.insert(current_negative->positiveneutralvertices.begin(),current_negative->positiveneutralvertices.end()); 
     1248                                                } 
     1249                                                else 
     1250                                                { 
     1251                                                        if(!current_positive->totally_neutral) 
     1252                                                        { 
     1253                                                                current_positive->positivechildren.clear(); 
     1254                                                                current_positive->negativechildren.clear(); 
     1255                                                                current_positive->neutralchildren.clear(); 
     1256                                                                current_positive->totallyneutralchildren.clear(); 
     1257                                                                current_positive->totallyneutralgrandchildren.clear();                                                           
     1258                                                                current_positive->positiveneutralvertices.clear(); 
     1259                                                                current_positive->negativeneutralvertices.clear(); 
     1260                                                                current_positive->totally_neutral = NULL; 
     1261                                                                current_positive->kids_rel_addresses.clear();                                                            
     1262                                                        } 
     1263                                                 
    12321264                                                } 
    12331265 
     
    12391271                                                        (*parent_ref)->children.remove(current_negative); 
    12401272                                                        (*parent_ref)->children.push_back(current_positive); 
    1241                                                 } 
    1242  
    1243                                                 current_positive->totallyneutralchildren.insert(current_negative->totallyneutralchildren.begin(),current_negative->totallyneutralchildren.end()); 
    1244                                                 current_positive->totallyneutralchildren.erase(*merge_ref); 
    1245  
    1246                                                 current_positive->totallyneutralgrandchildren.insert(current_negative->totallyneutralgrandchildren.begin(),current_negative->totallyneutralgrandchildren.end()); 
     1273                                                }                                                
    12471274                                                 
    12481275                                                current_positive->vertices.insert(current_negative->vertices.begin(),current_negative->vertices.end()); 
    1249                                                 current_positive->negativeneutralvertices.insert(current_negative->negativeneutralvertices.begin(),current_negative->negativeneutralvertices.end()); 
    1250                                                 current_positive->positiveneutralvertices.insert(current_negative->positiveneutralvertices.begin(),current_negative->positiveneutralvertices.end()); 
     1276                                                 
    12511277                                                 
    12521278                                                for(set<vertex*>::iterator vert_ref = (*merge_ref)->vertices.begin();vert_ref!=(*merge_ref)->vertices.end();vert_ref++) 
     
    12551281                                                        { 
    12561282                                                                current_positive->vertices.erase(*vert_ref); 
    1257                                                                 current_positive->negativeneutralvertices.erase(*vert_ref); 
    1258                                                                 current_positive->positiveneutralvertices.erase(*vert_ref); 
     1283                                                                 
     1284                                                                if((current_positive->get_state(SPLIT)==0&&!current_positive->totally_neutral)||(current_negative->get_state(SPLIT)==0&&!current_negative->totally_neutral)) 
     1285                                                                { 
     1286                                                                        current_positive->negativeneutralvertices.erase(*vert_ref); 
     1287                                                                        current_positive->positiveneutralvertices.erase(*vert_ref); 
     1288                                                                } 
    12591289                                                        } 
    12601290                                                } 
     
    13141344                                                } 
    13151345 
     1346                                                /* 
    13161347                                                for(list<polyhedron*>::iterator parent_ref = (*merge_ref)->parents.begin();parent_ref!=(*merge_ref)->parents.end();parent_ref++) 
    13171348                                                { 
     
    13211352                                                        (*parent_ref)->children.remove(*merge_ref); 
    13221353                                                } 
     1354                                                */ 
    13231355 
    13241356                                                for(set<polyhedron*>::iterator grand_ch_ref = (*merge_ref)->totallyneutralgrandchildren.begin();grand_ch_ref!=(*merge_ref)->totallyneutralgrandchildren.end();grand_ch_ref++) 
     
    13331365                                                } 
    13341366                                                 
     1367                                                for_splitting[k-1].remove(*merge_ref); 
    13351368 
    13361369                                                statistic.delete_polyhedron(k-1,*merge_ref);