Show
Ignore:
Timestamp:
04/27/11 19:00:36 (13 years ago)
Author:
sindj
Message:

Zacatky experimentovani v robustlib. Zacleneni vypoctu polynomialni rovnice pro optimalni akci s vyuzitim funkce itpp::roots(). Odstranovani zbylych chyb. JS

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/robustlib.h

    r1337 r1338  
    883883                                { 
    884884                                        current_parent->totallyneutralgrandchildren.insert(sender->totallyneutralchildren.begin(),sender->totallyneutralchildren.end()); 
    885  
     885                                         
    886886                                        for(set<polyhedron*>::iterator tot_child_ref = sender->totallyneutralchildren.begin();tot_child_ref!=sender->totallyneutralchildren.end();tot_child_ref++) 
    887887                                        { 
    888888                                                (*tot_child_ref)->grandparents.insert(current_parent); 
     889                                        } 
     890 
     891                                        if(current_parent->totally_neutral == NULL) 
     892                                        { 
     893                                                current_parent->totally_neutral = sender->totally_neutral; 
     894                                        } 
     895                                        else 
     896                                        { 
     897                                                current_parent->totally_neutral = current_parent->totally_neutral && sender->totally_neutral; 
    889898                                        } 
    890899 
     
    898907                                                current_parent->neutralchildren.push_back(sender); 
    899908                                                current_parent->positiveneutralvertices.insert(sender->positiveneutralvertices.begin(),sender->positiveneutralvertices.end()); 
    900                                                 current_parent->negativeneutralvertices.insert(sender->negativeneutralvertices.begin(),sender->negativeneutralvertices.end()); 
    901  
    902                                                 if(current_parent->totally_neutral == NULL) 
    903                                                 { 
    904                                                         current_parent->totally_neutral = sender->totally_neutral; 
    905                                                 } 
    906                                                 else 
    907                                                 { 
    908                                                         current_parent->totally_neutral = current_parent->totally_neutral && sender->totally_neutral; 
    909                                                 } 
     909                                                current_parent->negativeneutralvertices.insert(sender->negativeneutralvertices.begin(),sender->negativeneutralvertices.end());                                           
    910910 
    911911                                                if(sender->totally_neutral) 
     
    922922 
    923923                                        if(is_last) 
    924                                         { 
     924                                        {                                                
    925925                                                 
    926                                                 /// \TODO Nechapu druhou podminku, zda se mi ze je to spatne.. Nemela by byt jen prvni? Nebo se jedna o nastaveni totalni neutrality? 
    927                                                 if((current_parent->negativechildren.size()>0&&current_parent->positivechildren.size()>0)|| 
    928                                                                                                         (current_parent->neutralchildren.size()>0&&current_parent->totally_neutral==false)) 
     926                                                if((current_parent->negativechildren.size()>0&&current_parent->positivechildren.size()>0) 
     927                                                                                                        ||(current_parent->neutralchildren.size()>0&&current_parent->totallyneutralchildren.empty())) 
    929928                                                { 
    930929                                                        for_splitting[level+1].push_back(current_parent);                                                
     
    981980                                                                current_parent->negativechildren.clear(); 
    982981                                                                current_parent->neutralchildren.clear(); 
    983                                                                 current_parent->totallyneutralchildren.clear(); 
     982                                                                //current_parent->totallyneutralchildren.clear(); 
    984983                                                                current_parent->totallyneutralgrandchildren.clear(); 
    985984                                                                // current_parent->grandparents.clear(); 
     
    10021001                         
    10031002                        } 
    1004                          
     1003 
     1004                        sender->totallyneutralchildren.clear();                  
    10051005                }                
    10061006        } 
     
    10491049                        { 
    10501050                                 
    1051                                  
     1051                                /* 
    10521052                                if(i==statistic.size()-1) 
    10531053                                { 
     
    10551055                                        cout << "Order:" << ((toprow*)horiz_ref)->condition_order << endl; 
    10561056                                } 
     1057                                */ 
     1058 
     1059                                cout << "Stepped." << endl; 
    10571060                                 
    10581061                                /* 
     
    12591262                                                current_vertex->negativeneutralvertices.insert(current_vertex); 
    12601263                                                current_vertex->positiveneutralvertices.insert(current_vertex); 
    1261                                         }                                        
     1264                                        } 
     1265                                        else 
     1266                                        { 
     1267                                                current_vertex->totally_neutral = false; 
     1268                                        } 
    12621269                                } 
    12631270                         
     
    12961303                if(should_remove) 
    12971304                { 
     1305                        /* 
    12981306                        for(int i = 0;i<for_merging.size();i++) 
    12991307                        { 
     
    13051313                                cout << endl; 
    13061314                        } 
     1315                        */ 
     1316 
     1317                        cout << "Merging." << endl; 
    13071318 
    13081319                        set<vertex*> vertices_to_be_reduced;                     
     
    14071418                                                        } 
    14081419 
     1420                                                        /* 
    14091421                                                        current_positive->totallyneutralchildren.insert(current_negative->totallyneutralchildren.begin(),current_negative->totallyneutralchildren.end()); 
    14101422                                                         
    14111423                                                        current_positive->totallyneutralchildren.erase(*merge_ref); 
     1424                                                        */ 
    14121425 
    14131426                                                        current_positive->totallyneutralgrandchildren.insert(current_negative->totallyneutralgrandchildren.begin(),current_negative->totallyneutralgrandchildren.end()); 
     
    14231436                                                                current_positive->negativechildren.clear(); 
    14241437                                                                current_positive->neutralchildren.clear(); 
    1425                                                                 current_positive->totallyneutralchildren.clear(); 
     1438                                                                // current_positive->totallyneutralchildren.clear(); 
    14261439                                                                current_positive->totallyneutralgrandchildren.clear();                                                           
    14271440                                                                current_positive->positiveneutralvertices.clear(); 
     
    15581571                } 
    15591572                 
     1573                /* 
    15601574                vector<int> sizevector; 
    15611575                for(int s = 0;s<statistic.size();s++) 
     
    15641578                        cout << statistic.row_size(s) << ", "; 
    15651579                } 
    1566  
    1567                 cout << endl; 
     1580                */ 
     1581 
     1582                //cout << endl; 
     1583 
     1584                // this->step_me(2); 
    15681585 
    15691586                if(should_add) 
     
    17221739                } 
    17231740 
    1724                  
     1741                /* 
    17251742                sizevector.clear(); 
    17261743                for(int s = 0;s<statistic.size();s++) 
     
    17311748                 
    17321749                cout << endl; 
     1750                */ 
    17331751 
    17341752                /* 
     
    19431961 
    19441962                                //// cout << "Sigma: " << sigma << endl; 
    1945                                 //// cout << "Nr. of runs: " << number_of_runs << endl; 
     1963                                //// cout << "Nr. of sigma runs: " << number_of_runs << endl; 
    19461964 
    19471965                                int dimension = (*s_ref)->vertices.size()-1; 
     
    20872105                                        sample_mat.ins_col(0,sample_coordinates); 
    20882106 
    2089                                         cout << sample_mat.cols() << ","; 
     2107                                        // cout << sample_mat.cols() << ","; 
    20902108                                } 
    20912109 
     
    20962114                        } 
    20972115 
    2098                         cout << endl; 
     2116                        // cout << endl; 
    20992117                        return sample_mat; 
    21002118                }