Changeset 1319 for applications

Show
Ignore:
Timestamp:
03/28/11 18:09:23 (13 years ago)
Author:
sindj
Message:

Dalsi opravy ve slucovani. Ted uz to bezi!. Hura. JS

Location:
applications/robust
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/main.cpp

    r1307 r1319  
    162162                vector<vec> conditions; 
    163163                //emlig* emliga = new emlig(2); 
    164                 RARX* my_rarx = new RARX(2,1); 
     164                RARX* my_rarx = new RARX(2,30); 
    165165 
    166166                for(int k = 1;k<170;k++) 
     
    209209                                        } 
    210210                                        myfile.close(); 
    211                                 } 
    212                                          
     211                                }                                        
    213212                        }        
    214213                         
  • applications/robust/robustlib.h

    r1318 r1319  
    2121using namespace itpp; 
    2222 
    23 const double max_range = 100;//numeric_limits<double>::max()/10e-10; 
     23const double max_range = 10;//numeric_limits<double>::max()/10e-10; 
    2424 
    2525/// An enumeration of possible actions performed on the polyhedrons. We can merge them or split them. 
     
    738738                                        if(is_last) 
    739739                                        {                                                
     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                                                 
    740752                                                if(current_parent->mergechild != NULL) 
    741753                                                { 
     
    755767                                                else 
    756768                                                { 
    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  
    769769                                                        //current_parent->set_state(0,MERGE);    
    770770 
     
    784784                                                { 
    785785                                                        for_merging[level+1].push_back(current_parent); 
    786                                                         // current_parent->parentconditions.erase(toremove); 
     786                                                        //current_parent->parentconditions.erase(toremove); 
    787787                                                }                                                
    788788 
     
    845845                                                else 
    846846                                                { 
    847                                                                  
    848  
    849847                                                        if(current_parent->negativechildren.size()>0) 
    850848                                                        { 
     
    852850 
    853851                                                                ((toprow*)current_parent)->condition_sum-=toadd->value; 
    854  
    855852                                                                         
    856853                                                        } 
     
    945942                for(int i = 0;i<statistic.size();i++) 
    946943                { 
     944                        int zero = 0; 
     945                        int one  = 0; 
     946                        int two  = 0; 
     947 
    947948                        for(polyhedron* horiz_ref = statistic.rows[i];horiz_ref!=statistic.get_end();horiz_ref=horiz_ref->next_poly) 
    948949                        { 
     
    961962 
    962963                                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                                 
    963978                        } 
    964979                } 
     
    10371052        void add_and_remove_condition(vec toadd, vec toremove) 
    10381053        { 
     1054                step_me(0); 
     1055                 
    10391056                likelihood_value = numeric_limits<double>::max(); 
    10401057 
     
    12081225                                                toprow* current_negative = (toprow*)(*merge_ref)->negativeparent; 
    12091226 
    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); 
    12121231                                                 
    12131232                                                current_positive->children.insert(current_positive->children.end(),current_negative->children.begin(),current_negative->children.end()); 
     
    12421261                                                } 
    12431262 
    1244                                                 if(current_positive->get_state(SPLIT)!=0||current_negative->get_state(SPLIT)==0) 
     1263                                                if(current_positive->get_state(SPLIT)!=0&&current_negative->get_state(SPLIT)==0) 
    12451264                                                { 
    12461265                                                        for(list<polyhedron*>::iterator parent_ref = current_positive->parents.begin();parent_ref!=current_positive->parents.end();parent_ref++) 
     
    14291448                                        delete *vert_ref; 
    14301449                                } 
    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; 
    14351463 
    14361464                if(should_add) 
     
    14951523                                        positive_poly->my_emlig = this; 
    14961524                                        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()); 
    14971528 
    14981529                                        for(set<polyhedron*>::iterator grand_ref = current_polyhedron->totallyneutralgrandchildren.begin(); grand_ref != current_polyhedron->totallyneutralgrandchildren.end();grand_ref++) 
     
    15861617                } 
    15871618 
    1588                 /* 
    1589                 vector<int> sizevector; 
     1619                 
     1620                sizevector.clear(); 
    15901621                for(int s = 0;s<statistic.size();s++) 
    15911622                { 
     
    15931624                        cout << statistic.row_size(s) << ", "; 
    15941625                } 
    1595                 */ 
    1596  
    1597                 // cout << endl; 
     1626                 
     1627                cout << endl; 
    15981628 
    15991629                /*