Changeset 735

Show
Ignore:
Timestamp:
11/24/09 00:08:40 (14 years ago)
Author:
smidl
Message:

Initial implementation of mixef.init() -- does not work due to missing to_setting

Files:
2 added
5 modified

Legend:

Unmodified
Added
Removed
  • applications/bdmtoolbox/mex/CMakeLists.txt

    r733 r735  
    2222MEX(epdf_sample_mat) 
    2323MEX(lqg_redesign) 
     24MEX(mixef_init) 
  • library/bdm/base/user_info.cpp

    r728 r735  
    310310                from_setting ( matrix, link.result ); 
    311311 
    312                 if ( matrix.cols() != 1 && matrix.rows() != 1 ) 
     312                if ( matrix.cols() != 1 && matrix.rows() != 1 && matrix.cols()!=0) 
    313313                        throw UISettingException ( "UIException: the vector length is invalid, it seems to be rather a matrix.", link.result ); 
    314314 
  • library/bdm/estim/mixtures.cpp

    r682 r735  
    55 
    66 
    7 void MixEF::init ( BMEF* Com0, const mat &Data, int c ) { 
     7void MixEF::init ( BMEF* Com0, const mat &Data, const int c ) { 
    88        //prepare sizes 
    99        Coms.set_size ( c ); 
     
    3838        delete est; 
    3939        build_est(); 
    40  
    4140} 
    4241 
  • library/bdm/estim/mixtures.h

    r682 r735  
    9999        //! \param Data Data on which the initialization will be done 
    100100        //! \param c Initial number of components, default=5 
    101         void init ( BMEF* Com0, const mat &Data, int c = 5 ); 
     101        void init ( BMEF* Com0, const mat &Data, const int c = 5 ); 
    102102        //Destructor 
    103103        ~MixEF() { 
     
    130130                method = M; 
    131131        } 
     132         
     133        void to_setting(Setting &set) const{ 
     134                UI::save(Coms,set,"Coms"); 
     135                Setting &wei=set.add("weights",Setting::TypeGroup); 
     136                weights.to_setting(wei); 
     137        } 
    132138}; 
    133139 
  • library/bdm/stat/exp_family.h

    r730 r735  
    507507                        if (evalll) {last_lognc = est.lognc();} 
    508508                } 
     509                void to_setting(Setting &set) const{ 
     510                        BMEF::to_setting(set); 
     511                        Setting& prior= set.add("prior", Setting::TypeGroup); 
     512                        est.to_setting(prior); 
     513                } 
    509514}; 
    510515