Changeset 1266 for applications/robust

Show
Ignore:
Timestamp:
12/16/10 18:07:35 (13 years ago)
Author:
sindj
Message:

Dodelavani vypoctu integralu v polyhedronech. JS

Location:
applications/robust
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/main.cpp

    r1254 r1266  
    1616         
    1717        emlig* emlig1 = new emlig(3); 
     18 
     19        emlig1->set_correction_factors(3); 
    1820 
    1921        //emlig1->step_me(0); 
  • applications/robust/robustlib.h

    r1262 r1266  
    415415class emlig // : eEF 
    416416{ 
    417         vector<set<ivec>> correction_factors; 
     417         
    418418 
    419419        /// A statistic in a form of a Hasse diagram representing a complex of convex polyhedrons obtained as a result 
     
    628628public:  
    629629 
     630        vector<set<ivec>> correction_factors; 
     631 
    630632        int number_of_parameters; 
    631633 
     
    924926        } 
    925927 
    926         vector<list<ivec>> get_correction_factors(int order) 
     928 
     929        void set_correction_factors(int order) 
    927930                { 
    928931                        for(int remaining_order = correction_factors.size();remaining_order>order;remaining_order++) 
     
    931934                                set<ivec> final_factors; 
    932935 
     936                                 
    933937                                for(int i = 1;i==number_of_parameters-order+1;i++) 
    934                                 { 
    935                                         for(int j = 1;j==remaining_order;j++) 
    936                                         { 
    937                                                 factor_templates.insert(zeros(number_of_parameters-order+2)); 
    938  
     938                                {                                        
     939                                        ivec new_template = vec_2(1,i); 
     940                                        //new_template[0]=1; 
     941                                        //new_template[1]=i; 
     942                                        //factor_templates.insert(new_template); 
     943 
     944                                         
     945                                        for(int j = 1;j==remaining_order-1;j++) 
     946                                        { 
     947                                                 
    939948                                                for(set<ivec>::iterator fac_ref = factor_templates.begin();fac_ref!=factor_templates.end();fac_ref++) 
    940949                                                { 
    941950                                                        ivec current_template = (*fac_ref); 
    942  
     951                                                         
    943952                                                        current_template[0]+=1; 
    944                                                         current_template[i]+=1; 
    945  
     953                                                        current_template.ins(current_template.size(),i); 
     954 
     955                                                         
    946956                                                        if(current_template[0]==remaining_order) 
    947957                                                        { 
    948                                                                 final_factors.insert(current_template.right(current_template.size()-1); 
     958                                                                final_factors.insert(current_template.right(current_template.size()-1)); 
    949959                                                        } 
    950960                                                        else 
     
    952962                                                                factor_templates.insert(current_template); 
    953963                                                        } 
    954                                                 }                                        
     964                                                } 
    955965                                        } 
    956966                                }        
    957967 
    958                                 correction_factors.push_back(final_factors); 
     968                                correction_factors.push_back(final_factors);                     
    959969 
    960970                        } 
     
    12761286};*/ 
    12771287 
    1278  
     1288 bool ivec::operator>(const ivec &first, const ivec &second)  
     1289 { 
     1290         int size1 = first.size(); 
     1291         int size2 = second.size(); 
     1292          
     1293         int counter1 = 0; 
     1294         while(0==0) 
     1295         { 
     1296                 if(first[counter1]==0) 
     1297                 { 
     1298                        size1--; 
     1299                 } 
     1300                 
     1301                 if(first[counter1]!=0) 
     1302                         break; 
     1303         } 
     1304 
     1305         int counter2 = 0; 
     1306         while(0==0) 
     1307         { 
     1308                 if(second[counter2]==0) 
     1309                 { 
     1310                        size2--; 
     1311                 } 
     1312                 
     1313                 if(second[counter2]!=0) 
     1314                         break; 
     1315         } 
     1316 
     1317         if(size1!=size2) 
     1318         { 
     1319                return size1>size2; 
     1320         } 
     1321         else 
     1322         { 
     1323                 for(int i = 0;i<size1;i++) 
     1324                 { 
     1325                         if(first[counter1+i]!=second[counter2+i]) 
     1326                         { 
     1327                                return first[counter1+i]>second[counter2+i] 
     1328                         } 
     1329                 } 
     1330 
     1331                 return false; 
     1332         } 
     1333 } 
    12791334 
    12801335