Changeset 1219 for applications/robust

Show
Ignore:
Timestamp:
10/20/10 13:48:34 (14 years ago)
Author:
sindj
Message:

Dodelani deleni - uz funguje. Je treba jeste dodelat predavani vrcholu a triangulaci a vypocet integralu v jednotlivych polyhedronech. Pak uz slucovani. JS

Location:
applications/robust
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/main.cpp

    r1216 r1219  
    1515int main ( int argc, char* argv[] ) { 
    1616         
    17         emlig* emlig1 = new emlig(3); 
     17        emlig* emlig1 = new emlig(3);    
    1818 
    19         emlig1->step_me(); 
     19        for(int i = 0;i<500;i++) 
     20        { 
     21                double condition[4];             
    2022 
    21         vec condition = "3.0 -5.0 -3.0 -2.0";    
     23                condition[0] = rand()/1000.0; 
     24                condition[1] = rand()/1000.0; 
     25                condition[2] = rand()/1000.0; 
     26                condition[3] = rand()/1000.0; 
     27 
     28                vec* condition_vec = new vec(condition,4); 
     29                emlig1->add_condition(*condition_vec); 
     30 
     31                // emlig1->step_me(i); 
     32                 
     33                vector<int> sizevector; 
     34                for(int s = 0;s<=emlig1->number_of_parameters;s++) 
     35                { 
     36                        sizevector.push_back(emlig1->statistic_rowsize(s)); 
     37                } 
     38        } 
     39 
     40 
     41         
     42        /* 
     43        emlig1->step_me(1); 
     44 
     45        vec condition = "2.0 0.0 1.0";   
    2246 
    2347        emlig1->add_condition(condition); 
     
    2953        } 
    3054 
    31         emlig1->step_me(); 
     55        emlig1->step_me(2); 
    3256 
    33         condition = "-5.0 2.3 2.3 -1.0"; 
     57        condition = "2.0 1.0 0.0"; 
    3458 
    3559        emlig1->add_condition(condition); 
     
    4064                sizevector.push_back(emlig1->statistic_rowsize(s)); 
    4165        } 
     66        */ 
    4267 
    4368        return 0; 
  • applications/robust/robustlib.h

    r1216 r1219  
    497497                                                { 
    498498                                                case 1: 
    499                                                         current_parent->positivechildren.push_back(sender);      
     499                                                        current_parent->positivechildren.push_back(sender);                                                      
    500500                                                break; 
    501501                                                case 0: 
    502                                                         current_parent->neutralchildren.push_back(sender); 
     502                                                        current_parent->neutralchildren.push_back(sender);                                                       
    503503 
    504504                                                        if(current_parent->totally_neutral == NULL) 
     
    518518                                                break; 
    519519                                                case -1: 
    520                                                         current_parent->negativechildren.push_back(sender); 
     520                                                        current_parent->negativechildren.push_back(sender);                                                      
    521521                                                break; 
    522522                                                } 
     
    560560                                                                current_parent->totally_neutral = NULL; 
    561561                                                                current_parent->kids_rel_addresses.clear(); 
    562                                                                 //current_parent->set_state(0, SPLIT); 
     562                                                                current_parent->message_counter = 0; 
    563563                                                        } 
    564564                                                } 
     
    595595        } 
    596596 
    597         void step_me() 
     597        void step_me(int marker) 
    598598        { 
    599599                for(int i = 0;i<statistic.size();i++) 
     
    778778                                                                                                                                current_polyhedron->totallyneutralgrandchildren.end()); 
    779779 
     780                                        for(list<polyhedron*>::iterator grand_ref = current_polyhedron->totallyneutralgrandchildren.begin(); grand_ref != current_polyhedron->totallyneutralgrandchildren.end();grand_ref++) 
     781                                        { 
     782                                                (*grand_ref)->parents.push_back(new_totally_neutral_child); 
     783                                        } 
     784 
    780785                                        toprow* positive_poly = new toprow(((toprow*)current_polyhedron)->condition+toadd); 
    781786                                        toprow* negative_poly = new toprow(((toprow*)current_polyhedron)->condition-toadd); 
     
    786791 
    787792                                                (*parent_ref)->neutralchildren.remove(current_polyhedron); 
     793                                                (*parent_ref)->children.remove(current_polyhedron); 
     794 
     795                                                (*parent_ref)->children.push_back(positive_poly); 
     796                                                (*parent_ref)->children.push_back(negative_poly); 
    788797                                                (*parent_ref)->positivechildren.push_back(positive_poly); 
    789798                                                (*parent_ref)->negativechildren.push_back(negative_poly);