Show
Ignore:
Timestamp:
12/09/11 17:53:36 (12 years ago)
Author:
sindj
Message:

Update hlavnich casti z Thinkeru. JS

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • applications/robust/robustlib.h

    r1405 r1413  
    437437                start_poly = new polyhedron(); 
    438438        }; 
    439  
    440         ~c_statistic() 
    441         { 
    442                 delete end_poly; 
    443                 delete start_poly; 
    444         } 
    445439 
    446440        void append_polyhedron(int row, polyhedron* appended_start, polyhedron* appended_end) 
     
    11031097 
    11041098                this->condition_order = condition_order; 
     1099        } 
     1100 
     1101        ~emlig() 
     1102        { 
     1103                for(int i = 0;i<statistic.size();i++) 
     1104                { 
     1105                        polyhedron* current_polyhedron; 
     1106                        while(statistic.rows[i]!=statistic.end_poly) 
     1107                        { 
     1108                                current_polyhedron = statistic.rows[i]; 
     1109                                statistic.delete_polyhedron(i,statistic.rows[i]); 
     1110                                delete current_polyhedron; 
     1111                        } 
     1112                } 
     1113                 
     1114                delete statistic.end_poly; 
     1115                delete statistic.start_poly; 
     1116 
     1117                for(list<condition*>::reverse_iterator c_ref = conditions.rbegin();c_ref!=conditions.rend();c_ref++) 
     1118                { 
     1119                        delete *c_ref; 
     1120                } 
     1121 
     1122                cout << "Emlig deleted." << endl; 
    11051123        } 
    11061124 
     
    23022320                        pair<double,double> probability_and_sigma = choose_sigma(condition_and_simplex.second); 
    23032321 
     2322                        /* 
     2323                        if(samples.cols()<10) 
     2324                        { 
     2325                                cout << "S-P:" << probability_and_sigma.first << ", "; 
     2326                                pause(0.3); 
     2327                        }*/ 
     2328 
    23042329                        int dimension = condition_and_simplex.second->vertices.size(); 
    23052330 
     
    23362361 
    23372362                        double exponent = extended_coords*condition_and_simplex.first; 
    2338                         double sample_prob = 1*condition_and_simplex.second->volume/condition_and_simplex.second->probability/pow(2*probability_and_sigma.second,condition_order)*exp(-exponent/probability_and_sigma.second);//*probability_and_sigma.first;                    
     2363                        double sample_prob = 1*condition_and_simplex.second->volume/condition_and_simplex.second->probability/pow(2*probability_and_sigma.second,condition_order)*exp(-exponent/probability_and_sigma.second)*probability_and_sigma.first;                       
     2364 
     2365                        /* 
     2366                        if(samples.cols()<20) 
     2367                        { 
     2368                                cout << "prob:" << sample_prob << endl; 
     2369                                pause(0.2); 
     2370                        } 
     2371                        */                       
    23392372 
    23402373                        sample_coords.ins(sample_coords.size(),probability_and_sigma.second); 
     
    27362769        }; 
    27372770 
     2771        ~RARX() 
     2772        { 
     2773                delete posterior; 
     2774        } 
     2775 
    27382776        void bayes(itpp::vec yt) 
    27392777        {